:root {
  --bg: #fafaf7;
  --text: #1b2423;
  --muted: #5c6663;
  --accent: #0f5f52;
  --accent-dark: #0b4a40;
  --border: #e5e5de;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

/* visible keyboard focus */
a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.2; }
h2 { font-size: 1.5rem; margin: 0 0 1.5rem; letter-spacing: -0.01em; }
section, footer { padding: 3rem 0 0; }

/* top bar */
.top { display: flex; justify-content: flex-end; padding-top: 24px; }
.lang {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
}
.lang:hover { color: var(--accent); border-color: var(--accent); }

/* hero */
.hero { padding: 3.5rem 0 1rem; }
.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(27, 36, 35, 0.06);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3rem); margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.tagline { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 0 0 1.75rem; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
}
.button:hover { background: var(--accent-dark); }
.ghost { font-weight: 600; }

/* services */
.services {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.services li { border-top: 2px solid var(--accent); padding-top: 10px; }
.services h3 { font-size: 1.02rem; margin: 0 0 0.25rem; }
.services p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* projects */
.project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 2.5rem;
}
.shot { display: block; }
.shot img { border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.pbody h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.pbody h3 a { text-decoration: none; color: var(--text); }
.pbody h3 a:hover { color: var(--accent); }
.pbody p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: #e7f0ee;
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.also { font-size: 0.92rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 1rem; }

/* timeline */
.timeline { margin: 0; }
.timeline > div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 0.5rem 0; }
.timeline > div + div { border-top: 1px solid var(--border); }
.timeline dt { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline dd { margin: 0; }

/* footer */
footer { padding-bottom: 4rem; }
.fine { color: var(--muted); font-size: 0.85rem; margin-top: 2.5rem; }

@media (max-width: 640px) {
  .project { grid-template-columns: 1fr; }
  .timeline > div { grid-template-columns: 1fr; gap: 0; padding: 0.6rem 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .lang, .button, .pbody h3 a { transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease; }
}

/* project thumbnail button + before/after lightbox */
.shot-btn { position: relative; }
@media (min-width: 641px) { .shot-btn { cursor: zoom-in; } }
@media (max-width: 640px) { .shot-hint, .linkish { display: none; } }
.shot-hint {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #fff; background: rgba(27, 36, 35, 0.75);
  border-radius: 5px; padding: 3px 8px; pointer-events: none;
}
.linkish {
  padding: 0; border: 0; background: none; font: inherit;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.lightbox {
  border: 0; padding: 0; background: transparent;
  width: min(1200px, 94vw); max-width: none; max-height: none; overflow: visible;
}
.lightbox::backdrop { background: rgba(27, 36, 35, 0.85); }
.compare {
  position: relative; height: 84vh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  border-radius: 10px; background: #2a3432; user-select: none;
}
.compare:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.stage { position: relative; cursor: ew-resize; touch-action: pan-y; }
.stage.dragging { cursor: grabbing; }
.stage img { width: 100%; background: var(--card); pointer-events: none; }
.stage .after { position: absolute; inset: 0; background: #2a3432; clip-path: inset(0 0 0 var(--pos, 50%)); }
.tags {
  position: sticky; top: 0; z-index: 2; height: 0; overflow: visible;
  display: flex; justify-content: space-between; align-items: flex-start; padding: 12px; pointer-events: none;
}
.tag {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #fff; background: rgba(27, 36, 35, 0.75); border-radius: 5px; padding: 3px 9px;
}
.handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(27, 36, 35, 0.25); pointer-events: none;
}
.knob {
  position: sticky; top: calc(50% - 20px); display: block;
  width: 40px; height: 40px; margin-left: -19px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f5f52' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-5 6 5 6M15 6l5 6-5 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 1px 4px rgba(27, 36, 35, 0.35);
}
.lb-help { margin: 10px 0 0; text-align: center; font-size: 0.85rem; color: #d8ddda; }
.lb-close {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: #fff; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(27, 36, 35, 0.35);
}
.lb-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .lb-close { top: -44px; right: 0; } }
