/* Paper tiles on a white page: black ink, thin Geist numerals, mono captions,
   one ultramarine accent. */
:root {
  --bg: #fff;
  --tile: #f8f7f4;
  --ink: #141416;
  --muted: #7d7a72;
  --accent: #2b36ff;
  --white: #fff;
  --wash: rgba(20, 20, 22, 0.05);
  --hair: rgba(20, 20, 22, 0.12);
  --dotted: rgba(20, 20, 22, 0.2);
  --sun-glow: rgba(43, 54, 255, 0.14);

  --font-sans: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --label-font: 400 14px "Inter", system-ui, sans-serif;

  --tile-radius: 38px;
  --tile-shadow:
    0 0 0 1px rgba(20, 20, 22, 0.05), inset 0 1px 0 #fff, 0 28px 46px -30px rgba(40, 34, 20, 0.35),
    0 2px 4px rgba(40, 34, 20, 0.04);
  --gap: 20px;
  --row: 296px;
  --pad: 26px;

  --focus-dark: radial-gradient(320px 240px at 80% 10%, rgba(43, 54, 255, 0.55), transparent 70%), #121215;
  --focus-text: #f4f3f0;
  --focus-muted: rgba(244, 243, 240, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.mono { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; color: var(--muted); }
.thin { font-weight: 300; letter-spacing: -0.04em; line-height: 1; }

/* the label: accent dot + word */
.label {
  display: flex; align-items: center; gap: 8px;
  font: var(--label-font); letter-spacing: -0.1px; color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* page frame */
.top, main, .bottom { width: min(100% - 2 * var(--gap), 1268px); margin: 0 auto; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 28px 6px 26px; }
.top nav { display: flex; gap: 6px; }
.top nav a { padding: 12px 10px; font-size: 12px; transition: color 0.2s; }
.top nav a:hover { color: var(--accent); }
.bottom { display: flex; justify-content: space-between; padding: 56px 6px 40px; }
.bottom a { transition: color 0.2s; }
.bottom a:hover { color: var(--accent); }

/* grid: four columns of tiles */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: var(--row); gap: var(--gap); margin-bottom: var(--gap); }
.project { margin-top: 76px; grid-auto-flow: dense; }

.tile {
  position: relative; overflow: hidden; display: block;
  border-radius: var(--tile-radius); background: var(--tile); box-shadow: var(--tile-shadow);
  padding: 22px var(--pad) var(--pad); text-align: left; border: 0;
}
.corner { position: absolute; right: var(--pad); top: 24px; }

/* rising in, one after another (app.js adds .in) */
.js .tile { opacity: 0; transform: translateY(22px) scale(0.955); }
.js .tile.in {
  opacity: 1; transform: none;
  transition: opacity 0.65s cubic-bezier(0.33, 1, 0.68, 1) var(--d, 0s), transform 0.65s cubic-bezier(0.33, 1, 0.68, 1) var(--d, 0s);
}

/* overview */
.intro { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.intro h1 { font-size: clamp(56px, 7.4vw, 104px); margin-top: auto; }
.intro .small { max-width: 30em; margin-top: 22px; font-size: 15px; }
.intro .foot { margin-top: 26px; }

.hero { grid-column: span 2; grid-row: span 2; padding: 0; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .on-photo {
  position: absolute; left: 18px; top: 18px; padding: 8px 14px 8px 12px; border-radius: 99px;
  background: rgba(248, 247, 244, 0.9); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.stat { display: flex; flex-direction: column; }
.stat .num { font-size: 92px; margin-top: 36px; }
.stat .small { margin-top: auto; max-width: 18em; }

.timeline { grid-column: span 2; display: flex; flex-direction: column; }
.arc { width: 100%; height: auto; margin-top: auto; overflow: visible; }
.arc .dotted { fill: none; stroke: var(--dotted); }
.arc .horizon { stroke: var(--hair); }
.arc .lit { fill: none; stroke: var(--accent); stroke-linecap: round; }
.arc .glow { fill: var(--sun-glow); }
.arc .sun { fill: var(--accent); }
.arc .mark { fill: var(--tile); stroke: var(--dotted); stroke-width: 1.4; transition: fill 0.3s, stroke 0.3s; }
.arc .mark.on { fill: var(--accent); stroke: var(--accent); }
.arc text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.arc text.name { font-family: var(--font-sans); font-size: 12px; fill: var(--ink); opacity: 0; transition: opacity 0.4s; }
.arc text.name.on { opacity: 1; }

.closing { margin-top: 76px; }
.contact { grid-column: 1 / -1; grid-row: span 2; padding: 32px 40px 40px; background: var(--focus-dark); color: var(--focus-text); display: flex; flex-direction: column; }
.contact .label { color: var(--focus-muted); }
.contact .state { font-size: clamp(56px, 8vw, 120px); margin-top: auto; }
.contact .small { color: var(--focus-muted); margin-top: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 99px;
  font: 500 12px var(--font-mono); background: rgba(255, 255, 255, 0.1); color: var(--focus-text);
  transition: transform 0.25s ease, background 0.25s ease;
}
.pill:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.18); }
.pill.accent { background: var(--accent); color: var(--white); }
.pill.accent:hover { background: #4049ff; }

/* project cards */
.proj-card { display: flex; flex-direction: column; gap: 14px; transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.35s; }
.proj-card .cover { flex: 1; min-height: 0; border-radius: 24px; overflow: hidden; margin: 6px -10px 0; }
.proj-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1); }
.proj-card .small { font-size: 12px; }
.proj-card.in:hover { transform: translateY(-4px); }
.proj-card:hover .cover img { transform: scale(1.04); }
.proj-card:hover .label { color: var(--ink); }

/* project blocks */
.info { grid-row: span 2; display: flex; flex-direction: column; }
.info .year { font-size: 92px; margin-top: 40px; }
.info h2 { font-weight: 400; font-size: 28px; letter-spacing: -0.6px; margin-top: auto; }
.info .small { margin-top: 10px; }
.facts { margin-top: 22px; display: grid; gap: 10px; border-top: 1px solid var(--wash); padding-top: 16px; }
.facts div { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: baseline; }
.facts dd { font-size: 13px; }

.photo { padding: 0; cursor: zoom-in; background: var(--wash); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1); }
.photo:hover img { transform: scale(1.035); }
.photo .cap {
  position: absolute; left: 16px; bottom: 16px; padding: 4px 9px; border-radius: 99px;
  background: rgba(248, 247, 244, 0.88); color: var(--ink); font-weight: 500;
  opacity: 0; transform: translateY(4px); transition: opacity 0.25s, transform 0.25s;
}
.photo:hover .cap, .photo:focus-visible .cap { opacity: 1; transform: none; }
.photo.lead { grid-column: span 3; grid-row: span 2; }
.photo.wide { grid-column: span 2; }
.photo.tall { grid-row: span 2; }

/* lightbox */
dialog#lb { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--ink); }
dialog#lb::backdrop { background: var(--bg); }
#lb figure { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 20px 84px; }
#lb img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 24px; }
.lb-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px; padding: 16px; }
.lb-nav button { background: none; border: 0; padding: 12px 14px; min-height: 44px; cursor: pointer; font-size: 12px; color: var(--muted); }
.lb-nav button:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .tile, .js .tile.in { opacity: 1; transform: none; transition: none; }
}

/* tablet */
@media (max-width: 1000px) {
  :root { --row: 250px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo.lead { grid-column: span 2; }
  .info { grid-column: span 2; grid-row: span 2; }
}

/* phone */
@media (max-width: 600px) {
  :root { --gap: 12px; --row: 170px; --tile-radius: 28px; --pad: 20px; }
  .intro, .hero, .timeline { grid-column: span 2; }
  .intro { grid-row: span 2; }
  .hero { grid-row: span 2; }
  .stat .num { font-size: 64px; margin-top: 18px; }
  .stat .small { font-size: 12px; }
  .timeline { grid-row: span 1; }
  .contact { padding: 22px var(--pad) var(--pad); }
  .closing { margin-top: 48px; }
  .index { grid-auto-rows: 230px; }
  .proj-card .label { font-size: 13px; }
  .proj-card .corner { display: none; }
  .info { grid-row: span 2; }
  .info .year { font-size: 64px; margin-top: 14px; }
  .info h2 { font-size: 24px; }
  .facts { margin-top: 16px; padding-top: 12px; gap: 6px; }
  .photo.wide { grid-column: span 2; }
  .project { margin-top: 48px; }
}
