/* ============================================================
   FM Digital — fmdigital.uk
   Deep teal #1f4d47 primary, terracotta #d97a4a accent.
   Bitter (slab serif headings) + Public Sans (body).
   ============================================================ */

:root {
  --teal: #1f4d47;
  --teal-dark: #16332f;
  --teal-soft: #e3edea;
  --terra: #d97a4a;        /* graphics + large decorative use only */
  --terra-text: #a04a22;   /* AA-safe terracotta for text on light bg */
  --terra-on-dark: #eda882;/* AA-safe terracotta for text on teal */
  --mist: #f3f7f6;         /* teal-tinted off-white — page bg + text on teal */
  --white: #ffffff;
  --ink: #22312e;
  --muted: #5b6b65;
  --line: #d8e2df;

  --font-serif: 'Bitter', Georgia, 'Times New Roman', serif;
  --font-sans: 'Public Sans', -apple-system, 'Segoe UI', sans-serif;

  --max-w: 1200px;
  --section-pad: clamp(4rem, 9vw, 7rem);
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--teal);
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.5vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }

p { text-wrap: pretty; }

p + p { margin-top: 1em; }

a { color: var(--teal); }
a:hover { color: var(--terra-text); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding: var(--section-pad) 0; }
.section--tint { background: var(--teal-soft); }
.section--dark { background: var(--teal); }
.section--dark h2, .section--dark h3, .section--dark p { color: var(--mist); }

.section-intro { max-width: 46rem; margin-bottom: 2.5rem; }
.section-intro p { color: var(--muted); margin-top: 0.75rem; }
.section--dark .section-intro p { color: #cfdedb; }

/* Pulse line — the logo's heartbeat mark, used as the site's one
   recurring brand device (hero underline, section punctuation). */
.pulse {
  display: block;
  width: 180px;
  height: 34px;
  margin-top: 1.5rem;
}
.pulse path {
  fill: none;
  stroke: var(--terra);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn--primary { background: var(--teal); color: var(--white); }
.btn--primary:hover { background: var(--teal-dark); color: var(--white); }

.btn--light { background: var(--mist); color: var(--teal); }
.btn--light:hover { background: var(--white); color: var(--teal-dark); }

.btn--ghost { border-color: var(--teal); color: var(--teal); background: transparent; }
.btn--ghost:hover { background: var(--teal); color: var(--white); }

.section--dark .btn--ghost { border-color: var(--mist); color: var(--mist); }
.section--dark .btn--ghost:hover { background: var(--mist); color: var(--teal); }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--mist);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 12px rgba(31, 77, 71, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.nav-logo { display: inline-flex; align-items: center; min-height: 44px; }
.nav-logo img { height: 40px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 6px;
}

.nav-links a:hover { color: var(--teal); background: var(--teal-soft); }
.nav-links a[aria-current="page"] { color: var(--teal); font-weight: 700; }

.nav-cta { margin-left: 0.5rem; }

/* .nav-links a would out-specific .btn--primary and paint the CTA text dark-on-teal */
.nav-links a.btn--primary { color: var(--white); }
.nav-links a.btn--primary:hover { color: var(--white); background: var(--teal-dark); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: none;
  cursor: pointer;
}

.nav-toggle-bar {
  position: relative;
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
  transition: background 0.15s ease;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--teal);
  transition: transform 0.2s ease;
}

.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }

.nav.open .nav-toggle-bar { background: transparent; }
.nav.open .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav.open .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  background: var(--teal);
  padding: clamp(4.5rem, 10vw, 8rem) 0;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero-content { max-width: 38rem; }

.hero-visual { justify-self: end; width: 100%; max-width: 480px; }
.hero-browser { width: 100%; height: auto; display: block; }

/* Pulse draws itself in on load, then holds. pathLength="1" normalises
   the dash math regardless of the path's real length. */
.hero-pulse { stroke-dasharray: 1; stroke-dashoffset: 0; }

