/* ============================================================
   Deep Sea Fauna — Design Tokens (brand kit: bakery / chalkboard)
   CSS custom properties: colors, type, spacing, layout
   Fonts: self-hosted Source Sans 3 under /fonts/ (WOFF2 + WOFF, font-display: swap).
   ============================================================ */

/* ── Source Sans 3 (site-wide sans) ── */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-sans-3-v19-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/source-sans-3-v19-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/source-sans-3-v19-latin-700.woff2') format('woff2');
}

:root {
  /* ── Brand colors (from brand-kit/brand-kit.txt) ── */
  --color-brioche:        #C8882A;  /* Primary — Brioche Gold */
  --color-crust:          #8B5E2A;  /* Secondary — Crust Amber */
  --color-cream:          #F5ECD7;  /* Accent / Fresh Cream */
  --color-shopfront:      #1A1A18;  /* Dark — Shopfront Black */
  --color-cobblestone:    #6B6560;  /* Neutral */
  --color-parchment:      #FAF3E8;  /* Background */
  --color-chalkboard:     #2D2D2B;  /* Pop / chalk panels */

  /* ── Semantic mapping (used across existing components) ── */
  --color-primary:        var(--color-shopfront);
  --color-primary-light:   #2a2824;  /* lifted shopfront for hovers/gradients */
  --color-primary-dark:   #0e0e0c;  /* footer / deeper bar */
  --color-bg:             var(--color-parchment);
  /* Warm amber wash (~10% Brioche on parchment, kit “bakery window”) */
  --color-bg-alt:         #f3ebdc;
  --color-bg-dark:        var(--color-chalkboard);
  --color-accent:         var(--color-brioche);
  --color-accent-light:   #d9a54a;  /* lighter gold for hovers on dark */
  --color-cta:            var(--color-brioche);
  --color-cta-light:      #d9a54a;
  --color-cta-dark:       var(--color-crust);
  /* Success stays green-leaning for “OK” / a11y semantics */
  --color-success:        #4a5d3e;
  --color-text:           var(--color-shopfront);
  --color-text-light:     #494743;  /* muted prose — ≥4.5:1 on parchment (was cobblestone-only) */
  --color-text-placeholder: #575450;
  --color-text-on-dark:   var(--color-cream);
  --color-text-on-dark-muted: rgba(245, 236, 215, 0.9);
  /* Text on gold / amber fills — shopfront on brioche meets WCAG AA (white on #C8882A ≈ 3:1) */
  --color-text-on-gold:   var(--color-shopfront);
  --color-border:         #d4c9b5;
  --color-border-dark:    rgba(245, 236, 215, 0.18);
  --color-error:          #b91c1c;
  --color-white:          #ffffff;

  /* ── WCAG 2.1 AA contrast (light surfaces: parchment / alt stripes) ──
     Brioche (#C8882A) is kept for large display accents & fills — not for small body text. */
  --color-link:             #5c3f14;  /* ≥4.5:1 on parchment for normal body links */
  --color-link-hover:       #3d2a0e;
  --color-heading-accent:   #6e4a18;  /* hero emphasis / h1 accents on light bg */
  --color-focus-ring:       #5c3f14;  /* visible focus on light backgrounds */
  --color-focus-ring-dark:  #f5e6bc;  /* focus on shopfront / chalkboard / CTA bands */

  /* ── Typography (single optimized sans family) ── */
  --font-display: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-subhead: var(--font-body);
  --font-body:    'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: var(--font-display);
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.5rem;
  --text-4xl:  3.25rem;

  --line-height-body:    1.6;
  --line-height-heading: 1.15;
  --line-height-tight:   1.05;

  /* ── Spacing (8px base) ── */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* ── Layout ── */
  --layout-max:         min(1360px, 92vw);
  --max-width:          1360px;
  --max-width-narrow:   920px;
  --content-padding-x:  clamp(1rem, 4vw, 3rem);
  --gutter-bg:          var(--color-bg);

  /* ── Surfaces (kit: parchment cards, thin Brioche border, icon washes) ── */
  --surface-card:       var(--color-parchment);
  --border-brand:       rgba(200, 136, 42, 0.42);
  --icon-wash-bg:       rgba(200, 136, 42, 0.14);
  --ring-focus-input:   rgba(200, 136, 42, 0.28);

  /* ── Radii — pills for primary actions per brand kit ── */
  --radius:    6px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* ── Shadows — warm neutrals ── */
  --shadow-sm: 0 1px 2px rgba(26, 26, 24, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 26, 24, 0.09);
  --shadow-lg: 0 8px 24px rgba(26, 26, 24, 0.12);
  --shadow-xl: 0 16px 40px rgba(26, 26, 24, 0.14);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* ── Z-index ── */
  --z-base:    1;
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-toast:   400;
  --z-skip:    9999;
}

