:root {
  --accent: #f22a12;
  --accent-dark: #c11f0d;
  --coral: #ff9a8d;

  --paper: #f4f3f0;
  --paper-strong: #ebe8e3;
  --card: #ffffff;

  --ink: #15120e;
  --ink-soft: #221e19;

  --text: #1d1915;
  --muted: #6f655d;
  --muted-ink: #b6aaa0;

  --line: #e3ded8;
  --line-ink: rgba(255, 255, 255, 0.13);

  --shadow: 0 26px 70px rgba(24, 21, 18, 0.14);
  --shadow-sm: 0 10px 30px rgba(24, 21, 18, 0.08);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding-top: 64px;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain / atmosphere overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 64px;
  background: rgba(244, 243, 240, 0.78);
  border-bottom: 1px solid rgba(227, 222, 216, 0.9);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.header-inner {
  width: min(var(--maxw), calc(100vw - 40px));
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: stretch;
  padding: 4px 0;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 100%;
  width: auto;
}

.site-nav {
  position: fixed;
  top: 0;
  right: max(20px, calc((100vw - var(--maxw)) / 2));
  z-index: 25;
  height: 64px;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 30px);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav a {
  position: relative;
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.25s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

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

.site-nav a:hover::after {
  transform: scaleX(1);
}

/* ---------- Layout primitives ---------- */
.section {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(64px, 9vw, 116px) 0;
}

.band {
  width: 100%;
}

.band-soft {
  background: var(--paper-strong);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.band-ink {
  background: var(--ink);
  color: #efe9e2;
}

.band-ink .label {
  color: var(--coral);
}

.band-ink h2 {
  color: #fbf7f2;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  margin-top: 0;
}

p {
  margin-top: 0;
}

.label {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.label::before {
  content: "\025AE  ";
  color: var(--accent);
}

.label-accent {
  color: var(--coral);
}

h1 {
  max-width: 16ch;
  margin: 0 0 26px;
  font-size: clamp(2.9rem, 7vw, 6rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 4.4vw, 3.7rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  margin: 0 0 10px;
  font-family: var(--body);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.lede {
  max-width: 56ch;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
  line-height: 1.55;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--text);
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(242, 42, 18, 0.26);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(242, 42, 18, 0.34);
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button.secondary {
  background: transparent;
  color: var(--text);
}

.button.secondary:hover {
  transform: translateY(-2px);
  background: var(--text);
  color: var(--paper);
}

.button.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fbf7f2;
}

.button.ghost:hover {
  transform: translateY(-2px);
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.7fr);
  align-items: center;
  gap: clamp(36px, 6vw, 76px);
  padding-top: clamp(40px, 6vw, 72px);
}

.hero-wave {
  margin-top: clamp(36px, 6vw, 64px);
  width: 100%;
  height: 76px;
  opacity: 0.85;
  overflow: hidden;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wave-path {
  stroke-dasharray: 2600;
  stroke-dashoffset: 2600;
}

.hero-panel {
  display: grid;
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-line {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  align-items: start;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line-ink);
  transition: background 0.3s var(--ease);
}

.panel-line:last-child {
  border-bottom: 0;
}

.panel-line:hover {
  background: rgba(255, 255, 255, 0.04);
}

.panel-line span {
  font-family: var(--mono);
  color: var(--coral);
  font-size: 0.82rem;
  font-weight: 500;
  padding-top: 4px;
}

.panel-line strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.12rem, 1.7vw, 1.4rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

/* ---------- Intro band ---------- */
.intro {
  padding-top: clamp(72px, 9vw, 120px);
  padding-bottom: clamp(72px, 9vw, 120px);
}

.intro-statement {
  margin: 0;
  max-width: 26ch;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.4vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: #fbf7f2;
}

.intro-statement em {
  font-style: italic;
  color: var(--coral);
}

/* ---------- Split sections (Services / Approach) ---------- */
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: clamp(34px, 7vw, 84px);
}

.item-list {
  display: grid;
  gap: 0;
}

.item-list article,
.training-grid article {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  transition: transform 0.3s var(--ease);
}

.item-list article {
  display: grid;
  gap: 6px;
}

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

.item-list article:hover {
  transform: translateX(6px);
}

.band-soft .item-list article,
.band-soft .training-grid article {
  border-color: rgba(108, 98, 90, 0.22);
}

.item-list p,
.training-grid p,
.feature-copy p,
.contact p {
  margin: 0;
  color: var(--muted);
}

/* ---------- Training ---------- */
.section-heading {
  max-width: 30ch;
  margin-bottom: clamp(34px, 5vw, 52px);
}

.training-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.training-grid article {
  border-top-width: 2px;
  border-top-color: var(--accent);
}

/* ---------- Standards band ---------- */
.standards .section-heading {
  max-width: 38ch;
}

.standards-lede {
  margin: 18px 0 0;
  max-width: 52ch;
  color: var(--muted-ink);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}

.figure-grid {
  list-style: none;
  margin: 0 0 clamp(40px, 5vw, 56px);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.figure-grid li {
  padding-top: 22px;
  border-top: 1px solid var(--line-ink);
}

.figure {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.figure-label {
  display: block;
  margin-top: 12px;
  max-width: 26ch;
  color: var(--muted-ink);
  font-size: 0.96rem;
  line-height: 1.45;
}

.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-list li {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: #efe9e2;
  padding: 9px 15px;
  border: 1px solid var(--line-ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.cert-list li:hover {
  border-color: var(--coral);
  color: #fff;
}

/* ---------- Feature ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
  gap: clamp(34px, 7vw, 84px);
  align-items: center;
}

.feature-copy p {
  max-width: 60ch;
  font-size: 1.08rem;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s var(--ease);
}

.text-link::after {
  content: " \2192";
}

.text-link:hover {
  background-size: 100% 1.5px;
}

.feature-card {
  padding: clamp(28px, 4vw, 44px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.feature-card span {
  display: block;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.feature-card p {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.4vw, 1.95rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.7fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
}

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

.contact-actions p {
  flex-basis: 100%;
  margin: 8px 0 0;
  color: var(--muted-ink);
  font-size: 0.94rem;
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px var(--gutter);
  background: var(--ink);
  color: var(--muted-ink);
  font-size: 0.86rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fbf7f2;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
}

.footer-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.footer-links {
  display: inline-flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.footer-links a {
  color: var(--muted-ink);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.footer-links a:hover {
  color: #fbf7f2;
}

/* ---------- Legal pages ---------- */
.legal {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) 0;
}

.legal .label {
  margin-bottom: 14px;
}

.legal h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.legal .updated {
  margin: 0 0 clamp(32px, 5vw, 48px);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.legal h2 {
  margin: clamp(34px, 4vw, 46px) 0 12px;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

.legal p {
  margin: 0 0 16px;
}

.legal ul {
  margin: 0 0 16px;
  padding-left: 1.1rem;
}

.legal li {
  margin-bottom: 8px;
}

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

.legal .back-link {
  display: inline-block;
  margin-top: clamp(36px, 5vw, 52px);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Motion: reveals ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.reveal[data-delay="1"].is-visible { transition-delay: 0.05s; }
.reveal[data-delay="2"].is-visible { transition-delay: 0.14s; }
.reveal[data-delay="3"].is-visible { transition-delay: 0.24s; }
.reveal[data-delay="4"].is-visible { transition-delay: 0.34s; }
.reveal[data-delay="5"].is-visible { transition-delay: 0.46s; }

[data-stagger].is-visible > * {
  animation: rise 0.6s var(--ease) both;
}
[data-stagger].is-visible > *:nth-child(1) { animation-delay: 0.05s; }
[data-stagger].is-visible > *:nth-child(2) { animation-delay: 0.14s; }
[data-stagger].is-visible > *:nth-child(3) { animation-delay: 0.23s; }
[data-stagger].is-visible > *:nth-child(4) { animation-delay: 0.32s; }
[data-stagger].is-visible > *:nth-child(5) { animation-delay: 0.41s; }

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

.hero-wave.is-visible .wave-path {
  animation: draw 2.1s var(--ease) 0.4s forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero,
  .split-section,
  .feature,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-bottom: 8px;
  }

  .hero-wave {
    order: 5;
  }

  .training-grid,
  .figure-grid {
    grid-template-columns: 1fr;
  }

  .figure-grid {
    gap: 28px;
  }
}

/* ---------- Hamburger button ---------- */
.nav-toggle {
  display: none;
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 30;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile nav panel (hidden by default) ---------- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px; /* matches header height */
  left: 0;
  right: 0;
  background: rgba(244, 243, 240, 0.97);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid rgba(227, 222, 216, 0.9);
  z-index: 19;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
  padding: 16px var(--gutter) 24px;
  gap: 4px;
}

.mobile-nav nav a {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 0;
  border-bottom: 1px solid rgba(227, 222, 216, 0.6);
  transition: color 0.2s var(--ease);
}

.mobile-nav nav a:last-child {
  border-bottom: none;
}

.mobile-nav nav a:hover {
  color: var(--ink);
}

.mobile-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

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

  .nav-toggle {
    display: flex;
    top: 14px; /* center in 64px header: (64-36)/2 */
  }

  .mobile-nav {
    display: block;
  }
}

@media (max-width: 720px) {
  body {
    padding-top: 56px;
  }

  .site-header {
    height: 56px;
  }

  .header-inner {
    width: min(var(--maxw), calc(100vw - 28px));
  }

  .mobile-nav {
    top: 56px;
  }

  .brand img {
    height: 100%;
    width: auto;
  }
}

@media (max-width: 520px) {
  .section {
    width: min(100% - 28px, var(--maxw));
  }

  .actions,
  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .reveal,
  [data-stagger].is-visible > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .wave-path {
    stroke-dashoffset: 0;
  }

  .button:hover,
  .item-list article:hover,
  .panel-line:hover {
    transform: none;
  }
}
