/* Vestra One launch page (`hero: one`) and the `onecalc` calculator. Loaded only by pages that use
   them, on top of /static/css/styles.css and news.css. Palette: midnight violet with a pearl-lilac
   signal, so it reads apart from the galaxy (cobalt), trace (amber) and Veriwell (light) pages. */

.news-one {
  --bg: #07070c;
  --surface: #0f0f17;
  --surface-2: #16161f;
  --ink: #f1eff8;
  --ink-2: #c3bfd2;
  --muted: #8f8ba2;
  --line: rgba(230, 225, 255, 0.09);
  --line-2: rgba(230, 225, 255, 0.17);
  --one: #b9a6ff;            /* lilac: 9.6:1 on --bg */
  --one-ink: 185, 166, 255;
  --signal: var(--one);
  background: var(--bg);
}

html:has(> body.news-one) {
  background: #07070c;
}

/* ------------------------------------------------------------------ hero */

.one-hero {
  position: relative;
}

.one-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: var(--nav-h) var(--gutter) 0;
  overflow: clip;
  background:
    radial-gradient(60% 45% at 50% 52%, rgba(var(--one-ink), 0.10) 0%, rgba(var(--one-ink), 0) 70%),
    radial-gradient(120% 90% at 50% 120%, #120f22 0%, #07070c 60%);
}

.one-svg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: one-arrive 1.6s var(--ease-out) both;
}

.one-svg-front {
  z-index: 1;
  pointer-events: none;
}

@keyframes one-arrive {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.one-ghost {
  fill: none;
  stroke: rgba(230, 225, 255, 0.16);
  stroke-width: 1;
  stroke-dasharray: 2 7;
  vector-effect: non-scaling-stroke;
}

.one-path {
  fill: none;
  stroke: rgba(230, 225, 255, 0.34);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.one-path.is-vpn { stroke: rgba(var(--one-ink), 0.55); }

.one-ring {
  fill: none;
  stroke: url(#one-ring-grad);
  stroke-width: 2.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.one-glow { fill: rgba(var(--one-ink), 0.14); }
.one-dot { fill: var(--ink); }
.one-halo { fill: none; stroke: rgba(230, 225, 255, 0.35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.one-body.is-vpn .one-dot { fill: var(--one); }
.one-body.is-drive .one-dot { fill: #d9d3ee; }
.one-body.is-drive .one-halo { stroke-dasharray: 3 4; }

.one-label {
  fill: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-anchor: middle;
  text-transform: uppercase;
}

.one-title {
  max-width: 7em;
  margin-top: -2vh;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 0.8rem + 7.2vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.058em;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 40px rgba(7, 7, 12, 0.95), 0 0 12px rgba(7, 7, 12, 0.8);
}

.one-line {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(3rem, 11vh, 7.5rem);
  z-index: 2;
  max-width: 21em;
  margin-inline: auto;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 1rem + 1.9vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
  color: var(--ink-2);
}

.one-cue { display: none; }

/* With the script: a pinned scroll while the orbits merge. */
.one-hero.is-sequence {
  height: 250vh;
}

.one-hero.is-sequence .one-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 0;
}

.one-hero.is-sequence .one-line {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.one-hero.is-sequence .one-line.is-shown {
  opacity: 1;
  transform: none;
}

.one-hero.is-sequence .one-ghosts,
.one-hero.is-sequence [data-one-ring] {
  opacity: 0;
}

.one-hero.is-sequence .one-cue {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  left: 50%;
  display: block;
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(230, 225, 255, 0), rgba(230, 225, 255, 0.6));
  animation: cue 2.4s var(--ease-out) infinite;
  transform-origin: top;
  transition: opacity 0.6s;
}

.one-hero.is-merged .one-cue { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .one-svg { animation: none; }
}

/* ------------------------------------------------------- page chrome */

.news-one .one-intro .launch-dek { color: var(--ink); }

.news-one .launch-nav,
.news-one .nav.is-scrolled {
  background: rgba(7, 7, 12, 0.78);
}

.news-one .btn-primary,
.news-one .launch-nav-cta {
  background: var(--one);
  border-color: var(--one);
  color: #0b0a12;
}

.news-one .launch-ctas .btn-ghost {
  border-color: var(--line-2);
}

@media (hover: hover) {
  .news-one .btn-primary:hover,
  .news-one .launch-nav-cta:hover { background: #fff; border-color: #fff; }
}

.news-one .launch-nav-list a.is-active { color: var(--one); }
.news-one .c-callout { border-color: rgba(var(--one-ink), 0.3); }

/* ------------------------------------------------------------- onecalc */

.c-onecalc {
  padding: clamp(1.25rem, 0.9rem + 2vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: clamp(16px, 0.8rem + 1vw, 24px);
  background: var(--surface);
  --one-c: var(--one, #b9a6ff);
  --plan-c: #5f6672;
}

.c-onecalc-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.c-onecalc-tbl { font-variant-numeric: tabular-nums; }
.c-onecalc-tbl th[scope="row"] { font-weight: 500; text-align: left; }

.oc { display: grid; gap: 1.25rem; }
.oc-controls { display: grid; gap: 0.75rem; }

.oc-plans { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.oc-period {
  display: inline-flex;
  justify-self: start;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.oc-opt {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out), border-color 0.25s;
}

.oc-period .oc-opt { border-color: transparent; }
.oc-opt-sub { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.oc-opt[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #000; }
.oc-opt[aria-checked="true"] .oc-opt-sub { color: #444; }
.oc-opt:focus-visible { outline: 2px solid var(--one-c); outline-offset: 2px; }

@media (hover: hover) {
  .oc-opt:not([aria-checked="true"]):hover { color: var(--ink); border-color: var(--line-2); }
}

.oc-bars { display: grid; gap: 0.9rem; }

.oc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name val" "track track";
  gap: 0.4rem 1rem;
  align-items: baseline;
}

.oc-row-name { grid-area: name; color: var(--ink-2); font-size: 0.95rem; }
.oc-row-val { grid-area: val; font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

.oc-track {
  grid-area: track;
  display: flex;
  gap: 3px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.oc-seg {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  transition: width 0.6s var(--ease-expo);
}

.oc-seg.is-plan { background: var(--plan-c); }
.oc-seg.is-one { background: var(--one-c); }

.oc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.82rem; color: var(--muted); }
.oc-key { display: inline-block; width: 18px; height: 8px; border-radius: 999px; }
.oc-key.is-plan { background: var(--plan-c); }
.oc-key.is-one { background: var(--one-c); margin-left: 0.6rem; }

.oc-result {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 1.02rem;
  text-wrap: pretty;
}

.oc-net {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.oc-table { margin-top: 0.5rem; }
.oc-table summary { cursor: pointer; font-size: 0.875rem; color: var(--ink-2); }
.oc-table[open] summary { margin-bottom: 0.75rem; }

@media (min-width: 720px) {
  .oc-row { grid-template-columns: 9.5rem minmax(0, 1fr) 6rem; grid-template-areas: "name track val"; align-items: center; }
  .oc-row-val { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .oc-seg, .oc-opt { transition: none; }
}

/* Phones: draw the orbits right to the screen edges, and the labels bigger, so the
   drawing isn't lost in a portrait screen. */
@media (max-width: 600px) {
  .one-svg { left: -4%; width: 108%; }
  .one-label { font-size: 28px; }
  .one-dot { r: 14px; }
}
