/* nowill-tempest — built for weather. Everything moves, always:
   high-motion ping-pong loops + breathing plates + drifting mist banks + storm scroll. */

:root {
  --bg: #060809;
  --ink: #edf4f4;
  --ink-dim: rgba(237, 244, 244, 0.64);
  --teal: #0fb5ba;
  --teal-bright: #3fded4;
  --teal-glow: rgba(15, 181, 186, 0.38);
  --hair: rgba(237, 244, 244, 0.18);
  --display: 'Syne', -apple-system, sans-serif;
  --body: -apple-system, 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(1.25rem, 4vw, 4.5rem);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--teal); color: #02282b; }
:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 70;
  padding: 0.7em 1.2em; background: var(--teal); color: #02282b;
  font-family: var(--display); font-weight: 700; font-size: 0.9rem; text-decoration: none;
  border-radius: 0 0 10px 10px; transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */

.head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.9rem, 2vw, 1.3rem) var(--pad);
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 1rem; letter-spacing: 0.01em;
}
.head-cta {
  font-family: var(--display); font-weight: 700; font-size: 0.82rem;
  color: var(--ink); text-decoration: none;
  padding: 0.6em 1.4em; border: 1px solid var(--hair); border-radius: 999px;
  backdrop-filter: blur(10px); background: rgba(6, 8, 9, 0.25);
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.head-cta:hover { border-color: var(--teal); color: var(--teal-bright); box-shadow: 0 0 24px var(--teal-glow); }

/* ---------- Sections ---------- */

.sect { position: relative; height: 220vh; }
.pinbox {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden;
  display: grid; align-items: end;
}

/* The sky: video plate that ALSO breathes on its own (idle Ken Burns),
   so there is motion even before playback and on top of it. */
.sky {
  position: absolute; inset: -4%;              /* bleed for the breathe */
  z-index: 1; will-change: transform, filter;
  animation: breathe 16s ease-in-out infinite alternate;
}
.sect:nth-child(even) .sky { animation-duration: 19s; animation-delay: -8s; }
@keyframes breathe {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.055) translateY(-1.2%); }
}
.sky video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: var(--focus-x, 50%) center;
  opacity: 0; transition: opacity 0.9s ease;
}
.sky video.is-live { opacity: 1; }
.sky::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--poster);
  background-size: cover; background-position: var(--focus-x, 50%) center;
}

.storm-veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,8,9,0.5) 0%, rgba(6,8,9,0.04) 30%,
                    rgba(6,8,9,0.04) 55%, rgba(6,8,9,0.7) 100%);
}
.pinbox:has(.body-center) .storm-veil {
  background:
    radial-gradient(ellipse 70% 55% at 50% 60%, rgba(6,8,9,0.5), rgba(6,8,9,0) 72%),
    linear-gradient(180deg, rgba(6,8,9,0.42), rgba(6,8,9,0.04) 30%, rgba(6,8,9,0.6) 100%);
}

/* ---------- Copy ---------- */

.body {
  position: relative; z-index: 3;
  padding: 0 var(--pad) clamp(3.4rem, 9vh, 6.5rem);
  max-width: 76rem; width: 100%;
}
.body-center { justify-self: center; text-align: center; max-width: 52rem; }
#front .body-center { align-self: center; padding-bottom: 0; }

.tag {
  font-family: var(--display); font-weight: 700;
  font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--teal-bright);
  margin-bottom: 1.2rem;
  text-shadow: 0 0 22px var(--teal-glow);
}
.storm-line {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  line-height: 0.99; letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 3px 36px rgba(3, 5, 6, 0.85);
}
.under {
  margin-top: 1.4rem;
  font-size: clamp(0.98rem, 1.3vw, 1.14rem);
  color: var(--ink-dim); line-height: 1.7; max-width: 46ch;
  text-shadow: 0 1px 18px rgba(3, 5, 6, 0.9);
}
.body-center .under { margin-inline: auto; }

.acts { display: flex; gap: 1rem; margin-top: 2.3rem; flex-wrap: wrap; }
.acts-center, .body-center .acts { justify-content: center; }
.btn-fill, .btn-edge {
  font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  text-decoration: none; border-radius: 999px; padding: 0.9em 2em;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.35s, color 0.35s, border-color 0.35s;
}
.btn-fill { background: var(--teal); color: #02282b; }
.btn-fill:hover { background: var(--teal-bright); transform: translateY(-2px); box-shadow: 0 10px 36px var(--teal-glow); }
.btn-edge { color: var(--ink); border: 1px solid var(--hair); }
.btn-edge:hover { border-color: var(--teal); color: var(--teal-bright); transform: translateY(-2px); }

/* ---------- Pillars ---------- */

.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  margin-top: 2.8rem; max-width: 62rem;
}
.pillar {
  padding: 1.6rem 1.5rem 1.8rem;
  background: rgba(8, 11, 12, 0.42);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hair); border-radius: 14px;
  transition: transform 0.45s var(--ease), border-color 0.45s, box-shadow 0.45s;
}
.pillar:hover { transform: translateY(-5px); border-color: rgba(63, 222, 212, 0.45); box-shadow: 0 14px 40px rgba(3, 5, 6, 0.5); }
.pillar h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.02rem;
  margin-bottom: 0.55rem;
}
.pillar h3::before {
  content: ''; display: block; width: 1.8rem; height: 3px; border-radius: 2px;
  background: var(--teal); margin-bottom: 0.9rem;
  box-shadow: 0 0 12px var(--teal-glow);
}
.pillar p { font-size: 0.9rem; color: var(--ink-dim); }

