/* Black Forest Labs: site styles
   Brand: Black-Green #0E1F17, Sage #8FA872, Gold #C9A24A
   Type: Archivo (headings), Inter (text), Fraunces (Debatable's wordmark only) */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --deep: #0E1F17;
  --forest: #16301F;
  --sage: #8FA872;
  --sage-soft: #DCE5D2;
  --lichen: #EEF2EA;
  --gold: #C9A24A;
  --ink: #0E1F17;
  --ink-soft: #3D4A40;
  --fog: #E6ECE2;
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--lichen);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--deep); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; }

h1, h2, h3 { font-family: "Archivo", sans-serif; font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }

/* ---------- Hero: the page is counterchanged, like the shield ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  background: linear-gradient(90deg, var(--deep) 50%, var(--sage) 50%);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.hero-bar { position: relative; z-index: 3; }
.hero-bar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.hero-bar .lockup img { height: 52px; width: auto; }
.hero-bar nav { display: flex; gap: 28px; font-weight: 600; font-size: 15px; }
.hero-bar nav a { color: var(--deep); text-decoration: none; }
.hero-bar nav a:hover { text-decoration: underline; }

.hero-copy { position: relative; align-self: center; }
.hero-layer { padding: 4vh 0 10vh; }
.hero-layer.on-dark { color: var(--sage); clip-path: inset(0 50% 0 0); }
.hero-layer.on-light { color: var(--deep); clip-path: inset(0 0 0 50%); position: absolute; inset: 0; }
.hero h1, .hero .h1 {
  margin: 0;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  /* Sized to the split: the gold line always falls 4.12em into each line,
     so it cuts through "the" on both lines at every width. On phones the
     headline runs over four lines and the line falls 2.25em in. */
  font-size: calc((min(50vw, 590px) - var(--gutter)) / 4.12);
  white-space: nowrap;
  line-height: 0.95;
  letter-spacing: -0.035em;
  max-width: none;
}
.hero .lede {
  margin: 34px 0 0;
  /* Keep the paragraph on the dark half, clear of the gold line */
  max-width: min(34ch, calc(min(50vw, 590px) - var(--gutter) - 32px));
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
}

/* Height keeps the trees in proportion with the page width, so tree tops are never cropped */
.treeline { position: relative; height: max(70px, 8.41vw); }
.treeline svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.treeline .on-dark { clip-path: inset(0 50% 0 0); }
.treeline .on-light { clip-path: inset(0 0 0 50%); }

.treeline path { transform-box: fill-box; transform-origin: 50% 100%; }
.treeline .sapling { fill: var(--gold); }
.treeline .glint { fill: #FFF1C4; opacity: 0; transform-origin: 50% 50%; }
.hero::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: var(--gold); z-index: 2; opacity: 0.9;
}
[id] { scroll-margin-top: 84px; }  /* clears the header that follows you down */

