/* Hallmark · macrostructure: Narrative Workflow · genre: playful · theme: custom (2km brand teal, hue 195)
 * nav: N3 Side-rail (desktop) / horizontal dots (mobile) · footer: Ft5 Statement · enrichment: none (typography only)
 * pre-emit critique: P4 H4 E4 S4 R4 V4
 */

@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }

html {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@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; }
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  transition: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: normal;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
  min-width: 0;
}

p { margin: 0; }

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

pre {
  background: var(--card);
  border: var(--rule-hair) solid var(--border);
  border-radius: calc(var(--radius) * 0.6);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--card-foreground);
}

/* ---------- layout shell ---------- */

.page {
  padding-left: 3.5rem;
}

@media (max-width: 720px) {
  .page { padding-left: 0; }
}

.wrap {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* ---------- N3 side-rail nav (desktop) ---------- */

.nav-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-md);
  border-right: var(--rule-hair) solid var(--border);
  background: var(--card);
  z-index: 20;
}

@media (max-width: 720px) {
  .nav-rail { display: none; }
}

.nav-rail__mark {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  color: var(--foreground);
  text-decoration: none;
  white-space: nowrap;
}

.nav-rail__dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-rail__dots a {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border);
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.nav-rail__dots a:hover {
  background: var(--muted-foreground);
}

.nav-rail__dots a[aria-current="true"] {
  background: var(--primary);
  transform: scale(1.4);
}

/* ---------- mobile progress dots ---------- */

.nav-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--background);
  border-bottom: var(--rule-hair) solid var(--border);
  padding: var(--space-xs) var(--page-gutter);
}

@media (max-width: 720px) {
  .nav-mobile { display: flex; gap: var(--space-xs); overflow-x: auto; }
}

.nav-mobile a {
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  text-decoration: none;
  white-space: nowrap;
}

.nav-mobile a[aria-current="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: min(90vh, 760px);
  display: flex;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-block: var(--space-xl) var(--space-xl);
}

.hero__top {
  max-width: fit-content;
}

.hero h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--text-display-s);
  max-width: 24ch;
  text-shadow: 0 2px 12px color-mix(in oklch, var(--background) 70%, transparent);
}

.hero__lede {
  font-size: var(--text-xl);
  color: var(--muted-foreground);
  max-width: 42ch;
}

.hero__eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-foreground);
  background: var(--accent);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--foreground);
}

.hero__meta span {
  background: color-mix(in oklch, var(--background) 85%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: var(--rule-hair) solid var(--border);
}

.hero__meta strong {
  color: var(--foreground);
}

@media (max-width: 720px) {
  .hero {
    min-height: min(75vh, 560px);
  }
  .hero h1 {
    font-size: var(--text-display-s);
  }
}

/* ---------- stage (module) sections ---------- */

.stage {
  padding-block: var(--space-2xl);
  border-top: 2px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.stage:first-of-type {
  border-top: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .stage { opacity: 1; transform: none; transition: none; }
}

.stage__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-block-end: var(--space-xs);
}

.stage h2 {
  font-size: var(--text-display-s);
  max-width: 20ch;
}

.stage__opening {
  margin-block-start: var(--space-md);
  font-size: var(--text-lg);
  color: var(--foreground);
  max-width: 56ch;
}

.stage__opening em {
  font-style: italic;
}

/* video placeholder */

.video-frame {
  margin-block-start: var(--space-lg);
  aspect-ratio: 16 / 9;
  background: var(--secondary);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  padding: 0;
  border: var(--rule-hair) dashed var(--border);
  position: relative;
  overflow: hidden;
}

.video-frame img.video-frame__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-frame__label {
  position: relative;
  z-index: 1;
  margin: var(--space-md);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}

/* cards: exercise + download */

.stage__grid {
  margin-block-start: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .stage__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
}

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: var(--rule-hair) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: 0 8px 24px -18px var(--foreground);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -16px var(--foreground);
}

.card h3 {
  font-size: var(--text-lg);
  font-weight: 800;
}

.card ol, .card ul {
  margin: var(--space-sm) 0 0;
  padding-inline-start: 1.1rem;
  display: grid;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--foreground);
}

.card__deliverable {
  margin-block-start: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.card__deliverable strong {
  color: var(--foreground);
}

.card--download {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  justify-content: space-between;
}

.card--download p {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: 0.65rem 1.1rem;
  border-radius: calc(var(--radius) * 0.7);
  border: var(--rule-hair) solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  min-height: 2.75rem;
}

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

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px var(--primary); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--muted); }

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* production note callout */

.note {
  margin-block-start: var(--space-md);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  background: var(--muted);
  border-left: 3px solid var(--accent);
  border-radius: 0 calc(var(--radius) * 0.5) calc(var(--radius) * 0.5) 0;
  padding: var(--space-sm) var(--space-md);
}

/* ---------- Ft5 statement footer ---------- */

.foot-stmt {
  padding: var(--space-3xl) var(--page-gutter) var(--space-xl);
  padding-left: calc(var(--page-gutter) + 3.5rem);
  display: grid;
  gap: var(--space-lg);
  background: var(--card);
  border-top: 2px solid var(--border);
}

@media (max-width: 720px) {
  .foot-stmt { padding-left: var(--page-gutter); }
}

.foot-stmt__eyebrow {
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.foot-stmt__line {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 30ch;
  margin: 0;
}

.foot-stmt__cta {
  margin-block-start: var(--space-sm);
}

.foot-stmt__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  padding-block-start: var(--space-md);
  border-top: var(--rule-hair) solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.foot-stmt__meta .wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--foreground);
}
