/* =========================================================
   Coastline Home Media
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Palette (unchanged) */
  --ink: #0F2233;
  --ink-2: #1A3548;
  --tide: #1F6F8B;
  --tide-2: #2A8AAC;
  --tide-deep: #1A5E76;
  --foam: #FFFFFF;
  --shore: #F2F5F4;
  --sand: #E6EBE9;
  --stone: #5A6873;
  --stone-2: #8A969E;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale — wider display-to-body contrast */
  --t-micro: 0.8125rem;                                  /* 13 */
  --t-sm:    0.9375rem;                                  /* 15 */
  --t-base:  1.0625rem;                                  /* 17 */
  --t-lg:    clamp(1.1875rem, 1.11rem + 0.38vw, 1.4375rem);
  --t-xl:    clamp(1.5rem, 1.31rem + 0.94vw, 2.125rem);
  --t-2xl:   clamp(2rem, 1.55rem + 2.1vw, 3.25rem);
  --t-hero:  clamp(2.5rem, 1.85rem + 3.2vw, 4.5rem);

  /* Spacing (8px grid) */
  --s-1: 0.5rem;  --s-2: 1rem;   --s-3: 1.5rem; --s-4: 2rem;
  --s-5: 3rem;    --s-6: 4rem;   --s-7: 6rem;   --s-8: 8rem;
  --section: clamp(4.5rem, 8vw, 7.5rem);   /* 72 → 120 */

  --wrap: 70rem;   /* 1120px */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 4.5rem;
  --radius: 6px;
  --radius-lg: 16px;
  --line: 1px solid var(--sand);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.62;
  color: var(--ink);
  background: var(--foam);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}
::selection { background: var(--tide-2); color: var(--foam); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.14; letter-spacing: -0.025em; }
h1 { font-size: var(--t-hero); font-weight: 800; line-height: 0.99; letter-spacing: -0.04em; }
h2 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.06; letter-spacing: -0.035em; }
h3 { font-size: var(--t-xl); letter-spacing: -0.028em; }
p  { margin: 0; }
p + p { margin-top: var(--s-2); }
a { color: var(--tide); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--tide-2); outline-offset: 3px; border-radius: 3px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }

.lead { font-size: var(--t-lg); line-height: 1.5; letter-spacing: -0.015em; }

.skip {
  position: absolute; left: -999px; top: 0; padding: var(--s-1) var(--s-2);
  background: var(--ink); color: var(--foam); z-index: 100;
}
.skip:focus { left: var(--s-2); top: var(--s-2); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section.shore { background: var(--shore); }

/* Editorial two-column section header */
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-6);
  align-items: end; padding-bottom: var(--s-4); margin-bottom: var(--s-6);
  border-bottom: var(--line);
}
.section-head h2 { max-width: 15ch; }
.section-head p { color: var(--stone); font-size: var(--t-lg); line-height: 1.5; max-width: 44ch; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(20px); }
.js .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.js .reveal[data-delay="1"].is-in { transition-delay: 0.08s; }
.js .reveal[data-delay="2"].is-in { transition-delay: 0.16s; }
.js .reveal[data-delay="3"].is-in { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(15, 34, 51, 0.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--foam);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.site-header.is-stuck {
  background: rgba(15, 34, 51, 0.97);
  border-bottom-color: rgba(255,255,255,0.12);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; height: var(--header-h);
}
.logo { display: inline-flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo svg { width: 1.875rem; height: 1.875rem; flex: none; }
.logo .wordmark { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: var(--s-4); }
.nav a { position: relative; color: rgba(255,255,255,0.78); font-weight: 600; font-size: var(--t-sm); letter-spacing: -0.01em; }
.nav a:hover { color: var(--foam); text-decoration: none; }
.nav a[data-spy]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.4rem; height: 1.5px;
  background: var(--tide-2); transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a[data-spy].is-active { color: var(--foam); }
.nav a[data-spy].is-active::after { transform: scaleX(1); }
.nav .btn { color: var(--foam); }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--foam);
  width: 2.75rem; height: 2.75rem; margin-right: -0.6rem;
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle .bars { display: block; width: 1.375rem; height: 0.75rem; position: relative; }
.nav-toggle .bars i {
  position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform 0.32s var(--ease), opacity 0.2s ease;
}
.nav-toggle .bars i:first-child { top: 0; }
.nav-toggle .bars i:last-child  { bottom: 0; }
.nav-toggle[aria-expanded="true"] .bars i:first-child { transform: translateY(0.375rem) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars i:last-child  { transform: translateY(-0.375rem) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0 1.5rem; border-radius: var(--radius);
  font-weight: 700; font-size: var(--t-sm); line-height: 1; letter-spacing: -0.01em;
  text-decoration: none; border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
/* Hover darkens rather than lightens: keeps the white label at 7.22:1 (AA). */
.btn-primary { background: var(--tide); color: var(--foam); border-color: var(--tide); }
.btn-primary:hover { background: var(--tide-deep); border-color: var(--tide-deep); }
.btn-ink { background: var(--ink); color: var(--foam); border-color: var(--ink); }
.btn-ink:hover { background: var(--ink-2); border-color: var(--ink-2); }

.ghost-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: rgba(255,255,255,0.86); font-weight: 600; font-size: var(--t-sm);
  padding-bottom: 0.2rem; border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.ghost-link:hover { color: var(--foam); border-bottom-color: var(--foam); text-decoration: none; }

/* ---------- Video frame (9:16) ---------- */
.frame {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 50% 32%, rgba(42,138,172,0.26), rgba(42,138,172,0) 64%),
    linear-gradient(168deg, #22415A 0%, var(--ink) 76%);
  border: 1px solid rgba(255,255,255,0.13);
  display: grid; place-items: center;
  box-shadow: 0 24px 60px -28px rgba(15,34,51,0.55);
}
.frame .sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 34%, rgba(255,255,255,0.085) 47%, transparent 60%);
  transform: translateX(-65%);
}
.hero .frame .sheen { animation: sheen 7s ease-in-out infinite; }
@keyframes sheen { 0%, 55% { transform: translateX(-65%); } 100% { transform: translateX(65%); } }
@media (prefers-reduced-motion: reduce) { .hero .frame .sheen { animation: none; } }

.frame .play {
  width: 3.5rem; height: 3.5rem; border-radius: 999px; display: grid; place-items: center;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.34);
  color: var(--foam); backdrop-filter: blur(3px);
  transition: transform 0.45s var(--ease), background-color 0.3s ease;
}
.frame .play svg { width: 1.5rem; height: 1.5rem; margin-left: 2px; }
.frame figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--s-5) var(--s-3) var(--s-3);
  font-size: var(--t-micro); font-weight: 700; letter-spacing: 0.005em;
  color: rgba(255,255,255,0.88);
  background: linear-gradient(to top, rgba(9,22,34,0.94) 28%, rgba(9,22,34,0));
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--ink); color: var(--foam);
  padding: clamp(3.5rem, 6vw, 6rem) 0 clamp(3.5rem, 6vw, 6rem);
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60rem 34rem at 78% 8%, rgba(42,138,172,0.20), transparent 62%),
    radial-gradient(46rem 30rem at 6% 96%, rgba(31,111,139,0.16), transparent 66%);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center;
}
.hero h1 { max-width: 18ch; text-wrap: balance; }
.hero .lead { margin-top: var(--s-4); max-width: 46ch; color: rgba(255,255,255,0.76); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-top: var(--s-5); }
.hero-media { width: 15.5rem; }

