/* ============================================
   Algorithmica Solutions — Stylesheet
   ============================================ */

:root {
  --bg: #0a0e14;
  --bg-2: #0f141c;
  --bg-3: #151b25;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8ecf2;
  --text-dim: #a3acba;
  --text-faint: #6b7484;
  --accent: #ffa200;
  --accent-2: #ff8a00;
  --accent-soft: rgba(255, 162, 0, 0.12);
  --accent-glow: rgba(255, 162, 0, 0.35);
  --green: #2bd4a0;
  --danger: #ff5b5b;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --max: 1240px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 20px 50px -20px rgba(0, 0, 0, 0.7);

  /* Themeable aliases for values previously hardcoded */
  --text-strong: #fff;
  --nav-bg: rgba(10, 14, 20, 0.7);
  --nav-bg-scrolled: rgba(10, 14, 20, 0.92);
  --nav-bg-mobile: rgba(10, 14, 20, 0.98);
  --feature-overlay: rgba(10, 14, 20, 0.7);
  --hero-bg-start: #0a0e14;
  --hero-bg-end: #0f141c;
  --on-accent: #1a1100;
  --cta-bg: #0a0e14;
  --cta-bg-hover: #1a1f2a;
  --grid-line: rgba(255, 255, 255, 0.04);
  --grid-line-soft: rgba(255, 255, 255, 0.03);
  --grid-line-cta: rgba(0, 0, 0, 0.06);
  --accent-faint: rgba(255, 162, 0, 0.18);
  --accent-dot-glow: rgba(255, 162, 0, 0.18);
  --accent-core-glow: rgba(255, 162, 0, 0.4);
  --accent-card-glow: rgba(255, 162, 0, 0.08);
  --green-faint: rgba(43, 212, 160, 0.1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-2);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text-strong);
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.035em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-top: 1.6em;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.4em;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

p {
  margin: 0 0 1em;
  color: var(--text-dim);
}

ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
  color: var(--text-dim);
}

li + li {
  margin-top: 0.4em;
}

/* ----------- Layout ----------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: clamp(60px, 9vw, 120px) 0;
  position: relative;
}

.section--tight {
  padding: clamp(40px, 6vw, 80px) 0;
}

.section--alt {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 18px;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
  max-width: 62ch;
}

.grid {
  display: grid;
  gap: 24px;
}

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

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ----------- Header / Nav ----------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
  background: var(--nav-bg-scrolled);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__brand img {
  height: 36px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text-strong);
  background: var(--surface-2);
}

.nav__cta {
  margin-left: 8px;
}

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--text-strong);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-strong);
  margin: 5px 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav__toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 820px) {
  .nav__toggle {
    display: block;
  }
  .nav__links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 20px;
    background: var(--nav-bg-mobile);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease), padding 0.35s var(--ease);
  }
  .nav__links.is-open {
    max-height: 500px;
  }
  .nav__links li {
    border-bottom: 1px solid var(--border);
  }
  .nav__links li:last-child {
    border-bottom: 0;
  }
  .nav__links a {
    display: block;
    padding: 14px 4px;
  }
  .nav__cta {
    margin: 12px 0 0;
  }
  .nav__cta .btn {
    width: 100%;
  }
}

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-2);
  color: var(--on-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text-strong);
  background: var(--accent-soft);
}

.btn--link {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 500;
}

.btn--link::after {
  content: '→';
  transition: transform 0.2s var(--ease);
  display: inline-block;
}

.btn--link:hover::after {
  transform: translateX(3px);
}

/* ----------- Hero ----------- */
.hero {
  position: relative;
  padding: clamp(140px, 18vw, 200px) 0 clamp(80px, 12vw, 140px);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 70% 30%, var(--accent-faint), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 80%, var(--green-faint), transparent 60%),
    linear-gradient(180deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  animation: gridDrift 30s linear infinite;
}

@keyframes gridDrift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 56px 56px, 56px 56px;
  }
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), #ffd166 60%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 32px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  max-width: 540px;
}

.hero__stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.03em;
}

.hero__stat-num sup {
  color: var(--accent);
  font-size: 0.55em;
  margin-left: 2px;
  font-weight: 500;
}

.hero__stat-label {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.hero__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin-left: auto;
}

.hero__visual::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: conic-gradient(
    from 90deg,
    var(--accent),
    transparent 25%,
    var(--green) 50%,
    transparent 75%,
    var(--accent)
  );
  filter: blur(40px);
  opacity: 0.35;
  animation: spin 18s linear infinite;
}

.hero__visual::after {
  content: '';
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero__orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  animation: spin 40s linear infinite;
}

.hero__orbit--2 {
  inset: 12%;
  border-style: solid;
  border-color: var(--border);
  animation-duration: 28s;
  animation-direction: reverse;
}

