/* ===== Reset & Variables ===== */
:root {
  color-scheme: light;

  /* Every colour is a token so the dark palette below can restate it. The
     accent exists twice on purpose: as text it has to be dark on a light page
     and light on a dark one, while as a button fill it stays deep in both so
     --on-accent can always be white. */
  --bg: #FBF8F2;
  --surface: #FFFFFF;
  --nav-bg: rgba(251, 248, 242, 0.88);
  --ink: #16261F;
  --ink-soft: #4A5750;

  --accent: #1F5C52;
  --accent-bg: #1F5C52;
  --accent-bg-hover: #123D36;
  --on-accent: #FFFFFF;
  --accent-soft: #E9F3EE;

  --panel: #123D36;
  --card-from: #153F38;
  --card-to: #0E2925;
  --on-dark: #C9DAD3;

  --coral: #F2955C;
  --coral-hover: #DB7E45;
  --on-coral: #16261F;

  --seafoam: #7FC8A9;
  --line: #E4DFD3;
  /* Borders that form the only visible boundary of a control need 3:1 against
     the page, so they get their own darker token. --line stays for the purely
     decorative rules between sections. */
  --line-control: #8C8474;
  --focus: #123D36;
  --radius: 20px;
  /* Apple HIG minimum control size on iOS/iPadOS is 44x44 pt. */
  --tap: 44px;
  --nav-height: 76px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--ink);
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 2rem; }
section { padding: 6rem 0; }

/* ===== Accessibility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent-bg);
  color: var(--on-accent);
  padding: 0.75rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Full Keyboard Access and Switch Control both rely on a visible focus
   indicator, so every focusable element gets one. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

/* The dark sections would swallow a dark ring. */
.product-card :focus-visible,
.contact-section :focus-visible {
  outline-color: #fff;
}

/* Focused only to receive the skip link; the ring would be noise. */
main:focus {
  outline: none;
}

/* The sticky nav must not cover whatever an in-page link jumps to. */
:target,
main[id] {
  scroll-margin-top: calc(var(--nav-height) + 1rem);
}

/* ===== NAV ===== */
/* The bar sticks from its wrapper, not from the <nav>: a sticky element can
   only travel inside its own containing block, and <header> is exactly as tall
   as the <nav>, so sticking the <nav> itself never moved it at all. */
body > header {
  position: sticky;
  top: 0;
  z-index: 50;
}

nav.topnav {
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

nav.topnav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  font-weight: 700;
  font-size: 1.1875rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-soft);
  list-style: none;
}

.navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: none;
  color: var(--ink-soft);
}

.navlinks a:hover { color: var(--accent); }

.navlinks .lang-switch {
  justify-content: center;
  min-width: var(--tap);
  font-size: 0.8125rem;
  padding: 0 0.625rem;
  border: 1.5px solid var(--line-control);
  border-radius: 8px;
  color: var(--ink-soft);
}

.navlinks .lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  background: var(--accent-bg);
  color: var(--on-accent) !important;
  padding: 0 1.25rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-bg-hover);
}

.nav-toggle {
  display: none;
  width: var(--tap);
  height: var(--tap);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--line-control);
  border-radius: 100px;
  cursor: pointer;
  color: var(--ink-soft);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Each appearance shows the one it switches to. */
.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

/* ===== HERO ===== */
.hero {
  padding-top: 6rem;
  padding-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.4375rem 0.875rem;
  border-radius: 100px;
  margin-bottom: 1.375rem;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  flex-shrink: 0;
}

.hero-h {
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.06;
  margin-bottom: 1.375rem;
}

.hero-h em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  max-width: 30rem;
  margin-bottom: 2.125rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  background: var(--accent-bg);
  color: var(--on-accent);
  padding: 0.875rem 1.625rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-bg-hover);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.875rem 1.375rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9375rem;
  border: 1.5px solid var(--line-control);
  color: var(--ink);
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.375rem;
  margin-top: 2.125rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.trust-row span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Phone Mockup ===== */
