/* ==========================================================================
   Caldrant site: shared foundation
   Tokens, reset, type, buttons, labels, slots, nav and footer structure,
   the A/B/C switcher, and motion states. Shared by all three directions.
   ========================================================================== */

:root {
  color-scheme: light;

  /* brand: values from the brand kit */
  --paper: #F4F4F2;
  --paper-2: #EBEBE8;
  --white: #FFFFFF;
  --ink: #14171C;
  --ink-2: #3A4049;
  --mute: #5C6470;
  --steel: #8A8D93;          /* decorative only: fails contrast at small sizes */
  --line: #DDDCD7;
  --line-2: #C4C3BD;
  --cobalt: #2952CC;
  --cobalt-ink: #1F409F;
  --cobalt-bright: #3E6BF0;
  --cobalt-pale: #C9D5F8;
  --ice: #E9EEFB;
  --ice-2: #F5F7FD;
  --live: #16A36A;
  --down: #E04860;
  --warn: #D98A00;

  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-s: 6px;
  --r-m: 12px;
  --r-l: 20px;
  --r-btn: 999px;            /* each direction overrides this */

  --shadow-s: 0 1px 2px rgb(20 23 28 / .07), 0 1px 0 rgb(20 23 28 / .04);
  --shadow-m: 0 14px 34px -14px rgb(20 23 28 / .24), 0 2px 6px rgb(20 23 28 / .07);
  --shadow-desk: 0 34px 64px -26px rgb(20 23 28 / .5), 0 10px 22px -10px rgb(20 23 28 / .28);

  --wrap: 1200px;
  --pad: 20px;

  /* driven by motion.js */
  --progress: 0;
  --needle: 0deg;
}

/* ---- reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-height: 100vh; font: 400 17px/1.6 var(--font); color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; padding-bottom: 72px; /* room for the switcher */ }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--cobalt); }
ul[class], ol[class] { list-style: none; padding: 0; }
code, kbd, pre { font-family: var(--mono); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
::selection { background: var(--cobalt); color: #fff; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 4px; }

/* ---- type -------------------------------------------------------------- */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.022em; line-height: 1.06; text-wrap: balance; }
.display { font-size: clamp(2.75rem, 12.5vw, 7rem); letter-spacing: -.036em; line-height: .94; font-stretch: 100%; }
.h2 { font-size: clamp(2rem, 7.2vw, 3.75rem); letter-spacing: -.028em; line-height: 1; }
.h3 { font-size: clamp(1.35rem, 5.2vw, 1.75rem); line-height: 1.15; }
.lede { font-size: clamp(1.0625rem, 4.6vw, 1.3125rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; max-width: 36em; }
.small { font-size: .875rem; line-height: 1.5; color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }
.accent { color: var(--cobalt); }

/* ---- layout ------------------------------------------------------------ */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }
.wrap--narrow { max-width: calc(820px + 2 * var(--pad)); }
.section { position: relative; padding-block: clamp(3.75rem, 10vw, 8rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.band { background: var(--white); border-block: 1px solid var(--line); }
.band--ice { background: var(--ice-2); border-block: 1px solid var(--line); }
.stack > * + * { margin-block-start: var(--gap, 1rem); }
.hairline { border: 0; border-top: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ruler ticks: a minor tick every 10px, a major one every 100px */
.ruler { height: 12px; background:
  repeating-linear-gradient(90deg, var(--tick, var(--line-2)) 0 1px, transparent 1px 10px) left bottom / 100% 6px no-repeat,
  repeating-linear-gradient(90deg, var(--tick, var(--line-2)) 0 1px, transparent 1px 100px) left bottom / 100% 12px no-repeat; }
.ruler--top { transform: scaleY(-1); }

/* ---- labels ------------------------------------------------------------ */
.eyebrow { display: flex; align-items: center; gap: .65em; font: 500 .75rem/1.3 var(--mono);
  letter-spacing: .13em; text-transform: uppercase; color: var(--mute); }
.eyebrow::before { content: ""; flex: none; width: 18px; height: 2px; background: var(--cobalt); }
.tag { display: inline-flex; align-items: center; height: 1.5rem; padding: 0 .55rem; border: 1px solid var(--line-2);
  border-radius: var(--r-s); font: 500 .75rem/1 var(--mono); color: var(--mute); white-space: nowrap; }
.tag--cobalt { border-color: var(--cobalt-pale); color: var(--cobalt); background: var(--white); }
.pkg { font: 400 .8125rem/1.3 var(--mono); color: var(--mute); }

/* ---- buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px;
  padding: 0 1.3rem; border-radius: var(--r-btn); border: 1px solid transparent; background: none;
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), background-color .22s, border-color .22s, color .22s, box-shadow .22s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--primary { background: var(--cobalt); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), var(--shadow-s); }
.btn--primary:hover { background: var(--cobalt-ink); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), var(--shadow-m); }
.btn--ghost { color: var(--ink); border-color: var(--line-2); background: rgb(255 255 255 / .6); }
.btn--ghost:hover { border-color: var(--ink); background: var(--white); transform: translateY(-1px); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; transform: translateY(-1px); }
.btn--sm { min-height: 40px; padding: 0 .9rem; font-size: .9375rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---- brand ------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none;
  font: 700 1rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase; }
.brand .mark { width: 1.5rem; height: 1.5rem; }
.mark { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; overflow: visible; }
.mark__needle { transform-box: view-box; transform-origin: 30px 230px; transform: rotate(var(--needle));
  transition: transform .12s linear; }

/* ---- nav and footer structure (looks are set per direction) ----------- */
.nav { position: sticky; top: 0; z-index: 60; }
.nav__in { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.nav__links { display: none; align-items: center; gap: .25rem; margin-inline: auto; }
.nav__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8rem; border-radius: var(--r-btn);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .9375rem; }
.nav__links a:hover { color: var(--ink); background: var(--ice); }
.nav__cta { display: none; min-height: 40px; padding: 0 1rem; font-size: .9375rem; }
.nav__menu { position: relative; margin-left: auto; }
.nav__menu summary { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .85rem;
  border: 1px solid var(--line-2); border-radius: var(--r-btn); background: rgb(255 255 255 / .7); font-weight: 600; font-size: .9375rem; list-style: none; }
.nav__menu summary::-webkit-details-marker { display: none; }
.nav__sheet { position: absolute; right: 0; top: calc(100% + 8px); width: min(17rem, calc(100vw - 40px)); padding: .5rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-m); }
.nav__sheet a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 .8rem;
  border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-weight: 500; }
.nav__sheet a:hover { background: var(--ice-2); }
.nav__sheet .btn { width: 100%; margin-top: .4rem; }
.nav__contact { display: none; min-height: 40px; padding: 0 1rem; font-size: .9375rem; }
.nav__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.nav__progress::before { content: ""; position: absolute; inset: 0; background: var(--cobalt);
  transform: scaleX(var(--progress)); transform-origin: left; }
@media (min-width: 1000px) {
  .nav__links { display: flex; }
  .nav__cta { display: inline-flex; }
  .nav__contact { display: inline-flex; }
  .nav__menu { display: none; }
}

.foot { border-top: 1px solid var(--line); padding-block: 2.5rem 2rem; }
.foot__grid { display: grid; gap: 1.75rem; }
.foot h4 { font: 500 .75rem/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--mute); margin-bottom: .7rem; }
.foot a { display: flex; align-items: center; min-height: 40px; color: var(--ink-2); text-decoration: none; font-size: .9375rem; }
.foot a:hover { color: var(--cobalt); }
.foot__legal { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-size: .8125rem; color: var(--mute); }
@media (min-width: 760px) { .foot__grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }

/* ---- screenshot slots -------------------------------------------------- */
.slot { position: relative; border-radius: var(--r-m); overflow: hidden; background: var(--white);
  border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.slot__ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .55rem;
  text-align: center; color: var(--mute); padding: 1rem;
  background: var(--paper-2); background-image:
    linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; }
.slot__ph::before, .slot__ph::after { content: ""; position: absolute; left: 0; right: 0; height: 12px; --tick: var(--line-2); }
.slot__ph::before { top: 0; background:
  repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 10px) left top / 100% 6px no-repeat,
  repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 100px) left top / 100% 12px no-repeat; }
