/* ============================================================
   Ottermate — locked brand system
   Rust #BF5A2E · Cream #F2E9DD · Deep Rust #9A4423
   Off-White #FAF6F0 · Tint #F5E0D5 · Charcoal #1A1A1A · Grey #555
   Playfair Display (display) · Inter (body)
   ============================================================ */

:root {
  --rust: #BF5A2E;
  --cream: #F2E9DD;
  --rust-deep: #9A4423;
  --offwhite: #FAF6F0;
  --tint: #F5E0D5;
  --charcoal: #1A1A1A;
  --grey: #555555;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 62ch;
  --container: 1120px;
  --pad-x: clamp(20px, 4vw, 48px);
  --section-y: clamp(64px, 9vw, 112px);

  --ease-calm: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--offwhite);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rust-deep); }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; }

h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); letter-spacing: -0.01em; color: var(--rust); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); color: var(--rust-deep); letter-spacing: -0.005em; }
h3 { font-size: 1.25rem; color: var(--rust-deep); }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 14px;
}

.nowrap { white-space: nowrap; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-lg { padding: 17px 36px; font-size: 1.05rem; }

.btn-rust { background: var(--rust); color: var(--cream); }
.btn-rust:hover { background: var(--rust-deep); }

.btn-cream { background: var(--cream); color: var(--rust); }
.btn-cream:hover { background: var(--offwhite); color: var(--rust-deep); }

.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(154, 68, 35, 0.22); }
.btn:active { transform: translateY(1px); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}

.micro {
  font-size: 0.86rem;
  color: var(--grey);
  margin-top: 12px;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--offwhite);
  border-bottom: 1px solid var(--tint);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--rust-deep);
  margin-right: auto;
}

.brand-mark { flex-shrink: 0; }

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

.nav-links { display: flex; gap: 26px; }

.nav-links a {
  text-decoration: none;
  color: var(--charcoal);
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover { color: var(--rust-deep); border-bottom-color: var(--rust); }

.nav .btn { padding: 11px 20px; font-size: 0.92rem; }

@media (max-width: 860px) {
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .nav .btn { padding: 10px 14px; font-size: 0.85rem; white-space: nowrap; }
  .brand-word { font-size: 1.15rem; }
}
@media (max-width: 400px) {
  .nav .brand-word { display: none; }
}

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

.hero { padding-top: clamp(24px, 3.5vw, 44px); }

.hero-copy {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  opacity: 0;
  transform: translateY(14px);
  animation: hero-copy-in 0.9s var(--ease-calm) 0.1s forwards;
}

@keyframes hero-copy-in {
  to { opacity: 1; transform: none; }
}

.hero-cta {
  text-align: center;
  margin-top: clamp(16px, 2.2vw, 26px);
  opacity: 0;
  transform: translateY(14px);
  animation: hero-copy-in 0.9s var(--ease-calm) 1.1s forwards;
}

.hero-cta .sub {
  max-width: 56ch;
  margin: 0 auto 24px;
  font-size: 1.08rem;
}

/* line composition directly under the headline — compact so the
   drawing is on screen the moment the page loads */

.hero-line-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "line line"
    "start end";
  max-width: 760px;
  margin: clamp(10px, 1.6vw, 18px) auto 0;
}

.hero-line { grid-area: line; }
.hero-line svg { width: 100%; height: auto; display: block; }

.hero-line-mobile { display: none; }

.line-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
  opacity: 0;
  animation: hero-copy-in 0.9s var(--ease-calm) 1.4s forwards;
}

.label-start { grid-area: start; justify-self: start; padding-left: 2%; }
.label-end { grid-area: end; justify-self: end; text-align: right; padding-right: 2%; }

@media (max-width: 640px) {
  .hero-line-desktop { display: none; }
  .hero-line-mobile { display: block; max-width: 400px; margin: 0 auto; }

  .hero-line-wrap {
    grid-template-columns: 1fr;
    grid-template-areas:
      "start"
      "line"
      "end";
    justify-items: center;
    row-gap: 10px;
  }
  .label-start, .label-end { justify-self: center; text-align: center; padding: 0; }
}