@supports (color: color-mix(in srgb, white, black)) {
  :root {
    --color-bg-alt: color-mix(in srgb, var(--color-brioche) 10%, var(--color-parchment));
  }
}
/* ============================================================
   Deep Sea Fauna — Base Styles
   Reset, body, typography defaults, skip link, focus, utilities
   ============================================================ */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--gutter-bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  /* Preserve aspect ratio when width is constrained (avoids skew in flex/stretch layouts) */
  height: auto;
}

svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  color: var(--color-text);
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, var(--text-4xl)); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-3xl)); font-weight: 600; }
h3 { font-size: clamp(1.125rem, 2.5vw, var(--text-xl)); font-weight: 700; }
h4 { font-size: var(--text-lg); font-weight: 700; }
h5 { font-size: var(--text-base); font-weight: 600; }
h6 { font-size: var(--text-sm); font-weight: 600; }

p {
  margin-block-end: var(--space-md);
  max-width: 68ch;
}

p:last-child {
  margin-block-end: 0;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-link-hover);
}

strong {
  font-weight: 600;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-alt);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Focus visible ── */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Focus on dark bands (nav, trust strip, CTA, footer, mobile drawer) */
.site-header :focus-visible,
.trust-strip :focus-visible,
.cta-banner :focus-visible,
.site-footer :focus-visible,
.section--dark :focus-visible,
.hero--dark :focus-visible,
.mobile-nav__panel :focus-visible {
  outline-color: var(--color-focus-ring-dark);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: var(--z-skip);
  text-decoration: none;
}

.skip-link:focus {
  position: fixed;
  top: var(--space-sm);
  left: var(--space-sm);
  width: auto;
  height: auto;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius);
  z-index: var(--z-skip);
  text-decoration: none;
  outline: 3px solid var(--color-focus-ring-dark);
  outline-offset: 2px;
}

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

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    #e8e5de 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1em;
  border-radius: var(--radius);
}

.skeleton-img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
}

/* ── Image placeholder ── */
.img-placeholder {
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: var(--text-sm);
}

/* ── Links on dark bands (chalkboard, CTA, hero dark) — not primary nav (own styles) ── */
.section--dark a:not(.btn),
.hero--dark a:not(.btn),
.cta-banner a:not(.btn) {
  color: var(--color-text-on-dark);
}

.section--dark a:not(.btn):hover,
.hero--dark a:not(.btn):hover,
.cta-banner a:not(.btn):hover {
  color: var(--color-accent-light);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
  }
}

@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Scroll reveal ── */
[data-reveal] {
  opacity: 0;
}

[data-reveal].is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    transition: opacity var(--transition-slow);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Mobile: no hidden below-fold content on first paint (defers layout/IO cost to idle JS) */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 1;
  }
}
/* ============================================================
   Critical CSS — above-the-fold (sync with tokens + base)
   Full layout/components load async via media=print onload.
   ============================================================ */

.layout-shell {
  max-width: var(--layout-max);
  width: 100%;
  margin-inline: auto;
  background: var(--color-bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.layout-shell > main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--content-padding-x);
}

/* Section spacing — inlined to prevent CLS when layout.css loads async */
.section {
  padding-block: var(--space-3xl);
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-on-dark);
}

