/* ============================================================
   Affirmations Recorder — Cinematic night-sky design system
   Spec: Website Design Specification v1.0
   ============================================================ */

:root {
  /* Color — deep-navy foundation, single royal-blue accent */
  --night:        #070A12;
  --panel-navy:   #16294A;
  --panel-deep:   #0C1628;
  --ink:          #EEF1F7;   /* text primary */
  --muted:        #AAB3C7;   /* text muted */
  --faint:        #6d778c;
  --accent:       #4A86FF;
  --accent-deep:  #2F5FE0;
  --accent-light: #7AA8FF;
  --gold:         #D9B877;   /* ambient only */
  --hairline:     rgba(255,255,255,0.08);
  --hairline-2:   rgba(255,255,255,0.14);

  --accent-grad:  linear-gradient(135deg, #4A86FF, #2F5FE0);

  /* Layout */
  --maxw: 1180px;
  --pad: 48px;

  /* Type */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Cinematic background layers (fixed, site-wide) ---------- */
.bg-layers { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* 1 · Environment photo — the bioluminescent shore. Gradient layers sit
   behind the image as a graceful fallback if the photo is unavailable. */
.bg-env {
  position: absolute; inset: 0;
  background-color: #070a12;
  background-image:
    url("/assets/img/beach-view-sky.jpg"),
    radial-gradient(120% 80% at 50% 8%,  rgba(74,134,255,0.16), transparent 55%),
    radial-gradient(140% 60% at 50% 108%, rgba(217,184,119,0.10), transparent 60%),
    linear-gradient(180deg, #0a1428 0%, #0a1120 42%, #070a12 100%);
  background-size: cover, cover, cover, cover;
  background-position: center top, center, center, center;
  background-repeat: no-repeat;
}

/* 2 · Depth gradient — darken top & bottom, let scene show mid */
.bg-depth {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(7,10,18,0.92) 0%,
    rgba(7,10,18,0.55) 30%,
    rgba(7,10,18,0.55) 68%,
    rgba(7,10,18,0.96) 100%);
}
/* On phones the full photo shows, so darken the mid-section for text contrast */
@media (max-width: 760px){
  .bg-depth {
    background: linear-gradient(180deg,
      rgba(7,10,18,0.96) 0%,
      rgba(7,10,18,0.80) 28%,
      rgba(7,10,18,0.82) 70%,
      rgba(7,10,18,0.98) 100%);
  }
}

/* 3 · three.js particle canvas */
#cinematic-canvas {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  display: block;
}

/* ---------- Layout primitives ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { position: relative; }
.section-pad { padding: 96px 0; }
@media (max-width: 720px){ .section-pad{ padding: 64px 0; } :root{ --pad: 24px; } }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--accent-light);
  margin: 0 0 18px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.4px; margin: 0; }
h1 { font-size: clamp(40px, 6vw, 76px); }
h2 { font-size: clamp(30px, 4vw, 46px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); }

h1 em, h2 em { font-style: italic; }
p { margin: 0 0 18px; }
.lead { font-size: clamp(17px, 1.7vw, 21px); color: var(--muted); font-weight: 300; }

.affirmation { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.35; }

/* Legibility: a soft dark halo so light text pops over the photo background.
   Harmless on text that sits inside the translucent cards. */
h1, h2, h3, .eyebrow, .lead, .affirmation, .prose, .backlink { text-shadow: 0 2px 16px rgba(0,0,0,0.55); }
.page-hero .lead, .hero .lead { text-shadow: 0 2px 20px rgba(0,0,0,0.7); }

/* Shimmering emphasis word (hero) */
.shimmer {
  font-style: italic;
  background: linear-gradient(100deg, #7aa8ff 0%, #ffffff 45%, #7aa8ff 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%,100%{ background-position: 180% 0; } 50%{ background-position: -40% 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 15px 30px; border-radius: 100px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s, border-color .35s, background .35s;
}
.btn-primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 10px 40px rgba(60,120,255,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 52px rgba(60,120,255,0.5); }
.btn-secondary {
  background: transparent; color: var(--accent-light);
  border-color: rgba(74,134,255,0.45);
}
.btn-secondary:hover { border-color: var(--accent-light); color: #fff; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Cards / panels ---------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(22,32,58,.66), rgba(12,18,34,.44));
  border: 1px solid var(--hairline);
  border-radius: 22px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  padding: 32px;
  transition: transform .4s cubic-bezier(.2,.7,.3,1), border-color .4s, box-shadow .4s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(74,134,255,0.5); box-shadow: 0 20px 50px rgba(0,0,0,0.35); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--pad);
  background: linear-gradient(180deg, rgba(7,10,18,0.85), rgba(7,10,18,0));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .4s, padding .4s;
}
.nav.scrolled { background: rgba(7,10,18,0.82); padding: 14px var(--pad); border-bottom: 1px solid var(--hairline); }
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.nav-brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 22px rgba(74,134,255,0.5); }
.nav-brand span { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: -0.2px; }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: .3px; transition: color .3s; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }
.nav-toggle svg { display: block; }

