/* UnderFlow public site — dark green glass.
   Palette, type scale and spacing follow the design brief; see README.md. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #070e0b;
  --text-strong: #f2f8f3;
  --text: #ceddd3;
  --accent: #8cf5ad;
  --accent-soft: #caffdb;
  --on-accent: #082413;
  --border: rgba(195, 255, 213, .17);
  --border-strong: rgba(140, 245, 173, .5);
  --glass: linear-gradient(145deg, rgba(229, 255, 237, .08), rgba(18, 38, 27, .38));
  --glass-flat: rgba(23, 43, 32, .48);
  --radius: 20px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --gutter: 24px;
}

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

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

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.75 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

/* Breathing green light: a separate layer, only its opacity is animated. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(50, 209, 113, .23), transparent 48%),
    radial-gradient(ellipse at 9% 65%, rgba(23, 173, 83, .19), transparent 42%),
    radial-gradient(ellipse at 95% 80%, rgba(88, 221, 128, .14), transparent 40%);
  animation: uf-glow 9s ease-in-out infinite;
  will-change: opacity;
}

/* Falling four-point stars: one size, staggered grid. Only a transform is animated. */
/* The container stays still and fades the stars toward the bottom; the inner layer moves. */
.stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 30%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .7) 30%, transparent 92%);
}
.stars::before {
  content: "";
  position: absolute;
  inset: -128px 0 0 -128px;
  opacity: .32;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cg fill='%238cf5ad'%3E%3Cpath transform='rotate(-45 32 32)' d='M32 19Q33.8 30.2 40 32Q33.8 33.8 32 45Q30.2 33.8 24 32Q30.2 30.2 32 19Z'/%3E%3Cpath transform='rotate(-45 96 96)' d='M96 83Q97.8 94.2 104 96Q97.8 97.8 96 109Q94.2 97.8 88 96Q94.2 94.2 96 83Z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 128px 128px repeat;
  animation: uf-fall 14s linear infinite;
  will-change: transform;
}

h1, h2, h3 { margin: 0; color: var(--text-strong); font-family: var(--font); font-weight: 700; }
h1 { font-size: clamp(34px, 5.2vw, 62px); line-height: 1.12; letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: 26px; line-height: 1.3; letter-spacing: -.035em; margin-bottom: 18px; }
p { margin: 16px 0; color: var(--text); }
strong, b { color: var(--text-strong); }

