@font-face {
  font-family: "Terestris Logo";
  src: url("assets/TERESTRISLOGOONLY.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: block;
  unicode-range: U+0020, U+002F, U+0045, U+0052-0054;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("assets/space-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #141513;
  --paper: #fafaf7;
  --sheet: #fdfdfb;
  --gray: #555951;
  --line: #cccec6;
  --dark-line: #474a44;
  --sans: "Space Grotesk", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: "Space Mono", "PingFang SC", monospace;
  --gutter: clamp(22px, 5.05vw, 88px);
  --head-height: 74px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-height) + 12px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { text-decoration: none; }
button:focus-visible, a:focus-visible, [role="tabpanel"]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}
[hidden] { display: none !important; }
::selection { color: white; background: #41433e; }
.shell {
  width: calc(100% - var(--gutter) * 2);
  max-width: 1490px;
  margin-inline: auto;
}
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 12px; background: var(--paper); }
.type-defs { position: absolute; overflow: hidden; }
.wordmark { display: block; width: 100%; height: auto; overflow: visible; fill: currentColor; }
.word-font {
  font-family: "Terestris Logo";
  font-size: 1000px;
  font-style: normal;
  font-weight: 500;
  font-synthesis: none;
  letter-spacing: 0;
  visibility: hidden;
}
.logo-loaded .word-font { visibility: visible; }
.logo-loaded .word-outline { visibility: hidden; }

.site-head {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.nav, .main-nav, .signature, .actions, .stage, .grid-control, .specimen-tools {
  display: flex;
  align-items: center;
}
.nav { min-height: var(--head-height); justify-content: space-between; gap: 24px; }
.signature { align-items: flex-start; flex-direction: column; gap: 6px; }
.signature-project { font: 10px/1 var(--mono); letter-spacing: .19em; }
.signature .wordmark { width: 133px; }
.main-nav { gap: clamp(18px, 2.3vw, 37px); font-size: 13px; }
.main-nav a { padding-block: 10px; }
.main-nav a:hover, .foot-meta a:hover { text-decoration: underline; text-underline-offset: 5px; }
.locale-control {
  min-width: 44px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  font: 11px/1 var(--mono);
}
.locale-control:hover { border-color: var(--ink); }

.hero {
  display: flex;
  flex-direction: column;
  /* The opening screen is the hero alone: the dark section starts below the fold. */
  min-height: calc(100vh - var(--head-height));
  /* lvh reaches the real bottom edge, behind Safari's floating toolbar. The extra
     bottom padding (lvh − svh = the toolbar's height) keeps the buttons above it. */
  min-height: calc(100lvh - var(--head-height));
  padding-block: clamp(14px, 1.6vw, 26px) clamp(40px, 5.2vw, 86px);
  padding-bottom: max(clamp(40px, 5.2vw, 86px), calc(100lvh - 100svh + 28px));
}
.specimen-tools { justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.stage { gap: 10px; margin: 0; font-size: 12px; }
.stage-dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.grid-control {
  gap: 9px;
  padding: 8px 1px 8px 8px;
  border: 0;
  background: none;
  color: var(--gray);
  font-size: 11px;
}
.grid-control:hover { color: var(--ink); }
.grid-icon {
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  background-image: linear-gradient(to right, transparent 42%, currentColor 42%, currentColor 52%, transparent 52%),
                    linear-gradient(to bottom, transparent 42%, currentColor 42%, currentColor 52%, transparent 52%);
}
.grid-control[aria-checked="false"] .grid-icon { background-image: none; }
.proof {
  position: relative;
  width: 100%;
  background: var(--sheet);
  border: 1px solid var(--line);
}
.proof-type { margin: 0; color: #050504; }
/* Grid and glyphs share one viewBox, so they scale together at every width.
   One cell is 1/6 of the cap height; the baseline sits on a grid line. */
.proof-mark { display: block; width: 100%; height: auto; }
#proof-grid path { stroke: #22261d27; stroke-width: 1px; }
.proof-grid { transition: opacity .18s; }
.proof[data-grid="off"] .proof-grid { opacity: 0; }
.proof-mark .glyph { fill: currentColor; }

/* Intro: the grid is drawn left to right, each letter snaps down two cells,
   and the slash is struck last. Letters reach rest at 60% and hold there,
   so a missed final repaint (seen in Safari) cannot leave one in mid-air. */
.grid-cover {
  fill: var(--sheet);
  transform-box: fill-box;
  transform-origin: right center;
  animation: grid-reveal .9s cubic-bezier(.65, 0, .35, 1) forwards;
}
@keyframes grid-reveal { to { transform: scaleX(0); } }
.proof-mark .glyph {
  opacity: 0;
  transform-box: fill-box;
  animation: glyph-snap .5s step-end forwards;
  animation-delay: calc(.75s + var(--i) * 70ms);
}
@keyframes glyph-snap {
  0% { opacity: 1; transform: translateY(-233.333px); }
  30% { opacity: 1; transform: translateY(-116.667px); }
  60%, 100% { opacity: 1; transform: translateY(0); }
}
.proof-mark .slash {
  opacity: 1;
  clip-path: inset(100% 0 0 0);
  animation: slash-strike .45s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: 1.45s;
}
@keyframes slash-strike { to { clip-path: inset(0 0 0 0); } }
.crop {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  color: var(--ink);
}
.crop.tl { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.crop.tr { top: -1px; right: -1px; border-top: 1px solid; border-right: 1px solid; }
.crop.bl { bottom: -1px; left: -1px; border-bottom: 1px solid; border-left: 1px solid; }
.crop.br { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }
.hero-story {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: start;
  gap: clamp(32px, 6.7vw, 112px);
  padding-top: clamp(20px, 2.4vw, 40px);
}
/* The breathing logo fills whatever space the first screen leaves between
   the wordmark and the motto, as a square centred in that gap. */
.hero-bloom {
  position: relative;
  flex: 1 1 auto;
  min-height: 96px;
  margin-top: clamp(20px, 2.4vw, 40px);
}
.hero-bloom canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  height: 100%;
  max-height: 520px;
  width: auto;
  max-width: 100%;
  aspect-ratio: 1;
  opacity: 0;
  animation: bloom-in 1.2s ease 1.7s forwards;   /* after the wordmark has landed */
}
@keyframes bloom-in { to { opacity: 1; } }
.motto {
  margin: -4px 0 0;
  font-size: clamp(40px, 4.8vw, 78px);
  font-weight: 540;
  letter-spacing: -.061em;
  line-height: 1.04;
  text-wrap: balance;
}
.hero-intro > p, .section-text {
  margin: 0;
  font-size: clamp(15px, 1.22vw, 19px);
  line-height: 1.85;
  overflow-wrap: break-word;
}
.hero-intro > p { max-width: 24em; color: var(--gray); font-size: clamp(16px, 1.35vw, 21px); line-height: 1.45; text-wrap: balance; word-break: keep-all; }
.actions { flex-wrap: wrap; gap: 13px 24px; margin-top: 23px; }
.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.button { min-height: 44px; padding: 12px 19px; border: 1px solid var(--ink); }
.solid { background: var(--ink); color: var(--paper); }
.solid:hover { background: #33362f; }
.outline-button { background: transparent; }
.outline-button:hover { background: var(--ink); color: var(--paper); }
.text-button { min-height: 40px; padding: 4px 0; background: none; border: 0; }
.text-button:hover { text-decoration: underline; text-underline-offset: 5px; }
.arrow { font-family: var(--mono); font-size: 17px; line-height: 1; }
.section-kicker, .micro-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1.5;
}
h2 {
  margin: 20px 0 24px;
  font-size: clamp(38px, 4.65vw, 72px);
  font-weight: 520;
  line-height: 1.14;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.research, .method, .join { padding-block: clamp(62px, 7vw, 114px); }
.research { color: var(--paper); background: var(--ink); }
.research-layout, .method-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(45px, 7vw, 120px);
  align-items: start;
}
.research .section-kicker, .research .section-text { color: #cecfc7; }
.research .section-text, .method .section-text { max-width: 27em; }
.study-note {
  max-width: 28em;
  margin: 26px 0 0;
  padding: 0 0 0 14px;
  border-left: 1px solid #6c7067;
  color: #b4b8af;
  font-size: 12px;
  line-height: 1.8;
}
.study { align-self: center; }
.case-tabs, .role-tabs { display: flex; }
.case-tabs { border: 1px solid var(--dark-line); border-bottom: 0; }
.case-tabs button, .role-tabs button {
  flex: 1;
  min-width: 0;
  min-height: 47px;
  padding: 11px 8px;
  border: 0;
  font-size: 13px;
  font-weight: 500;
}
.case-tabs button { background: transparent; color: #d8d9d3; }
.case-tabs button + button { border-inline-start: 1px solid var(--dark-line); }
.case-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.case-tabs button[aria-selected="false"]:hover { background: #252822; color: white; }
.case-tabs button:focus-visible, .role-tabs button:focus-visible { outline-offset: -5px; }
.study-page { background: var(--paper); color: var(--ink); padding: clamp(25px, 3.1vw, 48px); }
.script-line { padding-bottom: clamp(23px, 2vw, 32px); border-bottom: 1px solid var(--line); }
.micro-label { color: var(--gray); }
blockquote {
  margin: 16px 0 0;
  font-size: clamp(25px, 2.55vw, 42px);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.34;
  text-wrap: balance;
}
.case-panel dl { margin: 24px 0 0; }
.case-panel dt { margin: 0 0 5px; color: var(--gray); font-size: 12px; }
.case-panel dd { margin: 0; font-size: 15px; line-height: 1.78; }
.case-panel dd + dt { margin-top: 19px; }
/* Measuring all variants in the same grid cell keeps the page still when a tab changes. */
.stable-panels { display: grid; }
.stable-panels > [role="tabpanel"] { grid-area: 1 / 1; min-width: 0; }
.stable-panels > [role="tabpanel"][hidden] { display: block !important; visibility: hidden; }

.method { border-bottom: 1px solid var(--line); }
.method .section-text, .join .section-text { color: var(--gray); }
.questions { margin: 0; }
.questions > div { padding: 23px 0 25px; border-top: 1px solid var(--line); }
.questions > div:last-child { border-bottom: 1px solid var(--line); }
.questions dt, .role-panel h3 { margin: 0 0 9px; font-size: clamp(19px, 1.65vw, 26px); font-weight: 550; line-height: 1.35; }
.questions dd, .role-panel p { margin: 0; color: var(--gray); font-size: 15px; line-height: 1.85; }

.join { background: #f1f2ec; }
.join-intro {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(45px, 7vw, 120px);
  align-items: start;
  margin: 20px 0 35px;
}
.join-intro h2 { margin: 0; }
.participation { border-top: 1px solid #bdc1b7; border-bottom: 1px solid #bdc1b7; }
.role-tabs { border-bottom: 1px solid #bdc1b7; }
.role-tabs button {
  position: relative;
  min-height: 52px;
  color: var(--gray);
  background: none;
}
.role-tabs button[aria-selected="true"] { color: var(--ink); }
.role-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--ink);
  content: "";
}
.role-tabs button:hover { background: #e5e7df; }
.role-panel { padding: 26px 0 29px; }
.role-panel h3, .role-panel p { max-width: 54em; }
.join-bottom, .foot-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.join-bottom { margin-top: 24px; }
.join-bottom p { margin: 0; color: var(--gray); font-size: 12px; line-height: 1.8; }
.join-bottom button { flex-shrink: 0; }

.site-foot { padding: 45px 0; background: var(--ink); color: var(--paper); }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer-brand .wordmark { width: clamp(195px, 25vw, 375px); }
.foot-meta { display: flex; flex-direction: column; gap: 15px; align-items: flex-end; }
.domain { font: 12px/1.4 var(--mono); }
.foot-meta a { font-size: 12px; color: #d3d5cc; }

dialog {
  width: min(600px, calc(100% - 36px));
  max-height: min(85dvh, 800px);
  padding: clamp(25px, 4vw, 48px);
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #15161399; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.close { min-width: 37px; min-height: 37px; border: 1px solid var(--line); background: none; font: 24px/1 var(--sans); }
dialog h2 { margin: 26px 0 23px; font-size: clamp(35px, 3.3vw, 50px); }
dialog p { font-size: 15px; line-height: 1.9; color: var(--gray); }
dialog .button { margin-top: 6px; }
.toast {
  position: fixed;
  z-index: 8;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* iOS 26 Safari draws its floating toolbar over the page, outside every viewport unit
   (100lvh = 100svh there). Touch screens get extra height so the dark section stays
   hidden behind the toolbar instead of peeking out under it. */
@media (pointer: coarse) {
  .hero { min-height: calc(100lvh - var(--head-height) + 80px); padding-bottom: 104px; }
}

@media (max-width: 960px) {
  :root { --head-height: 66px; }
  .hero-story { gap: 35px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .motto { font-size: clamp(35px, 5vw, 49px); }
  .research-layout, .method-layout, .join-intro { gap: 32px; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
  h2 { font-size: clamp(34px, 4.5vw, 46px); }
  .study-page { padding: 24px; }
  .actions { gap: 10px 17px; }
}

@media (max-width: 720px) {
  :root { --gutter: clamp(18px, 5.5vw, 32px); --head-height: 62px; }
  .nav { gap: 12px; }
  .signature-project { font-size: 8px; }
  .signature .wordmark { width: 110px; }
  .main-nav { gap: 16px; font-size: 12px; }
  .nav-extra { display: none; }
  .locale-control { min-width: 36px; min-height: 33px; }
  .specimen-tools { margin-bottom: 9px; }
  .stage { gap: 8px; font-size: 11px; }
  .grid-control { font-size: 10px; gap: 7px; }
  .hero-story, .research-layout, .method-layout, .join-intro { grid-template-columns: minmax(0, 1fr); }
  .hero-story { gap: 21px; padding-top: 20px; }
  .hero-bloom { min-height: 200px; }
  .motto { font-size: clamp(37px, 8.7vw, 54px); }
  .hero-intro > p, .section-text { font-size: 15px; line-height: 1.85; }
  .hero-intro > p { font-size: 17px; line-height: 1.45; }
  .actions { margin-top: 18px; gap: 12px 20px; }
  .research, .method, .join { padding-block: 50px; }
  .research-layout, .method-layout { gap: 28px; }
  h2 { font-size: clamp(34px, 7.8vw, 45px); margin: 15px 0 18px; }
  .section-kicker, .micro-label { font-size: 10px; }
  .study-note { margin-top: 15px; font-size: 11px; }
  .case-tabs button, .role-tabs button { font-size: 12px; line-height: 1.4; }
  .case-tabs button { min-height: 43px; }
  .study-page { padding: 23px 20px; }
  blockquote { font-size: clamp(25px, 5.7vw, 35px); }
  .case-panel dd, .questions dd, .role-panel p, dialog p { font-size: 14px; }
  .questions > div { padding: 20px 0; }
  .join-intro { margin-top: 15px; gap: 14px; margin-bottom: 25px; }
  .role-panel { padding: 22px 0; }
  .join-bottom { align-items: flex-start; flex-direction: column; gap: 16px; margin-top: 18px; }
  .site-foot { padding: 29px 0; }
  .foot-top { align-items: flex-start; gap: 15px; }
  .footer-brand { gap: 9px; }
  .footer-brand .wordmark { width: clamp(135px, 40vw, 212px); }
  .foot-meta { gap: 10px; }
  .domain { font-size: 10px; }
  .foot-meta a { font-size: 11px; }
}

@media (max-width: 370px) {
  .main-nav { gap: 10px; font-size: 11px; }
  .signature .wordmark { width: 90px; }
  .button { padding-inline: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .grid-cover { display: none; }
  .proof-mark .glyph, .proof-mark .slash { animation: none; opacity: 1; transform: none; clip-path: none; }
  .hero-bloom canvas { animation: none; opacity: 1; }
}

.copy-fallback { margin-top: 20px; }
.copy-fallback label { display: block; margin-bottom: 7px; font-size: 13px; }
.copy-fallback textarea {
  width: 100%;
  max-width: 650px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  font: 14px/1.65 var(--sans);
}


/* The opening slash starts in pearl tones and settles to the solid mark. */
.proof-mark .slash-color {
  fill: url(#intro-slash-gradient);
  animation: slash-color-settle .65s ease-in 2.2s both;
}

@keyframes slash-color-settle {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .proof-mark .slash-color {
    animation: none;
    opacity: 0;
  }
}
