/* Prototyphub — tokens from design-system/prototyphub/MASTER.md */

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-normal.woff2")
    format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-latin-400-italic.woff2")
    format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0b0c0c;
  --paper: #f4f4f1;
  --white: #ffffff;
  --rule: #d9d9d4;
  --rule-dark: #2a2b29;
  --muted: #5c5d59;
  --muted-dark: #9c9d98;
  --signal: #f24a12;

  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 32px;
  --s6: 48px;
  --s7: 64px;
  --s8: 96px;
  --s9: 160px;

  --margin: clamp(20px, 4vw, 56px);
  --gutter: 24px;
  --header: 64px;

  --dur-fast: 160ms;
  --dur-base: 320ms;
  --dur-slow: 900ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Surface-dependent, overridden by .dark */
  --fg: var(--ink);
  --bg: var(--paper);
  --fg-muted: var(--muted);
  --line: var(--rule);
}

.dark {
  --fg: var(--paper);
  --bg: var(--ink);
  --fg-muted: var(--muted-dark);
  --line: var(--rule-dark);
  background: var(--bg);
  color: var(--fg);
}

/* Base -------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + var(--s4));
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
p {
  margin: 0;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 4px;
}
::selection {
  background: var(--signal);
  color: var(--ink);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: var(--s2);
  left: var(--s2);
  z-index: 100;
  padding: var(--s2) var(--s3);
  background: var(--signal);
  color: var(--ink);
  font: 500 13px/1 var(--mono);
  text-transform: uppercase;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

/* Type primitives --------------------------------------------------------- */
.label {
  font: 450 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
}
.display {
  font: 400 clamp(44px, 6.4vw, 96px) / 0.98 var(--serif);
  letter-spacing: -0.015em;
  white-space: pre-line;
  text-wrap: balance;
}
.lead {
  font-size: clamp(21px, 2.1vw, 30px);
  line-height: 1.4;
  letter-spacing: -0.012em;
  font-weight: 380;
}

/* Buttons ----------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--s4);
  min-height: 48px;
  padding: 0 var(--s4);
  border: 1px solid currentColor;
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition:
    background-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease;
}
.button .arrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 16px;
  transition: transform var(--dur-base) var(--ease-out);
}
.button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.button:hover .arrow {
  transform: translate(3px, 3px);
}
.button.on-dark {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--ink);
}
.button.on-dark:hover {
  background: transparent;
  color: var(--paper);
}
.button.on-dark:hover .arrow,
.button.on-dark[aria-pressed="true"] .arrow {
  transform: translate(3px, -3px);
}
.button:disabled {
  opacity: 0.5;
}

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--paper);
  background: rgb(11 12 12 / 0.94);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--rule-dark);
  transition:
    background-color var(--dur-base) ease,
    color var(--dur-base) ease,
    border-color var(--dur-base) ease;
}
.site-header.is-light {
  color: var(--ink);
  background: rgb(244 244 241 / 0.86);
  border-color: var(--rule);
}
.bar {
  max-width: 1440px;
  height: var(--header);
  margin: 0 auto;
  padding: 0 var(--margin);
  display: flex;
  align-items: center;
  gap: var(--s5);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 560;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav {
  display: flex;
  gap: var(--s5);
  margin-left: auto;
}
.nav a,
.language button {
  font: 450 12px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 0;
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 1px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav a:hover::after {
  transform: scaleX(1);
}
.language {
  display: flex;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 35%, transparent);
}
.language button {
  min-width: 40px;
  min-height: 32px;
  padding: 0 var(--s2);
  opacity: 0.6;
  transition:
    opacity var(--dur-fast) ease,
    background-color var(--dur-fast) ease;
}
.language button[aria-pressed="true"] {
  opacity: 1;
  background: currentColor;
}
.language button[aria-pressed="true"] {
  color: inherit;
}
.site-header .language button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink);
}
.site-header.is-light .language button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.language button:not([aria-pressed="true"]):hover {
  opacity: 1;
}

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: min(calc(78svh - var(--header)), 720px);
  display: flex;
  overflow: hidden;
  isolation: isolate;
}
.hero-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-inner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-top: var(--s5);
  padding-bottom: var(--s5);
}
.label-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  font: 450 12px/1.4 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.edition {
  white-space: nowrap;
}
.label-star {
  color: var(--signal);
  margin-right: var(--s2);
}
.hero h1 {
  margin-top: auto;
  padding-top: var(--s6);
  font: 400 clamp(64px, 11.2vw, 168px) / 0.9 var(--serif);
  letter-spacing: -0.025em;
}
.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.2em;
  margin-bottom: -0.14em;
}
.hero h1 .line > span {
  display: inline-block;
}
.hero h1 em {
  font-style: italic;
}
.hero h1 .dot {
  color: var(--signal);
}
.hero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: 1px solid var(--rule-dark);
}
.scroll-cue {
  margin-left: auto;
  font: 400 18px/1 var(--sans);
  text-decoration: none;
  color: var(--muted-dark);
  animation: cue 2.4s var(--ease-in-out) infinite;
}
@keyframes cue {
  50% {
    transform: translateY(5px);
  }
}

/* Sections ---------------------------------------------------------------- */
.section {
  padding: var(--s9) 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s7);
}

