:root {
  --bg: #ffffff;
  --ink: #111110;
  --ink-dim: #a3a19b;
  --ink-mid: #55534e;
  --rule: rgba(17, 17, 16, 0.12);
  --accent: #4b45c6;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: 32px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 16px; top: 16px; z-index: 10;
  background: var(--bg); padding: 8px 12px; border: 1px solid var(--ink);
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px var(--pad);
  min-height: var(--header-h);
}

.site-header .brand {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.site-header .role {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-dim);
  letter-spacing: 0.01em;
}

.avail { margin: 0; font-size: 12px; color: var(--ink-dim); }
.avail a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.avail a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}

/* ---------- intro ---------- */

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(100svh - var(--header-h));
  min-height: 420px;
  padding: 0 var(--pad) 80px;
}

.wordmark {
  font-family: var(--sans);
  font-size: clamp(46px, 10.5vw, 150px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}

.intro-line {
  margin: 30px 0 0;
  color: var(--ink-mid);
  max-width: 46ch;
}

.intro-foot {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-dim);
}
.intro-foot a { text-decoration: none; }
.intro-foot a:hover { color: var(--ink); }

/* intro gate: hidden while the wordmark resolves, fades in once it lands */
html.intro-run .fade-late { opacity: 0; transform: translateY(6px); }
html.intro-run.intro-done .fade-late {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease 0.15s, transform 0.7s ease 0.15s;
}

/* ---------- section chrome ---------- */

.sec {
  border-top: 1px solid var(--rule);
  padding: 26px var(--pad) 0;
  margin-top: 130px;
}

.sec-label {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin: 0 0 44px;
}
.sec-label .no { margin-right: 10px; }

/* ---------- hero stage ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: stretch;
  height: calc(100svh - var(--header-h));
  min-height: 480px;
  max-height: 960px;
  padding: 0 var(--pad) var(--pad);
}

.hero-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.label {
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin: 6px 0 18px;
}

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { border-bottom: 1px solid var(--rule); }

.list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 20px 2px;
  text-decoration: none;
  color: var(--ink-dim);
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.list a .title {
  font-family: var(--sans);
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.list a .year { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }

.list li.is-active a,
.list a:hover,
.list a:focus-visible {
  color: var(--ink);
  padding-left: 14px;
}

.archive-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-dim);
  text-decoration: none;
}
.archive-link:hover { color: var(--ink); }

.caption {
  margin: auto 2px 4px;
  padding-top: 24px;
  color: var(--ink-dim);
  max-width: 44ch;
}
.caption strong { font-weight: 700; color: var(--ink); }

/* ---------- image ---------- */

.frame {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 2px;
  background: #f4f3f0;
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 480ms ease;
}

.frame img.is-shown { opacity: 1; }
.frame.is-direct img { transition-duration: 120ms; }

/* ---------- services ---------- */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px;
}

.svc-ill {
  display: block;
  width: min(200px, 70%);
  height: auto;
  margin: 0 0 34px;
}

.svc h3 {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.svc ul { list-style: none; margin: 0; padding: 0; color: var(--ink-mid); }
.svc li { padding: 3px 0; }

/* ---------- clients ---------- */

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 44px 64px;
}
.logo-row img { height: 30px; width: auto; }

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.portrait {
  width: 96px; height: 96px;
  border-radius: 2px;
  image-rendering: pixelated;
}

.about-text {
  font-family: var(--sans);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0 0 40px;
  max-width: 46ch;
}

.about-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  max-width: 640px;
}

.block h3 {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.block ul { list-style: none; margin: 0; padding: 0; }
.block a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.block a:hover { border-bottom-color: currentColor; }

/* ---------- contact ---------- */

.big-mail {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(26px, 6vw, 76px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-decoration: none;
  border-bottom: 3px solid var(--rule);
  padding-bottom: 6px;
  overflow-wrap: anywhere;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.big-mail:hover { border-bottom-color: var(--accent); color: var(--accent); }

.contact-alt { margin: 20px 0 0; color: var(--ink-dim); }
.contact-alt a { text-decoration: none; }
.contact-alt a:hover { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 120px;
  padding: 22px var(--pad) 26px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-dim);
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- project pages ---------- */

.topbar { padding: 16px var(--pad); font-size: 12px; color: var(--ink-dim); }
.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--ink); }

.article { max-width: 780px; margin: 0 auto; padding: 24px 24px 110px; }
.article h1 {
  font-family: var(--sans);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
}
.article .meta { color: var(--ink-dim); margin: 0 0 40px; }
.article h2 {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  margin: 44px 0 8px;
}
.article p { margin: 0 0 16px; max-width: 66ch; color: var(--ink-mid); }
.article figure { margin: 36px 0; }
.article img { width: 100%; height: auto; display: block; border-radius: 2px; }
.article figcaption { margin-top: 8px; color: var(--ink-dim); }
.article .tags { list-style: none; padding: 0; margin: 0; color: var(--ink-mid); }
.article .list a { padding: 14px 2px; }
.article .list .title { font-size: 17px; }

.next {
  display: block;
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink-dim);
}
.next:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  :root { --pad: 20px; }

  .intro { padding-bottom: 64px; }
  .intro-line { margin-top: 22px; }

  .sec { margin-top: 84px; }
  .sec-label { margin-bottom: 30px; }

  .hero {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .frame { order: 1; height: auto; aspect-ratio: 4 / 3; }
  .caption { order: 2; margin: 10px 2px 0; padding-top: 0; min-height: 2.6em; }
  .hero-left { display: contents; }
  .label { order: 3; margin-top: 30px; }
  .list { order: 4; }
  .list a { padding: 16px 2px; }
  .list a .title { font-size: 21px; }
  .archive-link { order: 5; }

  .svc-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .svc-ill { margin-bottom: 22px; }
  .logo-row { gap: 28px 40px; }
  .logo-row img { height: 24px; }

  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .about-cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }

  .site-footer { margin-top: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame img { transition-duration: 1ms; }
  .list a { transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