.hero__dot {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px var(--accent-dot-glow);
}

.hero__core {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--on-accent);
  box-shadow: 0 20px 60px var(--accent-core-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ----------- Cards ----------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
  overflow: hidden;
  isolation: isolate;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.card--service::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 0%),
    var(--accent-card-glow),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: -1;
}

.card--service:hover::before {
  opacity: 1;
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 10px;
}

.card__text {
  font-size: 0.94rem;
  color: var(--text-dim);
  margin: 0 0 18px;
}

.card__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card__link::after {
  content: '→';
  transition: transform 0.2s var(--ease);
}

.card__link:hover::after {
  transform: translateX(3px);
}

/* ----------- Feature row ----------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.feature--reverse > :first-child {
  order: 2;
}

@media (max-width: 900px) {
  .feature--reverse > :first-child {
    order: 0;
  }
}

.feature__visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  background: var(--bg-3);
}

.feature__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.6s var(--ease), opacity 0.3s var(--ease);
}

.feature__visual:hover img {
  transform: scale(1.04);
  opacity: 1;
}

.feature__visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--feature-overlay));
  pointer-events: none;
}

.feature__title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin-bottom: 16px;
}

.feature__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature__list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 0.96rem;
}

.feature__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 16px;
  height: 1px;
  background: var(--accent);
}

.feature__list li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ----------- Exchange / tag list ----------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.tag-list li {
  margin: 0;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tag-list li:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ----------- CTA Banner ----------- */
.cta {
  position: relative;
  padding: clamp(48px, 7vw, 80px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--on-accent);
  overflow: hidden;
  isolation: isolate;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line-cta) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-cta) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta__title {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  color: var(--on-accent);
  margin: 0;
  max-width: 30ch;
}

.cta .btn--primary {
  background: var(--cta-bg);
  color: var(--text-strong);
}

.cta .btn--primary:hover {
  background: var(--cta-bg-hover);
  color: var(--text-strong);
}

@media (max-width: 600px) {
  .cta__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ----------- Footer ----------- */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  position: relative;
  overflow: hidden;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 800px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 500px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand img {
  height: 32px;
  margin-bottom: 16px;
}

.footer__text {
  font-size: 0.9rem;
  color: var(--text-faint);
  max-width: 32ch;
}

.footer__heading {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-strong);
  margin: 0 0 16px;
}

.footer__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__list li {
  margin: 0;
}

.footer__list a {
  color: var(--text-dim);
  font-size: 0.92rem;
  display: inline-block;
  padding: 4px 0;
}

.footer__list a:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer__bottom a {
  color: var(--text-dim);
}

.footer__bottom a:hover {
  color: var(--accent);
}

/* ----------- Page header (inner pages) ----------- */
.page-header {
  position: relative;
  padding: clamp(120px, 16vw, 180px) 0 clamp(60px, 9vw, 100px);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
}

.page-header__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--hero-bg-start) 0%, var(--hero-bg-end) 100%);
}

.page-header__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000, transparent 90%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%);
}

.page-header h1 {
  margin-bottom: 16px;
  max-width: 18ch;
}

.page-header p {
  font-size: 1.05rem;
  max-width: 60ch;
}

/* ----------- Content blocks ----------- */
.prose h2 {
  position: relative;
  padding-top: 12px;
}

.prose h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--accent);
}

.prose h3 {
  color: var(--text-strong);
  margin-top: 1.8em;
}

.prose p,
.prose li {
  color: var(--text-dim);
}

.prose strong {
  color: var(--text-strong);
  font-weight: 600;
}