/* ---------- Proof strip ---------- */
.proof { background: #0B1B29; color: rgba(255,255,255,0.78); border-top: 1px solid rgba(255,255,255,0.08); }
.proof ul { display: flex; flex-wrap: wrap; align-items: center; }
.proof li {
  font-size: var(--t-sm); font-weight: 600; letter-spacing: -0.005em;
  padding: var(--s-3) 0;
}
.proof li:not(:last-child)::after {
  content: ""; display: inline-block; vertical-align: middle;
  width: 4px; height: 4px; border-radius: 999px; background: var(--tide-2);
  margin: 0 clamp(0.9rem, 2.2vw, 1.75rem); opacity: 0.85;
}

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-6) var(--s-5); }
.services article { border-top: 2px solid var(--ink); padding-top: var(--s-3); }
.services h3 { margin-bottom: var(--s-2); }
.services p { color: var(--stone); font-size: var(--t-sm); line-height: 1.72; }

/* ---------- Work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.75rem, 1.6vw, 1.5rem); }
.work-grid .tile { transition: transform 0.55s var(--ease), box-shadow 0.55s var(--ease); }
.work-grid li:hover .tile { transform: translateY(-7px); box-shadow: 0 30px 60px -28px rgba(15,34,51,0.6); }
.work-grid li:hover .play { transform: scale(1.09); background: rgba(255,255,255,0.17); }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5) var(--s-4); }
.steps li { position: relative; padding-top: 3.5rem; }
.steps li::before {
  content: ""; position: absolute; top: 1.125rem; left: 3rem; right: 0; height: 1px; background: var(--sand);
}
.steps .num {
  position: absolute; top: 0; left: 0; width: 2.25rem; height: 2.25rem; border-radius: 999px;
  background: var(--ink); color: var(--foam); display: grid; place-items: center;
  font-size: var(--t-sm); font-weight: 800; letter-spacing: 0;
}
.steps h3 { font-size: var(--t-lg); margin-bottom: var(--s-1); }
.steps p { color: var(--stone); font-size: var(--t-sm); line-height: 1.7; }

/* ---------- How we run ---------- */
.rules { max-width: 52rem; border-top: var(--line); }
.rules li {
  position: relative; padding: var(--s-3) 0 var(--s-3) 2.5rem;
  border-bottom: var(--line); font-size: var(--t-base); font-weight: 500; line-height: 1.55;
}
.rules li::before {
  content: ""; position: absolute; left: 0.4rem; top: 1.6rem;
  width: 0.45rem; height: 0.85rem; border: solid var(--tide);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------- Verticals ---------- */
.verticals { display: flex; flex-wrap: wrap; align-items: baseline; }
.verticals li { font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.025em; padding: 0.3rem 0; }
.verticals li:not(:last-child)::after {
  content: "·"; color: var(--tide-2); font-weight: 400; margin: 0 clamp(0.65rem, 1.4vw, 1.1rem);
}

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--foam); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.12fr; gap: var(--s-6); align-items: start; }
.contact h2 { max-width: 12ch; }
.contact-body { margin-top: var(--s-3); color: rgba(255,255,255,0.76); font-size: var(--t-lg); line-height: 1.5; max-width: 40ch; }
.contact-email {
  display: inline-block; color: var(--foam); font-weight: 800;
  font-size: clamp(1.0625rem, 0.88rem + 0.82vw, 1.5625rem); letter-spacing: -0.035em;
  line-height: 1.15; overflow-wrap: anywhere;
  padding-bottom: 0.4rem; border-bottom: 2px solid rgba(42,138,172,0.85);
  transition: border-color 0.25s ease;
}
.contact-email:hover { text-decoration: none; border-bottom-color: var(--foam); }
.contact-org { margin-top: var(--s-4); color: rgba(255,255,255,0.68); font-size: var(--t-sm); line-height: 1.75; }

