/* Precision AI Solutions
   Style language: restrained Swiss brutalism (hard 1px rules, square edges, solid colour fields,
   no shadows, no blur). Grounded in the Orbit Index system (website-library): two legal
   environments (quiet paper sections for explanation, full-bleed solid fields for hero, proof and
   conversion), stacked heading blocks, left alignment, radii 0/2px, ruled rows instead of cards.
   Re-cut to the brand guide v2 palette (#334155 primary field, #0F172A secondary, #0EA5E9 accent
   for action only). Fonts: Plein (headings) + Excon (text), both Fontshare.
   Button mechanics: cssbuttons.io / Uiverse "new-bird-34" by adamgiebl (icon tile that fills
   the button on hover), re-cut square, label kept above the fill so hover never covers text. */

:root {
  /* Brand guide v2 */
  --c-slate: #334155;      /* primary: header, hero field, CTA field, footer */
  --c-ink: #0f172a;        /* secondary: statement section, text */
  --c-sky: #0ea5e9;        /* accent: actions only, never text on white */
  --c-white: #ffffff;
  --c-mist: #f3f4f5;       /* guide "muted" */
  --c-rule: #dbdcdf;       /* guide "border" */

  /* Derived (contrast checked in tools/contrast.py) */
  --c-text: var(--c-ink);
  --c-text-2: #475467;           /* 7.6:1 on white */
  --c-on-dark: #f8fafc;
  --c-on-dark-2: #cbd5e1;        /* 6.6:1 on slate, 12:1 on ink */
  --c-grid-dark: #3d4b60;        /* calendar hairlines on slate */
  --c-slot: #f8fafc;
  --c-fade: #334155;             /* same as slate, used in masks */

  --f-display: 'Plein', 'Excon', sans-serif;
  --f-text: 'Excon', sans-serif;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --section: clamp(80px, 10vw, 144px);
  --wrap: 1184px;
  --gutter: clamp(20px, 5vw, 48px);
  --header-h: 64px;

  --r: 2px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-reveal: 640ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--f-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p, dd { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 700; }
:is(a[href], button) { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus, var(--c-ink)); outline-offset: 3px; border-radius: var(--r); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--c-white); color: var(--c-ink); padding: var(--s-3) var(--s-4);
  text-decoration: none; font-weight: 500;
}
.skip:focus { top: var(--s-3); }

/* Type */
.display {
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 6.2vw, 5.6rem);
  line-height: .98;
  letter-spacing: -0.025em;
  max-width: 13.5ch;
  text-wrap: balance;
}
.display-2 {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.022em;
  max-width: 16ch;
  text-wrap: balance;
}
.h2 {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  max-width: 18ch;
  text-wrap: balance;
}
.h3 {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lede { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); line-height: 1.55; max-width: 54ch; }

/* Fields (Orbit Index: inversion is structural, it owns the whole section) */
.field-slate { background: var(--c-slate); color: var(--c-on-dark); --focus: var(--c-sky); }
.field-ink { background: var(--c-ink); color: var(--c-on-dark); --focus: var(--c-sky); }
.field-slate .lede, .field-ink .lede { color: var(--c-on-dark-2); }
.paper { background: var(--c-white); }
.section { padding-block: var(--section); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--c-slate); color: var(--c-on-dark);
  border-bottom: 1px solid var(--c-grid-dark);
  --focus: var(--c-sky);
}
.header-bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.brand-word { font-family: var(--f-display); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-logo { height: 32px; width: auto; }
.nav { display: flex; align-items: center; gap: var(--s-5); }
.nav-link {
  color: var(--c-on-dark-2); text-decoration: none; font-size: .9375rem;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--c-on-dark); }

/* Button: cssbuttons.io / Uiverse new-bird-34, re-cut */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center;
  min-height: 52px; padding: 0 64px 0 22px;
  background: var(--c-sky); color: var(--c-ink);
  font-family: var(--f-text); font-weight: 500; font-size: 1.0625rem; letter-spacing: .005em;
  text-decoration: none; border-radius: var(--r);
}
.btn::before {
  content: ''; position: absolute; inset: 6px; z-index: -1;
  background: var(--c-ink); border-radius: var(--r);
  transform: scaleX(0); transform-origin: right center;
  transition: transform var(--dur-base) var(--ease);
}
.btn-label { position: relative; transition: color var(--dur-base) var(--ease); }
.btn-icon {
  position: absolute; right: 6px; top: 6px; bottom: 6px; aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--c-ink); color: var(--c-white); border-radius: var(--r);
}
.btn-icon svg { width: 20px; height: 20px; transition: transform var(--dur-base) var(--ease); }
.btn:hover::before { transform: scaleX(1); }
.btn:hover .btn-label { color: var(--c-white); }
.btn:hover .btn-icon svg { transform: translateX(2px); }
.btn:active::before { background: var(--c-slate); }
.btn-sm { min-height: 44px; padding: 0 52px 0 16px; font-size: .9375rem; }
.btn-sm .btn-icon svg { width: 18px; height: 18px; }
.btn-lg { min-height: 60px; padding: 0 76px 0 26px; font-size: 1.1875rem; }
.btn-lg .btn-icon svg { width: 22px; height: 22px; }

.text-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 6px; text-decoration-color: var(--c-sky);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.text-link:hover { text-decoration-color: currentColor; }
.text-link.on-dark { color: var(--c-on-dark); }

/* Hero: the calendar is the section background */
.hero { position: relative; overflow: hidden; min-height: min(86svh, 820px); display: flex; align-items: center; }
.hero-inner { position: relative; z-index: 2; padding-block: var(--s-9); }
.hero .display { font-size: clamp(2.6rem, 5.4vw, 4.9rem); max-width: min(12ch, 44vw); }
.hero .lede { margin-top: var(--s-5); max-width: min(44ch, 44vw); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); margin-top: var(--s-7); }