.phone-stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.ripple-bg {
  position: absolute;
  inset: -40px;
  z-index: 0;
  opacity: 0.5;
}

.phone {
  position: relative;
  z-index: 1;
  width: 250px;
  height: 510px;
  background: #123D36;
  border-radius: 38px;
  padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(18, 61, 54, 0.45);
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #0F2F2A 0%, #1B4B43 55%, #245C52 100%);
}

.phone-screen .fish {
  position: absolute;
  width: 26px;
  height: 14px;
  background: var(--coral);
  border-radius: 50% 50% 50% 10%;
  opacity: 0.9;
}

.phone-screen .fish::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 2px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 9px solid var(--coral);
}

.phone-screen .fish.f1 { top: 120px; left: 40px; transform: scaleX(-1); }
.phone-screen .fish.f2 { top: 210px; left: 150px; background: #F4C86B; }
.phone-screen .fish.f2::after { border-right-color: #F4C86B; }
.phone-screen .fish.f3 { top: 300px; left: 60px; background: var(--seafoam); transform: scaleX(-1); }
.phone-screen .fish.f3::after { border-right-color: var(--seafoam); }

.phone-timer {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: #EAF4EF;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 34px;
  font-weight: 700;
}

.phone-timer small {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 4px;
}

.phone-bubbles {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.06));
}

/* ===== Wave Divider ===== */
.wave-divider {
  width: 100%;
  height: 60px;
  display: block;
  /* The path is filled with currentColor so it tracks the section below it
     through a palette change. */
  color: var(--surface);
}

/* ===== PILLARS ===== */
.pillars-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 35rem;
  margin-bottom: 3.5rem;
}

.section-head .eyebrow { margin-bottom: 1rem; }

.section-head h2 {
  font-size: 2.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.pillar {
  padding: 2rem 1.625rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-bg);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pillar h3 { font-size: 1.1875rem; margin-bottom: 0.625rem; }
.pillar p { font-size: 0.9375rem; color: var(--ink-soft); }

/* ===== PRODUCT CARD ===== */
.product-card {
  background: linear-gradient(135deg, var(--card-from), var(--card-to));
  border-radius: 28px;
  padding: 3.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  color: #EAF4EF;
}

.product-card .tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.125rem;
  color: var(--seafoam);
}

.product-card h3 {
  font-size: 1.875rem;
  color: #fff;
  margin-bottom: 0.875rem;
}

.product-card p {
  color: var(--on-dark);
  font-size: 1rem;
  margin-bottom: 1.625rem;
  max-width: 26rem;
}

.product-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}

.product-features li {
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.4375rem 0.8125rem;
  border-radius: 100px;
}

/* HIG asks for roughly 12 pt of padding between bezelled controls. */
.product-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.product-shot {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.product-shot img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  object-position: top;
  border-radius: 20px;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3.5rem;
  align-items: center;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  background: url('../img/founder_image.JPEG') center / cover no-repeat;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

blockquote {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  margin: 1.25rem 0;
}

.quote-attr {
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ===== CONTACT ===== */
.contact-section {
  background: var(--panel);
  color: #fff;
  border-radius: 28px;
  margin: 0 2rem;
  padding: 4.5rem 3.5rem;
  text-align: center;
}

.contact-section h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 0.875rem;
}

.contact-section p {
  color: var(--on-dark);
  margin-bottom: 1.875rem;
  font-size: 1.0625rem;
}

.contact-section .btn-primary {
  background: var(--coral);
  color: var(--on-coral);
}

.contact-section .btn-primary:hover {
  background: var(--coral-hover);
}

/* ===== FOOTER ===== */
footer {
  padding: 3.5rem 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

footer .foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.375rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  list-style: none;
}

footer .foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 0.25rem;
  color: var(--ink-soft);
  text-decoration: none;
}

