/* caelval.com: one stylesheet for every page. One web font, IBM Plex Sans (the desk's font), as a single variable
   latin file (45 KB, weights 100-700; SIL Open Font License 1.1): light for headings, regular for text, 500 for the
   wordmark and labels. No italics anywhere. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --ink: #0a0d12;
  --ink-2: #0f131a;
  --panel: #121720;
  --line: rgba(200, 169, 106, 0.18);
  --line-soft: rgba(236, 230, 218, 0.08);
  --ivory: #ece6da;
  --ivory-2: #c9c2b4;
  --muted: #8f8a80;
  --gold: #d4b061;
  --gold-2: #e6c987;
  --mark: #c9a24b;
  --copper: #b8674a;
  --sans: "IBM Plex Sans", "Segoe UI", Calibri, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans); /* display type: the same family, light weight */
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory-2);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--ivory); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 10; background: var(--panel); padding: 8px 12px; }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--serif); color: var(--ivory); font-weight: 300; letter-spacing: -0.015em; margin: 0; }
h3 { font-weight: 400; }
h1 { font-size: clamp(38px, 6.2vw, 72px); line-height: 1.04; }
h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; }
h3 { font-size: 22px; line-height: 1.25; }
p { margin: 0 0 1em; }
.eyebrow {
  font: 500 12px/1.4 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 22px;
}
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ivory-2); max-width: 40em; }
.rule { height: 1px; background: linear-gradient(90deg, var(--line), transparent); border: 0; margin: 0; }
em.g { font-style: normal; color: var(--gold-2); }
em, i { font-style: normal; }

/* ---- header ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(10, 13, 18, 0.82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ivory); }
/* same wordmark as the desk (web/src/components/Brand.tsx): gold arc, CAELVAL in Plex Sans 500 at 0.18em */
.brand svg { width: 24px; height: 24px; flex: none; }
.brand span { font: 500 19.7px/1 var(--sans); letter-spacing: 0.18em; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: 14px; color: var(--ivory-2); text-decoration: none; letter-spacing: 0.02em; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  font: 500 14px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); background: var(--gold);
  border: 1px solid var(--gold); border-radius: 2px;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--gold-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ivory); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold-2); }
.nav .btn { min-height: 38px; padding: 0 16px; font-size: 12px; }
.nav a.btn, .nav a.btn:hover { color: var(--ink); }

