/*
  alexandrostzoumas.com — core components
  Needs tokens.css first. Class names follow the names the pages use today,
  so the migration is mostly "delete the local copy".
*/

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--weight-regular) var(--text-base) / var(--leading-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}
[hidden] { display: none !important; }
.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;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
.t-hero {      /* one per page: the main promise */
  font: var(--weight-bold) var(--text-h1) / var(--leading-tight) var(--font-display);
  letter-spacing: var(--tracking-display); max-width: 15ch; margin: 0;
}
.t-h2 {
  font: var(--weight-semibold) var(--text-h2) / var(--leading-heading) var(--font-display);
  letter-spacing: var(--tracking-heading); margin: 0;
}
.t-h3 {
  font: var(--weight-semibold) var(--text-h3) / 1.3 var(--font-display); margin: 0;
}
.t-voice {     /* Sora Light in purple: greetings, taglines — the human voice */
  font: var(--weight-light) var(--text-voice) / 1.2 var(--font-display);
  letter-spacing: var(--tracking-heading); color: var(--accent); margin: 0;
}
.t-lede { font-size: var(--text-lede); line-height: 1.45; max-width: var(--measure-prose); margin: 0; }
.t-muted { color: var(--muted); }
.t-eyebrow {
  font: var(--weight-regular) var(--text-xs) / 1 var(--font-mono);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--muted);
}
.t-num { font-variant-numeric: tabular-nums; }
code, pre, .t-mono { font-family: var(--font-mono); }
pre {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.25rem; overflow-x: auto; font-size: 0.82rem; line-height: 1.55; color: var(--ink);
}

/* ---------- Buttons ----------
   <a class="btn primary">  <button class="btn secondary">  .ghost  .danger
   Sizes: .sm (36px, dense admin rows)  default (44px)  .lg (52px, one per screen) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 1.25rem;
  border: 2px solid var(--accent); border-radius: var(--radius-pill);
  background: transparent; color: var(--accent);
  font: var(--weight-semibold) 1rem / 1 var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-1), color var(--dur-1), border-color var(--dur-1);
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn.secondary { /* default look, named for clarity */ }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { min-height: 36px; padding: 0 0.9rem; font-size: var(--text-sm); border-width: 1.5px; }
.btn.lg { min-height: 52px; padding: 0 1.9rem; font-size: 1.05rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }

/* ---------- Segmented control ----------
   <div class="seg" role="group" aria-label="..."><button aria-pressed="true">Agent</button>...</div> */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
}
.seg button {
  min-height: var(--tap); padding: 0 1rem; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--muted); cursor: pointer;
  font-weight: var(--weight-semibold); font-size: 0.9rem;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.seg.sm button { min-height: 34px; padding: 0 0.85rem; font-size: var(--text-sm); }

/* ---------- Pills (status, read-only) ----------
   .pill.draft  .pill.confirmed  .pill.private  .pill.rejected  .pill.accent */
.pill {
  display: inline-flex; align-items: center; gap: 0.3em;
  font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.5;
  padding: 0.1rem 0.6rem; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--muted);
}
.pill.draft     { background: var(--warning-soft); color: var(--warning); }
.pill.confirmed { background: var(--success-soft); color: var(--success); }
.pill.private   { box-shadow: inset 0 0 0 1px var(--line-strong); }
.pill.rejected  { background: var(--danger-soft); color: var(--danger); }
.pill.accent    { background: var(--accent-soft); color: var(--accent); }

/* ---------- Chips (tags; can be selectable) ----------
   <span class="chip">AI</span>
   <label class="chip"><input type="checkbox"> AI</label>
   Game words: .chip.tech (blue) / .chip.biz (coral) */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: var(--text-sm); line-height: 1.2; padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-pill);
  color: var(--ink); background: var(--bg);
}
label.chip { cursor: pointer; min-height: 32px; }
label.chip input { margin: 0; accent-color: var(--accent); }
label.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
label.chip:has(input:focus-visible) { outline: var(--focus-width) solid var(--focus-color); outline-offset: 2px; }
.chip.tech { color: var(--tech); border-color: currentColor; font-weight: var(--weight-semibold); }
.chip.biz  { color: var(--biz);  border-color: currentColor; font-weight: var(--weight-semibold); }
.chip.paired { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Cards ----------
   .card (surface)  .card.soft (purple tint, once per page: call to action or main takeaway)
   A section title (h2) goes above a card, outside it; inside a card only an h3 or no title.  .card.pop (floats: dialogs, results) */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: var(--space-5);
}
.card.soft { background: var(--accent-soft); border-color: transparent; padding: 2.25rem 1.75rem; }
.card.pop  { background: var(--bg); box-shadow: var(--shadow-pop); }