@media (prefers-reduced-motion: no-preference) {
  .hero-pulse {
    stroke-dashoffset: 1;
    animation: draw-pulse 1.5s cubic-bezier(0.65, 0, 0.35, 1) 0.4s forwards;
  }
}

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

.hero h1 { color: var(--mist); }
.hero h1 .accent { color: var(--terra-on-dark); }

.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: #cfdedb;
  max-width: 40rem;
}

.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-note { font-size: 0.95rem; color: #a8bfba; }

/* Hero entrance: content is fully visible by default; the animation only
   plays forward from a transformed start, so no-JS and headless renders
   still show everything. */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero-sub, .hero-actions, .hero-visual {
    animation: rise-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .hero-sub { animation-delay: 0.12s; }
  .hero-actions { animation-delay: 0.22s; }
  .hero-visual { animation-delay: 0.2s; }
}

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

/* ---- Page hero (inner pages) ---- */
.page-hero { background: var(--teal); padding: clamp(3rem, 7vw, 5rem) 0; }
.page-hero h1 { color: var(--mist); }
.page-hero p { margin-top: 1rem; color: #cfdedb; max-width: 42rem; font-size: 1.1rem; }

/* ---- Steps (how it works) — open numbered flow, no card boxes.
   The numbers are legitimate here: it's a real 3-step sequence. ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  counter-reset: step;
}

.step {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 3px solid var(--teal);
}

.step::before {
  content: counter(step);
  display: block;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: clamp(2.6rem, 4vw, 3.4rem);
  line-height: 1;
  color: var(--terra-text);
  margin-bottom: 0.75rem;
}

.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.98rem; }

/* ---- Cards (portfolio) ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Whole card is one link. */
.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--teal);
  box-shadow: 0 16px 36px rgba(31, 77, 71, 0.16);
  outline: none;
}

/* Browser-chrome frame — signals "this is a live website you can visit". */
.card-frame { position: relative; overflow: hidden; background: var(--teal-soft); }

.card-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  background: var(--teal);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(243, 247, 246, 0.4); }
.card-bar .dot:first-child { margin-left: 0; }

.card-url {
  margin-left: 0.6rem;
  padding: 0.2rem 0.8rem;
  flex: 1;
  background: rgba(243, 247, 246, 0.12);
  border-radius: 5px;
  font-size: 0.82rem;
  color: #cfdedb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover .card-img,
.card:focus-visible .card-img { transform: scale(1.035); }

.card-body { padding: 1.5rem 1.75rem 1.75rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }

.card-tag {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.card-tag--live { background: var(--teal); color: var(--mist); }
.card-tag--demo { background: var(--line); color: var(--ink); }

.card h3 { transition: color 0.2s ease; }
.card:hover h3, .card:focus-visible h3 { color: var(--terra-text); }

.card-body p { color: var(--muted); font-size: 0.98rem; flex: 1; }

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-weight: 700;
  color: var(--teal);
}

.card-cta .arrow { transition: transform 0.2s ease; }
.card:hover .card-cta .arrow,
.card:focus-visible .card-cta .arrow { transform: translateX(4px); }

/* ---- Feature / included lists ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature { padding-top: 1.25rem; border-top: 3px solid var(--terra); }

.feature h3 { margin-bottom: 0.4rem; }
.feature p { color: var(--muted); font-size: 0.95rem; }

.check-list { list-style: none; }
.check-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 2rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 1.1rem;
  height: 0.6rem;
  border-left: 2.5px solid var(--terra);
  border-bottom: 2.5px solid var(--terra);
  transform: rotate(-45deg);
}

/* ---- Pricing ---- */
.price-banner {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

.price-banner small {
  display: block;
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.75rem;
}

.price-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.price-table th, .price-table td { text-align: left; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.price-table th { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); background: var(--teal-soft); }
.price-table tr:last-child td { border-bottom: none; }
.price-table td:last-child { font-weight: 700; color: var(--teal); white-space: nowrap; }

.price-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

.price-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}

.price-card--featured { border: 2px solid var(--teal); }

.price-card .amount {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.1;
}

.price-card .amount span { font-family: var(--font-sans); font-size: 1rem; font-weight: 500; color: var(--muted); }

.price-card h3 { margin-bottom: 0.25rem; }
.price-card > p { color: var(--muted); font-size: 0.98rem; margin: 0.75rem 0 1rem; }

/* ---- Proof list — full-width stacked statements on the dark band,
   deliberately a different shape from the grids above it. ---- */
.proof-list { list-style: none; max-width: 52rem; }

.proof-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.4rem 0;
}