footer .foot-links a:hover {
  color: var(--accent);
}

footer .footer-copy {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.legal-page h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 2.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.legal-page .last-updated {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-bottom: 2.5rem;
}

.legal-page h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.legal-page h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.legal-page p {
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
  max-width: 45rem;
  line-height: 1.7;
}

.legal-page ul {
  color: var(--ink-soft);
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  max-width: 45rem;
}

.legal-page li {
  margin-bottom: 0.375rem;
  line-height: 1.7;
}

/* Underlined rather than teal-only, so the link is not signalled by colour
   alone for readers who cannot distinguish it. */
.legal-page a,
.error-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.legal-page a:hover,
.error-page a:hover {
  text-decoration-thickness: 2px;
}

/* ===== ERROR PAGE ===== */
.error-page {
  text-align: center;
  padding: 6rem 2rem;
}

.error-page h1 {
  margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 53.75em) {
  .hero-grid,
  .about-grid,
  .product-card {
    grid-template-columns: 1fr;
  }

  .pillars {
    grid-template-columns: 1fr;
  }

  .hero-h {
    font-size: 2.375rem;
  }

  .product-card {
    padding: 2rem;
  }

  .contact-section {
    margin: 0 1rem;
    padding: 3rem 1.75rem;
  }

  section {
    padding: 4rem 0;
  }

  .nav-toggle {
    display: block;
  }

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

  .navlinks.open {
    display: flex;
  }

  .navlinks .lang-switch {
    margin-top: 0.5rem;
  }

  .nav-cta {
    display: none;
  }

  .nav-actions {
    gap: 0;
  }

  .legal-page {
    padding: 2.5rem 1.25rem 4rem;
  }

  .legal-page h1 {
    font-size: 1.75rem;
  }
}

/* ===== Dark Mode ===== */
/* Opt-in only. The light appearance is the default for everyone, whatever the
   operating system is set to; js/theme.js puts data-theme="dark" on <html>
   when the reader asks for it with the button in the bar. Nothing here keys
   off prefers-color-scheme, and tests/check_a11y.py enforces that. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0E1714;
  --surface: #18241F;
  --nav-bg: rgba(14, 23, 20, 0.9);
  --ink: #ECF1EE;
  --ink-soft: #AABAB3;

  --accent: #7FC8A9;
  --accent-bg: #2A7A6C;
  --accent-bg-hover: #35917F;
  --accent-soft: #1B302A;

  /* Lifted clear of --bg so the card and the panel still read as raised
     surfaces rather than dissolving into the page. */
  --panel: #17392F;
  --card-from: #1E4038;
  --card-to: #15302A;

  --coral-hover: #F7AE7F;

  --line: #28382F;
  --line-control: #93A69E;
  --focus: #A7DCC3;
}

/* ===== Increase Contrast ===== */
/* :root[data-theme="dark"] outranks a bare :root, so the light block below
   cannot leak into the dark appearance and only the order of the two dark
   rules matters. tests/check_a11y.py resolves all four palettes and re-checks
   every colour pair in each. */
@media (prefers-contrast: more) {
  :root {
    --ink-soft: #2D3833;
    --accent: #0F3D35;
    --accent-soft: #DCEDE5;
    --line: #8C8474;
    --line-control: #16261F;
    --on-dark: #E8F1ED;
  }

  :root[data-theme="dark"] {
    --ink-soft: #D2DEDA;
    --accent: #A7DCC3;
    --accent-bg: #31897A;
    --line: #7A8C84;
    --line-control: #E4EEEA;
    --on-dark: #E8F1ED;
  }

  .navlinks a,
  footer .foot-links a,
  .quote-attr {
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .product-card .tag { color: #A7DCC3; }
  .btn-ghost { border-width: 2px; }
  .pillar { border-color: var(--line-control); }
}

/* ===== Reduce Motion ===== */
@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;
    scroll-behavior: auto !important;
  }
}
