/* Sixtyfour Studio — stylesheet
   Paper and ink. Hairlines are the structure. Nothing is rounded, nothing casts a shadow.
   Always light: the page never follows a dark system theme. */

/* ---------- tokens ---------- */
:root {
  --paper: #F3F1EC;
  --ink: #0A0A0A;
  --muted: #6E6A63;
  --rule: #D8D4CC;
  --wash: #E9E6DF;
  --gutter: clamp(16px, 2vw, 28px);
  --gap: 10px;
  --header-h: 52px;
  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --flip: 560ms;
  color-scheme: light;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body { min-height: 100dvh; padding: 0 var(--gutter); }
img, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { background: var(--ink); color: var(--paper); }
button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; cursor: pointer; text-align: inherit; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mono.right { text-align: right; }

.skip {
  position: fixed; top: 0; left: 0; z-index: 200;
  padding: 8px 12px; background: var(--ink); color: var(--paper);
  transform: translateY(-120%);
}
.skip:focus { transform: none; }

/* ---------- grid helpers ---------- */
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }

/* ---------- header ---------- */
#site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter);
  align-items: center; height: var(--header-h);
  border-bottom: 1px solid var(--rule);
}
#site-header .wordmark { grid-column: 1 / 4; font-weight: 500; letter-spacing: -.005em; justify-self: start; }
#site-header .clock { grid-column: 4 / 10; color: var(--muted); font-variant-numeric: tabular-nums; }
#site-header nav { grid-column: 10 / 13; display: flex; gap: 20px; justify-content: flex-end; }

/* ---------- hero: drifting frames + wordmark ---------- */
.hero {
  position: relative; height: calc(100dvh - var(--header-h)); min-height: 520px;
  margin: 0 calc(-1 * var(--gutter)); overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero-field { position: absolute; inset: 0; }
.hero-item {
  position: absolute; top: 0; left: 0; width: var(--w, 200px);
  background: var(--wash); overflow: hidden; will-change: transform;
  transform: translate(var(--x, 0px), var(--y, 0px));
}
.hero-item img, .hero-item video { width: 100%; height: auto; display: block; }
.hero-wordmark {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 50%; transform: translateY(-50%);
  font-size: clamp(67px, 15.1vw, 264px); line-height: .9; font-weight: 300; letter-spacing: -.045em;
  color: var(--paper); mix-blend-mode: difference; pointer-events: none;
  text-wrap: balance; margin: 0;
}
.hero-wordmark .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .06em; margin-bottom: -.06em; }
.hero-wordmark .l { display: inline-block; transform: translateY(110%); animation: settle 900ms var(--ease) forwards; animation-delay: calc(var(--i) * 28ms + 200ms); }
@keyframes settle { to { transform: none; } }
.hero-hint { position: absolute; right: var(--gutter); bottom: 20px; color: var(--muted); }
@media (max-width: 720px) { .hero { min-height: 420px; } .hero-wordmark { font-size: clamp(58px, 20.4vw, 144px); } }
@media (prefers-reduced-motion: reduce) { .hero-wordmark .l { animation: none; transform: none; } }

/* ---------- work ---------- */
.project { padding-top: 20px; display: flex; flex-direction: column; gap: 20px; }
.project + .project { margin-top: clamp(64px, 7vw, 96px); border-top: 1px solid var(--rule); }
.project-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); align-items: baseline; }
.project-row h2 { grid-column: 1 / 9; font-size: clamp(24px, 2.1vw, 30px); line-height: 1.1; letter-spacing: -.015em; font-weight: 400; }
.project-row .year { grid-column: 11 / 13; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-row h2 a:hover { background: var(--ink); color: var(--paper); }
.project-text { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.project-text .summary { grid-column: 1 / 7; max-width: 62ch; }

/* the sheet */
.sheet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); align-items: start; margin-top: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; position: relative; transform-origin: top left; }
.tile.is-open { grid-column: span 2; }
.tile-btn { display: block; width: 100%; background: var(--wash); position: relative; overflow: hidden; }
.tile-btn > img, .tile-btn > video { width: 100%; height: auto; }
.tile-btn video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 200ms var(--ease); }
.tile.is-playing .tile-btn video, .tile.is-open .tile-btn video { opacity: 1; }
.tile.is-film.is-open .tile-btn img { visibility: hidden; }
.tile .cap { color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.tile .cap .dim { font-variant-numeric: tabular-nums; }
.tile:hover .cap, .tile.is-open .cap { background: var(--ink); color: var(--paper); }
.tile.is-open .cap::after { content: "close"; }
.tile.is-film .cap .kind::before { content: "▶ "; }
.tile.is-flipping { will-change: transform; }

/* ---------- contact ---------- */
.contact {
  padding: clamp(56px, 7vw, 96px) 0 clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter);
}
.contact { margin-top: clamp(64px, 7vw, 96px); }
.label { grid-column: 1 / 3; color: var(--muted); }

.contact-body { grid-column: 3 / 13; display: flex; flex-direction: column; gap: 28px; }
.email { font-size: clamp(28px, 5vw, 72px); line-height: 1; letter-spacing: -.025em; font-weight: 300; align-self: flex-start; overflow-wrap: anywhere; }
.contact-meta { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: var(--gutter); }
.contact-meta p { grid-column: 1 / 6; max-width: 46ch; color: var(--muted); }
.contact-meta .social { grid-column: 7 / 11; display: flex; gap: 20px; justify-content: flex-end; }

/* ---------- footer ---------- */
#site-footer { padding: 48px 0 24px; }
.basalt { height: 40px; background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 22px); opacity: .55; }
.footer-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); padding-top: 16px; color: var(--muted); }
.footer-row > :nth-child(1) { grid-column: 1 / 5; }
.footer-row > :nth-child(2) { grid-column: 5 / 9; font-variant-numeric: tabular-nums; }
.footer-row > :nth-child(3) { grid-column: 9 / 13; text-align: right; justify-self: end; }
.noscript { padding: 24px 0; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  #site-header .clock { grid-column: 4 / 9; }
  #site-header nav { grid-column: 9 / 13; }
  .statement-meta .lede { grid-column: 5 / 11; }
  .project-text .summary { grid-column: 1 / 8; }
}
@media (max-width: 720px) {
  #site-header { display: flex; justify-content: space-between; }
  #site-header .clock { display: none; }
  #site-header nav { gap: 16px; }
  .statement-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .statement-meta .right { display: none; }
  .project-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .project-row h2 { width: 100%; }
  .project-row .year { text-align: left; margin-left: auto; }
  .project-text { display: flex; flex-direction: column; gap: 12px; }
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile .cap .dim { display: none; }
  .contact { display: flex; flex-direction: column; gap: 16px; }
    .contact-meta { display: flex; flex-direction: column; gap: 16px; }
  .footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile-btn video { transition: none; }
}
