/* Ekko Academy stylesheet.
   Neutrals: IVORY palette, src/constants/index.js (gold not used).
   Accents: the four Ekko logo colours, assets/brand/ekko-icon-only.svg.
   Spacing: 4, 8, 16, 24, 32, 48, 64, 96, 128 only. */

:root {
  /* IVORY neutrals */
  --bg:        #fafaf8;
  --surface:   #ffffff;
  --surface-2: #f5f2ed;
  --border:    #e8e3db;
  --border-2:  #d4cfc6;
  --ink:       #1a1a1a;
  --ink-sub:   #3a3a3a;

  /* Text on dark sections */
  --on-dark:     #fafaf8;
  --on-dark-sub: #d4cfc6;

  /* Logo colours: shapes, strokes and large graphics only, never text */
  --red:    #D9433F;
  --green:  #4E8A1E;
  --blue:   #2F7FCC;
  --orange: #E08A0F;

  /* Spacing scale */
  --s-4:   4px;
  --s-8:   8px;
  --s-16:  16px;
  --s-24:  24px;
  --s-32:  32px;
  --s-48:  48px;
  --s-64:  64px;
  --s-96:  96px;
  --s-128: 128px;

  --radius: 16px;
  --header-h: 72px;

  /* One typeface */
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --size-h1:    64px;
  --size-h2:    40px;
  --size-h3:    24px;
  --size-price: 40px;
  --size-lead:  20px;
  --size-body:  18px;
  --size-small: 16px;

  --focus: var(--ink);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--s-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── LAYOUT ─────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 1248px;
  margin: 0 auto;
  padding-left: var(--s-48);
  padding-right: var(--s-48);
}

.section {
  padding-top: var(--s-128);
  padding-bottom: var(--s-128);
}

.section-title {
  font-size: var(--size-h2);
  margin-bottom: var(--s-64);
}

.is-dark {
  background: var(--ink);
  color: var(--on-dark);
  --focus: var(--on-dark);
}

.is-surface {
  background: var(--surface-2);
}

/* ── BUTTONS ────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--s-8) var(--s-24);
  border-radius: 999px;
  font-family: var(--font);
  font-size: var(--size-small);
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  background: var(--ink);
  color: var(--on-dark);
  transition: opacity 150ms ease;
}

.button:hover {
  opacity: 0.85;
}

.is-dark .button,
.site-header .button {
  background: var(--on-dark);
  color: var(--ink);
}

.text-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: var(--s-4);
  text-decoration-thickness: 1px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* ── HEADER ─────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: var(--on-dark);
  --focus: var(--on-dark);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-24);
  min-height: var(--header-h);
  padding-top: var(--s-8);
  padding-bottom: var(--s-8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  font-size: var(--size-small);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.brand svg {
  width: 36px;
  height: 32px;
  flex: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--s-32);
}

.header-nav ul {
  display: flex;
  gap: var(--s-32);
  list-style: none;
}

.header-nav ul a {
  font-size: var(--size-small);
  text-decoration: none;
  color: var(--on-dark-sub);
}

.header-nav ul a:hover {
  color: var(--on-dark);
  text-decoration: underline;
  text-underline-offset: var(--s-4);
}

/* ── HERO ───────────────────────────────── */

.hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding-top: var(--s-96);
  padding-bottom: var(--s-96);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--s-64);
}

.hero-title {
  font-size: var(--size-h1);
  line-height: 1.05;
  max-width: 14ch;
  margin-bottom: var(--s-24);
}

.hero-lead {
  font-size: var(--size-lead);
  line-height: 1.6;
  max-width: 40ch;
  color: var(--ink-sub);
}

.is-dark .hero-lead {
  color: var(--on-dark-sub);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-32);
  margin-top: var(--s-48);
}

.hero-mark {
  display: flex;
  justify-content: center;
}

.hero-mark svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  overflow: visible;
}

/* Hero load sequence. Only runs when hero-motion.js adds .motion to <html>,
   which it skips under prefers-reduced-motion. Without it, the finished
   logo shows with no motion. Every animation ends on the unaltered logo. */
html.motion .hero-mark .shape-tri,
html.motion .hero-mark .shape-square,
html.motion .hero-mark .shape-circle {
  stroke-dasharray: 1 1;
}

html.motion .hero-mark .shape-tri {
  animation: draw 700ms cubic-bezier(0.65, 0, 0.35, 1) 200ms both;
}

html.motion .hero-mark .shape-square {
  animation: draw 600ms cubic-bezier(0.65, 0, 0.35, 1) 700ms both;
}

html.motion .hero-mark .shape-circle {
  animation: ring 1500ms linear 1150ms both;
}

html.motion .hero-mark .shape-rect {
  animation: rise 600ms cubic-bezier(0.22, 1, 0.36, 1) 2050ms both;
}

