/* ============================================================
   INN8 TEC DESIGN LAB — COMPONENTS
   Every component belongs to one operating system, not one
   website. Tokens only — raw hex is forbidden in this file.
   ============================================================ */

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

/* A themed subtree must re-assert ink: inherited computed color from an
   outer theme would otherwise override the flipped --ink token. */
[data-theme] { color: var(--ink); background-color: var(--bg); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section { padding-block: var(--space-24); position: relative; }
.section-quiet { padding-block: var(--space-16); }

/* ---- Hairline — the signature structural device ---- */
.hairline { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ============================================================
   THE "8" — fixed architectural background form.
   CSS mask so the theme owns its colour. Content sits above
   at --z-content. Drift is transform-only + reduced-motion safe.
   ============================================================ */
.eight-bg {
  position: fixed;
  top: 50%; left: 50%;
  height: 150lvh;
  aspect-ratio: 0.817;                 /* from eight.svg viewBox */
  transform: translate(-50%, -50%);
  background-color: var(--eight);
  opacity: var(--eight-opacity);
  -webkit-mask: url("/assets/eight.svg") center / contain no-repeat;
          mask: url("/assets/eight.svg") center / contain no-repeat;
  pointer-events: none;
  z-index: var(--z-eight);
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .eight-bg {
      animation: eight-drift linear both;
      animation-timeline: scroll(root);
    }
    @keyframes eight-drift {
      from { transform: translate(-50%, -48%); }
      to   { transform: translate(-50%, -54%); }
    }
  }
}
main, header, footer { position: relative; z-index: var(--z-content); }

/* ============================================================ NAV */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
}
.nav-links { display: flex; gap: var(--space-8); align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: var(--text-sm); font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
  padding-block: var(--space-3);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

/* ============================================================ BUTTONS
   4 variants × ≥44px targets × full states. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font: inherit; font-size: var(--text-sm); font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:active { transform: translateY(0) scale(0.99); }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--muted); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-link {
  background: none; border: none; color: var(--ink);
  padding-inline: 0; min-height: 44px;
  font-weight: 600;
  position: relative;
}
.btn-link::after {
  content: ""; position: absolute; left: 0; bottom: 10px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease);
}
.btn-link:hover::after { transform: scaleX(1); }

.btn-lg { min-height: 52px; padding: var(--space-4) var(--space-8); font-size: var(--text-base); }

/* ============================================================ CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: transform var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
a.card { display: block; color: inherit; text-decoration: none; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Stat tile — numbers carry the proof */
.stat { display: grid; gap: var(--space-1); }
.stat-value {
  font-size: var(--text-3xl); font-weight: 800;
  letter-spacing: var(--tracking-heading);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-label { font-size: var(--text-sm); color: var(--muted); }

/* Bento grid — one element may dominate; never card soup */
.bento { display: grid; gap: var(--space-4); grid-template-columns: repeat(12, 1fr); }
.bento > * { grid-column: span 12; }
@media (min-width: 768px) {
  .bento-4  { grid-column: span 4; }
  .bento-6  { grid-column: span 6; }
  .bento-8  { grid-column: span 8; }
  .bento-12 { grid-column: span 12; }
}

/* ============================================================ FORMS */
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted); }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--ring);
}
.field .hint { font-size: var(--text-xs); color: var(--muted); }

/* ============================================================ BADGE */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
}
.badge-dot {
  width: 6px; height: 6px; border-radius: var(--radius-full);
  background: var(--ink);
}

/* ============================================================ FAQ ACCORDION */
.accordion { border-top: 1px solid var(--border); }
.accordion details { border-bottom: 1px solid var(--border); }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-weight: 600; cursor: pointer; list-style: none;
  min-height: 44px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+"; font-weight: 400; font-size: var(--text-lg);
  color: var(--muted);
  transition: transform var(--dur-base) var(--ease),
              color var(--dur-fast) var(--ease);
}
.accordion summary:hover::after { color: var(--ink); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.accordion .accordion-body { padding: 0 0 var(--space-5); color: var(--muted); max-width: var(--measure); }
.accordion .accordion-body p + p { margin-top: var(--space-3); }

/* ============================================================ FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-16) var(--space-8);
  color: var(--muted); font-size: var(--text-sm);
}
.footer a { color: var(--muted); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.footer a:hover { color: var(--ink); }
.footer-grid { display: grid; gap: var(--space-10); grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid p + p { margin-top: var(--space-2); }  /* one rhythm across all columns */
.footer-meta {
  margin-top: var(--space-12); padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  justify-content: space-between;
}

/* ============================================================ REVEAL
   Entrance: fade + 20px rise, 40–80ms stagger via --reveal-i.
   Inert without JS; fully disabled under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
    transition-delay: calc(var(--reveal-i, 0) * 60ms);
  }
  .reveal.in { opacity: 1; transform: translateY(0); }
}

/* ============================================================ SKIP LINK */
.skip-link {
  position: absolute; left: var(--space-4); top: -100px;
  z-index: var(--z-overlay);
  background: var(--accent); color: var(--accent-contrast);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus-visible { top: var(--space-4); }