/* mobile menu: <details>, no script */
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 10px 0 10px 10px; color: var(--ivory); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .panel {
  position: absolute; right: 0; top: 46px; width: min(84vw, 300px);
  background: var(--panel); border: 1px solid var(--line); padding: 10px 0;
  display: flex; flex-direction: column;
}
.menu .panel a { padding: 12px 20px; text-decoration: none; color: var(--ivory-2); }
.menu .panel a:hover { color: var(--gold-2); }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 80% 30%, rgba(200, 169, 106, 0.10), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, rgba(184, 103, 74, 0.06), transparent 70%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 4vw, 64px); align-items: center; padding-top: clamp(48px, 8vw, 104px); padding-bottom: clamp(48px, 8vw, 104px); }
/* two lines at every width: each line is a block, sized so the longer one (8.9em in Plex Light) fits the column */
.hero h1 { margin-bottom: 26px; font-size: clamp(32px, 3.9vw, 48px); line-height: 1.12; }
.hero h1 .l { display: block; white-space: nowrap; }
@media (max-width: 380px) { .hero h1 .l { white-space: normal; } }
.hero .lede { margin-bottom: 34px; }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.sim {
  position: relative; margin: 0;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(18, 23, 32, 0.9), rgba(10, 13, 18, 0.9));
  aspect-ratio: 16 / 9; min-height: 260px;
}
.sim canvas { width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.sim .tag {
  position: absolute; left: 16px; top: 14px; right: 16px; pointer-events: none;
  font: 500 11px/1.4 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.sim .readout {
  position: absolute; left: 16px; right: 16px; bottom: 14px; pointer-events: none;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  font: 400 12px/1.3 var(--sans); color: var(--muted);
}
.sim .readout b { display: block; font: 400 20px/1.2 var(--serif); color: var(--ivory); }
.sim .readout .ac b { color: var(--gold-2); }
.sim .readout .ki b { color: #d98a6c; }
.sim figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- sections ---- */
section { padding: clamp(64px, 9vw, 120px) 0; }
section + section { border-top: 1px solid var(--line-soft); }
.head { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
.head p { color: var(--ivory-2); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 30px 26px 28px; text-decoration: none; color: var(--ivory-2);
  border-right: 1px solid var(--line); min-height: 300px;
  transition: background .25s;
}
.card:last-child { border-right: 0; }
.card:hover { background: rgba(200, 169, 106, 0.05); color: var(--ivory-2); }
.card .n { font: 400 13px/1 var(--serif); color: var(--gold); letter-spacing: .1em; }
.card h3 { color: var(--ivory); }
.card p { font-size: 15px; margin: 0; }
.card .more { margin-top: auto; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }

.who { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.who div { background: var(--ink); padding: 32px 30px; }
.who h3 { margin-bottom: 10px; }
.who p { margin: 0; font-size: 15.5px; }

.ai { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.ai > div { background: linear-gradient(180deg, rgba(212, 176, 97, 0.06), rgba(10, 13, 18, 0) 60%), var(--ink); padding: 34px 30px; }
.ai .k { font: 500 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.ai h3 { margin-bottom: 12px; }
.ai p { font-size: 15.5px; margin: 0; }
.ai-cta { margin-top: 32px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; counter-reset: s; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; padding: 26px 22px 0 0; font-size: 15px; }
.steps li::before { content: "0" counter(s); display: block; font: 400 13px/1 var(--serif); color: var(--gold); letter-spacing: .1em; margin-bottom: 16px; }
.steps b { display: block; font: 400 19px/1.3 var(--serif); color: var(--ivory); margin-bottom: 8px; }

.founder { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: start; }

.band { text-align: center; }
.band h2 { margin: 0 auto 18px; max-width: 26em; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; text-wrap: balance; }
.band p { margin: 0 auto 34px; max-width: 36em; }
.band .ctas { justify-content: center; }

/* ---- inner pages ---- */
.page-hero { border-bottom: 1px solid var(--line-soft); padding: clamp(56px, 9vw, 112px) 0 clamp(44px, 6vw, 72px); background: radial-gradient(60% 90% at 90% 0%, rgba(200, 169, 106, 0.08), transparent 70%); }
.page-hero h1 { font-size: clamp(36px, 5.4vw, 62px); max-width: 15em; margin-bottom: 24px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--gold-2); }
.prose { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(28px, 5vw, 72px); }
.prose + .prose { margin-top: clamp(48px, 6vw, 80px); padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--line-soft); }
.prose h2 { font-size: clamp(24px, 2.6vw, 32px); }
.prose ul { margin: 0 0 1em; padding: 0; list-style: none; }
.prose li { position: relative; padding: 10px 0 10px 26px; border-bottom: 1px solid var(--line-soft); }
.prose li::before { content: ""; position: absolute; left: 2px; top: 21px; width: 10px; height: 1px; background: var(--gold); }
.prose li b { color: var(--ivory); font-weight: 500; }
.next { display: flex; flex-wrap: wrap; gap: 12px; }
a.profile { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
a.profile:hover { color: var(--gold-2); }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line-soft); padding: 56px 0 40px; font-size: 14px; color: var(--muted); }
footer .grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 32px; margin-bottom: 40px; }
footer h4 { font: 500 12px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ivory-2); margin: 0 0 14px; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin: 0 0 8px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--gold-2); }
footer .legal { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line-soft); font-size: 13px; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(2) { border-right: 0; }
  .card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li { padding-bottom: 8px; }
}
@media (max-width: 1100px) {
  .nav { display: none; }
  .menu { display: block; }
}
@media (max-width: 960px) {
  .hero .wrap, .head, .founder, .prose { grid-template-columns: 1fr; }
  .head { gap: 16px; }
  .ai { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards, .who { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .card:last-child { border-bottom: 0; }
  .steps { grid-template-columns: 1fr; }
  .sim .readout { grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
  .sim .readout b { font-size: 18px; }
  .ctas .btn { flex: 1 1 100%; }
  footer .grid { grid-template-columns: 1fr 1fr; }
  footer .grid > :first-child { grid-column: 1 / -1; }
}
/* ---- page transitions ----
   Cross-document view transitions (Chrome/Edge 126+, Safari 18.2+): the header stays put, the old page lifts away and
   the new one settles in. Elsewhere the new page just fades in. Pages are prerendered on hover (speculation rules in
   each page's head), so the transition starts as soon as the link is clicked. */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
::view-transition-group(top) { animation: none; }
::view-transition-old(root) { animation: 180ms cubic-bezier(.4, 0, 1, 1) both vt-out; }
::view-transition-new(root) { animation: 420ms cubic-bezier(.16, 1, .3, 1) 60ms both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); filter: blur(2px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
@supports not (view-transition-name: none) {
  main { animation: vt-in 420ms cubic-bezier(.16, 1, .3, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  main { animation: none !important; }
}