a { color: var(--accent); text-underline-offset: 5px; }
a:hover { color: var(--accent-soft); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(1100px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
main.wrap { margin-block: 32px 64px; min-height: 65vh; }
main > section:not(.hero) { margin-top: 40px; }

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- glass surfaces ---------- */
.glass, .card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  box-shadow: inset 0 1px 0 rgba(232, 255, 238, .08), 0 12px 34px rgba(0, 0, 0, .18);
}

/* ---------- header & footer ---------- */
header {
  background: rgba(7, 17, 11, .6);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
.top { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 20px 0; }
.brand {
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.065em;
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}
nav a:hover { color: var(--accent-soft); }
nav a[aria-current="page"] { color: var(--accent); }

footer { border-top: 1px solid var(--border); padding: 28px 0 38px; color: var(--text); font-size: 12px; }
footer nav { margin: 15px 0; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 23px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
  box-shadow: 0 0 30px rgba(115, 255, 164, .18);
}
.button:hover { background: #b0ffc8; color: var(--on-accent); }

/* ---------- hero ---------- */
.hero { padding: 46px 22px 42px; text-align: center; }
.hero h1 { max-width: 850px; margin: 22px auto 18px; font-weight: 800; }
.hero p { max-width: 560px; margin: 10px auto 24px; font-size: 15px; line-height: 1.8; }
.hero .hero-price {
  margin: 8px auto 12px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}

/* Orb with orbit (decorative) */
.orb-wrap {
  --orb: 136px;
  --orbit-w: 250px;
  --orbit-h: 154px;
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 300px);
  height: 190px;
  margin: 10px auto 5px;
  pointer-events: none;
}
.orb {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--orb);
  height: var(--orb);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #effff6 0, #b5f7d1 13%, #46d695 42%, #12714a 74%, #062c1d 100%);
  box-shadow:
    inset -16px -22px 38px rgba(0, 25, 14, .55),
    inset 8px 10px 22px rgba(255, 255, 255, .25),
    0 0 64px rgba(61, 220, 140, .34),
    0 26px 50px rgba(0, 0, 0, .42);
  animation: uf-float 6s ease-in-out infinite;
}
.orb b {
  color: #062516;
  font: 800 43px/1 var(--font);
  letter-spacing: -.075em;
  text-shadow: 0 1px 1px rgba(235, 255, 240, .35);
}
.orbit { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; transform: rotate(-20deg); }
.orbit::before {
  content: "";
  width: var(--orbit-w);
  height: var(--orbit-h);
  border: 1px solid rgba(181, 247, 209, .3);
  border-radius: 50%;
}
.orbit-x, .orbit-y { position: absolute; left: 50%; top: 50%; display: block; }
.orbit-x { animation: uf-orbit-x 9s infinite cubic-bezier(.445, .05, .55, .95); }
.orbit-y { animation: uf-orbit-y 9s infinite cubic-bezier(.445, .05, .55, .95); animation-delay: -2.25s; }
.orbit-y i {
  display: block;
  width: 9px;
  height: 9px;
  margin: -4.5px;
  border-radius: 50%;
  background: #effff6;
  box-shadow: 0 0 14px 4px rgba(181, 247, 209, .75);
}

/* ---------- tariffs ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin: 46px 0 20px; }
.section-head h2 { margin: 8px 0 0; }

.period-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--glass-flat);
}
.period-picker[hidden] { display: none; }
.period-picker button {
  padding: 9px 14px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--text);
  font: 600 12px/1.4 var(--font);
  letter-spacing: -.01em;
  cursor: pointer;
}
.period-picker button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 25px; }
.card h2 { margin-bottom: 18px; font-size: 23px; letter-spacing: -.04em; }
.card p { margin: 16px 0; font-size: 13px; line-height: 1.6; }
.card ul { margin: 22px 0 0; padding: 0; list-style: none; }
.card li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
}
.card li strong { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card li.selected, .card li.selected strong { color: var(--accent); }

.starting-price {
  color: var(--text-strong);
  font-size: 46px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.055em;
  font-variant-numeric: tabular-nums;
}
.starting-price .unit { color: var(--text); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.starting-price .save {
  display: block;
  width: fit-content;
  min-height: 26px;
  margin-top: 6px;
  padding: 2px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: rgba(140, 245, 173, .12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
/* Keeps the row's height so cards do not jump when the term has no discount. */
.starting-price .save[hidden] { display: block; visibility: hidden; }
/* The term list stays in the markup for no-JS visitors; with JS the picker replaces it. */
.js .tariff ul { display: none; }
.starting-price .amount { display: inline-block; transform-origin: left center; }
.starting-price .amount.pop { animation: uf-pop .4s cubic-bezier(.2, .8, .2, 1); }

.featured {
  background: linear-gradient(145deg, rgba(130, 246, 168, .15), rgba(22, 54, 34, .42));
  border-color: rgba(140, 245, 173, .46);
  box-shadow: inset 0 1px 0 rgba(212, 255, 225, .15), 0 0 40px rgba(64, 213, 112, .09);
}

.note { margin: 20px 0; font-size: 12px; }
.trial { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 20px 24px; font-size: 13px; line-height: 1.7; }
.trial strong { display: block; font-weight: 600; }
.trial small { display: block; color: var(--text); font-size: 12px; }
.trial span { color: var(--accent); }

/* ---------- document links ---------- */
.info-section { margin-top: 46px; }
.info-section h2 { margin-top: 10px; }
.document-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.document-link {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  color: var(--text-strong);
  text-decoration: none;
}
.document-link strong { font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: -.015em; }
.document-link span { color: var(--accent); font-size: 12px; white-space: nowrap; }

/* ---------- document pages ---------- */
.document-heading { padding: 20px 0 30px; }
.document-heading h1 { max-width: 900px; margin-top: 22px; font-size: clamp(32px, 4vw, 48px); line-height: 1.2; }
.document-heading p { margin: 18px 0 0; font-size: 13px; }

.document-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.contents { position: sticky; top: 24px; padding: 24px; }
.contents strong { font-size: 13px; font-weight: 700; }
.contents nav { flex-direction: column; gap: 4px; margin-top: 16px; }
.contents nav a { min-height: 36px; font-size: 12px; line-height: 1.65; }

.document-body { padding: 36px 40px; }
.refund-section { scroll-margin-top: 20px; padding-inline: 4px; }
.refund-section + .refund-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.refund-section h2 { font-size: 21px; line-height: 1.4; letter-spacing: -.025em; }
.document-body p { max-width: 72ch; margin: 16px 0 0; font-size: 15px; line-height: 1.85; }

/* ---------- contacts ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact { padding: 30px; }
.contact h2 { margin-top: 15px; }
.contact a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- motion ---------- */
.card, .document-link, .contact, .button {
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, background-color .3s ease;
}

/* Blocks rise into view. Content stays visible when JavaScript is off. */
.js [data-reveal]:not(.is-visible) { opacity: 0; }
[data-reveal].is-visible { animation: uf-enter .55s cubic-bezier(.2, .7, .2, 1) backwards; }

@media (hover: hover) {
  .card:hover, .document-link:hover, .contact:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: inset 0 1px 0 rgba(232, 255, 238, .12), 0 18px 42px rgba(0, 0, 0, .22), 0 0 30px rgba(64, 213, 112, .1);
  }
  .button:hover { transform: translateY(-2px); box-shadow: 0 0 38px rgba(115, 255, 164, .3); }
}