/* --- hero SVG line animation --- */

.chaos-line path,
.chaos-line polyline {
  fill: none;
  stroke: var(--rust);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chaos-line .seg {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.chaos-line .node {
  fill: var(--offwhite);
  stroke: var(--rust);
  opacity: 0;
}

.play .seg-tangle {
  animation: draw 1.2s cubic-bezier(0.6, 0.05, 0.5, 0.95) 0s forwards;
}
.play .seg-bridge {
  animation: draw 0.45s var(--ease-calm) 1.2s forwards;
}
.play .seg-lattice-a { animation: draw 0.7s var(--ease-calm) 1.5s forwards; }
.play .seg-lattice-b { animation: draw 0.7s var(--ease-calm) 1.6s forwards; }
.play .seg-lattice-c { animation: draw 0.6s var(--ease-calm) 1.75s forwards; }
.play .seg-lattice-d { animation: draw 0.6s var(--ease-calm) 1.8s forwards; }
.play .node { animation: node-in 0.4s var(--ease-calm) 2.05s forwards; }
.play .node-pulse { animation: node-in 0.4s var(--ease-calm) 2.05s forwards,
                               pulse 4s ease-in-out 2.6s infinite; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes node-in { to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Static final frame: no-motion preference, no-JS fallback, or the
   locked state after the intro choreography finishes (.done) */
.no-anim .seg, .done .seg { stroke-dashoffset: 0 !important; }
.no-anim .node, .done .node { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  .chaos-line .seg { stroke-dashoffset: 0 !important; animation: none !important; }
  .chaos-line .node { opacity: 1 !important; animation: none !important; }
  .hero-copy, .hero-cta, .line-label { opacity: 1; transform: none; animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- sections ---------- */

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

.section-rule { border-top: 1px solid var(--tint); }

.section p + p { margin-top: 1.1em; }

/* ---------- metrics strip ---------- */

.metrics {
  margin-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--tint);
  border-bottom: 1px solid var(--tint);
  padding: clamp(36px, 5vw, 56px) 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 40px);
}

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

.metric dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  color: var(--rust);
}

.metric dd {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--grey);
}

@media (max-width: 900px) {
  .metrics-grid, .metrics-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .metrics-grid, .metrics-3 { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------- "where the hours hide" cards ---------- */

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  margin-top: clamp(32px, 4vw, 52px);
}

.case-card {
  background: var(--cream);
  border-radius: 10px;
  padding: clamp(24px, 2.8vw, 34px);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease-calm), box-shadow 0.2s var(--ease-calm);
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(154, 68, 35, 0.12);
}

.case-card strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.4vw, 2.1rem);
  line-height: 1.1;
  color: var(--rust);
  margin-bottom: 12px;
}

.case-card strong span { font-size: 0.6em; }

.case-card p { font-size: 0.94rem; flex: 1; }

.case-card footer {
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

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

/* ---------- what we do ---------- */

.svc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
  margin-top: clamp(32px, 4vw, 52px);
}

.svc-card {
  background: var(--cream);
  border-radius: 10px;
  padding: clamp(24px, 2.6vw, 32px);
  transition: transform 0.2s var(--ease-calm), box-shadow 0.2s var(--ease-calm);
}

.svc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(154, 68, 35, 0.12);
}

.icon {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--rust);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 18px;
  transition: transform 0.25s var(--ease-calm);
}

.svc-card:hover .icon { transform: translateY(-4px) rotate(-4deg); }

@media (prefers-reduced-motion: reduce) {
  .svc-card:hover .icon { transform: none; }
}

.svc-card h3 { margin-bottom: 8px; font-size: 1.15rem; }

.svc-card p { font-size: 0.94rem; }

