/* Naoki Sullivan — site styles
   Tokens first; components read only from tokens. */

/* Fonts: self-hosted, SIL Open Font License (Archivo, IBM Plex Mono) */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-var.woff2") format("woff2-variations"), url("fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --ground: #F5F6F4;
  --ink: #121615;
  --muted: #5B6461;
  --rule: #D6DAD8;
  --accent: #3F7166;          /* borosilicate edge green */
  --slot: #E6E9E7;
  --slot-ink: #6C7572;
  --panel: #0D1110;           /* studio black for the glass study */

  --gutter: clamp(16px, 3.4vw, 52px);
  --maxw: 1560px;
  --measure: 36rem;

  --f-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --t-xs: 0.75rem;   /* 12 */
  --t-sm: 0.875rem;  /* 14 */
  --t-md: 1rem;      /* 16 */
  --t-lg: 1.25rem;   /* 20 */
  --t-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  --t-2xl: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem);
  --t-3xl: clamp(2.75rem, 1.2rem + 6.4vw, 7.5rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E1211;
    --ink: #E6EAE8;
    --muted: #97A19D;
    --rule: #26302D;
    --accent: #8CC2B3;
    --slot: #171D1B;
    --slot-ink: #7E8985;
    --panel: #080B0A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E1211;
  --ink: #E6EAE8;
  --muted: #97A19D;
  --rule: #26302D;
  --accent: #8CC2B3;
  --slot: #171D1B;
  --slot-ink: #7E8985;
  --panel: #080B0A;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-md);
  font-stretch: 100%;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ——— Type roles ——— */
.label {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.display {
  font-stretch: 125%;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-wrap: balance;
  margin: 0;
}
h1, h2, h3 { text-wrap: balance; }
p { margin: 0; }
.prose { max-width: var(--measure); display: grid; gap: 1.1em; }
.prose p { text-wrap: pretty; }
.lead {
  font-stretch: 112%;
  font-weight: 300;
  font-size: var(--t-2xl);
  line-height: 1.15;
  letter-spacing: -0.005em;
  max-width: 19em;
  text-wrap: balance;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
}
.wordmark {
  font-stretch: 125%;
  font-weight: 500;
  font-size: var(--t-sm);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.site-nav a {
  font-size: var(--t-sm);
  font-stretch: 110%;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; }

main { display: block; }

/* ——— Image slots ———
   Each <figure class="slot"> holds an <img> pointing at /images/…
   When the file is missing, the slot shows its filename and spec. */
.slot {
  position: relative;
  margin: 0;
  background: var(--slot);
  aspect-ratio: var(--ratio, 3 / 2);
  max-width: 100%;
  overflow: hidden;
}
.slot > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot-label {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  right: 1rem;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  line-height: 1.5;
  color: var(--slot-ink);
}
.slot.is-empty > img { display: none; }
.slot:not(.is-empty) .slot-label { display: none; }
.slot > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}
.slot.is-empty.has-study { background: var(--panel); }
.slot.is-empty.has-study > canvas { display: block; }
.slot.is-empty.has-study .slot-label { display: none; }

figure { margin: 0; }

/* Dark panel for rendered work (hero study, Cedar Sconce) */
.panel {
  position: relative;
  background: var(--panel);
  aspect-ratio: var(--ratio, 16 / 9);
  max-width: 100%;
  overflow: hidden;
}
.panel > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 700px) { .panel { --ratio: 4 / 5; } }

/* Concept drawing sheet */
.drawing-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.drawing {
  background: #F2F0EA;
  aspect-ratio: 16 / 10;
  min-width: 680px;
}
.drawing svg { display: block; width: 100%; height: auto; }

/* Experience blocks on the practice page */
.exp { display: grid; gap: 1.5rem; min-width: 0; }
.exp > *, .split > * { min-width: 0; }
.exp-images {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  align-items: end;
}
@media (max-width: 700px) { .exp-images { grid-template-columns: minmax(0, 1fr); } }
figcaption, .caption {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  line-height: 1.55;
  color: var(--muted);
  padding-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
}

/* ——— Sections ——— */
.section { padding-block: clamp(3.5rem, 8vw, 8rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 3rem;
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); }
}

/* Hero */
.hero { padding-top: 0.5rem; }
.hero .slot { --ratio: 16 / 9; }
@media (max-width: 700px) { .hero .slot { --ratio: 4 / 5; } }