@keyframes uf-glow { 0% { opacity: .85; } 12% { opacity: 1; } 55% { opacity: .18; } 76% { opacity: .12; } 90% { opacity: .95; } 100% { opacity: .85; } }
@keyframes uf-fall { from { transform: translate(0, 0); } to { transform: translate(128px, 128px); } }
@keyframes uf-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes uf-pop { 0% { transform: scale(.82); opacity: .3; color: var(--accent); } 60% { transform: scale(1.06); opacity: 1; color: var(--accent); } 100% { transform: scale(1); color: var(--text-strong); } }
@keyframes uf-float { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-6px); } }
@keyframes uf-orbit-x { 0%, 100% { transform: translateX(calc(var(--orbit-w) / -2)); } 50% { transform: translateX(calc(var(--orbit-w) / 2)); } }
@keyframes uf-orbit-y { 0%, 100% { transform: translateY(calc(var(--orbit-h) / -2)); } 50% { transform: translateY(calc(var(--orbit-h) / 2)); } }

/* ---------- tablet ---------- */
@media (max-width: 800px) {
  .top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .grid { gap: 12px; }
  .card { padding: 18px; }
  .starting-price { font-size: 38px; }
  .document-layout { grid-template-columns: 1fr; }
  .contents { position: static; }
  .contents nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phone ---------- */
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  h1 { font-size: clamp(30px, 8.5vw, 42px); letter-spacing: -.04em; }
  h2 { font-size: 23px; }
  nav { gap: 0 16px; }
  header nav a, footer nav a { min-height: 38px; }
  .hero { padding: 32px 16px; }
  .hero h1 { line-height: 1.18; }
  .hero p { font-size: 14px; }
  .orb-wrap { --orb: 116px; --orbit-w: 224px; --orbit-h: 140px; height: 166px; }
  .grid, .document-links, .contact-grid { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .starting-price { font-size: 43px; }
  .section-head { margin-top: 32px; }
  .period-picker button { min-height: 44px; padding: 8px 12px; }
  .trial, .document-link { padding: 18px; }
  .document-heading h1 { font-size: 32px; letter-spacing: -.04em; }
  .document-body { padding: 26px 24px; }
  .refund-section { padding-inline: 0; }
  .document-body p { font-size: 14px; }
  .contents nav { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before, .stars::before, .orb, .orbit-x, .orbit-y, [data-reveal].is-visible, .starting-price .amount.pop { animation: none; }
  .js [data-reveal]:not(.is-visible) { opacity: 1; }
  .card, .document-link, .contact, .button { transition: none; }
  .orbit-x { transform: translateX(calc(var(--orbit-w) / 2)); }
}
