/* ==========================================================================
   Phantazein Design System · phantazein.css
   https://phantazein.com/design/  ·  spec: https://phantazein.com/design/DESIGN.md
   Version 1.1.0 · 2026-10-04
   © 2026 Phantazein S.L. · SPDX-License-Identifier: CC-BY-4.0
   https://creativecommons.org/licenses/by/4.0/ · terms: https://phantazein.com/design/LICENSE.txt
   "Phantazein", the mark and the logos are trademarks of Phantazein S.L. and are
   not covered by this licence.

   This file IS the system: phantazein.com itself loads it. Change a value
   here and the site, the style guide and every consumer change with it.

   Load the fonts first, then this file:
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=Archivo+Black&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap">
     <link rel="stylesheet" href="https://phantazein.com/design/phantazein.css">

   Themes: dark by default. <html data-theme="light"> forces light,
   data-theme="dark" forces dark, no attribute follows the OS.
   ========================================================================== */

/* ─── tokens · dark (default) ─── */
:root {
  color-scheme: dark;

  /* colour */
  --bg:        #000000;   /* page ground */
  --bg-elev:   #0a0a0a;   /* elevated band, form fields */
  --bg-card:   #0e0e0e;   /* card hover, panels */
  --ink:       #f4f2ee;   /* headlines, primary text */
  --ink-soft:  #a8a5a0;   /* body text */
  --ink-mute:  #5e5c58;   /* labels and meta only, never body copy */
  --rule:      #1c1c1c;   /* hairlines */
  --rule-hi:   #2a2a2a;   /* control borders */
  --accent:    #ff0018;   /* THE red */
  --accent-dim:#b30011;   /* pressed red */
  --accent-hover: #ff2030;                /* filled red buttons on hover */
  --accent-glow:  rgba(255, 0, 24, 0.18); /* status-dot halo, focus ring */
  --on-accent: #ffffff;                   /* text on red */

  --status-shipping: var(--accent);
  --status-preview:  #d6d1c6;
  --status-research: var(--ink-mute);

  /* type families */
  --display: "Archivo Black", "Archivo", ui-sans-serif, system-ui, sans-serif;
  --heavy:   "Archivo", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* type scale */
  --text-hero:      clamp(40px, 7.2vw, 116px);
  --text-xl:        clamp(32px, 5vw, 68px);
  --text-section:   clamp(30px, 4vw, 54px);
  --text-statement: clamp(24px, 3vw, 38px);
  --text-card:      26px;
  --text-lede:      18px;
  --text-body:      15.5px;
  --text-small:     14px;
  --text-nav:       11.5px;
  --text-label:     11px;
  --text-micro:     10.5px;

  /* layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --space-section: clamp(72px, 12vh, 130px);

  /* motion */
  --dur-fast: .2s;
  --dur: .3s;
  --dur-reveal: .9s;
}

/* ─── tokens · light ─── */
:root[data-theme="light"] {
  --bg:#f5f3ef; --bg-elev:#eceae3; --bg-card:#e5e2da;
  --ink:#0b0b0b; --ink-soft:#4a4843; --ink-mute:#86827b;
  --rule:#dbd7d0; --rule-hi:#c6c1b8;
  --status-preview:#4a4843;
  color-scheme:light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg:#f5f3ef; --bg-elev:#eceae3; --bg-card:#e5e2da;
    --ink:#0b0b0b; --ink-soft:#4a4843; --ink-mute:#86827b;
    --rule:#dbd7d0; --rule-hi:#c6c1b8;
    --status-preview:#4a4843;
    color-scheme:light;
  }
}

/* ─── base ─── */
*,*::before,*::after { box-sizing: border-box; }
html, body { margin:0; padding:0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration: none; }
img { display:block; max-width:100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The accent rule: wrap the LAST word of a display title. */
.red { color: var(--accent); }

/* ─── display type ─── */
.title-hero {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ink);
}
.title-xl {
  font-family: var(--display); font-weight: 900; font-size: var(--text-xl);
  line-height: 1.0; letter-spacing: -0.02em; text-transform: uppercase; color: var(--ink);
}
.title-statement {
  font-family: var(--display); font-weight: 900; font-size: var(--text-statement);
  line-height: 1.08; letter-spacing: -0.015em; text-transform: uppercase; color: var(--ink);
}

/* ─── eyebrow: red mono kicker with a dash ─── */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  display:flex; align-items:center; gap: 14px;
}
.eyebrow::before {
  content:"";
  display:inline-block;
  width: 36px; height: 2px; background: var(--accent);
  flex-shrink: 0;
}

/* ─── buttons ─── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 16px 22px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--accent);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-2px); }
.btn-primary .arrow { font-family: var(--sans); font-weight: 400; transition: transform .2s ease; }
.btn-primary:hover .arrow { transform: translateX(6px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--rule-hi);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.btn-ghost:hover { border-color: var(--ink-mute); color: var(--ink); background: var(--bg-elev); }

.btn-cta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--rule-hi);
  color: var(--ink);
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.btn-primary, .btn-ghost, .btn-cta { cursor: pointer; }
.btn-primary:disabled, .btn-ghost:disabled, .btn-cta:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* square icon-only button; always give it an aria-label */
.icon-btn{ display:inline-grid; place-items:center; width:38px; height:38px; border:1px solid var(--rule-hi); background:transparent; color:var(--ink); cursor:pointer; transition:border-color .15s, color .15s; flex-shrink:0; }
.icon-btn:hover{ border-color:var(--ink-mute); }
.icon-btn svg{ width:16px; height:16px; display:block; }