/* ——— Project index (list view) ——— */
.index { border-top: 1px solid var(--ink); }
.index-head, .index-row {
  display: grid;
  grid-template-columns: minmax(0, 3.2fr) minmax(0, 3fr) minmax(0, 3fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: baseline;
  padding-block: 1rem;
}
.index-head { border-bottom: 1px solid var(--rule); }
.index-row {
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background-color 160ms ease;
}
.index-row:hover { color: inherit; background: var(--slot); }
.index-row .title { font-stretch: 112%; font-size: var(--t-lg); font-weight: 400; line-height: 1.3; }
.index-row .cell { font-size: var(--t-sm); color: var(--muted); }
.index-row .year { font-family: var(--f-mono); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--t-sm); }
.status::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--accent);
}
.status[data-state="complete"]::before { background: var(--accent); }
@media (max-width: 860px) {
  .index-head { display: none; }
  .index-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; }
  .index-row .title { grid-column: 1; }
  .index-row .year { grid-column: 2; grid-row: 1; }
  .index-row .cell { grid-column: 1 / -1; }
}

/* Two-up images */
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
@media (min-width: 760px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair .slot { --ratio: 4 / 5; }

.textlink {
  display: inline-flex;
  gap: 0.6em;
  align-items: baseline;
  font-stretch: 110%;
  font-size: var(--t-md);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.15em;
}
.textlink::after { content: "→"; font-family: var(--f-mono); }

/* ——— Project page ——— */
.page-title { padding-block: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); display: grid; gap: 1rem; }
.page-title .display { font-size: var(--t-3xl); }
.page-title .sub { font-size: var(--t-lg); font-stretch: 110%; color: var(--muted); font-weight: 300; }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--ink);
  align-content: start;
}
.facts > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 2fr) minmax(0, 3fr);
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.facts dt { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.2em; }
.facts dd { margin: 0; font-size: var(--t-sm); }

.tk {
  font-family: var(--f-mono);
  font-size: 0.92em;
  color: var(--accent);
  border-bottom: 1px dashed var(--accent);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.5rem);
}
.gallery > figure { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .gallery .g-wide { grid-column: 1 / -1; }
  .gallery .g-left { grid-column: 1 / span 7; }
  .gallery .g-right { grid-column: 8 / -1; align-self: end; }
  .gallery .g-inset { grid-column: 3 / span 8; }
}

.phases {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem 3rem;
}
@media (min-width: 760px) { .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.phase { display: grid; gap: 0.9rem; align-content: start; border-top: 1px solid var(--ink); padding-top: 1.1rem; }
.phase h3 { margin: 0; font-stretch: 112%; font-weight: 400; font-size: var(--t-xl); line-height: 1.2; }

/* ——— Practice / commissions ——— */
.bio {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 3rem;
  align-items: start;
}
@media (min-width: 900px) { .bio { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } }
.bio .slot { --ratio: 4 / 5; }

.trio {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 2.5rem;
}
@media (min-width: 820px) { .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trio > div { display: grid; gap: 0.7rem; align-content: start; border-top: 1px solid var(--ink); padding-top: 1rem; }
.trio h3 { margin: 0; font-stretch: 112%; font-weight: 400; font-size: var(--t-lg); line-height: 1.3; }
.trio p { color: var(--muted); font-size: var(--t-sm); max-width: 30em; }

.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 2.2fr) minmax(0, 4fr);
  gap: 0.4rem 1.5rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.steps h3 { margin: 0; font-stretch: 112%; font-weight: 400; font-size: var(--t-lg); line-height: 1.3; }
.steps p { color: var(--muted); font-size: var(--t-sm); max-width: 36em; }
@media (max-width: 700px) {
  .steps li { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .steps p { grid-column: 2; }
}

.inquiry {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}
.email-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
}
.email-line a {
  font-stretch: 112%;
  font-weight: 300;
  font-size: var(--t-2xl);
  line-height: 1.15;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
}
.copy-btn {
  font: inherit;
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink); }

.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; max-width: var(--measure); }
.ticks li { padding-left: 1.4rem; position: relative; font-size: var(--t-sm); }
.ticks li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }

.rows { margin: 0; border-top: 1px solid var(--ink); }
.rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-sm);
}
.rows dt { font-weight: 500; }
.rows dd { margin: 0; color: var(--muted); }

/* ——— Footer ——— */
.site-footer { border-top: 1px solid var(--ink); margin-top: clamp(2rem, 6vw, 5rem); }
.site-footer .wrap { padding-block: 2.5rem 2rem; display: grid; gap: 2.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } }
.footer-grid > div { display: grid; gap: 0.45rem; align-content: start; font-size: var(--t-sm); }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-grid p { color: var(--muted); }
.legal { font-family: var(--f-mono); font-size: var(--t-xs); color: var(--muted); }

.not-found { padding-block: clamp(4rem, 14vw, 12rem); display: grid; gap: 1.5rem; }
.not-found .display { font-size: var(--t-3xl); }

@media (prefers-reduced-motion: reduce) {
  .index-row { transition: none; }
}
