/* ═══════════════════════════════════════════════════════
   Mini Forge Dev — Stylesheet
   Token-based design system with dark (default) and light
   themes, switched via [data-theme] on <html>.
   ═══════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────── */
:root {
  /* Color — dark theme (default) */
  --page-bg:        #0C0E13;
  --surface-1:      #12151C;
  --surface-2:      #181D26;
  --surface-3:      #202632;
  --surface-raised: #161A22;
  --text-primary:   #F3F5F9;
  --text-secondary: #BAC1CF;
  --text-muted:     #8D95A7;
  --border:         rgba(151, 161, 183, 0.14);
  --border-strong:  rgba(151, 161, 183, 0.28);
  --accent:         #FF8A3D;
  --accent-hover:   #FFA05F;
  --accent-soft:    rgba(255, 138, 61, 0.11);
  --accent-text:    #211107;
  --accent-strong:  #FFA05F;   /* text-safe accent on page background */
  --ember:          #FFC27A;   /* spark / highlight tone */
  --focus-ring:     #FFB35C;
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md:      0 6px 20px rgba(0, 0, 0, 0.32);
  --shadow-lg:      0 18px 48px rgba(0, 0, 0, 0.42);
  --header-bg:      rgba(12, 14, 19, 0.82);
  --menu-bg:        rgba(15, 18, 24, 0.97);
  --hero-glow:      rgba(255, 138, 61, 0.07);
  --phone-frame:    #1B202B;
  --phone-screen:   #10141C;

  /* Typography — polished system stacks, no external fonts */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono",
               Consolas, monospace;

  --text-hero:    clamp(2.25rem, 5vw, 3.35rem);
  --text-page:    clamp(1.85rem, 4vw, 2.5rem);
  --text-section: clamp(1.45rem, 3vw, 1.9rem);
  --text-card:    1.05rem;
  --text-body:    0.975rem;
  --text-small:   0.9rem;
  --text-caption: 0.8rem;
  --text-label:   0.72rem;

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-s:   0.75rem;
  --space-m:   1rem;
  --space-l:   1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --section-y: clamp(3.25rem, 7vw, 5.25rem);

  /* Radius */
  --radius-xs:   6px;
  --radius-s:    8px;
  --radius-m:    12px;
  --radius-l:    16px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* Motion */
  --ease:     cubic-bezier(0.2, 0.6, 0.25, 1);
  --dur-fast: 130ms;
  --dur:      220ms;

  /* Layout */
  --header-h:      60px;
  --container-max: 1120px;
  --content-max:   780px;
  --container-px:  clamp(1.25rem, 4vw, 2rem);
}

:root[data-theme="light"] {
  --page-bg:        #F6F5F2;
  --surface-1:      #FFFFFF;
  --surface-2:      #EFEDE7;
  --surface-3:      #E7E4DC;
  --surface-raised: #FFFFFF;
  --text-primary:   #1E222C;
  --text-secondary: #494F5F;
  --text-muted:     #676E7E;
  --border:         rgba(32, 38, 52, 0.13);
  --border-strong:  rgba(32, 38, 52, 0.26);
  --accent:         #EC6A1E;
  --accent-hover:   #D95A10;
  --accent-soft:    rgba(226, 96, 22, 0.10);
  --accent-text:    #2B1507;
  --accent-strong:  #B04607;
  --ember:          #E8842F;
  --focus-ring:     #C2540E;
  --shadow-sm:      0 1px 2px rgba(28, 22, 12, 0.07);
  --shadow-md:      0 6px 18px rgba(28, 22, 12, 0.09);
  --shadow-lg:      0 18px 44px rgba(28, 22, 12, 0.13);
  --header-bg:      rgba(246, 245, 242, 0.85);
  --menu-bg:        rgba(250, 249, 247, 0.98);
  --hero-glow:      rgba(226, 96, 22, 0.07);
  --phone-frame:    #2A2F3A;
  --phone-screen:   #FDFCFA;
}