@keyframes draw {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  1%   { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

/* 0 to 80% of the ring, hold, then close to 100% as the rectangle rises. */
@keyframes ring {
  0%   { stroke-dashoffset: 1;   opacity: 0; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  1%   { stroke-dashoffset: 1;   opacity: 1; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  45%  { stroke-dashoffset: 0.2; opacity: 1; }
  60%  { stroke-dashoffset: 0.2; opacity: 1; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  100% { stroke-dashoffset: 0;   opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
  html.motion .hero-mark * {
    animation: none !important;
    stroke-dasharray: none !important;
  }
}

/* ── HOW IT WORKS ───────────────────────── */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-48);
}

.step-shape {
  display: flex;
  align-items: flex-end;
  height: 96px;
  margin-bottom: var(--s-24);
}

.step-shape svg {
  height: auto;
}

/* Each shape keeps the logo's own scale (0.25 of logo units). */
.ico-tri    { width: 58px; }
.ico-square { width: 31px; }
.ico-circle { width: 42px; }
.ico-rect   { width: 24px; }

.step-title {
  font-size: var(--size-h3);
  margin-bottom: var(--s-8);
}

.step-text {
  color: var(--ink-sub);
  max-width: 68ch;
}

/* ── COURSES ────────────────────────────── */

.tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-32);
  align-items: stretch;
}

.tier {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-48);
}

.tier-featured {
  border: 2px solid var(--blue);
}

.tier-art {
  height: 96px;
  margin-bottom: var(--s-32);
}

.tier-art svg {
  height: 96px;
  width: auto;
}

.tier-label {
  font-size: var(--size-small);
  font-weight: 600;
  color: var(--ink-sub);
  margin-bottom: var(--s-8);
}

.tier-name {
  font-size: var(--size-h3);
  margin-bottom: var(--s-16);
}

.tier-price {
  font-size: var(--size-price);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--s-32);
}

.tier-list-title {
  font-size: var(--size-small);
  font-weight: 600;
  margin-bottom: var(--s-8);
  padding-top: var(--s-24);
  border-top: 1px solid var(--border);
}

.tier-list {
  list-style: disc;
  padding-left: var(--s-24);
  color: var(--ink-sub);
  margin-bottom: var(--s-24);
}

.tier-list li + li {
  margin-top: var(--s-4);
}

.tier-list li::marker {
  color: var(--border-2);
}

.tier .button {
  margin-top: auto;
  align-self: flex-start;
}

/* ── FAQ ────────────────────────────────── */

.faq {
  display: grid;
  max-width: 800px;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding-top: var(--s-32);
  padding-bottom: var(--s-32);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  font-size: var(--size-h3);
  margin-bottom: var(--s-8);
}

.faq-a {
  color: var(--ink-sub);
  max-width: 68ch;
}

/* ── REGISTER INTEREST ──────────────────── */

.register-head {
  max-width: 720px;
  margin-bottom: var(--s-48);
}

.register-head .section-title {
  margin-bottom: var(--s-16);
}

.register-head p {
  color: var(--on-dark-sub);
}

/* The HubSpot form is an iframe with a transparent background and dark
   text, so it needs a light panel to stay readable on the dark section. */
.form-panel {
  max-width: 720px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--s-32);
}

/* ── FOOTER ─────────────────────────────── */

.site-footer {
  background: var(--bg);
  padding-top: var(--s-64);
  padding-bottom: var(--s-64);
  font-size: var(--size-small);
  color: var(--ink-sub);
}

.footer-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--s-32);
  align-items: start;
}

.footer-logo {
  width: 44px;
  height: 40px;
}

.footer-details p + p {
  margin-top: var(--s-8);
}

.footer-links {
  display: flex;
  gap: var(--s-24);
  list-style: none;
}

.footer-copyright {
  margin-top: var(--s-32);
}

/* ── PRIVACY PAGE ───────────────────────── */

.policy {
  max-width: 800px;
}

.policy h1 {
  font-size: var(--size-h2);
  margin-bottom: var(--s-16);
}

.policy h2 {
  font-size: var(--size-h3);
  margin-top: var(--s-48);
  margin-bottom: var(--s-16);
}

.policy p,
.policy ul,
.policy table {
  margin-bottom: var(--s-16);
  color: var(--ink-sub);
  max-width: 68ch;
}

.policy ul {
  padding-left: var(--s-24);
}

.policy li + li {
  margin-top: var(--s-4);
}

.policy .updated {
  margin-bottom: var(--s-32);
}

.policy table {
  width: 100%;
  border-collapse: collapse;
}

.policy th,
.policy td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-8) var(--s-16) var(--s-8) 0;
  border-bottom: 1px solid var(--border);
}

.policy th {
  font-weight: 600;
  color: var(--ink);
}

/* ── RESPONSIVE ─────────────────────────── */

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

@media (max-width: 899px) {
  :root {
    --size-h1: 40px;
    --size-h2: 32px;
    --size-price: 32px;
    --size-lead: 18px;
  }

  .wrap {
    padding-left: var(--s-16);
    padding-right: var(--s-16);
  }

  .section {
    padding-top: var(--s-64);
    padding-bottom: var(--s-64);
  }

  .section-title {
    margin-bottom: var(--s-48);
  }

  .header-nav ul {
    display: none;
  }

  .hero {
    padding-top: var(--s-48);
    padding-bottom: var(--s-64);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-48);
  }

  .hero-mark {
    order: -1;
  }

  .hero-mark svg {
    max-width: 240px;
  }

  .hero-actions {
    gap: var(--s-24);
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-32);
  }

  .steps li {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: var(--s-16);
  }

  .step-shape {
    height: auto;
    margin-bottom: 0;
    align-items: flex-start;
    justify-content: center;
    padding-top: var(--s-4);
  }

  .ico-tri    { width: 41px; }
  .ico-square { width: 22px; }
  .ico-circle { width: 29px; }
  .ico-rect   { width: 17px; }

  .tiers {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-24);
  }

  .tier {
    padding: var(--s-24);
  }

  .tier-art,
  .tier-art svg {
    height: 64px;
  }

  .form-panel {
    padding: var(--s-16);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-24);
  }
}

@media (max-width: 599px) {
  .hero-actions .button {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .header-nav .button {
    padding-left: var(--s-16);
    padding-right: var(--s-16);
  }
}