@media (max-width: 1020px) {
  .svc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: 1fr; }
}

/* ---------- how it works ---------- */

.how-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  margin-top: clamp(32px, 4vw, 52px);
}

.steps-wrap { position: relative; }

.steps-rail {
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 25px;
  width: 2px;
}

.steps-rail svg { width: 2px; height: 100%; display: block; }

.rail-path {
  fill: none;
  stroke: var(--rust);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.drawn .rail-path {
  animation: draw 1.2s var(--ease-calm) 0.1s forwards;
}

.steps { list-style: none; display: grid; gap: 38px; position: relative; }

.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 22px; }

.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--rust);
  border: 2px solid var(--rust);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--offwhite);
  position: relative;
  z-index: 1;
}

.steps h3 { margin-bottom: 4px; }
.steps p { font-size: 0.97rem; }

.how-ill img,
.co-ill img {
  border: 1px solid var(--tint);
  border-radius: 10px;
  transition: transform 0.25s var(--ease-calm), box-shadow 0.25s var(--ease-calm);
}

.how-ill img:hover,
.co-ill img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(154, 68, 35, 0.1);
}

.scope-note {
  margin-top: clamp(28px, 4vw, 44px);
  font-size: 0.95rem;
  color: var(--grey);
}

@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr; }
  .how-ill { order: -1; max-width: 560px; }
}

@media (prefers-reduced-motion: reduce) {
  .rail-path { stroke-dashoffset: 0 !important; animation: none !important; }
}

/* ---------- company ---------- */

.co-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  margin-top: clamp(32px, 4vw, 52px);
}

.co-text { max-width: var(--measure); }

.co-ill img { border: 1px solid var(--tint); border-radius: 10px; }

.founder-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.founder-chip img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--rust);
}

.founder-chip strong { display: block; font-size: 0.98rem; }
.founder-chip span { font-size: 0.85rem; color: var(--grey); }

.stats-note { margin-top: 22px; font-size: 0.88rem; color: var(--grey); font-style: italic; }

@media (max-width: 860px) {
  .co-grid { grid-template-columns: 1fr; }
  .co-ill { order: -1; max-width: 560px; }
}

/* ---------- FAQ ---------- */

.faq-list { max-width: 760px; margin-top: clamp(28px, 4vw, 44px); }

.faq-list details {
  border-bottom: 1px solid var(--tint);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 20px 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--rust-deep);
  transition: color 0.2s ease;
}

.faq-list summary:hover { color: var(--rust); }

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--rust);
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-calm);
}

.faq-list summary:hover::after { transform: rotate(90deg); }

.faq-list details[open] summary::after { content: "–"; transform: none; }

.faq-list details p {
  padding: 0 4px 22px;
  max-width: var(--measure);
  color: var(--charcoal);
}

/* ---------- final CTA band ---------- */

.cta-band {
  background: var(--rust);
  color: var(--cream);
  overflow: hidden;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.cta-band h2 { color: var(--cream); }

.cta-band .sub { margin-top: 18px; max-width: 46ch; }

.cta-band .btn { margin-top: 30px; }

@media (max-width: 820px) {
  .cta-grid { grid-template-columns: 1fr; }
  .cta-ill { max-width: 520px; margin: 0 auto; }
}

/* ---------- footer ---------- */

.footer { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--tint); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}

.footer .brand-word { font-size: 1.15rem; }

.footer-tag { color: var(--grey); font-size: 0.92rem; margin-right: auto; }

.footer-links { display: flex; gap: 22px; font-size: 0.92rem; }

.footer-links a { color: var(--charcoal); text-decoration: none; border-bottom: 1px solid var(--tint); }
.footer-links a:hover { color: var(--rust-deep); border-bottom-color: var(--rust); }

.footer-copy { width: 100%; font-size: 0.82rem; color: var(--grey); }

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-calm), transform 0.5s var(--ease-calm);
}

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

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