:root[data-theme="dark"]  { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

body {
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
h1, h2, h3, h4 { line-height: 1.22; font-weight: 700; }
code { font-family: var(--font-mono); font-size: 0.88em; }

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

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Utilities ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}
.container-narrow { max-width: calc(var(--content-max) + 2 * var(--container-px)); }

.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;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: var(--text-small);
  border-radius: 0 0 var(--radius-s) var(--radius-s);
}
.skip-link:focus { top: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-strong);
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
}

/* ══════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.site-header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* Brand lockup: inline SVG mark + HTML wordmark (theme-aware) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  min-height: 44px;
  transition: opacity var(--dur-fast) var(--ease);
}
.brand:hover { opacity: 0.85; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-name {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand-name em {
  font-style: normal;
  color: var(--accent-strong);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Main nav ── */
.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.nav-link {
  display: block;
  padding: 0.5rem 0.8rem;
  font-size: var(--text-small);
  font-weight: 550;
  color: var(--text-secondary);
  border-radius: var(--radius-s);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: var(--surface-2); }
.nav-link[aria-current="page"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 650;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur) var(--ease);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--border-strong); }

.theme-toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  z-index: 2;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
  pointer-events: none;
}
.theme-toggle-icon--moon { left: 7px; }
.theme-toggle-icon--sun  { right: 7px; }

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  z-index: 1;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}
/* The thumb slides under the current mode's icon, which is re-inked so it
   reads as the icon inside the thumb — state is shown by position + icon. */
:root[data-theme="dark"]  .theme-toggle-thumb { transform: translateX(0); }
:root[data-theme="light"] .theme-toggle-thumb { transform: translateX(32px); }
:root[data-theme="dark"]  .theme-toggle-icon--moon { color: var(--accent-text); }
:root[data-theme="light"] .theme-toggle-icon--sun  { color: var(--accent-text); }

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius-s);
  transition: background-color var(--dur-fast) var(--ease);
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle-bar {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: var(--text-small);
  font-weight: 650;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  min-height: 44px;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 18px var(--accent-soft), var(--shadow-sm);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  min-height: 36px;
  font-size: 0.84rem;
  border-radius: var(--radius-s);
}

/* ══════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════ */
.hero-section {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.25rem));
  padding-bottom: clamp(2.75rem, 6vw, 4.5rem);
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: -10%;
  right: 0;
  width: min(620px, 60vw);
  height: 620px;
  background: radial-gradient(ellipse at center, var(--hero-glow) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-content { max-width: 560px; }

.hero-content h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}
.hero-content h1 em {
  font-style: normal;
  color: var(--accent-strong);
}

.hero-desc {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  max-width: 46ch;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 1.9rem;
  font-size: var(--text-caption);
  color: var(--text-muted);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.hero-meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ── Hero visual: phone on an anvil, with embers ── */
.hero-visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 340px;
}

.hero-forge { position: relative; width: min(300px, 100%); }

.hf-phone {
  position: relative;
  width: 168px;
  margin: 0 auto;
  background: var(--phone-frame);
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  padding: 7px;
  box-shadow: var(--shadow-lg), 0 0 44px var(--accent-soft);
}