@media (max-width: 860px){
  .nav { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav .btn { padding: 10px 18px; font-size: 13px; }
  .nav-brand span { font-size: 17px; }
  /* Links become a full-width dropdown below the bar */
  .nav-links {
    display: none;
    order: 3; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    margin: 14px calc(-1 * var(--pad)) calc(-1 * var(--pad));
    padding: 6px 0;
    background: rgba(7,10,18,0.98);
    border-top: 1px solid var(--hairline);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 15px var(--pad); font-size: 15px; }
  .nav-links a.active { background: rgba(74,134,255,0.08); }
}
@media (max-width: 480px){
  /* Keep the wordmark next to the icon; shrink + tighten so it fits */
  .nav-brand { gap: 9px; }
  .nav-brand span { font-size: 15px; }
  .nav-cta { gap: 10px; }
  .nav .btn { padding: 8px 14px; font-size: 12px; }
}
@media (max-width: 340px){
  .nav-brand span { display: none; }   /* only hide on very narrow screens */
}

/* ---------- Responsive grid fixes (override inline grid-template) ---------- */
@media (max-width: 760px){
  .pillars { grid-template-columns: 1fr !important; }
  .tile-grid { grid-template-columns: 1fr 1fr !important; gap: 14px !important; }
}
@media (max-width: 440px){
  .tile-grid { grid-template-columns: 1fr !important; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--hairline); margin-top: 40px; padding: 56px 0 40px; position: relative; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-brand span { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.footer h4 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--faint); margin: 0 0 14px; }
.footer a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 10px; transition: color .3s; }
.footer a:hover { color: #fff; }
.footer-legal { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
@media (max-width: 720px){ .footer-grid{ grid-template-columns: 1fr; gap: 28px; } .footer-legal{ flex-direction: column; gap: 10px; } }

/* ---------- Reveal-on-scroll (progressive enhancement) ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.2,.7,.3,1), transform 1s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.js-off .reveal { opacity: 1; transform: none; }   /* never gate content on JS */

@media (prefers-reduced-motion: reduce){
  .reveal { opacity: 1; transform: none; transition: none; }
  .shimmer { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Category tile ---------- */
.tile {
  position: relative; display: block; overflow: hidden;
  border-radius: 20px; text-decoration: none; color: #fff;
  aspect-ratio: 3 / 3.4; border: 1px solid var(--hairline);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.1s cubic-bezier(.2,.7,.3,1); }
.tile:hover img { transform: scale(1.09); }
.tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,10,18,0.1) 0%, rgba(7,10,18,0.35) 45%, rgba(7,10,18,0.92) 100%),
              radial-gradient(90% 40% at 50% 118%, rgba(74,134,255,0.35), transparent 70%);
}
.tile-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px; z-index: 2; }
.tile-body h3 { font-size: 24px; margin: 0 0 6px; }
.tile-body .view { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-light); font-weight: 600; }