/* ---------- Services current ---------- */

.current-list {
  list-style: none; margin-top: 2.8rem;
  display: grid; grid-template-columns: repeat(2, minmax(0, 21rem)); gap: 0 2.6rem;
}
.current-list li {
  padding: 0.78rem 0.3rem;
  border-bottom: 1px solid var(--hair);
  font-family: var(--display); font-weight: 700;
  font-size: clamp(0.92rem, 1.3vw, 1.05rem); letter-spacing: 0.01em;
  transition: color 0.3s, padding-left 0.3s, text-shadow 0.3s;
}
.current-list li:hover { color: var(--teal-bright); padding-left: 0.7rem; text-shadow: 0 0 18px var(--teal-glow); }

/* ---------- Scroll cue ---------- */

.cue {
  position: absolute; bottom: 2.2rem; left: 50%; z-index: 3;
  transform: translateX(-50%);
  width: 1px; height: 56px;
  background: rgba(237, 244, 244, 0.18); overflow: hidden;
}
.cue span {
  position: absolute; top: -40%; left: 0; width: 100%; height: 40%;
  background: var(--teal-bright);
  animation: cue 2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes cue { 0% { top: -40%; } 60%, 100% { top: 110%; } }

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

.foot {
  position: relative; z-index: 3;
  padding: 2.8rem var(--pad);
  text-align: center;
  font-size: 0.78rem; color: var(--ink-dim);
}

/* ---------- Weather layer: mist banks that never stop drifting ---------- */

.mist {
  position: fixed; z-index: 19; pointer-events: none;
  width: 140vw; height: 60vh; left: -20vw;
  filter: blur(50px);
  opacity: 0.5;
  will-change: transform;
}
.mist-a {
  top: -12vh;
  background: radial-gradient(ellipse 45% 65% at 30% 50%, rgba(120, 150, 155, 0.10), rgba(0,0,0,0) 70%),
              radial-gradient(ellipse 35% 55% at 75% 40%, rgba(90, 120, 128, 0.08), rgba(0,0,0,0) 70%);
  animation: drift-a 38s linear infinite;
}
.mist-b {
  bottom: -18vh;
  background: radial-gradient(ellipse 40% 60% at 60% 55%, rgba(100, 135, 140, 0.09), rgba(0,0,0,0) 70%),
              radial-gradient(ellipse 30% 50% at 20% 45%, rgba(15, 181, 186, 0.05), rgba(0,0,0,0) 70%);
  animation: drift-b 47s linear infinite;
}
@keyframes drift-a {
  0% { transform: translateX(-6%); } 50% { transform: translateX(6%); } 100% { transform: translateX(-6%); }
}
@keyframes drift-b {
  0% { transform: translateX(5%); } 50% { transform: translateX(-5%); } 100% { transform: translateX(5%); }
}

/* ---------- Family glue ---------- */

.grade {
  position: fixed; inset: 0; z-index: 20; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, rgba(0,0,0,0) 55%, rgba(2, 4, 5, 0.55) 100%),
    linear-gradient(165deg, rgba(15, 181, 186, 0.045), rgba(6, 8, 9, 0) 45%, rgba(8, 22, 26, 0.12) 100%);
}
.grain {
  position: fixed; inset: -100px; z-index: 21; pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.66s steps(8) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); } 12.5% { transform: translate(-28px, 16px); }
  25% { transform: translate(14px, -30px); } 37.5% { transform: translate(-34px, -8px); }
  50% { transform: translate(22px, 26px); } 62.5% { transform: translate(-12px, 34px); }
  75% { transform: translate(30px, -18px); } 87.5% { transform: translate(-20px, -26px); }
  100% { transform: translate(0, 0); }
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  .pillars { grid-template-columns: 1fr; gap: 0.9rem; }
  .current-list { grid-template-columns: 1fr; }
  #front { --focus-x: 42%; }     /* teal glow in the cloud wall */
  #storm { --focus-x: 55%; }     /* lightning veins right of center */
  #shelter { --focus-x: 42%; }   /* the beacon on the breakwater */
  #current { --focus-x: 55%; }   /* the lit current mid-right */
  #rift { --focus-x: 50%; }
  .mist { filter: blur(36px); }
}
@media (max-width: 380px) {
  .acts { flex-direction: column; align-items: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .grain, .cue span, .sky, .mist-a, .mist-b { animation: none; }
  .mist { display: none; }
  .sect { height: auto; }
  .pinbox { position: relative; height: 100vh; }
  .sky { inset: 0; transform: none !important; filter: none !important; }
  .body { opacity: 1 !important; transform: none !important; }
}