.hf-screen {
  background: var(--phone-screen);
  border-radius: 20px;
  overflow: hidden;
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hf-screen-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.hf-screen-title svg { width: 12px; height: 12px; flex-shrink: 0; }

.hf-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
}
.hf-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hf-app img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.hf-app span {
  font-size: 6.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hf-screen-foot {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 6.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

/* Anvil platform below the phone */
.hf-platform {
  position: relative;
  margin-top: -10px;
  display: flex;
  justify-content: center;
}
.hf-anvil { width: 250px; color: var(--accent); }
.hf-anvil .anvil-base { opacity: 0.55; }
.hf-glow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 44px;
  background: radial-gradient(ellipse, var(--accent-soft) 0%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

/* Ember particles */
.hf-sparks { position: absolute; inset: 0; pointer-events: none; }
.hf-spark {
  position: absolute;
  border-radius: 50%;
  background: var(--ember);
}
.hf-spark-1 { width: 5px; height: 5px; top: 16%; left: 8%;   opacity: 0.85; animation: spark-float 3.4s ease-in-out infinite; }
.hf-spark-2 { width: 4px; height: 4px; top: 8%;  right: 16%; opacity: 0.7;  animation: spark-float 2.9s ease-in-out infinite 0.6s; }
.hf-spark-3 { width: 5px; height: 5px; top: 30%; right: 5%;  opacity: 0.6;  animation: spark-float 3.7s ease-in-out infinite 1.2s; }
.hf-spark-4 { width: 3px; height: 3px; top: 44%; left: 3%;   opacity: 0.5;  animation: spark-float 2.5s ease-in-out infinite 0.4s; background: var(--accent); }
.hf-spark-5 { width: 4px; height: 4px; top: 6%;  left: 30%;  opacity: 0.7;  animation: spark-float 3.1s ease-in-out infinite 1.8s; }

@keyframes spark-float {
  0%, 100% { transform: translateY(0) scale(1);      opacity: 0.8; }
  33%      { transform: translateY(-9px) scale(1.15); opacity: 1; }
  66%      { transform: translateY(-4px) scale(0.9);  opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .hf-spark { animation: none !important; }
}

/* ══════════════════════════════════════════════════════
   SECTIONS (shared)
   ══════════════════════════════════════════════════════ */
.section { padding-block: var(--section-y); }

.section-header { margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-header.center { text-align: center; }

.section-title {
  font-size: var(--text-section);
  font-weight: 750;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}
.section-desc {
  font-size: var(--text-body);
  color: var(--text-secondary);
  max-width: 56ch;
}
.section-header.center .section-desc { margin-inline: auto; }

/* ══════════════════════════════════════════════════════
   "HOW WE BUILD" VALUE STRIP
   ══════════════════════════════════════════════════════ */
.values-strip {
  border-block: 1px solid var(--border);
  background: var(--surface-1);
  padding-block: clamp(1.75rem, 4vw, 2.5rem);
}
.values-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.value-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.value-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.value-item h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.value-item p {
  font-size: var(--text-caption);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 32ch;
}

/* ══════════════════════════════════════════════════════
   APP DIRECTORY
   ══════════════════════════════════════════════════════ */
.apps-section { padding-block: var(--section-y); }

.apps-group + .apps-group { margin-top: clamp(2.25rem, 5vw, 3.25rem); }

.apps-group-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.apps-group-title {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.apps-group-count {
  font-size: var(--text-caption);
  font-weight: 650;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.05rem 0.55rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.15rem 1.2rem 1.05rem;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.app-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.app-card-top img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-m);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.app-card-id { min-width: 0; }
.app-card-name {
  font-size: var(--text-card);
  font-weight: 750;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
}
.app-card-category {
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.app-card-desc {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(3 * 1.55em);
}

.app-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}

.app-soon-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-muted);
  min-height: 36px;
  padding: 0.4rem 0.15rem;
}
.app-soon-note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  opacity: 0.75;
}

.app-card-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}
.app-card-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-xs);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.app-card-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* No-JS fallback list */
.app-grid noscript { grid-column: 1 / -1; }
.apps-noscript ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}
.apps-noscript li {
  padding: 0.85rem 1rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  font-size: var(--text-small);
  color: var(--text-secondary);
}
.apps-noscript a { color: var(--accent-strong); font-weight: 650; }
.apps-noscript a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════════════ */
.contact-section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.contact-topic {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1rem 1.1rem;
}
.contact-topic .value-icon { margin-bottom: 0.65rem; width: 34px; height: 34px; }
.contact-topic h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.contact-topic p {
  font-size: var(--text-caption);
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-email-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-strong);
  padding: 0.7rem 1.3rem;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
  overflow-wrap: anywhere;
}
.contact-email:hover { border-color: var(--accent); }
.contact-email svg { flex-shrink: 0; }
.contact-email-note {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--page-bg);
  padding-block: 2.75rem 1.75rem;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(200px, 1.3fr) repeat(3, minmax(120px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand .brand { min-height: 0; margin-bottom: 0.6rem; }
.footer-tagline {
  font-size: var(--text-caption);
  color: var(--text-muted);
  max-width: 30ch;
  line-height: 1.6;
}

.footer-col-title {
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.15rem; }
.footer-col a {
  display: inline-block;
  font-size: 0.86rem;
  color: var(--text-secondary);
  padding: 0.22rem 0;
  transition: color var(--dur-fast) var(--ease);
}
.footer-col a:hover { color: var(--accent-strong); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-copy { font-size: var(--text-caption); color: var(--text-muted); }
.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.8;
  max-width: 72ch;
}

/* ══════════════════════════════════════════════════════
   SUBPAGE HERO (privacy / support)
   ══════════════════════════════════════════════════════ */
.page-hero {
  padding-top: calc(var(--header-h) + clamp(2rem, 5vw, 3.25rem));
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.page-hero h1 {
  font-size: var(--text-page);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}
.page-hero .page-meta {
  font-size: var(--text-small);
  color: var(--text-secondary);
  max-width: 60ch;
}
.page-hero .page-meta a {
  color: var(--accent-strong);
  font-weight: 650;
}
.page-hero .page-meta a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   APP SELECTOR (privacy / support)
   ══════════════════════════════════════════════════════ */
.app-select-wrap { margin-bottom: 1.75rem; }

.app-select {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.app-select-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem 0.45rem 0.5rem;
  min-height: 44px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.app-select-tab img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-s);
  flex-shrink: 0;
}
.app-select-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.app-select-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
  font-weight: 750;
  box-shadow: inset 0 0 0 1px var(--accent);
}
/* Active state beyond color: a check indicator */
.app-select-tab.active::after {
  content: "";
  width: 6px;
  height: 10px;
  margin-left: 0.1rem;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg) translateY(-1px);
}

