/* ==========================================================================
   Strypse — site foundation
   1. Tokens   2. Base   3. Backdrop   4. Glass   5. Controls
   6. Top bar  7. Hero   8. Panel      9. Features   10. Small screens
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand */
  --pink: #FE6080;
  --pink-soft: #ff9fb3;
  --ink: #0d1b2a;
  --white: #ffffff;

  /* Backdrop palette (read by script.js) */
  --sky-deep: #1f5d97;
  --sky: #3f8fcc;
  --sky-pale: #b9d7ec;
  --coral: #ff8a6b;

  /* Text on the backdrop */
  --text: rgba(255, 255, 255, 0.96);
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.5);
  --hairline: rgba(255, 255, 255, 0.28);

  /* Glass */
  --glass-fill: rgba(255, 255, 255, 0.14);
  --glass-fill-clear: rgba(255, 255, 255, 0.10);
  --glass-fill-inset: rgba(255, 255, 255, 0.12);
  --glass-edge: rgba(255, 255, 255, 0.26);
  --glass-rim: rgba(255, 255, 255, 0.45);
  --glass-blur: 26px;

  /* Type */
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(52px, 7.6vw, 116px);
  --fs-lede: clamp(15px, 1.15vw, 17px);
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-micro: 11px;

  /* Space, shape, motion */
  --gutter: clamp(20px, 3.6vw, 48px);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Reeded glass: width of one reed in CSS px (shared with script.js) */
  --reed: 22px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  background: var(--sky-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* 3. Backdrop -------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(60% 70% at 52% 52%, var(--coral) 0%, transparent 60%),
    linear-gradient(120deg, var(--sky-deep), var(--sky) 55%, var(--sky-pale));
}
.backdrop-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Light down the left of each reed, shade down the right */
.backdrop-reeds {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0.16) 0,
    rgba(255, 255, 255, 0.05) calc(var(--reed) * 0.18),
    rgba(255, 255, 255, 0) calc(var(--reed) * 0.5),
    rgba(0, 20, 50, 0.07) calc(var(--reed) * 0.86),
    rgba(0, 20, 50, 0.14) var(--reed));
  mix-blend-mode: soft-light;
}
/* Keep text legible: a soft darkening at the bottom and top */
.backdrop-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 30, 60, 0.18), transparent 22%),
    linear-gradient(0deg, rgba(10, 30, 60, 0.32), transparent 45%);
}

/* 4. Glass ----------------------------------------------------------------- */
.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 18px 50px -20px rgba(8, 25, 55, 0.45);
}
.glass-clear {
  background: var(--glass-fill-clear);
  --glass-blur: 16px;
}
.glass-inset {
  background: var(--glass-fill-inset);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 5. Controls -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body);
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background-color 0.3s, opacity 0.3s;
}
.btn-solid { background: var(--white); color: var(--ink); }
.btn-solid:hover { transform: translateY(-1px); background: #f3f6fa; }
.btn-link { padding: 0 6px; color: var(--text); }
.btn-link:hover { opacity: 0.75; }
.arrow { font-size: 0.9em; transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 46px;
  border-radius: var(--radius-md);
  transition: transform 0.4s var(--ease), background-color 0.3s;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn-solid { background: var(--white); color: var(--ink); }
.icon-btn:hover { transform: translateY(-1px); }

.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--text-2);
}

/* 6. Top bar --------------------------------------------------------------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: var(--gutter) var(--gutter) 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand img { filter: brightness(0) invert(1); }
.brand-mark { height: 20px; width: auto; }
.brand-word { height: 21px; width: auto; }

.nav {
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: var(--radius-md);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-2);
  transition: background-color 0.3s, color 0.3s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.nav-link.is-active { color: var(--text); background: rgba(255, 255, 255, 0.16); }
.nav-link.is-active::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}
.nav-plus { color: var(--pink-soft); font-size: 16px; font-weight: 300; line-height: 1; }

.topbar-actions { display: flex; gap: 10px; justify-self: end; }

/* 7. Hero ------------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
  grid-template-rows: 1fr auto;
  column-gap: var(--gutter);
  row-gap: 32px;
  padding: 18px var(--gutter) 40px;
}
.hero-copy { grid-column: 1; grid-row: 2; max-width: 820px; }
.display {
  font-size: var(--fs-display);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  max-width: 470px;
  margin-top: 28px;
  font-size: var(--fs-lede);
  font-weight: 300;
  color: var(--text-2);
}
.hero-actions {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

/* 8. Panel ----------------------------------------------------------------- */
.panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 12px 14px 16px;
  border-radius: var(--radius-xl);
  background: rgba(150, 195, 225, 0.22);
}
.panel-grabber {
  justify-self: center;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.75);
}
.panel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 8px;
  font-size: var(--fs-small);
  font-weight: 300;
  color: var(--text-2);
}
.panel-meta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.session {
  padding: 16px 18px 12px;
  border-radius: var(--radius-lg);
  border: 0;
}
.session-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.session-head h3 { font-size: 16px; font-weight: 400; letter-spacing: -0.01em; }
.session-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--text-3); }
.level { width: 11px; height: 9px; fill: currentColor; }
.level .off { opacity: 0.35; }

.session-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  margin-top: 14px;
}
.session-row .right { text-align: right; }
.session-row .chip { margin-bottom: 4px; }
.label { display: block; font-size: var(--fs-micro); color: var(--text-3); }
.session-row strong {
  display: block;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ticks {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 18px;
  margin-top: 12px;
}
.ticks i {
  width: 1px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.32);
}
.ticks i.on { background: rgba(255, 255, 255, 0.85); }

/* 9. Features -------------------------------------------------------------- */
.features { padding: 0 var(--gutter) calc(var(--gutter) * 0.9); }
.feature-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gutter);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}
.feature {
  position: relative;
  padding-top: 26px;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.5s var(--ease);
}
.feature::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  height: 2px;
  width: 0;
  border-radius: 1px;
  background: var(--pink);
  box-shadow: 0 0 10px rgba(254, 96, 128, 0.7);
}
.feature.is-active { color: var(--text); }
.feature.is-active::before { animation: feature-progress var(--feature-time, 5s) linear forwards; }
.feature:hover { color: var(--text-2); }
.feature.is-active:hover { color: var(--text); }
.feature svg {
  width: 18px;
  height: 18px;
  margin-bottom: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature.is-active svg { stroke: var(--pink-soft); }
.feature p { max-width: 210px; font-size: var(--fs-small); font-weight: 400; }
@keyframes feature-progress { from { width: 0; } to { width: 100%; } }

/* 10. Small screens -------------------------------------------------------- */
@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto; padding-top: 32px; }
  .hero-copy { grid-row: 1; padding-top: 18vh; }
  .hero-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .panel { grid-column: 1; grid-row: 3; max-width: 420px; }
  .hero { row-gap: 28px; }
  .feature-rail {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .feature-rail::-webkit-scrollbar { display: none; }
  .feature { flex: 0 0 62%; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .feature.is-active::before { animation: none; width: 100%; }
}