.section--dark p {
  color: rgba(245, 236, 215, 0.95);
}

.site-header {
  background: var(--color-primary);
  color: var(--color-text-on-dark);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-md);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__wordmark {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(220px, 46vw);
  aspect-ratio: 3382 / 2636;
  object-fit: contain;
  object-position: left center;
}

.primary-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.primary-nav__link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: rgba(245, 236, 215, 0.88);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.header-cta {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  font-size: var(--text-xs);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 2px solid rgba(247, 245, 240, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-on-dark);
  border-radius: 2px;
}

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

  .primary-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
}

.btn--primary {
  background: var(--color-cta);
  color: var(--color-text-on-gold);
  border-color: var(--color-cta);
  border-radius: var(--radius-pill);
}

.hero {
  padding-block: var(--space-4xl) var(--space-3xl);
  background: var(--color-bg);
}

.section.hero[data-section-id='homepage__hero'] {
  padding-block-start: var(--space-3xl);
}

.hero-heading {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, var(--text-4xl));
  line-height: var(--line-height-tight);
  margin-block-end: var(--space-lg);
  color: var(--color-text);
}

.hero-subtext {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  color: var(--color-text-light);
  line-height: 1.65;
  margin-block-end: var(--space-xl);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin-block-end: var(--space-xl);
}

.split {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

@media (min-width: 769px) {
  .split,
  .split--60-40 {
    grid-template-columns: 1fr 1fr;
  }

  .homepage-hero__split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr);
    align-items: start;
  }
}

.browser-mockup {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
}

.browser-mockup__bar {
  background: var(--color-bg-dark);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.browser-mockup__screen {
  aspect-ratio: 1195 / 1600;
  background: var(--color-white);
  overflow: hidden;
}

.browser-mockup__screen img {
  width: 100%;
  height: auto;
  display: block;
}

/* Homepage hero, mockup chrome, trust strip (inlined on index — no extra blocking CSS) */
.hero-content {
  max-width: 56ch;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-subhead);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-link);
  margin-block-end: var(--space-md);
}

.hero-subtext-emphasis {
  color: var(--color-text);
  font-weight: 700;
}

.btn--ghost {
  background: transparent;
  color: var(--color-link);
  border-color: var(--color-link);
  border-radius: var(--radius-pill);
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: var(--text-lg);
  min-height: 56px;
}

.browser-mockup__dots {
  display: flex;
  gap: 6px;
}

.browser-mockup__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.browser-mockup__dot--red { background: #ff5f56; }
.browser-mockup__dot--yellow { background: #ffbd2e; }
.browser-mockup__dot--green { background: #27c93f; }

.browser-mockup__url {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  height: 24px;
  max-width: min(100%, 360px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  padding-inline: var(--space-sm);
}

.browser-mockup__url-text {
  font-size: 0.7rem;
  color: rgba(247, 245, 240, 0.5);
  font-family: var(--font-mono);
}

.browser-mockup--paris .browser-mockup__url {
  max-width: min(100%, 420px);
}

.browser-mockup--paris .browser-mockup__screen {
  aspect-ratio: 1195 / 1600;
  display: block;
  overflow: hidden;
}

.browser-mockup--paris .browser-mockup__screen img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.trust-strip {
  background: var(--color-bg-dark);
  padding-block: var(--space-xl);
}

.trust-strip__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2xl);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--color-text-on-dark);
}

.trust-item + .trust-item {
  padding-inline-start: var(--space-2xl);
  border-inline-start: 1px solid var(--color-border-dark);
}

.trust-item__number {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-on-dark);
  line-height: 1;
}

.trust-item__label {
  font-size: var(--text-sm);
  color: var(--color-text-on-dark-muted);
  line-height: 1.3;
}

@media (max-width: 768px) {
  .trust-strip__inner {
    gap: var(--space-lg);
  }

  .trust-item + .trust-item {
    padding-inline-start: 0;
    border-inline-start: none;
  }
}
