/* ============================================
   NARWHAL MEDIA — "Sunlit Arctic" redesign
   Light, glacial, luminous. three.js + GSAP.
   ============================================ */

:root {
  --ice: #EFF8FA;          /* page base */
  --foam: #FFFFFF;
  --glacial: #CBEBF1;      /* pale aqua */
  --aqua: #64C7D8;
  --sea: #1E90A8;          /* mid teal */
  --ink: #0B2E3C;          /* deep sea ink — text */
  --ink-soft: #3E6272;
  --coral: #EF4244;        /* logo red, kept as accent */

  --font-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'Space Mono', monospace;

  --pad: clamp(24px, 6vw, 96px);
}

* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; }

body {
  background: linear-gradient(180deg, #F4FBFD 0%, #DFF2F6 30%, #BFE6EE 70%, #9FD9E6 100%);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Fixed WebGL scene ---------- */

#ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* faint surface glow over the scene (plain alpha — blend modes are
   too expensive to composite full-screen on low-end GPUs) */
.water-tint {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(ellipse 60% 35% at 80% 0%, rgba(255,255,255,0.28), transparent 65%);
}

main, .footer, .nav { position: relative; z-index: 2; }

/* ---------- Type helpers ---------- */

.hero-kicker {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.section-title {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  text-transform: uppercase;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}

.nav.is-scrolled {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(11,46,60,0.08);
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 18px;
}
.nav-brand img { height: 38px; width: auto; }
.nav-brand em { font-style: normal; color: var(--coral); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a { position: relative; padding: 4px 0; }
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s cubic-bezier(.7,0,.3,1);
}
.nav-links a:not(.nav-cta):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links a.nav-cta {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 9px 32px;
  background: var(--ink);
  color: var(--ice);
  transition: background .25s ease, color .25s ease;
}
.nav-cta:hover { background: var(--coral); border-color: var(--coral); color: #fff; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  position: relative;
}

.hero-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.92;
  font-size: clamp(3.4rem, 13.5vw, 12.5rem);
  user-select: none;
}

.hero-title .line { display: block; overflow: hidden; }
.hero-title .line.accent { color: var(--coral); }
.hero-title .line-mid {
  font-size: 0.42em;
  line-height: 1.15;
  padding-left: 0.08em;
}

/* split chars */
.char {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

.reveal-line { overflow: hidden; }
.reveal-line span { display: inline-block; transform: translateY(120%); }

.hero-lede {
  margin-top: 34px;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 44ch;
  opacity: 0;
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: var(--pad);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
}
.scroll-cue-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-cue-line {
  width: 60px; height: 2px;
  background: var(--ink);
  transform-origin: left;
  animation: cue 2.2s cubic-bezier(.7,0,.3,1) infinite;
}
@keyframes cue {
  0%   { transform: scaleX(0); transform-origin: left; }
  45%  { transform: scaleX(1); transform-origin: left; }
  55%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

.depth-meter {
  position: absolute;
  bottom: 40px;
  right: var(--pad);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  opacity: 0;
}
.depth-value { font-size: 26px; color: var(--ink); font-weight: 700; }
.depth-unit { margin-left: 3px; }

/* ---------- Panels (frosted content plates) ---------- */

.panel {
  margin: 14vh var(--pad);
  padding: clamp(40px, 6vw, 90px);
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 28px;
  box-shadow: 0 30px 80px -30px rgba(11,46,60,0.25);
}

/* ---------- Manifesto ---------- */

.manifesto-line {
  font-size: clamp(1.5rem, 3.4vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 26ch;
}
.manifesto-line .mword { opacity: 0.18; display: inline-block; }

.ninety {
  display: flex;
  align-items: baseline;
  gap: clamp(20px, 4vw, 48px);
  margin-top: clamp(48px, 7vw, 90px);
  flex-wrap: wrap;
}
.ninety-num {
  font-size: clamp(6rem, 16vw, 15rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.85;
  color: var(--sea);
}
.ninety-pct { font-size: 0.4em; color: var(--coral); }
.ninety-caption {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 34ch;
}

/* ---------- Horizontal rail ---------- */

.rail-section { position: relative; }

.rail-pin {
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  gap: clamp(28px, 4vh, 56px);
}

.rail-head { padding: 0 var(--pad); }

.rail-track {
  display: flex;
  gap: clamp(18px, 2.5vw, 32px);
  padding: 0 var(--pad);
  width: max-content;
  will-change: transform;
}

.card {
  width: clamp(280px, 30vw, 420px);
  flex: 0 0 auto;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 22px;
  padding: clamp(24px, 2.6vw, 40px);
  box-shadow: 0 24px 60px -28px rgba(11,46,60,0.28);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 80px -30px rgba(11,46,60,0.35);
}

.card h3 {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--coral);
  font-size: clamp(1.8rem, 2.4vw, 2.3rem);
  letter-spacing: 0;
  margin-bottom: 12px;
}
.card p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Work list ---------- */

.work-list { margin-top: clamp(28px, 4vw, 52px); border-top: 1px solid rgba(11,46,60,0.15); }

.work-row {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  align-items: baseline;
  gap: 18px 48px;
  padding: clamp(20px, 2.6vw, 34px) 8px;
  border-bottom: 1px solid rgba(11,46,60,0.15);
  position: relative;
  transition: padding-left .35s cubic-bezier(.2,.8,.2,1);
}
.work-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(100,199,216,0.25), transparent);
  transition: width .4s cubic-bezier(.2,.8,.2,1);
  z-index: -1;
}
.work-row:hover { padding-left: 26px; }
.work-row:hover::before { width: 100%; }

.work-cat {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  color: var(--coral);
}
.work-name {
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.work-arrow {
  font-size: 1.5rem;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.work-row:hover .work-arrow { transform: translateX(10px); color: var(--coral); }

/* ---------- Quote ---------- */

.quote-section {
  min-height: 55svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12vh var(--pad) 4vh;
}

.big-quote {
  font-size: clamp(1.9rem, 5.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 24ch;
}
.big-quote .qword { opacity: 0.16; display: inline-block; transition: opacity .1s linear; }

.quote-link {
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea);
}
.quote-link:hover { color: var(--coral); }

/* ---------- Contact ---------- */

.contact {
  min-height: 95svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4vh var(--pad) 18vh;
}

.contact-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(3rem, 10.5vw, 9.5rem);
}
.contact-title .line { display: block; overflow: hidden; }

.contact-lede {
  margin-top: 30px;
  color: var(--ink-soft);
  max-width: 52ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 46px;
  flex-wrap: wrap;
}

.btn-magnetic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--ice);
  border-radius: 999px;
  padding: 22px 52px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  transition: background .3s ease;
  will-change: transform;
}
.btn-magnetic:hover { background: var(--coral); }
.btn-magnetic span { display: inline-block; will-change: transform; }

.link-plain {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--aqua);
  padding-bottom: 3px;
}
.link-plain:hover { border-color: var(--coral); color: var(--coral); }