/* 01 Why ------------------------------------------------------------------ */
/* Tighter gap between the signature and the prototypes section */
.section.why {
  padding-bottom: var(--s6);
}
.section.prototypes {
  padding-top: var(--s6);
}
.why-copy {
  display: grid;
  gap: var(--s6);
  max-width: 34em;
}
.why-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.signature {
  font: italic 400 28px/1 var(--serif);
}

/* 02 Prototypes ----------------------------------------------------------- */
.count {
  color: var(--muted);
}
/* Register: a grid of numbered, dated fields */
.reg {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.reg > li {
  /* Each field draws its own frame, so a partly filled row looks finished. */
  margin: -1px 0 0 -1px;
  border: 1px solid var(--rule);
}
.reg-item {
  position: relative;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto auto auto;
  min-height: 320px;
  height: 100%;
  padding: var(--s4);
  overflow: hidden;
  transition:
    background-color var(--dur-base) ease,
    color var(--dur-base) ease;
}
.f-no {
  font: 300 72px/0.9 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.f-date,
.f-tag {
  font: 450 12px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color var(--dur-base) ease;
}
.f-date {
  justify-self: end;
}
.reg .f-title {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-bottom: var(--s3);
  font: 400 clamp(28px, 2.6vw, 40px) / 1 var(--serif);
  letter-spacing: -0.01em;
}
.f-tag {
  grid-column: 1 / -1;
  grid-row: 4;
}
.f-arrow {
  position: absolute;
  right: var(--s4);
  bottom: var(--s4);
  font: 300 28px/1 var(--mono);
  transition:
    transform var(--dur-base) var(--ease-out),
    color var(--dur-base) ease;
}
.reg-item:hover .f-arrow,
.reg-item:focus-visible .f-arrow {
  color: var(--signal);
  transform: translate(3px, -3px);
}
.reg-item details {
  grid-column: 1 / -1;
  grid-row: 5;
  margin-top: var(--s3);
}
.reg-item::after {
  /* scan line on hover */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--signal);
  box-shadow: 0 0 12px 1px rgb(242 74 18 / 0.5);
  opacity: 0;
  pointer-events: none;
}
.reg-item:hover,
.reg-item:focus-visible,
.reg-item:focus-within {
  background: var(--ink);
  color: var(--paper);
}
.reg-item:hover .f-date,
.reg-item:hover .f-tag,
.reg-item:hover .pending,
.reg-item:focus-within .f-date,
.reg-item:focus-within .f-tag,
.reg-item:focus-within .pending {
  color: var(--muted-dark);
}
.reg-item:hover::after {
  animation: scan 900ms var(--ease-out) forwards;
}
@keyframes scan {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(320px);
  }
}
.reg .is-empty .reg-item {
  color: #c9c9c3;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 7px,
    rgb(11 12 12 / 0.035) 7px 8px
  );
}
.reg .is-empty .reg-item::after {
  display: none;
}
/* Status tag sits above the title, so titles line up across cards */
.reg .is-empty .f-tag {
  grid-row: 2;
  align-self: end;
  margin-bottom: var(--s2);
}
.reg .is-empty .f-date,
.reg .is-empty .f-tag,
.reg .is-empty .f-title {
  color: var(--muted);
}
.reg-item summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  min-height: 40px;
  list-style: none;
  cursor: pointer;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.reg-item summary::-webkit-details-marker {
  display: none;
}
.plus {
  position: relative;
  width: 24px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition:
    transform var(--dur-base) var(--ease-out),
    background-color var(--dur-fast) ease;
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}
summary:hover .plus {
  background: currentColor;
}
summary:hover .plus::before,
summary:hover .plus::after {
  background: var(--ink);
}
details[open] .plus {
  transform: rotate(45deg);
}
.row-detail {
  display: grid;
  gap: var(--s3);
  max-width: 42em;
  padding: var(--s4) 0 var(--s3);
}
.row-detail p:first-child {
  font-size: 17px;
}
.pending {
  font-size: 15px;
  color: var(--muted);
  padding-left: var(--s3);
  border-left: 2px solid var(--signal);
}
details[open] .row-detail {
  animation: reveal var(--dur-base) var(--ease-out);
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* 03 Contact -------------------------------------------------------------- */
.contact {
  padding-top: 0;
}
.contact-grid h2 {
  grid-column: 1 / span 6;
}
.contact-body {
  grid-column: 8 / span 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s5);
  padding-top: var(--s3);
}
.email-link {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s3);
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.015em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--signal), var(--signal)) 0 100% / 0% 2px
      no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 6px;
  transition: background-size var(--dur-slow) var(--ease-out);
}
.email-link:hover {
  background-size:
    100% 2px,
    100% 1px;
}
.email-link .arrow {
  transition: transform var(--dur-base) var(--ease-out);
}
.email-link:hover .arrow {
  transform: translate(3px, -3px);
}
.copy {
  font: 450 12px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 32px;
  border-bottom: 1px dotted currentColor;
}
.copy:hover {
  color: var(--ink);
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
  padding: var(--s7) 0 var(--s5);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s4);
}
.site-footer a.label:hover {
  color: var(--paper);
}
.no-script {
  margin: 0;
  padding: var(--s3) var(--margin);
  font: 450 12px/1.5 var(--mono);
  background: var(--ink);
  color: var(--muted-dark);
}

