/* Features page (Pages/Features.cshtml). Only theme tokens, so it follows Owner > Theme.
   One loud element - the orrery in the hero - and one reveal - the request travelling through the
   pipeline. Everything else stays quiet. */
.feat {
    --feat-gold: var(--accent, #c7a567);
    --feat-moss: var(--accent-gradient-to, #71813b);
    --feat-ember: var(--warning, #d9823b);
    --feat-ink: var(--text, #ead5a5);
    --feat-muted: var(--text-muted, #bba77f);
    --feat-line: color-mix(in srgb, var(--feat-gold) 34%, transparent);
    max-width: var(--site-shell-width, 1200px);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) 1rem clamp(3rem, 6vw, 5rem);
    color: var(--feat-ink);
}
.feat h2 { margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.12; text-wrap: balance; }
.feat h3 { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.feat p { margin: 0; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.feat-hero { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.feat-hero__copy { display: grid; gap: 1.1rem; max-width: 34rem; }
.feat-hero__title { margin: 0; font-size: clamp(2.3rem, 5.6vw, 3.9rem); line-height: 1.04; letter-spacing: -.015em; text-wrap: balance; }
.feat-hero__intro { color: var(--feat-muted); font-size: 1.08rem; line-height: 1.65; max-width: 60ch; }
.feat-hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .4rem; }

/* ── Orrery ─────────────────────────────────────────────────────────────── */
.feat-orrery { display: grid; justify-items: center; gap: 1rem; margin: 0; }
.feat-orrery__space { --size: min(calc(100vw - 2.5rem), 34rem); position: relative; width: var(--size); height: var(--size); }
.feat-orrery__core {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    display: grid; place-content: center; width: calc(var(--size) * .25); aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--feat-gold) 60%, transparent); border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--feat-gold) 46%, var(--bg, #080a06)), color-mix(in srgb, var(--feat-moss) 30%, var(--bg, #080a06)) 72%);
    box-shadow: 0 0 2.4rem color-mix(in srgb, var(--feat-gold) 30%, transparent);
    text-align: center; line-height: 1.1;
    animation: feat-core-in .9s cubic-bezier(.2, .8, .2, 1) both, feat-core-glow 7s ease-in-out 1.2s infinite;
}
/* Tiny label on the lit core gradient - muted text dropped to ~3:1 there. */
.feat-orrery__core span { color: color-mix(in srgb, var(--feat-muted) 15%, var(--text)); font-size: clamp(.62rem, 1.3vw, .78rem); }
.feat-orrery__core strong { font-size: clamp(.82rem, 1.8vw, 1.05rem); }

.feat-ring {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    width: calc(var(--size) * var(--rf) * 2); aspect-ratio: 1;
    border: 1px solid var(--feat-line); border-radius: 50%;
    animation: feat-ring-in 1s cubic-bezier(.2, .8, .2, 1) calc(var(--ring-i) * .16s + .15s) backwards, feat-spin var(--period) linear infinite;
}
.feat-ring--base { --ring-i: 0; --dot: var(--feat-moss); }
.feat-ring--portal { --ring-i: 1; --dot: var(--feat-gold); }
.feat-ring--sites { --ring-i: 2; --dot: var(--feat-ember); border-style: dashed; }

.feat-node {
    position: absolute; left: 50%; top: 50%;
    transform: rotate(var(--a)) translateX(calc(var(--size) * var(--rf))) rotate(calc(var(--a) * -1)) translate(-50%, -50%);
    padding: .3rem; border: 0; border-radius: 999px; background: none; color: var(--feat-ink); font: inherit; cursor: pointer;
}
.feat-node__body {
    display: grid; justify-items: center; gap: .3rem;
    animation: feat-node-in .55s cubic-bezier(.3, 1.4, .5, 1) calc(.75s + var(--i) * 70ms) backwards, feat-spin-back var(--period) linear infinite;
}
.feat-node__dot {
    width: .8rem; height: .8rem; border-radius: 50%; background: var(--dot);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--dot) 22%, transparent), 0 0 1rem color-mix(in srgb, var(--dot) 55%, transparent);
    transition: scale .2s ease, box-shadow .2s ease;
}
.feat-node__label {
    padding: .05rem .4rem; border-radius: .4rem; background: color-mix(in srgb, var(--bg, #080a06) 78%, transparent);
    font-size: clamp(.64rem, 1.25vw, .78rem); white-space: nowrap;
}
.feat-node:is(:hover, :focus-visible, .is-active) .feat-node__dot { scale: 1.45; box-shadow: 0 0 0 .3rem color-mix(in srgb, var(--dot) 30%, transparent), 0 0 1.6rem var(--dot); }
.feat-node:focus-visible { outline: 2px solid var(--feat-gold); outline-offset: 2px; }
/* The sky holds still while someone reads a dot. */
.feat-orrery__space:is(:hover, :focus-within, .is-paused) :is(.feat-ring, .feat-node__body) { animation-play-state: paused; }

.feat-orrery__caption { display: grid; gap: .2rem; min-height: 4.4rem; max-width: 30rem; text-align: center; color: var(--feat-muted); line-height: 1.5; }
.feat-orrery__caption strong { color: var(--feat-ink); }
.feat-orrery__caption strong:empty { display: none; }
.feat-orrery__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.1rem; margin: 0; padding: 0; list-style: none; color: var(--feat-muted); font-size: .8rem; }
.feat-orrery__legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.feat-orrery__legend-item::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--dot); }
.feat-orrery__legend-item--base { --dot: var(--feat-moss); }
.feat-orrery__legend-item--portal { --dot: var(--feat-gold); }
.feat-orrery__legend-item--sites { --dot: var(--feat-ember); }

@keyframes feat-spin { to { rotate: 360deg; } }
@keyframes feat-spin-back { to { rotate: -360deg; } }
@keyframes feat-ring-in { from { scale: .55; opacity: 0; } }
@keyframes feat-node-in { from { scale: 0; opacity: 0; } }
@keyframes feat-core-in { from { scale: .4; opacity: 0; } }
@keyframes feat-core-glow { 50% { box-shadow: 0 0 3.6rem color-mix(in srgb, var(--feat-gold) 45%, transparent); } }

/* ── Sections ───────────────────────────────────────────────────────────── */
.feat-section { display: grid; gap: 1.6rem; margin-top: clamp(3.5rem, 8vw, 6rem); }
.feat-section__head { display: grid; gap: .6rem; max-width: 44rem; }
.feat-section__head p { color: var(--feat-muted); line-height: 1.65; }

.feat-areas { display: grid; gap: 0 2.5rem; margin: 0; }
.feat-areas__item { display: grid; gap: .3rem; padding: 1rem 0; border-top: 1px solid var(--feat-line); }
.feat-areas__item dt { font-weight: 700; }
.feat-areas__item dd { margin: 0; color: var(--feat-muted); line-height: 1.6; }

/* ── The path of a request ──────────────────────────────────────────────── */
.feat-route { --step: .32s; position: relative; display: grid; gap: 1.2rem; justify-items: start; }
.feat-route__track { position: relative; }
.feat-route__stages { position: relative; display: grid; gap: .15rem; margin: 0; padding: 0 0 0 2.4rem; list-style: none; counter-reset: feat-stage; }
.feat-route__stages::before { content: ""; position: absolute; left: .55rem; top: .7rem; bottom: .7rem; width: 2px; background: linear-gradient(var(--feat-line), var(--feat-line)); }
.feat-route__stage { position: relative; display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: .2rem 1.2rem; align-items: baseline; padding: .45rem 0; counter-increment: feat-stage; }
.feat-route__stage::before {
    content: counter(feat-stage); position: absolute; left: -2.4rem; top: .45rem;
    display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border: 1px solid var(--feat-gold); border-radius: 50%;
    background: var(--bg, #080a06); color: var(--feat-gold); font-size: .62rem; font-variant-numeric: tabular-nums;
}
.feat-route__stage span { color: var(--feat-muted); }
.feat-route__packet { display: none; }
.feat-route__replay { margin-left: 2.4rem; }

/* With script: the stations wait dim until the request comes past. */
.feat-route.is-armed .feat-route__stage { opacity: .38; }
.feat-route.is-armed .feat-route__packet {
    display: block; position: absolute; z-index: 1; left: .2rem; top: .55rem; width: .85rem; height: .85rem; border-radius: 50%;
    background: var(--feat-ember); box-shadow: 0 0 .6rem var(--feat-ember), 0 0 1.6rem color-mix(in srgb, var(--feat-ember) 60%, transparent);
    opacity: 0;
}
.feat-route.is-running .feat-route__packet { animation: feat-travel calc(var(--stages) * var(--step)) linear forwards; }
.feat-route.is-running .feat-route__stage { animation: feat-stage-lit .5s ease calc(var(--i) * var(--step)) forwards; }
.feat-route.is-running .feat-route__stage::before { animation: feat-stage-dot .5s ease calc(var(--i) * var(--step)) forwards; }
@keyframes feat-travel {
    0% { opacity: 1; top: .55rem; }
    92% { opacity: 1; }
    100% { opacity: 0; top: calc(100% - 1.3rem); }
}
@keyframes feat-stage-lit { to { opacity: 1; } }
@keyframes feat-stage-dot { 40% { scale: 1.35; } to { background: var(--feat-gold); color: var(--bg, #080a06); } }

/* ── Framework building blocks ──────────────────────────────────────────── */
.feat-blocks { display: grid; gap: 2rem 2.5rem; }
.feat-blocks__group { display: grid; gap: .6rem; align-content: start; padding-top: 1rem; border-top: 3px double var(--feat-line); }
.feat-blocks__group p { color: var(--feat-muted); line-height: 1.6; }
.feat-blocks__group ul { display: grid; gap: .35rem; margin: .2rem 0 0; padding-left: 1.1rem; }
.feat-blocks__group li::marker { color: var(--feat-gold); }

/* ── Closing ────────────────────────────────────────────────────────────── */
.feat-plan {
    display: grid; justify-items: center; gap: .9rem; margin-top: clamp(3.5rem, 8vw, 6rem); padding: clamp(2rem, 5vw, 3rem) 1rem;
    border-block: 3px double var(--feat-line); text-align: center;
}
.feat-plan p { max-width: 40rem; color: var(--feat-muted); line-height: 1.65; }

@media (min-width: 700px) {
    .feat-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feat-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
    .feat-hero { grid-template-columns: minmax(0, 1fr) auto; }
    .feat-orrery__space { --size: clamp(22rem, 38vw, 32rem); }
}
@media (min-width: 1100px) {
    .feat-blocks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    /* Labels of the inner and outer ring would collide on a phone; the legend and the caption name them. */
    :is(.feat-ring--base, .feat-ring--sites) .feat-node__label { display: none; }
    .feat-route__stage { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .feat-orrery__core, .feat-ring, .feat-node__body { animation: none; }
    .feat-route.is-armed .feat-route__stage { opacity: 1; }
    .feat-route.is-armed .feat-route__packet, .feat-route__replay { display: none; }
}