.slot__ph::after { bottom: 0; background:
  repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 10px) left bottom / 100% 6px no-repeat,
  repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 100px) left bottom / 100% 12px no-repeat; }
.slot__hint { font: 500 .75rem/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.slot__file { font: 500 .875rem/1 var(--mono); color: var(--cobalt); background: var(--white);
  border: 1px dashed var(--cobalt); padding: .5rem .7rem; border-radius: var(--r-s); }
.slot__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.slot.has-shot .slot__img { opacity: 1; }
.slot.has-shot > :not(.slot__img) { visibility: hidden; }
/* a plain slot has no content of its own: give it the 16:10 capture ratio */
.slot--plain { aspect-ratio: 16 / 10; }
.slot > figcaption { position: absolute; left: .75rem; bottom: .75rem; z-index: 2; padding: .3rem .6rem; border-radius: var(--r-s);
  background: rgb(255 255 255 / .88); font: 500 .75rem/1.3 var(--mono); color: var(--mute); backdrop-filter: blur(6px); }

/* ---- A/B/C switcher ---------------------------------------------------- */
.cd-switcher { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  display: flex; gap: 2px; padding: 4px; background: rgb(255 255 255 / .9); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-m); }
.cd-switcher a { display: grid; place-items: center; min-width: 44px; height: 38px; padding: 0 .5rem; border-radius: 999px;
  color: var(--mute); text-decoration: none; font: 600 .875rem/1 var(--font); }
.cd-switcher a:hover { color: var(--ink); background: var(--ice-2); }
.cd-switcher a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---- motion states ----------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(20px);
  transition: opacity .75s cubic-bezier(.2,.7,.2,1), transform .75s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* hero entrance: pure CSS so it plays even before JavaScript settles */
.js .rise { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
