/* RiskOS — the home page. Hero, the mark drawing itself, the chapters and
   their figures, the gallery, the questions and the close. */

.home { padding-top: calc(var(--nav-h) + 26px); }

.section { padding: 92px 0; }
.section.band { background: var(--bg-alt); }
.section.wash { position: relative; overflow: hidden; }
.section.wash::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(60% 60% at 50% 0%, var(--accent-soft), transparent 72%);
  pointer-events: none;
}
.section > .wrap { position: relative; }

@media (max-width: 720px) { .section { padding: 64px 0; } }

/* The walkthrough is the one figure that wants the full width of the page. */
#walkthrough > .wrap { max-width: 1260px; }

/* ------------------------------------------------------------------ type -- */

.headline {
  font-size: clamp(30px, 5.2vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.032em;
  font-weight: 680;
}
.headline.center { text-align: center; }
.chapter-intro { max-width: 40rem; margin-bottom: 40px; }
.chapter-intro .lede { margin-top: 16px; }
.chapter-intro .eyebrow { display: block; margin-bottom: 12px; }
.section.chapter .figure-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-4);
  max-width: 38rem;
}
.chapter-guide-link { display: inline-block; margin-top: 22px; }

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

#hero { padding-top: 26px; padding-bottom: 76px; }
.hero-in { display: grid; gap: 26px; justify-items: center; text-align: center; }

.hero-stage-wrap {
  width: min(620px, 100%);
  margin-inline: auto;
  cursor: pointer;
}
.hero-name {
  font-size: clamp(31px, 5.2vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.034em;
  font-weight: 680;
  max-width: 20ch;
  margin-inline: auto;
}
.hero-lede {
  margin-top: 18px;
  max-width: 34rem;
  margin-inline: auto;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.hero-meta { font-size: 13.5px; color: var(--ink-4); }
.hero-meta b { font-weight: 620; color: var(--ink-3); }

.hero-copy.rv { opacity: 0; transform: translateY(14px); }
.hero-copy.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-reveal), transform 0.7s var(--ease-reveal);
}

/* -------------------------------------------------- the mark, animating -- */

