/* Slipstack design system: tokens and primitives shared by the site, the cabinet and the panel. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/static/fonts/bricolage-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/static/fonts/geistmono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

:root {
  --ink: #0f1214;
  --ink-2: #191f23;
  --ink-3: #232b31;
  --paper: #fbf9f5;
  --paper-2: #f3efe8;
  --paper-3: #ebe5da;
  --line: #e0d9cd;
  --line-strong: #cfc5b5;
  --text: #14181b;
  --muted: #5d6771;
  --muted-2: #7d8791;
  --on-ink: #f6f2ea;
  --on-ink-muted: #a9b2b8;
  --on-ink-line: #2c343a;

  --accent: #0b6e5a;
  --accent-strong: #085246;
  --accent-bright: #0e9070;
  --accent-soft: #e4f1ec;
  --amber: #c4761a;
  --amber-soft: #f8ecdc;
  --danger: #a8322a;
  --danger-soft: #f8e6e4;
  --success: #1f7a4d;

  --grad-mark: linear-gradient(135deg, #0e9070 0%, #0b6e5a 46%, #c4761a 100%);
  --grad-pro: linear-gradient(158deg, #10161a 0%, #0d2a26 58%, #0b3b32 100%);
  --grad-sweep: linear-gradient(180deg, rgba(14, 144, 112, 0) 0%, rgba(14, 144, 112, 0.35) 48%, rgba(14, 144, 112, 0) 100%);

  --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;

  --r-1: 8px;
  --r-2: 12px;
  --r-3: 18px;
  --r-4: 26px;
  --r-pill: 999px;

  --fs-display: clamp(44px, 6.4vw, 86px);
  --fs-h1: clamp(34px, 4.4vw, 58px);
  --fs-h2: clamp(28px, 3.2vw, 42px);
  --fs-h3: 22px;
  --fs-h4: 18px;
  --fs-lead: 19px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 13px;

  --font-display: 'Bricolage Grotesque', 'Geist', system-ui, sans-serif;
  --font-text: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --container: 1120px;
  --column: 680px;
  --header-h: 68px;

  --shadow-1: 0 1px 2px rgba(15, 18, 20, 0.05), 0 2px 8px rgba(15, 18, 20, 0.04);
  --shadow-2: 0 2px 6px rgba(15, 18, 20, 0.06), 0 12px 32px rgba(15, 18, 20, 0.08);
  --shadow-3: 0 24px 64px rgba(15, 18, 20, 0.16);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 220ms;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea { font: inherit; color: inherit; }

img,
svg,
canvas { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.028em;
  margin: 0;
  color: var(--text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.24; letter-spacing: -0.018em; }
h4 { font-size: var(--fs-h4); line-height: 1.3; letter-spacing: -0.012em; }
p { margin: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

.column {
  max-width: var(--column);
  margin-inline: auto;
}

.section { padding-block: var(--s-9); }
.section--tight { padding-block: var(--s-8); }

.on-ink {
  background: var(--ink);
  color: var(--on-ink);
}
.on-ink h1,
.on-ink h2,
.on-ink h3,
.on-ink h4 { color: var(--on-ink); }
.on-ink .muted { color: var(--on-ink-muted); }
.on-ink a { color: #6fd6b4; }

.muted { color: var(--muted); }

.stack > * + * { margin-top: var(--s-4); }

/* ---------- type helpers ---------- */

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
}

.accent-line { color: var(--accent); }
.on-ink .accent-line { color: #55c8a4; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
}
.on-ink .lead { color: var(--on-ink-muted); }

.index {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- buttons ---------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--on-ink);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }

.btn--accent {
  --btn-bg: var(--accent);
  --btn-bd: var(--accent);
  --btn-fg: #fff;
}
.btn--accent:hover { --btn-bg: var(--accent-strong); --btn-bd: var(--accent-strong); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-bd: var(--line-strong);
  --btn-fg: var(--text);
}
.btn--ghost:hover { --btn-bd: var(--ink); }

.on-ink .btn--ghost {
  --btn-bd: var(--on-ink-line);
  --btn-fg: var(--on-ink);
}
.on-ink .btn--ghost:hover { --btn-bd: var(--on-ink-muted); }

/* Dark surfaces take the bright mint so the filled button keeps its contrast. */
.on-ink .btn--accent,
.plan--pro .btn {
  --btn-bg: #55c8a4;
  --btn-bd: #55c8a4;
  --btn-fg: #06251f;
}
.on-ink .btn--accent:hover,
.plan--pro .btn:hover { --btn-bg: #7ad9bb; --btn-bd: #7ad9bb; }

.btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-xs); }
.btn--lg { min-height: 54px; padding: 0 30px; font-size: var(--fs-body); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }

/* ---------- surfaces ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
}

.card--flat { box-shadow: none; }
.card--raised { box-shadow: var(--shadow-1); }

.on-ink .card {
  background: var(--ink-2);
  border-color: var(--on-ink-line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
}
.pill--accent { background: var(--accent-soft); border-color: #c7e3d9; color: var(--accent-strong); }
.pill--amber { background: var(--amber-soft); border-color: #ecd7b8; color: #8d520f; }
.pill--danger { background: var(--danger-soft); border-color: #eec9c5; color: var(--danger); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.on-ink .rule { background: var(--on-ink-line); }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }

.input,
.select,
.textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: #fff;
  font-size: var(--fs-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

/* ---------- motion ---------- */

.reveal {
  opacity: 0;
  transition: opacity 620ms var(--ease);
}
.reveal.is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; }
}

/* ---------------------------------------------------------------- brand mark */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.on-ink .brand__name,
.site-footer .brand__name { color: inherit; }

.mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad-mark);
  overflow: hidden;
  flex: none;
}
.mark svg { width: 34px; height: 34px; }
.mark__slip rect,
.mark__slip { fill: #fff; }
.mark__slip--back { opacity: 0.45; }
.mark__slip--mid { opacity: 0.7; }
.mark__row { fill: #0b6e5a; opacity: 0.55; }
.mark__row--total { fill: #0b6e5a; opacity: 0.9; }
.mark__beam { fill: #fff; opacity: 0; }

.mark__slips > * { transform-box: fill-box; transform-origin: center; }

/* The slips fade in one after another - opacity only, nothing moves and nothing jumps.
   The beam is an ambient loop over the stack; hover speeds it up. */
@keyframes mark-fade {
  from { opacity: 0; }
}
@keyframes mark-sweep {
  0%, 6% { transform: translateY(0); opacity: 0; }
  12% { opacity: 0.9; }
  30% { opacity: 0.9; }
  36%, 100% { transform: translateY(22px); opacity: 0; }
}

.mark__slip--back { animation: mark-fade 460ms var(--ease) 60ms both; }
.mark__slip--mid { animation: mark-fade 460ms var(--ease) 170ms both; }
.mark__slip--front { animation: mark-fade 460ms var(--ease) 280ms both; }
.mark__beam { animation: mark-sweep 6000ms var(--ease) 900ms infinite both; }
.brand:hover .mark__beam { animation-duration: 1800ms; animation-delay: 0ms; }

/* ---------- utility ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: var(--r-1);
  transform: translateY(-140%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: none; color: var(--on-ink); }
