/* ---------- Tokens ---------- */
:root {
  --accent: #f2b705;
  --accent-ink: #14181b;
  --accent-text: #8a6700;

  --bg: #f5f3ec;
  --surface: #ffffff;
  --text: #14181b;
  --muted: #5b6168;
  --line: rgba(20, 24, 27, 0.12);
  --dot: rgba(20, 24, 27, 0.14);
  --shadow: 0 1px 2px rgba(20, 24, 27, 0.06), 0 8px 24px rgba(20, 24, 27, 0.08);
  --shadow-lift: 0 2px 4px rgba(20, 24, 27, 0.08), 0 18px 40px rgba(20, 24, 27, 0.14);

  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --max: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-text: #f2b705;
    --bg: #0f1214;
    --surface: #171b1e;
    --text: #eceae4;
    --muted: #9aa1a8;
    --line: rgba(236, 234, 228, 0.12);
    --dot: rgba(236, 234, 228, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --accent-text: #f2b705;
  --bg: #0f1214;
  --surface: #171b1e;
  --text: #eceae4;
  --muted: #9aa1a8;
  --line: rgba(236, 234, 228, 0.12);
  --dot: rgba(236, 234, 228, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Living background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(420px circle at var(--mx, 85%) var(--my, 10%), #000 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: radial-gradient(420px circle at var(--mx, 85%) var(--my, 10%), #000 0%, rgba(0, 0, 0, 0.35) 60%, rgba(0, 0, 0, 0.35) 100%);
}

.bg__glow {
  position: absolute;
  top: -220px;
  right: -220px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 183, 5, 0.35) 0%, rgba(242, 183, 5, 0) 65%);
  animation: glow 9s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes glow {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.7; }
  50% { transform: scale(1.18) translate(-40px, 30px); opacity: 1; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
}

.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  margin: 0 calc(50% - 50vw);
}

.nav.is-scrolled::before {
  opacity: 1;
  border-bottom-color: var(--line);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform 0.4s var(--ease);
}

.nav__logo:hover .nav__mark {
  transform: rotate(-12deg) scale(1.08);
}

.nav > nav {
  margin-left: auto;
}

.nav__links {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__links a {
  position: relative;
  display: block;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav__links a:hover {
  color: var(--text);
}

.nav__links a:hover::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.theme-toggle:hover {
  transform: translateY(-2px) rotate(-8deg);
  box-shadow: var(--shadow-lift);
}

.theme-toggle:active {
  transform: scale(0.92);
}

/* Sun in light mode, moon in dark mode */
.theme-toggle__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

:root[data-theme="dark"] .theme-toggle__icon {
  background: transparent;
  box-shadow: inset -5px -3px 0 0 var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon {
    background: transparent;
    box-shadow: inset -5px -3px 0 0 var(--accent);
  }
}

/* ---------- Buttons ---------- */
.btn {
  --lift: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transform: translateY(var(--lift));
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn__icon {
  display: inline-block;
  font-family: var(--font-mono);
  transition: transform 0.3s var(--ease);
}

.btn:hover {
  --lift: -3px;
}

.btn:hover .btn__icon {
  transform: translate(3px, -3px);
}

.btn:active {
  --lift: 1px;
  transition-duration: 0.08s;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 0 #b88a00, 0 10px 24px rgba(242, 183, 5, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 7px 0 #b88a00, 0 18px 34px rgba(242, 183, 5, 0.4);
}

.btn--primary:active {
  box-shadow: 0 1px 0 #b88a00, 0 4px 10px rgba(242, 183, 5, 0.3);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

/* Click ripple, added by script.js */
.ripple {
  position: absolute;
  z-index: -1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s var(--ease) forwards;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: translate(-50%, -50%) scale(40); opacity: 0; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 8px auto 0;
  padding: 0 16px;
}

.hero__media {
  position: absolute;
  inset: 0 16px;
  border-radius: calc(var(--radius) + 8px);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: heroZoom 18s ease-out forwards;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 12, 14, 0.85) 0%, rgba(10, 12, 14, 0.55) 55%, rgba(10, 12, 14, 0.2) 100%),
    linear-gradient(0deg, rgba(10, 12, 14, 0.6) 0%, transparent 40%);
}

@keyframes heroZoom {
  to { transform: scale(1); }
}

.hero__content {
  position: relative;
  padding: clamp(56px, 10vw, 120px) clamp(20px, 6vw, 72px) 40px;
  color: #fff;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(242, 183, 5, 0.7);
  animation: ping 2s ease-out infinite;
}

@keyframes ping {
  to { box-shadow: 0 0 0 10px rgba(242, 183, 5, 0); }
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4.2rem, 16vw, 9.5rem);
  line-height: 0.85;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.hero__line {
  display: block;
  animation: rise 0.9s var(--ease) both;
}

.hero__line--accent {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(242, 183, 5, 0.35);
  animation-delay: 0.12s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.hero__lead {
  max-width: 30ch;
  margin: 22px 0 32px;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  color: rgba(255, 255, 255, 0.88);
  animation: rise 0.9s var(--ease) 0.24s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  animation: rise 0.9s var(--ease) 0.36s both;
}

/* ---------- Stats ---------- */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 clamp(20px, 6vw, 72px);
  padding: 0;
  list-style: none;
  transform: translateY(50%);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow-lift);
}

.stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 18px 20px;
  background: var(--surface);
  transition: background-color 0.3s var(--ease);
}

.stat:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.stat__num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.stat__unit {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
}

.stat__label {
  flex-basis: 100%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 16px 40px;
}

.section__head {
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 0.95;
  text-transform: uppercase;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.card:hover .card__media img {
  transform: scale(1.07);
}

.card__num {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.35s var(--ease);
}

.card:hover .card__num {
  transform: rotate(-6deg) scale(1.1);
}

.card__body {
  padding: 22px 24px 26px;
}

.card__kicker {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.card__text {
  margin: 0;
  color: var(--muted);
}

/* ---------- Guide ---------- */
.guide {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--accent);
}

.guide__avatar {
  width: 120px;
  height: 120px;
  transition: transform 0.5s var(--ease);
}

.guide:hover .guide__avatar {
  transform: rotate(-6deg) scale(1.04);
}

.guide__avatar svg {
  width: 100%;
  height: 100%;
}

.guide__ring {
  fill: var(--accent);
  stroke: var(--accent-ink);
  stroke-width: 3;
  stroke-dasharray: 6 6;
}

.guide__avatar text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 46px;
  fill: var(--accent-ink);
}

.guide__quote {
  margin: 0;
}

.guide__quote p {
  margin: 0 0 14px;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  line-height: 1.5;
}

.guide__quote footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.guide__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.guide__role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--max);
  margin: 60px auto 0;
  padding: 28px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--accent-text);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .cards .reveal:nth-child(2) { transition-delay: 0.1s; }
.js .cards .reveal:nth-child(3) { transition-delay: 0.2s; }

/* Card hover still works after reveal */
.js .card.reveal.is-visible:hover {
  transform: translateY(-8px);
  transition-delay: 0s;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .cards .card:last-child {
    grid-column: 1 / -1;
  }

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

  .guide {
    grid-template-columns: auto 1fr;
  }

  .guide__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .nav__word {
    display: none;
  }

  .hero__media {
    border-radius: var(--radius);
  }

  .hero__content {
    padding-bottom: 32px;
  }

  .hero__actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .stats {
    margin: 0 12px;
    transform: translateY(40px);
  }

  .stat {
    padding: 14px 16px;
  }

  .section {
    padding-top: 96px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .guide {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 20px;
    padding: 28px 22px;
  }

  .guide__avatar {
    width: 88px;
    height: 88px;
  }

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg__glow {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