/* Narrow screens: one scrollable row instead of tall wrapping */
@media (max-width: 640px) {
  .app-select {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-inline: calc(-1 * var(--container-px));
    padding-inline: var(--container-px);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .app-select-tab { flex-shrink: 0; scroll-snap-align: start; }
}

/* ── Panel visibility ──
   Without JS: all panels visible, stacked with separators.
   With JS (.switcher-ready): only the .active panel is shown. */
.app-policy { display: block; }
.switcher-ready .app-policy { display: none; }
.switcher-ready .app-policy.active { display: block; }
[data-switcher]:not(.switcher-ready) .app-policy + .app-policy {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border);
}

/* ══════════════════════════════════════════════════════
   POLICY / SUPPORT PANEL CONTENT
   ══════════════════════════════════════════════════════ */
.panel-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.panel-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.panel-meta {
  font-size: var(--text-caption);
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* "At a glance" summary */
.glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.glance-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 0.85rem 0.95rem;
}
.glance-item h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-label);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 0.35rem;
}
.glance-item h3 svg { flex-shrink: 0; }
.glance-item p {
  font-size: var(--text-caption);
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Callout for app-specific warnings */
.callout {
  display: flex;
  gap: 0.7rem;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-s);
  padding: 0.8rem 1rem;
  margin-bottom: 1.1rem;
  font-size: var(--text-caption);
  color: var(--text-secondary);
  line-height: 1.6;
}
.callout svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--accent-strong);
}
.callout strong { color: var(--text-primary); }