/* ─── sections ─── */
.sec { padding: var(--space-section) 0; border-bottom: 1px solid var(--rule); }
.sec-head {
  display: grid; grid-template-columns: 160px 1fr; gap: 40px;
  margin-bottom: 64px; align-items: start;
}
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; gap: 20px; margin-bottom: 48px; } }
.sec-label {
  font-family: var(--mono); font-size: var(--text-label); font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--ink-mute); padding-top: 8px;
}
.sec-label .num { color: var(--accent); margin-right: 8px; }
.sec-title {
  font-family: var(--display); font-weight: 900;
  font-size: var(--text-section); line-height: 1.0; letter-spacing: -0.02em;
  text-transform: uppercase; margin: 0 0 14px; max-width: 20ch; color: var(--ink);
}
.sec-intro { font-size: var(--text-body); color: var(--ink-soft); line-height: 1.6; max-width: 56ch; margin: 0; }

/* ─── card grid: cells share 1px rules like a table ─── */
.catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
@media (max-width: 760px) { .catalog { grid-template-columns: 1fr; } }
.card {
  position: relative;
  padding: 32px 28px 28px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column;
  min-height: 220px;
  background: var(--bg);
  transition: background .3s ease;
}
.card:hover { background: var(--bg-card); }
.card-index {
  font-family: var(--mono); font-size: var(--text-label); font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-mute);
  display: flex; align-items: center; gap: 10px;
}
.card-index .num {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  background: var(--accent); color: var(--on-accent); font-family: var(--display);
  font-size: 11px; letter-spacing: 0;
}
.card-name {
  font-family: var(--display); font-weight: 900; font-size: var(--text-card);
  line-height: 1.05; letter-spacing: -0.01em; text-transform: uppercase;
  margin: 22px 0 12px; color: var(--ink);
}
.card-line { font-size: var(--text-small); color: var(--ink-soft); line-height: 1.6; margin: 0; max-width: 34ch; }

/* ─── key/value panel ─── */
.meta { border: 1px solid var(--rule); padding: 8px 28px; background: var(--bg-card); }
.meta-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.meta-row:last-child { border-bottom: none; }
.meta-k {
  font-family: var(--mono); font-size: var(--text-micro); font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mute);
}
.meta-v { font-size: 14.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.meta-v .dim { color: var(--ink-mute); }

/* ─── status badge: square dot + mono caps ─── */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  padding: 5px 9px; border: 1px solid var(--rule-hi);
  color: var(--ink); background: transparent;
}
.badge::before { content:""; width: 8px; height: 8px; flex: none; background: var(--status-research); }
.badge-shipping::before { background: var(--status-shipping); box-shadow: 0 0 0 3px var(--accent-glow); }
.badge-preview::before  { background: var(--status-preview); }
.badge-research { color: var(--ink-soft); }

/* ─── tag: mono caps, no fill, no border; separate terms with " · " ─── */
.tag {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono); font-size: var(--text-micro); font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1;
  white-space: nowrap; color: var(--ink-mute);
}
.tag-active { color: var(--accent); }

/* ─── form fields ─── */
.field { display: flex; flex-direction: column; gap: .45rem; }
.field-label {
  font-family: var(--mono); font-size: var(--text-label); font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute);
}
.input, .textarea, .select {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--rule-hi); border-radius: 0;
  padding: 10px 12px; width: 100%; min-width: 0;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.textarea { line-height: 1.55; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%),
                    linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-mute); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-glow); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: none; }
.field-hint  { font-family: var(--mono); font-size: var(--text-label); color: var(--ink-mute); }
.field-error { font-family: var(--mono); font-size: var(--text-label); color: var(--accent); }
.field.is-error .input, .field.is-error .textarea, .field.is-error .select { border-color: var(--accent); }

/* ─── switch: <label class="switch"><input type="checkbox" role="switch"><span>Label</span></label> ─── */
.switch {
  display: inline-flex; align-items: center; gap: .6rem; cursor: pointer;
  font-family: var(--mono); font-size: var(--text-label); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink);
}
.switch input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: inherit;
  position: relative; width: 40px; height: 22px;
  border: 1px solid var(--rule-hi); background: var(--bg-elev);
  transition: background .2s ease, border-color .2s ease;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--ink-mute); transition: transform .2s ease, background .2s ease;
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { background: var(--on-accent); transform: translateX(18px); }
.switch input:disabled { cursor: not-allowed; }
.switch:has(input:disabled) { opacity: .4; cursor: not-allowed; }

/* ─── avatar: square, echoes the mark ─── */
.avatar {
  width: 40px; height: 40px; flex: none; overflow: hidden; user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--rule-hi); color: var(--ink);
  font-family: var(--display); font-weight: 400; font-size: 13.6px; letter-spacing: .02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 9.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }

/* ─── reveal on scroll (add .in with an IntersectionObserver) ─── */
.reveal { opacity: 0; transition: opacity var(--dur-reveal) ease; }
.reveal.in { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; } html { scroll-behavior: auto; } }
