/* Cloudship Digital — hero + story split
   Tokens mirror the Figma "Cloudship" styles. */

:root {
  --ink: #193739;
  --ink-muted: rgba(25, 55, 57, 0.72);
  --accent: #e4b442;
  --primary: #dae8eb;
  --bg: #f8f5ee;
  --border: rgba(25, 55, 57, 0.14);
  --shadow-card: 0 14px 32px rgba(26, 51, 56, 0.12);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, figure, blockquote { margin: 0; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

/* ---------- Shared type + controls ---------- */

.eyebrow,
.pill,
.wordmark__tag,
.stat__label {
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--accent:hover { box-shadow: 0 8px 18px rgba(228, 180, 66, 0.35); }
.btn--outline { border: 1.5px solid var(--border); padding: 13.5px 24.5px; }
.btn--outline:hover { background: rgba(255, 255, 255, 0.4); }

.text-link { font-weight: 600; font-size: 15px; line-height: 20px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

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

/* At the top: a full-width bar in the hero's top colour, so the nav and hero read as one surface.
   Once the page scrolls (js/site.js adds .is-scrolled) it floats down into a cream pill. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0 var(--gutter);
  background: var(--primary);
  border-bottom: 1px solid rgba(25, 55, 57, 0.08);
  transition: padding-top 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
}

.nav__bar {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-radius: 999px;
  transition: padding 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.nav.is-scrolled {
  padding-top: 12px;
  background: transparent;
  border-bottom-color: transparent;
}
.nav.is-scrolled .nav__bar {
  padding: 10px 10px 10px 28px;
  background: rgba(248, 245, 238, 0.94);
  box-shadow: 0 10px 30px rgba(26, 51, 56, 0.12), 0 0 0 1px rgba(25, 55, 57, 0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.wordmark { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.wordmark__name { font-family: var(--font-display); font-weight: 700; font-size: 29px; line-height: 42px; }

.nav__links { display: flex; gap: 34px; font-weight: 500; font-size: 15px; line-height: 20px; }
.nav__links a:hover { text-decoration: underline; text-underline-offset: 4px; }

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

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
  padding: 80px var(--gutter) 96px;
  background: linear-gradient(180deg, #dae8eb 0%, #f8f5ee 78%);
}

/* Decorative clouds are placed against the 1440px design, anchored to the page centre */
.hero__cloud { position: absolute; pointer-events: none; }
.hero__cloud--big-left  { left: calc(50% - 810px); top: 40px;  width: 420px; }
.hero__cloud--far-top   { left: calc(50% - 200px); top: 20px;  width: 220px; filter: blur(2px); }
.hero__cloud--far-right { left: calc(50% + 530px); top: 70px;  width: 160px; filter: blur(2px); }
.hero__cloud--low-right { left: calc(50% + 460px); top: 520px; width: 300px; }
.hero__cloud--low-left  { left: calc(50% - 660px); top: 600px; width: 140px; filter: blur(2px); }

.hero__container {
  position: relative;
  width: 100%;
  max-width: var(--container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero__copy {
  flex: 0 1 620px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.pill { background: var(--accent); padding: 7px 14px; border-radius: 999px; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 5.3vw, 76px);
  line-height: 1.0526; /* 80 / 76 */
  letter-spacing: -1px;
  text-wrap: balance;
  padding-bottom: 10px; /* matches the 330px headline box */
}

/* The swoosh tucks just behind the bottoms of the g and f, so the next line can sit right under it */
.swoosh-word { position: relative; z-index: 0; display: inline-block; font-style: italic; }
.swoosh-word img {
  position: absolute;
  z-index: -1;      /* always drawn behind the letters */
  left: -0.053em;   /* -4px at 76px */
  top: 0.9em;       /* across the descender tips, behind the letters */
  width: 4.09em;    /* 311px at 76px */
  max-width: none;
  height: auto;
  pointer-events: none;
}

.hero__lede { font-size: 19px; line-height: 30px; color: var(--ink-muted); }

.hero__ctas { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* Hero visual: a 540×560 composition that scales as one piece (1 --u = 1px at full size) */
.hero__visual {
  position: relative;
  flex: 0 0 auto;
  width: min(540px, 100%);
  aspect-ratio: 540 / 560;
  container-type: inline-size;
}
.hero__visual > * { --u: calc(100cqw / 540); }

.hv { position: absolute; max-width: none; }
.hv--cloud-under { left: calc(10 * var(--u)); top: calc(300 * var(--u)); width: calc(520 * var(--u)); }
.hv--cloud-front { left: calc(300 * var(--u)); top: calc(420 * var(--u)); width: calc(260 * var(--u)); }

/* Dashboard cards: example results floating over the clouds */
.hv--traffic { left: calc(50 * var(--u));  top: calc(118 * var(--u)); width: calc(400 * var(--u)); }
.hv--leads   { left: calc(290 * var(--u)); top: calc(46 * var(--u)); }
.hv--rank    { left: calc(0 * var(--u));   top: calc(394 * var(--u)); }

.dash-card {
  background: #fffdf9;
  border: 1px solid rgba(25, 55, 57, 0.06);
  border-radius: calc(22 * var(--u));
  box-shadow: 0 calc(22 * var(--u)) calc(44 * var(--u)) rgba(26, 51, 56, 0.12);
  --float: -8;
  animation: dash-float 8s ease-in-out infinite;
}
/* The two chips only drift slightly so the right side stays calm */
.hv--leads .dash-card { --float: -3; animation-duration: 9s; animation-delay: -2s; }
.hv--rank  .dash-card { --float: -3; animation-duration: 10s; animation-delay: -5s; }
@keyframes dash-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(calc(var(--float) * var(--u))); }
}

.dash-card--traffic { padding: calc(26 * var(--u)) calc(28 * var(--u)) calc(24 * var(--u)); }
.dash-card__head { display: flex; align-items: center; gap: calc(12 * var(--u)); }
.dash-card__title { flex: 1; font-weight: 600; font-size: calc(15 * var(--u)); line-height: calc(20 * var(--u)); color: var(--ink-muted); }

.dash-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(42 * var(--u));
  height: calc(42 * var(--u));
  border-radius: calc(13 * var(--u));
}
.dash-icon svg {
  width: calc(21 * var(--u));
  height: calc(21 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dash-icon--sky   { background: var(--primary); color: var(--ink); }
.dash-icon--gold  { background: rgba(228, 180, 66, 0.22); color: #9a6c12; }
.dash-icon--cream { background: #f3ece0; color: #b0661c; }

.dash-card__big,
.dash-card__num { font-variant-numeric: lining-nums; }
.dash-card__big {
  margin-top: calc(20 * var(--u));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(64 * var(--u));
  line-height: 1;
  letter-spacing: calc(-1 * var(--u));
}
.dash-card__sub { margin-top: calc(6 * var(--u)); font-size: calc(15 * var(--u)); line-height: calc(22 * var(--u)); color: var(--ink-muted); }
.dash-card__sub .up { color: #d19f2a; font-weight: 600; }

.traffic-chart { display: block; width: 100%; height: calc(110 * var(--u)); margin-top: calc(16 * var(--u)); overflow: visible; }
.traffic-chart__line {
  fill: none;
  stroke: #d19f2a;
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: chart-draw 1.8s ease-out 0.3s backwards;
}
.traffic-chart__area { animation: chart-fill 0.8s ease-out 2.1s backwards; }
@keyframes chart-draw { from { stroke-dashoffset: 1; } }
@keyframes chart-fill { from { opacity: 0; } }

.dash-card--chip {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  padding: calc(18 * var(--u)) calc(28 * var(--u)) calc(18 * var(--u)) calc(18 * var(--u));
}
.dash-card__stack { display: flex; flex-direction: column; white-space: nowrap; }
.dash-card__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(36 * var(--u));
  line-height: 1;
  letter-spacing: calc(-0.5 * var(--u));
}
.dash-card__label { margin-top: calc(4 * var(--u)); font-size: calc(15 * var(--u)); line-height: calc(20 * var(--u)); color: var(--ink-muted); }

/* Stats bar */
.stats-bar {
  position: relative;
  width: 100%;
  max-width: var(--container);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 32px 48px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--bg);
  border-radius: 32px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4vw, 56px);
  line-height: 1.107;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.stat__label { color: var(--ink-muted); }

/* ---------- Story split ---------- */

.story { padding: 0 var(--gutter) 96px; }

.story__container {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.story__card,
.story__photo { min-width: 0; border-radius: 28px; overflow: hidden; }

.story__card {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 56px;
  background: var(--primary);
}
.story__top { display: flex; flex-direction: column; gap: 20px; }
.story__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 3.9vw, 56px);
  line-height: 1.107;
  letter-spacing: -0.5px;
}
.story__body { font-size: 16px; line-height: 26px; color: var(--ink-muted); }
.story__buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* Photo card: takes the row height set by the story card. The 588×560 scene inside scales to
   cover it (1 --u = 1px at full size); the stat cards scale with the card width. */
.story__photo {
  position: relative;
  min-height: 300px;
  background: var(--primary);
  container-type: size;
}

.story__stats {
  --u: calc(100cqw / 588);
  position: absolute;
  left: calc(24 * var(--u));
  bottom: calc(49 * var(--u));
  display: flex;
  gap: calc(12 * var(--u));
}
.mini-stat {
  width: calc(264 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  padding: calc(20 * var(--u)) calc(22 * var(--u));
  background: var(--bg);
  border-radius: calc(18 * var(--u));
}
.mini-stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(39 * var(--u));
  line-height: calc(44 * var(--u));
  white-space: nowrap;
}
.mini-stat__label { font-size: calc(14 * var(--u)); line-height: calc(21 * var(--u)); color: var(--ink-muted); }

/* ---------- Sky ship animation ----------
   Layers back to front: cloudscape, birds, ship, far cloud bank, near cloud bank.
   Every loop divides 12s, and each cloud bank moves exactly one tile per loop, so it repeats seamlessly. */

.sky-ship {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #6bc4fa;
}
.sky-ship__stage {
  --u: max(calc(100cqw / 588), calc(100cqh / 560));
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(588 * var(--u));
  height: calc(560 * var(--u));
  transform: translate(-50%, -50%);
  background: url("../img/sky-ship/cloudscape.webp") center / cover no-repeat;
}
.sky-ship img { max-width: none; image-rendering: pixelated; user-select: none; pointer-events: none; }

.sky-ship__ship {
  position: absolute;
  left: calc(115 * var(--u));
  top: calc(110 * var(--u));
  width: calc(370 * var(--u));
  height: auto;
  transform-origin: 50% 65%;
  animation: sky-ship-bob 6s ease-in-out infinite;
}
@keyframes sky-ship-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%      { transform: translateY(calc(-9 * var(--u))) rotate(-1deg); }
  50%      { transform: translateY(0) rotate(0deg); }
  75%      { transform: translateY(calc(9 * var(--u))) rotate(1deg); }
}

.sky-ship__bank {
  position: absolute;
  background: url("../img/sky-ship/clouds-front.webp") 0 0 repeat-x;
  image-rendering: pixelated;
  will-change: transform;
}
.sky-ship__bank--far {
  left: calc(-465 * var(--u));
  top: calc(347 * var(--u));
  width: calc(2790 * var(--u));
  height: calc(168 * var(--u));
  background-size: calc(930 * var(--u)) 100%;
  animation: sky-ship-far 12s linear infinite;
}
.sky-ship__bank--near {
  left: 0;
  top: calc(308 * var(--u));
  width: calc(2790 * var(--u));
  height: calc(252 * var(--u));
  background-size: calc(1395 * var(--u)) 100%;
  animation: sky-ship-near 12s linear infinite;
}
@keyframes sky-ship-far  { to { transform: translateX(calc(-930 * var(--u))); } }
@keyframes sky-ship-near { to { transform: translateX(calc(-1395 * var(--u))); } }

.sky-ship__bird { position: absolute; animation: sky-ship-glide 12s linear infinite; }
.sky-ship__bird img { width: 100%; height: auto; animation: sky-ship-flap 0.5s ease-in-out infinite alternate; }
.sky-ship__bird--1 { left: calc(610 * var(--u)); top: calc(58 * var(--u));  width: calc(22 * var(--u)); }
.sky-ship__bird--2 { left: calc(700 * var(--u)); top: calc(104 * var(--u)); width: calc(27 * var(--u)); }
.sky-ship__bird--3 { left: calc(790 * var(--u)); top: calc(140 * var(--u)); width: calc(25 * var(--u)); }
.sky-ship__bird--2 img { animation-delay: -0.25s; }
@keyframes sky-ship-glide {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(calc(-225 * var(--u)), calc(-4 * var(--u))); }
  50%  { transform: translate(calc(-450 * var(--u)), 0); }
  75%  { transform: translate(calc(-675 * var(--u)), calc(4 * var(--u))); }
  100% { transform: translate(calc(-900 * var(--u)), 0); }
}
@keyframes sky-ship-flap { to { transform: scaleY(0.45); } }

/* Story bubbles: drift right-to-left across the stage, some behind the ship and some in front.
   All eight share one 56s cycle and enter 7s apart (--i). A crossing takes at most 21s
   (3 × 7s), so no more than 3 bubbles are ever on screen. Each starts just off the right
   edge and exits fully off the left, then waits off-stage, so every loop is seamless. */
.bubble {
  position: absolute;
  left: 100%;
  top: calc(var(--y) * var(--u));
  animation: bubble-drift-front 56s linear infinite;
  animation-delay: calc(var(--i) * 7s - 66s);
  will-change: transform;
}
.bubble--back { animation-name: bubble-drift-back; }
.bubble__inner {
  position: relative;
  display: block;
  white-space: nowrap;
  font-weight: 600;
  border-radius: 999px;
  animation: bubble-bob var(--bob) ease-in-out infinite alternate;
}
.bubble__inner::after { /* speech-bubble tail */
  content: "";
  position: absolute;
  left: 18%;
  bottom: calc(-4 * var(--u));
  width: calc(10 * var(--u));
  height: calc(10 * var(--u));
  background: inherit;
  transform: rotate(45deg);
  border-radius: 0 0 calc(3 * var(--u)) 0;
}
.bubble--back .bubble__inner {
  padding: calc(7 * var(--u)) calc(13 * var(--u));
  font-size: max(9px, calc(12 * var(--u)));
  line-height: 1.3;
  color: var(--ink-muted);
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(26, 51, 56, 0.08);
}
.bubble--front .bubble__inner {
  padding: calc(9 * var(--u)) calc(16 * var(--u));
  font-size: max(10px, calc(14 * var(--u)));
  line-height: 1.3;
  color: var(--ink);
  background: #fffdf9;
  box-shadow: 0 calc(10 * var(--u)) calc(22 * var(--u)) rgba(26, 51, 56, 0.14);
}
/* front: 15s crossing (26.8% of 56s); back: slower 21s crossing (37.5%) */
@keyframes bubble-drift-front {
  0%           { transform: translateX(0); }
  26.8%, 100%  { transform: translateX(calc(-588 * var(--u) - 100%)); }
}
@keyframes bubble-drift-back {
  0%           { transform: translateX(0); }
  37.5%, 100%  { transform: translateX(calc(-588 * var(--u) - 100%)); }
}
@keyframes bubble-bob   { to { transform: translateY(calc(-5 * var(--u))); } }


@media (prefers-reduced-motion: reduce) {
  .sky-ship__ship, .sky-ship__bank, .sky-ship__bird, .sky-ship__bird img,
  .dash-card, .traffic-chart__line, .traffic-chart__area,
  .bubble__inner { animation: none; }
  .nav, .nav__bar { transition: none; }
  /* Bubbles hold still, spread across the scene */
  .bubble { animation-play-state: paused; }
  .sky-ship__bird { transform: translateX(calc(-420 * var(--u))); }
  .btn { transition: none; }
}

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

@media (max-width: 1100px) {
  .hero { gap: 56px; }
  .hero__container { flex-direction: column; align-items: flex-start; gap: 48px; }
  .hero__copy { flex-basis: auto; max-width: 620px; }
  .hero__visual { align-self: center; }

  .story__container { grid-template-columns: 1fr; }
  .story__card { min-height: 0; }
  .story__photo { aspect-ratio: 588 / 560; min-height: 0; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav__bar { padding: 12px 0; }
  .nav.is-scrolled { padding-top: 8px; }
  .nav.is-scrolled .nav__bar { padding: 6px 6px 6px 18px; }
  .wordmark__name { font-size: 26px; }
  .nav__bar .btn { padding: 12px 18px; }

  .hero { padding-top: 48px; padding-bottom: 64px; }
  .hero__lede { font-size: 17px; line-height: 27px; }
  .stats-bar { padding: 24px 12px; gap: 8px; border-radius: 24px; }
  .stat__label { font-size: 10px; letter-spacing: 1px; }

  .story { padding-bottom: 64px; }
  .story__card { padding: 32px 24px; }

  /* Stat cards drop below the animation so their text stays readable */
  .story__photo { aspect-ratio: auto; container-type: inline-size; display: flex; flex-direction: column; }
  .sky-ship { position: relative; inset: auto; aspect-ratio: 588 / 560; }
  .sky-ship__stage { --u: calc(100cqw / 588); }
  .story__stats { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; }
  .mini-stat { width: auto; padding: 16px; gap: 4px; border-radius: 16px; }
  .mini-stat__num { font-size: 32px; line-height: 38px; }
  .mini-stat__label { font-size: 14px; line-height: 20px; }
}