.callout {
  position: relative;
  padding: 24px 28px;
  margin: 32px 0;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p {
  color: var(--text);
  margin: 0;
}

.callout strong {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ----------- Forms ----------- */
.form {
  max-width: 420px;
  margin: 32px auto 0;
  padding: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  transition: border-color 0.2s var(--ease);
}

.form input:focus {
  outline: 0;
  border-color: var(--accent);
}

.form .btn {
  width: 100%;
  justify-content: center;
}

.form__error {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: -8px;
  margin-bottom: 12px;
  min-height: 1.2em;
}

/* ----------- Reveal animation ----------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----------- Utilities ----------- */
.text-center {
  text-align: center;
}

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

.mb-0 {
  margin-bottom: 0;
}

.mt-3 {
  margin-top: 24px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0;
  border: 0;
}

/* ----------- Reduced motion ----------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------- Selection ----------- */
::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* ----------- Scrollbar (subtle) ----------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ============================================
   Temporary theme switcher — Light-Gray
   ============================================ */
html[data-theme="light-gray"] {
  --bg: #d1d5db;
  --bg-2: #e5e7eb;
  --bg-3: #c4c8ce;
  --surface: rgba(0, 0, 0, 0.03);
  --surface-2: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #1f2937;
  --text-dim: #4b5563;
  --text-faint: #6b7280;
  --text-strong: #111827;
  --nav-bg: rgba(229, 231, 235, 0.7);
  --nav-bg-scrolled: rgba(229, 231, 235, 0.92);
  --nav-bg-mobile: rgba(229, 231, 235, 0.98);
  --feature-overlay: rgba(209, 213, 219, 0.6);
  --hero-bg-start: #d1d5db;
  --hero-bg-end: #e5e7eb;
  --cta-bg: #1f2937;
  --cta-bg-hover: #374151;
  --grid-line: rgba(0, 0, 0, 0.06);
  --grid-line-soft: rgba(0, 0, 0, 0.05);
  --grid-line-cta: rgba(0, 0, 0, 0.08);
  --accent-faint: rgba(255, 162, 0, 0.16);
  --accent-dot-glow: rgba(255, 162, 0, 0.22);
  --accent-core-glow: rgba(255, 162, 0, 0.3);
  --accent-card-glow: rgba(255, 162, 0, 0.1);
  --green-faint: rgba(43, 212, 160, 0.14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-2: 0 20px 50px -20px rgba(0, 0, 0, 0.18);
}

/* ============================================
   Temporary theme switcher — White
   ============================================ */
html[data-theme="white"] {
  --bg: #ffffff;
  --bg-2: #f9fafb;
  --bg-3: #f3f4f6;
  --surface: rgba(0, 0, 0, 0.02);
  --surface-2: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #111827;
  --text-dim: #4b5563;
  --text-faint: #6b7280;
  --text-strong: #000000;
  --nav-bg: rgba(255, 255, 255, 0.7);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.92);
  --nav-bg-mobile: rgba(255, 255, 255, 0.98);
  --feature-overlay: rgba(255, 255, 255, 0.55);
  --hero-bg-start: #ffffff;
  --hero-bg-end: #f9fafb;
  --cta-bg: #111827;
  --cta-bg-hover: #1f2937;
  --grid-line: rgba(0, 0, 0, 0.04);
  --grid-line-soft: rgba(0, 0, 0, 0.035);
  --grid-line-cta: rgba(0, 0, 0, 0.06);
  --accent-faint: rgba(255, 162, 0, 0.14);
  --accent-dot-glow: rgba(255, 162, 0, 0.2);
  --accent-core-glow: rgba(255, 162, 0, 0.35);
  --accent-card-glow: rgba(255, 162, 0, 0.08);
  --green-faint: rgba(43, 212, 160, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 20px 50px -20px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Temporary theme switcher — ICE
   ============================================ */
html[data-theme="ice"] {
  --bg: #eef5fb;
  --bg-2: #e1edf6;
  --bg-3: #d3e3f0;
  --surface: rgba(15, 50, 90, 0.03);
  --surface-2: rgba(15, 50, 90, 0.06);
  --border: rgba(15, 50, 90, 0.1);
  --border-strong: rgba(15, 50, 90, 0.18);
  --text: #0f2540;
  --text-dim: #3a5a7a;
  --text-faint: #5e7a96;
  --text-strong: #0a1a2e;
  --nav-bg: rgba(238, 245, 251, 0.7);
  --nav-bg-scrolled: rgba(238, 245, 251, 0.92);
  --nav-bg-mobile: rgba(238, 245, 251, 0.98);
  --feature-overlay: rgba(211, 227, 240, 0.6);
  --hero-bg-start: #eef5fb;
  --hero-bg-end: #e1edf6;
  --cta-bg: #0f2540;
  --cta-bg-hover: #1a3a5a;
  --grid-line: rgba(15, 50, 90, 0.05);
  --grid-line-soft: rgba(15, 50, 90, 0.04);
  --grid-line-cta: rgba(15, 50, 90, 0.06);
  --accent-faint: rgba(255, 162, 0, 0.14);
  --accent-dot-glow: rgba(255, 162, 0, 0.2);
  --accent-core-glow: rgba(255, 162, 0, 0.32);
  --accent-card-glow: rgba(255, 162, 0, 0.08);
  --green-faint: rgba(43, 212, 160, 0.14);
  --shadow-1: 0 1px 2px rgba(15, 50, 90, 0.08);
  --shadow-2: 0 20px 50px -20px rgba(15, 50, 90, 0.18);
}

/* ============================================
   Theme switcher button (temporary)
   ============================================ */
.nav__theme {
  margin-left: 4px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
  white-space: nowrap;
}

.theme-toggle:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.theme-toggle__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

@media (max-width: 820px) {
  .nav__theme {
    margin: 12px 0 0;
  }
  .theme-toggle {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 4px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }
  .theme-toggle:hover {
    background: transparent;
  }
}