/* ---------- Motion (only for people who haven't asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* The forest grows: the gold line draws down, the trees rise left to right,
     then the gold sapling comes up last and catches the light. Plays once. */
  .hero::after { transform-origin: top; animation: seam 1.1s 0.2s cubic-bezier(.2,.7,.2,1) both; }
  .treeline g path { animation: rise 0.8s var(--d) cubic-bezier(.25,1.3,.5,1) both; }
  .treeline .sapling { animation: rise 0.7s 1.45s cubic-bezier(.25,1.4,.5,1) both, shine 1s 2s ease-in-out both; }
  .treeline .glint { animation: glint 1s 1.95s ease-in-out both; }
  @keyframes seam { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  @keyframes shine { 0%, 100% { fill: #C9A24A; } 45% { fill: #F1D488; } }
  @keyframes glint {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    40% { opacity: 1; transform: scale(1) rotate(45deg); }
    100% { opacity: 0; transform: scale(0.2) rotate(90deg); }
  }
}

/* ---------- Apps ---------- */
.apps { padding: clamp(72px, 10vw, 128px) 0; }
.apps > .wrap > h2 { font-size: clamp(34px, 4vw, 52px); margin-bottom: 40px; }
.app {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(24px, 5vw, 72px);
  padding: 44px 0;
  border-top: 1px solid var(--sage);
  align-items: start;
}
.app:last-child { border-bottom: 1px solid var(--sage); }
.app-name { margin: 0; }
.app-name.debatable { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: clamp(56px, 7vw, 96px); letter-spacing: -0.02em; line-height: 0.9; }
.aurora { height: 4px; width: 132px; margin-top: 18px; border-radius: 2px; background: linear-gradient(90deg, #6E4BFF, #C45BDD 55%, #FF6B8B); }
.app p { margin: 0 0 14px; max-width: 46ch; }
.app .what { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.45; }
.status { color: var(--ink-soft); font-size: 15px; }
.status strong { color: var(--ink); font-weight: 600; }
.app a.go { font-weight: 600; }
.app.quiet { opacity: 0.9; }

/* Debatable screens, in simple phone frames. Sizes use the phone's own width (cqw)
   so the corners and camera pill stay in proportion at any size. */
.phones {
  grid-column: 1 / -1; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px); align-items: end;
  width: 100%; max-width: 980px; justify-self: center; margin-top: clamp(16px, 3vw, 40px);
}
.phones::before {
  content: ""; position: absolute; left: 50%; top: 12%; width: 46%; height: 70%; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(110, 75, 255, 0.30), rgba(196, 91, 221, 0.18) 55%, transparent);
  filter: blur(28px); pointer-events: none;
}
.phone { position: relative; margin: 0; text-align: center; container-type: inline-size; }
.phone .device {
  position: relative; padding: 3.4cqw; border-radius: 15cqw; background: #141414;
  box-shadow: inset 0 0 0 1px #2e2e2e, 0 32px 60px -24px rgba(14, 31, 23, 0.5), 0 14px 28px -16px rgba(14, 31, 23, 0.4);
}
.phone .device img { display: block; width: 100%; height: auto; border-radius: 11.6cqw; background: #0b0b0d; }
.phone .device::after {
  content: ""; position: absolute; top: 6.2cqw; left: 50%; width: 29cqw; height: 8.4cqw; transform: translateX(-50%);
  border-radius: 99px; background: #000;
}
.phone figcaption { margin-top: 18px; font-size: 15px; color: var(--ink-soft); }

/* ---------- About ---------- */
.about { background: var(--forest); color: var(--fog); padding: clamp(72px, 10vw, 128px) 0; }
.about .wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); }
.about h2 { font-size: clamp(34px, 4vw, 52px); color: var(--sage); }
.about p { margin: 0 0 18px; max-width: 58ch; font-size: 19px; line-height: 1.6; }
.about p.small { font-size: 16px; color: #B9C6B1; }

/* ---------- Footer ---------- */
.site-foot { background: var(--deep); color: #B9C6B1; padding: 56px 0 48px; font-size: 15px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: flex-end; justify-content: space-between; }
.site-foot .lockup img { height: 56px; width: auto; }
/* Sits under the wordmark, lined up with "LABS" (the wordmark starts 1.05× the logo height in) */
.site-foot .lockup { display: block; }
.site-foot .anno { margin: 2px 0 0 58.8px; line-height: 1; font-family: "Archivo", sans-serif; font-weight: 400; font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-foot nav a { color: var(--fog); text-decoration: none; }
.site-foot nav a:hover { text-decoration: underline; }
.site-foot .legal { flex-basis: 100%; margin: 8px 0 0; color: #8C9A86; font-size: 14px; }


/* ---------- Small screens ---------- */
.lede-below { display: none; }
@media (max-width: 760px) {
  .hero { min-height: 74vh; }
  .hero .lede { display: none; }
  .hero-layer { padding: 2vh 0 8vh; }
  .lede-below { display: block; margin: 0 0 56px; font-size: 20px; line-height: 1.5; max-width: 34ch; }
  .hero-bar .lockup img { height: 40px; }
  .hero-bar nav { gap: 18px; font-size: 14px; }
  .app, .about .wrap { grid-template-columns: 1fr; }
  /* On phones the three screens become a strip you can swipe through */
  .phones {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 18px;
    margin: 8px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 12px; max-width: none; width: auto;
    scrollbar-width: none;
  }
  .phones::-webkit-scrollbar { display: none; }
  .phones::before { display: none; }
  .phones { justify-self: stretch; }
  .phone { flex: 0 0 62%; scroll-snap-align: center; }
}
@media (max-width: 420px) {
  .hero-bar nav { display: none; }
}

h1, h2, .h1 { text-wrap: balance; }

.hero br.m { display: none; }
@media (max-width: 520px) {
  .hero h1, .hero .h1 { font-size: calc((50vw - var(--gutter)) / 2.25); }
  .hero br.m { display: inline; }
}

/* ---------- Not-found page ---------- */
/* Same trick as the home page: the gold line falls 2.8em in, through the
   "n" of "in" and the "o" of "woods", at every width. */
.hero.hero-404 h1, .hero.hero-404 .h1 { font-size: calc((min(50vw, 590px) - var(--gutter)) / 2.8); }
.hero .go { color: inherit; }
.hero-404 { min-height: 100vh; min-height: 100svh; }
.hero .lede + .lede { margin-top: 18px; }
.hero-404 + main { display: none; }
@media (max-width: 760px) { .hero-404 + main { display: block; } }

[tabindex="-1"]:focus { outline: none; }

/* ---------- Header that follows you down the page ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  /* Frosted glass: the page shows through, softly blurred, tinted black-green */
  background: rgba(14, 31, 23, 0.8);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(201, 162, 74, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 30px -18px rgba(14, 31, 23, 0.5);
  transform: translateY(-101%); transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.topbar.is-on { transform: none; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.topbar .lockup img { display: block; height: 34px; width: auto; }
.topbar nav { display: flex; gap: 30px; font-weight: 600; font-size: 15px; }
.topbar nav a { position: relative; padding: 8px 0; color: var(--fog); text-decoration: none; transition: color 0.3s; }
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.45s cubic-bezier(.2, .8, .2, 1);
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.is-active { color: var(--gold); }
.topbar nav a.is-active::after { transform: scaleX(1); }
@media (max-width: 420px) {
  .topbar .wrap { height: 56px; }
  .topbar .lockup img { height: 28px; }
  .topbar nav { gap: 18px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar, .topbar nav a, .topbar nav a::after { transition: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: rgba(14, 31, 23, 0.95); }
}