/* ---------- Form fields ----------
   <div class="field"><label for="n">Name</label><input id="n" class="input" aria-describedby="n-help"><p class="help" id="n-help">…</p></div>
   Error: add aria-invalid="true" to the input and a .help.error with the message. */
.field { display: grid; gap: var(--space-1); }
.field > label { font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.field .help { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.field .help.error { color: var(--danger); font-weight: var(--weight-semibold); }
.input {
  width: 100%; min-height: var(--tap); padding: 0 0.9rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--bg); color: var(--ink);
}
textarea.input { min-height: 6rem; padding: 0.6rem 0.9rem; line-height: 1.45; resize: vertical; }
.input.round { border-radius: var(--radius-pill); padding: 0 1.1rem; }
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }

/* ---------- Brand pieces ---------- */
/* Badge (3A.4). Use <svg class="badge-mark"> or <img src=".../logo-mark.svg">. Min 16px. */
.badge-mark { width: 30px; height: 30px; flex: none; }
/* Wordmark W.1 as live text. The × is an inline SVG with class "x". Needs Sora 300 + 600. */
.wm {
  font: var(--weight-semibold) 1.15rem / 1 var(--font-display);
  letter-spacing: -0.01em; white-space: nowrap; color: var(--ink);
}
.wm .x { height: 0.598em; width: 0.598em; vertical-align: -0.027em; }
.wm .last { font-weight: var(--weight-light); }
.lockup { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; }
/* The bridge: a short gradient bar, blue → purple → coral. Max one per view. */
.bridge { display: block; width: 4.5rem; height: 4px; border-radius: 2px; background: var(--gradient-bridge); border: 0; }
/* "Not a match" list: a plain text × in coral (not the 3-color crossing x). */
.x-list { list-style: none; padding: 0; margin: 0; }
.x-list li { position: relative; padding-left: 1.6rem; margin: 0 0 0.9rem; }
.x-list li::before {
  content: "×"; position: absolute; left: 0; top: -0.05em;
  font: var(--weight-bold) 1.2em / inherit var(--font-display); color: var(--biz);
}

/* ---------- Icons ----------
   <svg class="ico" viewBox="0 0 640 640" aria-hidden="true" focusable="false"><path fill="currentColor" d="…"/></svg>
   Inline SVG only (no icon font, no CDN). Decorative inside a labelled control: aria-hidden. */
.ico { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

/* ---------- Contact links ----------
   Email is the main action (.btn.primary with a visible label). Social links are 44px round icon
   links with a .sr-only name. Works on --bg, --surface and .card.soft (--accent-soft), light and dark.
   Third-party marks are one color, black or white (--social-ink), as the X, Threads and LinkedIn
   brand rules allow; never purple, never the brand gradient. The icon carries the contrast (16:1+);
   the disc border is decorative.
   <div class="contact-links">
     <a class="btn primary" href="mailto:…"><svg class="ico">…</svg>Email me</a>
     <ul class="social" aria-label="Elsewhere"><li><a href="…" rel="me"><svg class="ico">…</svg><span class="sr-only">LinkedIn</span></a></li>…</ul>
   </div> */
.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.social { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.social a {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--bg); color: var(--social-ink); text-decoration: none;
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.social a:hover { border-color: var(--accent); background: var(--surface); }
.social .ico { width: 20px; height: 20px; }

/* ---------- Motion ---------- */
.arrive { animation: arrive var(--dur-2) var(--ease-standard); }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  /* Durations are already 0 (tokens.css). Stop loops and keyframe movement too. */
  *, *::before, *::after { animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .arrive { animation: none; }
}
