/* =========================================================
   Vigil — site-specific components (loaded after style.css)
   ========================================================= */
:root { --maxw: 1280px; }
body { font-size: 17px; }
.mono { font-family: var(--mono); }

/* ---------- Brand ---------- */
.brand-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
.brand-name { font-size: 16px; letter-spacing: -.01em; }

/* ---------- Nav additions ---------- */
.menu-btn { display: inline-flex; gap: 8px; width: auto; padding: 0 10px; color: var(--muted); }
.menu-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.menu-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.icon-btn svg { width: 18px; height: 18px; }
.sound-btn .ic-on, .sound-btn .eq { display: none; }
html.sound-on .sound-btn .ic-off { display: none; }
html.sound-on .sound-btn .eq { display: flex; }
html.sound-on .sound-btn { color: #fff; }
.eq { align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 2px; height: 100%; border-radius: 1px; background: var(--ch, var(--red)); animation: eq 1.1s ease-in-out infinite; transform-origin: bottom; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.8s; }
@keyframes eq { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.nav-links { position: static; transform: none; flex: 1; justify-content: center; min-width: 0; }
@media (max-width: 1320px) {
  .nav-actions .link-quiet { display: none; }
}
@media (max-width: 1100px) {
  .nav-links { display: none; }
}
@media (max-width: 1040px) {
  .menu-btn .menu-label { display: none; }
  .menu-btn { padding: 0; width: 40px; justify-content: center; }
}
@media (max-width: 640px) {
  .nav .btn-light span { display: none; }
  .nav .btn-light { width: 36px; padding: 0; }
  .nav .btn-light svg { display: block !important; }
}

/* ---------- Full-screen menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 48;
  background: rgba(7,8,10,.86);
  -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
  display: grid; place-items: center; padding: 110px 24px 40px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .45s var(--ease), visibility 0s linear .45s;
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s var(--ease); }
.menu-inner { width: min(1100px, 100%); display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: end; }
.menu-links { list-style: none; margin: 0; padding: 0; }
.menu-links li { overflow: hidden; }
.menu-links a {
  display: flex; align-items: baseline; gap: 18px; padding: 6px 0;
  font-size: clamp(32px, 5vw, 60px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
  color: rgba(255,255,255,.88); transition: color .25s, transform .25s var(--ease);
  transform: translateY(110%);
}
.menu.is-open .menu-links a { transform: none; transition: transform .7s var(--ease), color .25s; }
.menu.is-open .menu-links li:nth-child(2) a { transition-delay: .04s; }
.menu.is-open .menu-links li:nth-child(3) a { transition-delay: .08s; }
.menu.is-open .menu-links li:nth-child(4) a { transition-delay: .12s; }
.menu.is-open .menu-links li:nth-child(5) a { transition-delay: .16s; }
.menu.is-open .menu-links li:nth-child(6) a { transition-delay: .2s; }
.menu.is-open .menu-links li:nth-child(7) a { transition-delay: .24s; }
.menu-links a:hover { color: var(--ch); }
.menu-links .mono { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: .04em; }
.menu-side { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding-bottom: 10px; }
.menu-ca { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); max-width: 100%; }
.menu-ca code { color: #D8D8D9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.menu-social { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.menu-social a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 16px; }
.menu-social a:hover { color: #fff; }
.menu-social svg { width: 14px; height: 14px; }
.menu-hint { font-size: 12px; color: var(--muted); margin: 0; }
html.menu-open .rail, html.menu-open .letterbox { opacity: 0 !important; }
@media (max-width: 860px) {
  .menu { place-items: start center; overflow-y: auto; }
  .menu-inner { grid-template-columns: 1fr; gap: 36px; }
  .menu-hint { display: none; }
}

/* ---------- Intro gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; text-align: center;
  background: var(--bg); overflow: hidden; isolation: isolate;
  transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease);
}
.gate[hidden] { display: none; }
.gate.is-leaving { opacity: 0; transform: scale(1.06); filter: blur(8px); pointer-events: none; }
.gate .art .scrim { background: radial-gradient(ellipse 38% 34% at 50% 50%, rgba(7,8,10,.9), rgba(7,8,10,.5) 60%, transparent 100%); }
.gate-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: 24px; }
.gate-kicker { margin: 0 0 18px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.gate-title {
  margin: 0; font-size: clamp(64px, 13vw, 168px); font-weight: 600; letter-spacing: -.045em; line-height: .95;
  text-shadow: 0 4px 60px rgba(7,8,10,.7);
}
.gate-sub { margin: 18px 0 40px; font-size: 18px; letter-spacing: .01em; color: var(--muted); }
.gate-enter { height: 48px; padding: 0 26px; font-size: 16px; border-radius: 10px; }
.gate-quiet {
  margin-top: 18px; background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer;
  padding: 8px 10px; border-radius: 6px;
}
.gate-quiet:hover { color: #fff; }
.gate-bar { position: absolute; left: 50%; bottom: 40px; width: 120px; height: 1px; margin-left: -60px; background: rgba(255,255,255,.12); overflow: hidden; }
.gate-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--red), transparent); animation: gatebar 2.4s ease-in-out infinite; }
@keyframes gatebar { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* staged entrance */
.gate .gate-kicker, .gate .gate-title, .gate .gate-sub, .gate .gate-enter, .gate .gate-quiet {
  opacity: 0; transform: translateY(24px); filter: blur(8px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}
.gate.is-in .gate-kicker { transition-delay: .2s; }
.gate.is-in .gate-title { transition-delay: .45s; }
.gate.is-in .gate-sub { transition-delay: .8s; }
.gate.is-in .gate-enter { transition-delay: 1.15s; }
.gate.is-in .gate-quiet { transition-delay: 1.4s; }
.gate.is-in .gate-kicker, .gate.is-in .gate-title, .gate.is-in .gate-sub, .gate.is-in .gate-enter, .gate.is-in .gate-quiet { opacity: 1; transform: none; filter: none; }
html.gate-open body { overflow: hidden; }

/* ---------- Custom cursor (sits above everything, including the Enter button) ---------- */
.cursor { position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.is-visible { opacity: 1; }
.cursor-dot, .cursor-ring { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
.cursor-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 12px rgba(255,255,255,.5); }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), border-color .25s, background .25s;
}
.cursor.is-hot .cursor-ring { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--ch, var(--red)); background: color-mix(in srgb, var(--ch, var(--red)) 10%, transparent); }
.cursor.is-down .cursor-ring { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.cursor.is-text .cursor-ring { opacity: 0; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor summary, html.has-cursor label { cursor: none; }
html.has-cursor input, html.has-cursor textarea { cursor: text; }

/* ---------- Hero ---------- */
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #D6D6D7;
  background: rgba(7,8,10,.5); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); animation: live 2s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }
.hero-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn-ghost { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- Story images ---------- */
.frame img.frame-inner { width: 100%; height: 100%; object-fit: cover; object-position: 0 0; display: block; }
.panel img {
  margin-top: 14px; width: 100%; height: clamp(150px, 30vh, 320px); object-fit: cover; object-position: 50% 50%;
  border-radius: 10px; border: 1px solid var(--border); background: var(--card);
}
.deck-card img {
  flex: 1; min-height: 0; width: 100%; margin-top: 14px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border);
}
html:not(.cinema) .deck-card img { height: 220px; flex: none; }
.zoom-word { font-size: clamp(110px, 30vw, 460px); }
.counter { color: #fff; }

/* ---------- Feature cards ---------- */
.shot { margin: auto 0 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(0,0,0,.9); }
.shot img { width: 100%; height: auto; display: block; }
.ladder { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 8px; }
.ladder li {
  display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); font-size: 15px;
}
.ladder em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ladder li.done { border-color: rgba(74,222,155,.3); background: rgba(74,222,155,.06); }
.ladder li.done em, .ladder li.done span { color: #7BE8B6; }
.levels-mini { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.levels-mini span {
  display: grid; place-items: center; height: 64px; border-radius: 12px; font-weight: 600; font-size: 17px; color: var(--muted);
  background: linear-gradient(#15161A, #0F1013); border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 0 #050506;
}
.levels-mini span.on { color: #fff; border-color: rgba(255,99,99,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 0 #2a0508, 0 0 30px rgba(255,99,99,.25); }
.chat { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { margin: 0; max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.msg.me { align-self: flex-end; background: #E6E6E6; color: #1E1F20; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: rgba(154,134,255,.1); border: 1px solid rgba(154,134,255,.25); color: #E4E0FF; border-bottom-left-radius: 4px; }
.card p, .ticks li { font-size: 16px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { min-height: 240px; }
.step-n { font-size: 13px; color: rgb(var(--glow)); }
.step h3 { margin-top: auto; }

/* ---------- Rule library ---------- */
.library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lib { gap: 14px; }
.lib h3 { margin: 0; }
.lib ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lib li { position: relative; padding: 8px 0 8px 18px; color: #C9C9CA; font-size: 16px; border-top: 1px solid rgba(255,255,255,.05); }
.lib li:first-child { border-top: 0; }
.lib li::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 2px; background: rgb(var(--glow)); opacity: .8; }
.plain { margin-top: 16px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; padding: 36px; }
.plain h3 { font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 12px; letter-spacing: -.01em; }
.plain .eyebrow { margin-bottom: 12px; }
.plain-example { display: flex; flex-direction: column; gap: 14px; }
.plain-in {
  margin: 0; padding: 18px 20px; border-radius: 12px; font-size: 14px; line-height: 1.6; color: #E8E8E8;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
}
.plain-out { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-rule {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-size: 14px;
  background: rgba(255,99,99,.08); border: 1px solid rgba(255,99,99,.3); color: #FFD1D1;
}
.chip-rule svg { width: 15px; height: 15px; color: var(--red); }

/* ---------- Plans / tiers ---------- */
.price .unit { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan .badge { color: var(--red) !important; }
.ca-card { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-direction: row; padding: 22px 24px; }
.ca-card[hidden] { display: none; }
.ca-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ca-left .eyebrow { margin: 0; }
.ca-code { font-size: 15px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.ca-actions svg { width: 15px; height: 15px; }

/* ---------- Quote / footer ---------- */
.quote figcaption { text-align: center; }
.footer-legal { margin: 40px 0 0; max-width: 760px; font-size: 14px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta-inner .hero-buttons { margin-top: 30px; }
.cta-inner .notify { margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .library { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .step { min-height: 0; }
  .step h3 { margin-top: 12px; }
}
@media (max-width: 860px) {
  .plain { grid-template-columns: 1fr; padding: 24px; gap: 22px; }
  .ca-card { flex-direction: column; align-items: stretch; }
  .tiers .plan.is-featured { order: -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .library { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; width: 100%; max-width: 340px; }
  .hero-buttons .btn { width: 100%; }
  .hero-kicker { margin-bottom: 20px; }
  .msg { font-size: 14px; }
  .gate-enter { height: 52px; }
  .panel img { height: 26vh; }
}
@media (prefers-reduced-motion: reduce) {
  .gate .gate-kicker, .gate .gate-title, .gate .gate-sub, .gate .gate-enter, .gate .gate-quiet { transition: none; opacity: 1; transform: none; filter: none; }
  .eq i, .dot-live, .gate-bar span { animation: none; }
}

/* =========================================================
   Rule builder page
   ========================================================= */
.builder { max-width: 1360px; margin: 0 auto; padding: 136px 24px 120px; }
.b-head { text-align: center; max-width: 860px; margin: 0 auto 52px; }
.b-head .eyebrow { margin-bottom: 16px; }
.b-head h1 { margin: 0; font-size: clamp(40px, 5.4vw, 64px); font-weight: 600; line-height: 1.1; text-shadow: 0 2px 40px rgba(7,8,10,.7); }
.b-lede { margin: 18px auto 0; max-width: 640px; font-size: 18px; letter-spacing: .01em; color: #B4B4B5; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 32px; }
.preset {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; text-align: left; cursor: pointer;
  background: rgba(12,13,15,.82); border: 1px solid var(--border); color: #fff; font: inherit;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color .2s, box-shadow .2s;
}
.preset b { font-weight: 600; font-size: 16px; }
.preset span { font-size: 14px; color: var(--muted); }
.preset:hover { border-color: rgba(255,255,255,.2); }
.preset[aria-pressed="true"] { border-color: rgba(255,99,99,.55); box-shadow: 0 0 0 1px rgba(255,99,99,.2), 0 0 40px rgba(255,99,99,.14); }

.b-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.b-cats { position: sticky; top: 100px; }
.b-cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.b-cats a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.b-cats a:hover { color: #fff; background: rgba(255,255,255,.05); }
.b-cats .h-ic { width: 16px; height: 16px; color: currentColor; }
.b-cats em { margin-left: auto; font-style: normal; font-size: 12px; }

.b-main { display: flex; flex-direction: column; gap: 44px; min-width: 0; }
.rule-cat { scroll-margin-top: 100px; }
.rule-cat header { margin-bottom: 14px; }
.rule-cat h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 600; }
.rule-cat h2 .h-ic { color: var(--red); }
.rule-cat header p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.rule-list { display: grid; gap: 10px; }
.rcard { padding: 18px 20px; gap: 14px; }
.rcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rcard h3 { margin: 0 0 4px; font-size: 17px; }
.rcard .rcard-head p { font-size: 15px; }
.rcard.off h3 { color: #C4C4C5; }
.rcard.off .rcard-inputs { opacity: .4; }
.rcard.flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--red), 0 0 40px rgba(255,99,99,.4); } 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.06); } }

.switch { position: relative; flex: none; cursor: pointer; margin-top: 2px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.track { position: relative; display: block; width: 42px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.16); transition: background .2s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--red); outline-offset: 3px; }

.rcard-inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.field {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); transition: border-color .2s;
}
.field:focus-within { border-color: var(--red); }
.field input { width: 9ch; padding: 0; border: 0; outline: none; background: none; color: #fff; font: 500 16px var(--mono); }
.field.text input { width: 26ch; font-family: var(--sans); }
.field.time input { width: auto; color-scheme: dark; }
.field .unit { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.ladder-edit { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ladder-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 15px; }
.ladder-row .field input { width: 6ch; }
.add-step { align-self: flex-start; height: 34px; }

.plain-card { padding: 20px; gap: 12px; }
.plain-card label { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.plain-card label .h-ic { color: #9A86FF; }
.plain-card textarea {
  width: 100%; min-height: 76px; resize: vertical; padding: 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); color: #fff; font: 16px/1.5 var(--sans);
}
.plain-card textarea::placeholder { color: var(--muted); }
.plain-card textarea:focus-visible { outline: none; border-color: #9A86FF; }
.plain-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.plain-actions .form-msg { margin: 0; min-height: 0; }

.b-side { position: sticky; top: 100px; }
.side-card { padding: 20px; gap: 14px; }
.side-h { margin: 0; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.level {
  display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: rgba(255,255,255,.03); color: #fff; font: inherit;
}
.level b { font-size: 15px; }
.level span { font-size: 12px; line-height: 1.3; color: var(--muted); }
.level[aria-checked="true"] { border-color: rgba(255,99,99,.55); background: rgba(255,99,99,.08); }
.side-sep { height: 1px; background: var(--border); }
.side-row { display: flex; justify-content: space-between; align-items: center; }
.side-count { font-size: 12px; color: var(--muted); }
.sum-list {
  list-style: none; margin: 0; padding: 0 4px 18px 0; max-height: 36vh; overflow: auto; display: grid; gap: 12px;
  -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent);
}
.sum-cat { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sum-list ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.sum-list ul li { position: relative; padding-left: 14px; font-size: 14px; color: #DADADB; }
.sum-list ul li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 1px; background: var(--red); }
.side-actions { display: flex; flex-direction: column; gap: 10px; }
.side-actions .btn-lg { width: 100%; }
.side-minor { display: flex; gap: 6px; }
.side-minor .btn { flex: 1; padding: 0 8px; font-size: 13px; }
.file-btn { cursor: pointer; position: relative; }
.file-btn:focus-within { outline: 2px solid var(--red); outline-offset: 3px; }
.side-state { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.ext-state.ok { color: #7BE8B6; }
body.is-dirty [data-save-state] { color: #FFCB85; }
.b-mobilebar { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 10px; background: #E6E6E6; color: #1E1F20; font-size: 14px; font-weight: 500;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); opacity: 0; transform: translate(-50%, 20px); pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #FF9A9A; color: #2a0508; }
html.page-builder .footer { margin-top: 40px; }

@media (max-width: 1100px) {
  .b-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .b-cats { display: none; }
}
@media (max-width: 860px) {
  .builder { padding-top: 112px; }
  .b-grid { grid-template-columns: 1fr; }
  .b-side { position: static; }
  .presets { grid-template-columns: 1fr; }
  .sum-list { max-height: none; }
  .plain-actions { flex-direction: column; align-items: stretch; }
  .b-mobilebar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 46;
    justify-content: space-between; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px;
    background: rgba(14,15,17,.88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.1);
  }
  .b-mobilebar .mono { font-size: 12px; color: var(--muted); }
  .toast { bottom: 84px; }
  html.page-builder .footer { padding-bottom: 90px; }
}

/* Wider dark pool behind the hero copy so the supporting line stays readable over the paint */
html.webgl .hero .scrim { background: radial-gradient(ellipse 52% 38% at 50% 48%, rgba(7,8,10,.92), rgba(7,8,10,.62) 55%, transparent 100%); }
@media (max-width: 640px) {
  html.webgl .hero .scrim { background: radial-gradient(ellipse 95% 40% at 50% 46%, rgba(7,8,10,.9), rgba(7,8,10,.55) 60%, transparent 100%); }
}


/* =========================================================
   Bigger, readable screenshots (chapter I + chapter II panels)
   ========================================================= */
/* Chapter I: screenshot appears centred, near full-screen */
.scene-reveal .scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.frame { aspect-ratio: 1600 / 1107; }
.frame img.frame-inner { object-fit: cover; object-position: 50% 50%; }
html.cinema .scene-reveal .scene { grid-template-columns: minmax(0, 640px); }
html.cinema .scene-reveal .frame {
  position: absolute; left: 50%; top: calc(50% + 28px); z-index: 2;
  width: min(94vw, 1560px, calc((100svh - 150px) * 1.4454));
  box-shadow: 0 60px 160px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.06), 0 0 120px -30px color-mix(in srgb, var(--ch) 45%, transparent);
}

/* Chapter II: large panels, screenshot takes most of the panel */
.panel {
  width: min(1280px, 86vw);
  display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr; column-gap: 28px; row-gap: 10px; align-items: start;
}
.panel > .panel-n, .panel > h3, .panel > p { grid-column: 1; }
.panel h3 { font-size: 26px; }
.panel img {
  grid-column: 2; grid-row: 1 / span 3; margin: 0; align-self: center;
  width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: min(62vh, 680px); object-fit: contain;
  background: #07080A;
}
@media (max-width: 860px) {
  .panel { width: 88vw; display: flex; }
  .panel img { margin-top: 12px; max-height: none; }
  html.cinema .scene-reveal .frame { width: 94vw; top: 50%; }
}
/* Chapter II: keep the whole panel on screen */
.scene-pan .scene { gap: 28px; padding-top: 96px; padding-bottom: 40px; }
.scene-pan .ch-title { font-size: clamp(32px, 3.8vw, 56px); }
.scene-pan .ch-meta { margin-bottom: 14px; }
.panel img { max-height: max(220px, min(680px, calc(100svh - 400px))); }
.panel { align-self: center; }


/* =========================================================
   3D intro
   ========================================================= */
html.gate-pending .gate[hidden] { display: grid; }
html.gate-pending body { overflow: hidden; }
.gate .intro3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
html.has-intro3d .gate .art .ribbons,
html.has-intro3d .gate .art .grain,
html.has-intro3d .gate .art .vignette,
html.has-intro3d .gate .gate-bar { display: none; }
html.has-intro3d .gate { place-items: end center; }
html.has-intro3d .gate .art .scrim {
  background:
    linear-gradient(to top, rgba(7,8,10,.94) 0%, rgba(7,8,10,.7) 24%, rgba(7,8,10,0) 52%),
    radial-gradient(ellipse 120% 80% at 50% 40%, transparent 55%, rgba(7,8,10,.75) 100%);
}
html.has-intro3d .gate-inner { padding-bottom: clamp(36px, 8vh, 96px); }
html.has-intro3d .gate-title { font-size: clamp(64px, 11vw, 150px); }
html.has-intro3d .gate-sub { margin: 14px 0 30px; }
/* text arrives after the snap */
html.has-intro3d .gate.is-in .gate-kicker { transition-delay: 4.0s; }
html.has-intro3d .gate.is-in .gate-title  { transition-delay: 4.25s; }
html.has-intro3d .gate.is-in .gate-sub    { transition-delay: 4.65s; }
html.has-intro3d .gate.is-in .gate-enter  { transition-delay: 4.95s; }
html.has-intro3d .gate.is-in .gate-quiet  { transition-delay: 5.2s; }
html.has-intro3d .gate .gate-title { letter-spacing: .12em; }
html.has-intro3d .gate.is-in .gate-title { letter-spacing: -.045em; transition-property: opacity, transform, filter, letter-spacing; transition-duration: 1.6s; }
.gate.is-skip .gate-kicker, .gate.is-skip .gate-title, .gate.is-skip .gate-sub,
.gate.is-skip .gate-enter, .gate.is-skip .gate-quiet { transition-delay: 0s !important; }
/* the dive: text blows past the camera */
.gate.is-diving .gate-inner { opacity: 0; transform: scale(1.25); filter: blur(10px); transition: opacity .6s var(--ease), transform .8s var(--ease), filter .6s var(--ease); }
html.has-intro3d .gate.is-leaving { transform: none; filter: none; transition: opacity 1.1s var(--ease); }
.gate .art .ribbons { transition: opacity 1s var(--ease); }
html.js .gate:not(.is-in) .art .ribbons { opacity: 0; }


/* =========================================================
   Extension install guide
   ========================================================= */
.install {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: rgba(7,8,10,.78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .35s var(--ease);
}
.install[hidden] { display: none; }
.install.is-open { opacity: 1; }
.install-card {
  width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 30px; border-radius: 20px;
  background: #0E0F12; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 90px -20px rgba(255,99,99,.25);
  transform: translateY(16px); transition: transform .45s var(--ease);
}
.install.is-open .install-card { transform: none; }
.install-card .eyebrow { margin: 0 0 10px; }
.install-card h2 { margin: 0 0 18px; font-size: 28px; font-weight: 600; letter-spacing: -.01em; }
.install-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.install-steps li {
  counter-increment: s; position: relative; padding: 12px 14px 12px 52px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 2px;
}
.install-steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font: 500 13px var(--mono); color: var(--red);
  background: rgba(255,99,99,.1); border: 1px solid rgba(255,99,99,.3);
}
.install-steps b { font-weight: 600; font-size: 16px; }
.install-steps span { color: var(--muted); font-size: 15px; }
.install-steps code, .install-next code { font-family: var(--mono); font-size: 13px; color: #FFD1D1; background: rgba(255,99,99,.08); padding: 1px 6px; border-radius: 5px; }
.install-next { margin: 16px 0 0; color: var(--muted); font-size: 15px; }
.install-next a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.install-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