/* ---------- Footer ---------- */
.site-footer { background: var(--shore); border-top: var(--line); padding: var(--s-5) 0 var(--s-4); color: var(--stone); font-size: var(--t-sm); }
.site-footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); align-items: center; }
.site-footer .logo { color: var(--ink); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: var(--s-4); }
.site-footer .links a { color: var(--stone); font-weight: 600; }
.site-footer .links a:hover { color: var(--ink); }
.foot-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5);
  margin-top: var(--s-4); padding-top: var(--s-3); border-top: var(--line);
}
.site-footer .copy { font-size: var(--t-micro); color: var(--stone); }
/* --stone = 5.23:1 on --shore. --stone-2 was 2.76:1 and failed AA. */
.site-footer .fine { font-size: var(--t-micro); color: var(--stone); max-width: 62ch; }

/* ---------- Legal pages ---------- */
.legal { padding: var(--section) 0; }
.legal .wrap { max-width: 46rem; }
.legal .eyebrow { color: var(--stone); font-size: var(--t-sm); margin-bottom: var(--s-2); }
.legal h1 { font-size: var(--t-2xl); letter-spacing: -0.035em; line-height: 1.08; }
.legal .updated { color: var(--stone); font-size: var(--t-sm); margin: var(--s-2) 0 var(--s-5); padding-bottom: var(--s-4); border-bottom: var(--line); }
.legal h2 { font-size: var(--t-xl); font-weight: 700; margin: var(--s-5) 0 var(--s-2); }
.legal h3 { font-size: var(--t-base); font-weight: 700; margin: var(--s-4) 0 var(--s-1); letter-spacing: -0.015em; }
.legal p, .legal li { line-height: 1.75; }
.legal ul { list-style: disc; padding-left: 1.25rem; margin: var(--s-2) 0; }
.legal li + li { margin-top: 0.5rem; }
.legal .toc { background: var(--shore); border-radius: var(--radius); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.legal .toc ol { margin: 0; padding-left: 1.25rem; columns: 2; column-gap: var(--s-4); list-style: decimal; }
.legal .toc li { font-size: var(--t-sm); line-height: 1.9; break-inside: avoid; }
.legal .toc a { color: var(--ink); }

/* ---------- Error page ---------- */
.errpage { padding: var(--s-8) 0; }
.errpage h1 { font-size: var(--t-2xl); }
.errpage p { margin-top: var(--s-2); color: var(--stone); font-size: var(--t-lg); }
.errpage .btn { margin-top: var(--s-5); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .services { grid-template-columns: 1fr; gap: var(--s-5); }
  .services article { max-width: 60ch; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
  .section-head h2 { max-width: 20ch; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-5); align-items: start; }
  .hero-media { width: 100%; max-width: 13rem; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .contact h2 { max-width: 20ch; }
}

@media (max-width: 720px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; gap: var(--s-4); }
  .steps li { padding-top: 0; padding-left: 3.25rem; min-height: 2.25rem; }
  .steps li::before { display: none; }
  .verticals li { font-size: var(--t-base); }
  .proof ul { display: grid; gap: 0; }
  .proof li { padding: 0.55rem 0; }
  .proof li:not(:last-child)::after { display: none; }
  .proof li + li { border-top: 1px solid rgba(255,255,255,0.07); }

  .hero-actions { gap: var(--s-3); }
  .hero-cta { display: flex; width: 100%; }
  .hero-media { margin: 0 auto; }
  .legal .toc ol { columns: 1; }

  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(15,34,51,0.99);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: var(--s-2) var(--gutter) var(--s-3);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.9rem 0; font-size: var(--t-base); border-bottom: 1px solid rgba(255,255,255,0.08); }
  .nav a[data-spy]::after { display: none; }
  .nav a:last-of-type { border-bottom: 0; }
  .nav .btn { margin-top: var(--s-2); justify-content: center; }
}

@media print {
  .site-header, .site-footer .links, .btn, .hero-bg { display: none !important; }
  body { color: #000; background: #fff; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