/* ---------- Footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px var(--pad);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-top: 1px solid rgba(11,46,60,0.12);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- Scroll reveal defaults ---------- */

.section-title, .manifesto-line, .ninety, .work-row, .quote-link, .contact-lede, .contact-actions {
  /* animated in via GSAP; keep visible if JS fails */
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .work-row { grid-template-columns: 1fr auto; }
  .work-cat { display: none; }
  .panel { margin-left: 16px; margin-right: 16px; }
  .depth-meter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .char, .reveal-line span { transform: none !important; }
  .hero-lede, .scroll-cue, .depth-meter { opacity: 1 !important; }
  .scroll-cue-line { animation: none; }
}

/* ---------- Sub-pages ---------- */

.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.page-hero {
  min-height: 46svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 150px var(--pad) 24px;
}

.page-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-size: clamp(2.6rem, 8.5vw, 6.5rem);
}
.page-title .line { display: block; overflow: hidden; }
.page-title .line.accent { color: var(--coral); }

.page-lede {
  margin-top: 22px;
  color: var(--ink-soft);
  max-width: 56ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.page-main > .panel { margin: 6vh var(--pad); }

.panel-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--coral);
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  margin-bottom: 16px;
}

.panel-heading {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 18px;
}

.panel-cat, .panel p.panel-cat {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--coral);
  font-size: clamp(1.3rem, 1.8vw, 1.6rem);
  margin: 0 0 6px;
}

.panel .lede {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  max-width: 62ch;
  margin-bottom: 1em;
}
.panel p { color: var(--ink-soft); max-width: 68ch; margin: 0 0 1.1em; }
.panel p:last-child { margin-bottom: 0; }
.panel p a { color: var(--sea); border-bottom: 1px solid var(--aqua); }
.panel p a:hover { color: var(--coral); border-color: var(--coral); }

.case-label, .panel p.case-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sea);
  margin: 26px 0 6px;
}

.pov-pull, .panel p.pov-pull {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--coral);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.25;
  margin: 0 0 18px;
  max-width: 32ch;
}

.page-cta {
  padding: 8vh var(--pad) 16vh;
}
.page-cta-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-size: clamp(2.2rem, 6.5vw, 4.8rem);
  margin-bottom: 22px;
}
.page-cta .page-lede { margin: 0 0 34px; }
.page-cta-actions {
  display: flex;
  align-items: center;
  gap: 34px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a:hover { color: var(--coral); }