/* ── Accordions (native details/summary) ── */
.accordion {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  transition: border-color var(--dur-fast) var(--ease);
}
.accordion + .accordion { margin-top: 0.55rem; }
.accordion[open] { border-color: var(--border-strong); }

.accordion summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.05rem;
  font-size: 0.94rem;
  font-weight: 650;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-m);
  min-height: 48px;
  transition: background-color var(--dur-fast) var(--ease);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: var(--surface-2); }
.accordion[open] summary { border-radius: var(--radius-m) var(--radius-m) 0 0; }

.accordion summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.accordion[open] summary::after { transform: rotate(225deg) translate(-1px, -1px); }

.accordion-body {
  padding: 0.35rem 1.05rem 1.15rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.accordion-body p,
.accordion-body li {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1.7;
}
.accordion-body ul,
.accordion-body ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-block: 0.5rem;
}
.accordion-body ul { list-style: disc; }
.accordion-body ol { list-style: decimal; }
.accordion-body p + p { margin-top: 0.6rem; }
.accordion-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.9rem 0 0.35rem;
}
.accordion-body a {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.accordion-body a:hover { text-decoration-color: currentColor; }
.accordion-body strong { color: var(--text-primary); }

/* Anchor targets inside accordions keep old deep-link ids working */
.anchor-topic { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

.policy-footnote {
  margin-top: 1.1rem;
  font-size: var(--text-caption);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Contact button inside panels */
.panel-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--accent-strong);
  padding: 0.55rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease);
  overflow-wrap: anywhere;
}
.panel-contact:hover { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════
   POLICY / SUPPORT PAGE LAYOUT
   ══════════════════════════════════════════════════════ */
.policy-body,
.support-body { padding-block: clamp(2rem, 5vw, 3.25rem); }

.support-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.support-help-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.25rem 1.35rem;
}
.support-help-card h2 {
  font-size: 1rem;
  font-weight: 750;
  margin-bottom: 0.4rem;
}
.support-help-card p {
  font-size: var(--text-small);
  color: var(--text-secondary);
  line-height: 1.65;
}
.support-help-card p + p { margin-top: 0.5rem; }
.support-help-card a:not(.panel-contact) {
  color: var(--accent-strong);
  font-weight: 650;
}
.support-help-card a:not(.panel-contact):hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   404 PAGE
   ══════════════════════════════════════════════════════ */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.error-code {
  font-size: clamp(4.5rem, 16vw, 8.5rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.error-anvil {
  width: 84px;
  margin: 0.75rem auto 1.5rem;
  color: var(--accent);
  opacity: 0.7;
}
.error-title {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 750;
  margin-bottom: 0.6rem;
}
.error-desc {
  font-size: var(--text-body);
  color: var(--text-secondary);
  max-width: 40ch;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-content { max-width: 640px; margin-inline: auto; }
  .hero-desc { margin-inline: auto; }
  .hero-cta, .hero-meta { justify-content: center; }
  .hero-visual { order: -1; min-height: 0; margin-bottom: 0.5rem; }
  .hf-phone { width: 150px; }
  .hf-anvil { width: 222px; }

  .values-row { grid-template-columns: 1fr; gap: 1rem; }
  .value-item p { max-width: 60ch; }

  .contact-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--menu-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0 0.9rem;
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open {
    display: block;
    animation: menu-in var(--dur) var(--ease);
  }
  @keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0.1rem; padding-inline: 0.75rem; }
  .nav-link { padding: 0.8rem 1rem; font-size: 0.98rem; border-radius: var(--radius-s); }

  .support-after { grid-template-columns: 1fr; }
  .glance { grid-template-columns: 1fr; }

  .footer-main { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (max-width: 479px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }

  .contact-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }

  .app-card-actions { align-items: stretch; }

  .footer-main { grid-template-columns: 1fr; gap: 1.4rem; }
  .brand-name { font-size: 0.98rem; }
}

/* ══════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