.cal {
  position: absolute; z-index: 1; top: 0; bottom: 0; right: 0; left: 58%;
  display: grid; grid-template-rows: 56px 1fr;
  border-left: 1px solid var(--c-grid-dark);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--c-fade) 22%);
  mask-image: linear-gradient(90deg, transparent 0, var(--c-fade) 22%);
}
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(5, 1fr); }
.cal-head span {
  display: flex; align-items: flex-end; padding: 0 var(--s-3) var(--s-3);
  font-size: .875rem; color: var(--c-on-dark-2);
  border-right: 1px solid var(--c-grid-dark); border-bottom: 1px solid var(--c-grid-dark);
}
.cal-col {
  display: grid; grid-template-rows: repeat(8, 1fr);
  border-right: 1px solid var(--c-grid-dark);
  background-image: linear-gradient(var(--c-grid-dark) 1px, transparent 1px);
  background-size: 100% calc(100% / 8);
}
.slot {
  grid-row: var(--row); margin: 5px;
  display: flex; align-items: flex-start;
  padding: var(--s-2) var(--s-3);
  background: var(--c-slot); color: var(--c-slate);
  border-radius: var(--r); gap: 6px;
  font-size: .8125rem; font-weight: 500; line-height: 1.2;
}
.slot svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.slot.m-only { display: none; }
.js .slot { opacity: 0; transform: translateY(10px); }
.js .hero.on .slot {
  opacity: 1; transform: none;
  transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out);
  transition-delay: calc(400ms + var(--d) * 260ms);
}

/* How it works: heading column + ruled sequential steps */
#how .wrap { display: grid; grid-template-columns: 5fr 7fr; gap: var(--s-8); align-items: start; }
#how .h2 { position: sticky; top: calc(var(--header-h) + var(--s-6)); }
.steps { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--c-ink); }
.step {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--s-5);
  padding: var(--s-6) 0 var(--s-7); border-bottom: 1px solid var(--c-rule);
  background: var(--c-white);
}
.step-n {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--c-slate); color: var(--c-white);
  font-family: var(--f-display); font-weight: 700; font-size: 1.125rem; border-radius: var(--r);
}
.step p { margin-top: var(--s-3); color: var(--c-text-2); max-width: 52ch; }

/* Statement */
.statement { padding-block: var(--s-4); }
.statement .lede { margin-top: var(--s-6); }

/* Fit: ruled definition rows */
.rows { margin: var(--s-8) 0 0; border-top: 2px solid var(--c-ink); }
.row {
  display: grid; grid-template-columns: 4fr 7fr; gap: var(--s-6);
  padding: var(--s-6) 0; border-bottom: 1px solid var(--c-rule); background: var(--c-white);
}
.row dd { margin: 0; color: var(--c-text-2); max-width: 58ch; padding-top: 2px; }

/* CTA */
.cta { padding-block: var(--section); border-bottom: 1px solid var(--c-grid-dark); }
.cta .lede { margin-top: var(--s-5); }
.cta .btn { margin-top: var(--s-7); }

/* Footer */
.site-footer { background: var(--c-slate); color: var(--c-on-dark-2); --focus: var(--c-sky); padding-block: var(--s-7); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: var(--s-4) var(--s-6); align-items: center; }
.footer-grid .brand-word { color: var(--c-on-dark); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: .9375rem; transition: color var(--dur-fast) var(--ease); }
.site-footer nav a:hover { color: var(--c-on-dark); }
.fine { grid-column: 1 / -1; font-size: .875rem; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.on { opacity: 1; transform: none; transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }

/* Privacy page */
.doc { padding-block: var(--s-9); }
.doc .wrap { max-width: 760px; }
.doc h2 { font-family: var(--f-display); font-size: 1.375rem; margin-top: var(--s-7); }
.doc p { margin-top: var(--s-3); color: var(--c-text-2); }
.doc a { text-decoration-color: var(--c-sky); text-decoration-thickness: 2px; text-underline-offset: 4px; }

@media (max-width: 900px) {
  #how .wrap { grid-template-columns: 1fr; gap: var(--s-7); }
  #how .h2 { position: static; }
  .row { grid-template-columns: 1fr; gap: var(--s-3); }
}

@media (max-width: 760px) {
  .nav-link { display: none; }
  .hero { min-height: 0; align-items: flex-end; }
  .hero-inner { padding-top: 260px; padding-bottom: var(--s-8); }
  .hero .display, .hero .lede { max-width: none; }
  .slot.late { display: none; }
  .slot.m-only { display: flex; }
  .cal-col { grid-template-rows: repeat(5, 1fr); background-size: 100% calc(100% / 5); }
  .slot { padding: var(--s-1) var(--s-2); align-items: center; }
  .cal {
    left: 0; bottom: auto; height: 280px; border-left: 0;
    -webkit-mask-image: linear-gradient(180deg, var(--c-fade) 72%, transparent 100%);
    mask-image: linear-gradient(180deg, var(--c-fade) 72%, transparent 100%);
  }
  .cal-head, .cal-body { grid-template-columns: repeat(3, 1fr); }
  .cal-head span:nth-child(n+4), .cal-col:nth-child(n+4) { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-word { font-size: 1rem; }
  .btn-sm .btn-label { font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .slot { opacity: 1; transform: none; transition: none; }
  .btn::before, .btn-label, .btn-icon svg, .text-link { transition: none; }
}