.proof-list li + li { border-top: 1px solid rgba(243, 247, 246, 0.15); }

.proof-list .tick {
  width: 1.3rem;
  height: 0.75rem;
  border-left: 3px solid var(--terra-on-dark);
  border-bottom: 3px solid var(--terra-on-dark);
  transform: rotate(-45deg) translateY(-2px);
}

.proof-list strong { color: var(--mist); font-family: var(--font-serif); font-size: 1.15rem; }
.proof-list p { color: #cfdedb; font-size: 1rem; margin-top: 0.25rem; line-height: 1.7; }

/* ---- CTA band ---- */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 0.75rem; }
.cta-band p { color: var(--muted); max-width: 38rem; margin: 0 auto 2rem; }
.cta-band p.price-banner { color: var(--teal); max-width: none; margin-bottom: 0; }

/* ---- Forms ---- */
.form-grid { display: grid; gap: 1.25rem; max-width: 40rem; }

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--teal);
}

.form-field input,
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 8px;
}

.form-field textarea { min-height: 160px; resize: vertical; }

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.form-note { font-size: 0.9rem; color: var(--muted); }
.form-note a { color: var(--teal); }

/* Links that sit inside running text: expand the tap area to 44px+
   without shifting layout (padding grows the target, negative margin
   cancels the visual offset). */
.footer-meta a,
.form-note a,
.prose a,
.price-table a {
  display: inline-block;
  padding: 0.85rem 0.25rem;
  margin: -0.85rem -0.25rem;
}

.hidden { display: none !important; }

/* ---- Contact layout ---- */
.contact-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }

.contact-aside {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}

.contact-aside h3 { margin-bottom: 0.5rem; }
.contact-aside p { color: var(--muted); font-size: 0.98rem; }
.contact-aside a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---- Prose (privacy page) ---- */
.prose { max-width: 46rem; }
.prose h2 { margin: 2.25rem 0 0.75rem; font-size: 1.4rem; }
.prose ul { padding-left: 1.4rem; margin: 0.75rem 0; }
.prose li { margin: 0.35rem 0; }
.prose .updated { color: var(--muted); font-size: 0.95rem; }

/* ---- Footer ---- */
/* Footer uses --teal exactly so the reversed logo's baked-in background blends in */
.footer { background: var(--teal); padding: 3.5rem 0 2.5rem; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-logo img { height: 36px; width: auto; }

.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

.footer-links a,
.footer a {
  color: #cfdedb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer-links a:hover, .footer a:hover { color: var(--white); text-decoration: underline; }

.footer-meta { width: 100%; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(250, 248, 245, 0.12); color: #a8bfba; font-size: 0.9rem; }
.footer-meta a { color: #cfdedb; min-height: auto; }

/* ---- Scroll reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease var(--reveal-delay, 0s), transform 0.6s ease var(--reveal-delay, 0s);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .steps, .feature-grid, .proof { grid-template-columns: 1fr; }
  .cards, .price-cols, .contact-cols { grid-template-columns: 1fr; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-content { max-width: none; }
  .hero-visual { display: none; }
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--mist);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.25rem 1.25rem;
    display: none;
  }

  .nav.open .nav-links { display: flex; }

  .nav-links a { min-height: 48px; }

  .nav-cta { margin: 0.75rem 0 0; }
}