.rlg {
  position: relative;
  width: 100%;
  aspect-ratio: 560 / 300;
  isolation: isolate;
}
.rlg-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  will-change: transform;
}
.rlg-cell {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  opacity: 0;
  background: linear-gradient(180deg, var(--cb), var(--cd));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 40% 0 -20% rgba(255, 255, 255, 0.24);
  will-change: transform, width, height;
}
.rlg-cell[data-band="low"] { --cb: #41e874; --cd: #0f9d4a; }
.rlg-cell[data-band="medium"] { --cb: #ffde45; --cd: #e0a000; }
.rlg-cell[data-band="high"] { --cb: #ffad22; --cd: #e57200; }
.rlg-cell[data-band="critical"] { --cb: #ff6154; --cd: #d0241b; }

.rlg-plate {
  position: absolute;
  opacity: 0;
  border-radius: 22.37%;
  background: linear-gradient(180deg, #2c2d35, #0d0e12);
  box-shadow: inset 0 0 0 1.2px rgba(255, 255, 255, 0.22),
    0 18px 40px -14px rgba(0, 0, 0, 0.55);
}
.rlg-gloss {
  position: absolute;
  opacity: 0;
  border-radius: 22.37%;
  pointer-events: none;
  background-image: linear-gradient(104deg, rgba(255, 255, 255, 0) 38%,
      rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 62%);
  background-size: 260% 100%;
  background-position: var(--sweep, -120%) 0;
}
.rlg-glow {
  position: absolute;
  width: 400px;
  height: 270px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(36% 44% at 26% 66%, rgba(15, 157, 74, 0.26), transparent 70%),
    radial-gradient(36% 44% at 52% 32%, rgba(224, 160, 0, 0.24), transparent 70%),
    radial-gradient(38% 46% at 76% 62%, rgba(208, 36, 27, 0.24), transparent 70%);
  filter: blur(6px);
}

.rlg-ring {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  border-radius: 50%;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 var(--rs, 8px) rgba(255, 255, 255, 0.65),
    0 2px 7px rgba(0, 0, 0, 0.32);
  will-change: transform, width, height;
}
.rlg-ring-o {
  border-color: var(--accent);
  background: transparent;
  box-shadow: 0 0 var(--rs, 10px) var(--accent-soft), none;
}
@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
  .rlg-ring-o {
    border-color: transparent;
    background: var(--grad) border-box;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
}

.rlg-word {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  font-size: 62px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  white-space: nowrap;
}
.rlg-word span { display: inline-block; opacity: 0; }
.rlg-o { width: 0.72em; height: 0.72em; margin-inline: 0.045em 0.02em; opacity: 1 !important; }

.rlg-read {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  width: 150px;
}
.rlg-li { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rlg-score {
  font-size: 54px;
  font-weight: 660;
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--sev-high-vivid);
}
.rlg-read[data-band="low"] .rlg-score { color: var(--sev-low-vivid); }
.rlg-read[data-band="medium"] .rlg-score { color: var(--sev-medium-vivid); }
.rlg-read[data-band="high"] .rlg-score { color: var(--sev-high-vivid); }
.rlg-read[data-band="critical"] .rlg-score { color: var(--sev-critical-vivid); }
.rlg-bar {
  position: relative;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--fill-2);
  overflow: hidden;
}
.rlg-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--sev-high-vivid);
  transition: width 0.4s var(--snappy), background 0.3s var(--smooth);
}
.rlg-read[data-band="low"] .rlg-bar > i { background: var(--sev-low-vivid); }
.rlg-read[data-band="medium"] .rlg-bar > i { background: var(--sev-medium-vivid); }
.rlg-read[data-band="high"] .rlg-bar > i { background: var(--sev-high-vivid); }
.rlg-read[data-band="critical"] .rlg-bar > i { background: var(--sev-critical-vivid); }
.rlg-band { margin-top: 8px; font-size: 14px; font-weight: 620; color: var(--ink-2); }

/* -------------------------------------------------------------- features -- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.feature-card {
  padding: 24px 22px 26px;
  border-radius: var(--r-18);
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--sh-low);
  transition: transform 0.28s var(--ease-reveal), box-shadow 0.28s var(--ease-reveal);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--sh-med); }
.card-glyph {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: var(--grad-warm);
  color: #fff;
  box-shadow: 0 4px 12px -2px var(--accent-line);
}
:root[data-theme="dark"] .card-glyph { color: var(--on-accent); }
.card-glyph svg { width: 20px; height: 20px; }
.feature-card h3 { font-size: 17.5px; letter-spacing: -0.02em; }
.feature-card p { margin-top: 8px; font-size: 14.8px; line-height: 1.55; color: var(--ink-2); }

/* -------------------------------------------------------- chapter stages -- */

.scene {
  margin-top: 8px;
  border-radius: var(--radius-card);
  padding: clamp(18px, 3vw, 40px);
  background: var(--sunken);
  border: 1px solid var(--hairline-soft);
}
.section.band .scene { background: var(--bg); }
.scene.plain { background: none; border: 0; padding: 0; }

.scene-split {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .scene-split { grid-template-columns: 1fr 1fr; } }
.scene-split.flip > :first-child { order: 2; }
@media (max-width: 899px) { .scene-split.flip > :first-child { order: 0; } }

.point-list { display: grid; gap: 18px; margin-top: 4px; }
.point { display: flex; gap: 14px; }
.point .pn {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.point h3 { font-size: 16.5px; letter-spacing: -0.018em; }
.point p { margin-top: 5px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

/* The report pages, fanning. */
.fan {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(260px, 38vw, 420px);
}
.fan .stage { position: absolute; width: min(31%, 200px); }
.fan .stage:nth-child(1) { transform: rotate(-3deg) translate(-4%, 2%); z-index: 1; }
.fan .stage:nth-child(2) { transform: rotate(3deg) translate(4%, 3%); z-index: 2; }
.fan .stage:nth-child(3) { z-index: 3; }
.fan.live .stage:nth-child(1) {
  transform: rotate(-9deg) translate(-56%, 3%);
  transition: transform 0.9s var(--spring);
}
.fan.live .stage:nth-child(2) {
  transform: rotate(8deg) translate(56%, 4%);
  transition: transform 0.9s var(--spring) 0.06s;
}

/* ------------------------------------------------------- privacy banners -- */

.banner-grid { display: grid; gap: 16px; margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
/* Inside a split the column is too narrow for auto-fit to find a second
   track, and four stacked tiles run far past the shield beside them. */
@media (min-width: 620px) { .scene-split .banner-grid { grid-template-columns: 1fr 1fr; } }
.banner-tile {
  padding: 26px 22px;
  border-radius: var(--r-18);
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  text-align: center;
}
.banner-tile .bt-glyph {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green);
}
.banner-tile .bt-glyph svg { width: 22px; height: 22px; }
.banner-tile h3 { font-size: 16.5px; letter-spacing: -0.018em; }
.banner-tile p { margin-top: 7px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

.claims { display: grid; gap: 10px; margin-top: 28px; max-width: 30rem; }
.claim {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-14);
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  font-size: 15.5px;
  opacity: 0;
  transform: translateY(10px);
}
.scene.live .claim {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease-reveal), transform 0.5s var(--ease-reveal);
}
.scene.live .claim:nth-child(2) { transition-delay: 0.14s; }
.scene.live .claim:nth-child(3) { transition-delay: 0.28s; }
.claim svg.tick { margin-left: auto; width: 17px; height: 17px; color: var(--green); flex: none; }
.claim > svg:first-child { width: 20px; height: 20px; color: var(--ink-3); flex: none; }

.shield {
  width: clamp(92px, 16vw, 128px);
  aspect-ratio: 1;
  border-radius: 26%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #33cc66, #16994b);
  color: #fff;
  box-shadow: 0 16px 38px -12px rgba(22, 153, 75, 0.6);
  transform: scale(0.78);
  opacity: 0;
}
.scene.live .shield {
  transform: none;
  opacity: 1;
  transition: transform 0.7s var(--spring), opacity 0.5s var(--ease-reveal);
}
.shield svg { width: 52%; height: 52%; }

/* --------------------------------------------------------------- gallery -- */

.rail-wrap { position: relative; margin-top: 40px; }
.rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.gallery-card {
  flex: 0 0 min(78%, 620px);
  scroll-snap-align: center;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: #f2f2f4;
  border: 1px solid var(--hairline-soft);
  box-shadow: var(--sh-med);
}
.gallery-card img { width: 100%; display: block; }
.card-caption {
  padding: 16px 18px 20px;
  background: var(--surface);
  border-top: 1px solid var(--hairline-soft);
}
.card-caption b { display: block; font-size: 16px; letter-spacing: -0.018em; }
.card-caption span { display: block; margin-top: 5px; font-size: 14.2px; color: var(--ink-2); }
.paddles { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.paddle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--fill-2);
  color: var(--ink-2);
  transition: background 0.18s, opacity 0.18s;
}
.paddle:hover { background: var(--fill-3); }
.paddle:disabled { opacity: 0.35; cursor: default; }
.paddle svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------- faq -- */

.faq-list { max-width: 50rem; margin: 36px auto 0; display: grid; gap: 10px; }
.faq-item {
  border-radius: var(--r-14);
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  text-align: left;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.faq-q::after {
  content: "";
  margin-left: auto;
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.28s var(--snappy);
}
.faq-item.open .faq-q::after { transform: rotate(-135deg) translate(-3px, -3px); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--snappy);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p {
  padding: 0 20px 20px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46rem;
}
.faq-a p + p { padding-top: 0; margin-top: -8px; }

/* ----------------------------------------------------------------- close -- */

.closing { text-align: center; }
.closing .closing-stage { width: min(560px, 100%); margin: 0 auto 4px; }
.closing h2 { font-size: clamp(28px, 4.6vw, 46px); letter-spacing: -0.03em; }
.closing p { margin: 18px auto 0; max-width: 34rem; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.closing .hero-ctas { margin-top: 28px; }

/* --------------------------------------------------------------- reveals -- */

.rv { opacity: 0; transform: translateY(18px); }
.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.72s var(--ease-reveal), transform 0.72s var(--ease-reveal);
}

@media (prefers-reduced-motion: reduce) {
  .rv, .rv.in, .hero-copy.rv { opacity: 1 !important; transform: none !important; }
  .fan .stage,
  .fan.live .stage { transition: none !important; }
  .claim, .shield { opacity: 1 !important; transform: none !important; }
}