/* Entrance reveals (JS adds .js to <html>) -------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.js .hero h1 .line > span {
  transform: translateY(105%);
  transition: transform 1100ms var(--ease-out);
}
.js .hero h1 .line:nth-child(2) > span {
  transition-delay: 90ms;
}
.js .is-loaded .hero h1 .line > span,
.js.is-loaded .hero h1 .line > span {
  transform: none;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1024px) {
  .contact-grid h2,
  .contact-body {
    grid-column: 1 / -1;
  }
  .contact-body {
    margin-top: var(--s6);
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .reg {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  :root {
    --header: 56px;
  }
  .section {
    padding: var(--s8) 0;
  }
  .contact {
    padding-top: 0;
  }
  .nav {
    gap: var(--s3);
  }
  .nav a[href="#why"] {
    display: none;
  }
  .bar {
    gap: var(--s3);
  }
  .hero {
    min-height: calc(70svh - var(--header));
  }
  .hero h1 {
    font-size: 17vw;
  }
  .reg {
    grid-template-columns: minmax(0, 1fr);
  }
  .reg-item {
    min-height: 240px;
  }
}
@media (max-width: 420px) {
  .wordmark {
    font-size: 15px;
  }
  .nav a[href$="#prototypes"] {
    display: none;
  }
}

/* Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .reg-item::after {
    display: none;
  }
  .js [data-reveal],
  .js .hero h1 .line > span {
    opacity: 1;
    transform: none;
  }
}
