/* SecurityTouch enhancement layer.
   Loaded after styles.css and both theme files. It brings the later add-on
   components (videos, access flow, family tools, zone filter, FAQ search) into
   the day (cut paper) and night (slate glass) worlds, and styles the newer
   content blocks. Every surface reads its look from the --st-* tokens below. */

:root[data-mode="day"] {
  --st-surface: var(--grain), var(--color-card);
  --st-surface-2: var(--grain), var(--color-paper-2);
  --st-lift: var(--shadow-paper);
  --st-ring: none;
  --st-pill-bg: var(--grain), var(--color-paper-2);
  --st-pill-shadow: inset 0 0 0 1px var(--color-rule), 0 3px 0 var(--color-edge);
  --st-pill-on-bg: var(--color-ink);
  --st-pill-on-fg: var(--color-paper);
  --st-pill-on-shadow: 0 3px 0 var(--color-ink-2);
  --st-field-bg: var(--color-card);
  --st-field-border: var(--color-muted);
  --st-rule: 2px dashed var(--color-edge);
  --st-tint: var(--grain), color-mix(in oklab, var(--color-accent) 26%, var(--color-card));
  --st-tint-calm: var(--grain), color-mix(in oklab, var(--color-mint) 30%, var(--color-card));
  --st-badge-bg: var(--grain), var(--color-accent);
  --st-badge-fg: var(--color-ink);
  --st-badge-shadow: 0 3px 0 var(--color-accent-deep);
  --st-link-line: var(--color-edge);
  --st-radius: var(--radius-card);
  --st-radius-s: var(--radius-stock);
}
:root[data-mode="night"] {
  --st-surface: var(--color-paper-2);
  --st-surface-2: var(--color-paper-3);
  --st-lift: none;
  --st-ring: inset 0 1px 0 color-mix(in oklab, var(--color-light) 7%, transparent), 0 0 0 1px var(--color-rule), 0 30px 60px -36px var(--color-shade);
  --st-pill-bg: color-mix(in oklab, var(--color-light) 5%, transparent);
  --st-pill-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-light) 13%, transparent);
  --st-pill-on-bg: var(--color-ink);
  --st-pill-on-fg: var(--color-accent-ink);
  --st-pill-on-shadow: none;
  --st-field-bg: color-mix(in oklab, var(--color-light) 4%, transparent);
  --st-field-border: color-mix(in oklab, var(--color-light) 18%, transparent);
  --st-rule: 1px solid var(--color-rule);
  --st-tint: color-mix(in oklab, var(--color-accent) 14%, var(--color-paper-2));
  --st-tint-calm: color-mix(in oklab, var(--color-accent) 10%, var(--color-paper-2));
  --st-badge-bg: var(--color-accent);
  --st-badge-fg: var(--color-accent-ink);
  --st-badge-shadow: none;
  --st-link-line: var(--color-rule);
  --st-radius: 24px;
  --st-radius-s: 16px;
}

/* ---------- Browser surfaces ---------- */
html { scrollbar-width: thin; }
:root[data-mode="night"] { scrollbar-color: var(--color-rule) var(--color-paper); }
a { text-underline-offset: 0.18em; }
.compare td, .compare th, .specs td, .log time, .hours { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }
summary { -webkit-tap-highlight-color: transparent; }

/* ---------- Hero facts ---------- */
.hero-facts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; max-width: 34rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--st-radius-s); background: var(--st-pill-bg); box-shadow: var(--st-pill-shadow); font-size: 0.9rem; font-weight: 500; color: var(--text); }
.hero-facts svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--teal-dark); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-note { margin-bottom: 0; }

/* ---------- Shared paper / glass surface ---------- */
.motion-card,
.family-tool,
.policy-flow .flow-step,
.netmap,
.child-view,
.contact-card { border: 0; border-radius: var(--st-radius); background: var(--st-surface); box-shadow: var(--st-ring); filter: var(--st-lift); color: var(--text); }
:root[data-mode="night"] .band-mint .family-tool,
:root[data-mode="night"] .band-mint .policy-flow .flow-step,
:root[data-mode="night"] .band-mint .netmap { background: var(--st-surface-2); }

/* ---------- Motion feature ---------- */
.motion-section { background: transparent; }
.motion-card { padding: clamp(16px, 2.4vw, 28px); gap: clamp(24px, 4vw, 56px); }
.motion-figure video { border: 0; border-radius: calc(var(--st-radius) - 8px); background: var(--color-paper-3); }
.motion-figure figcaption { margin-top: 12px; font-size: 0.86rem; line-height: 1.45; color: var(--text-soft); }
.motion-copy h3 { margin: 0 0 12px; }
.motion-copy p { max-width: 38ch; }
.motion-copy .link { font-weight: 600; }

/* ---------- Promo film ---------- */
.promo-section { background: transparent; padding-block: var(--section); }
.promo-split { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: center; gap: clamp(32px, 7vw, 104px); }
.promo-frame { position: relative; margin: 0; }
.promo-video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border: 0; border-radius: var(--st-radius); background: var(--color-paper-3); box-shadow: var(--st-ring); filter: var(--st-lift); }
:root[data-mode="day"] .promo-frame { rotate: -1.2deg; }
:root[data-mode="day"] .promo-frame::before { content: ""; position: absolute; inset: 5% -7% 7% 9%; z-index: -1; background: var(--grain), var(--color-sugar); rotate: 4deg; border-radius: 6px; clip-path: var(--torn-both); }
[dir="rtl"]:root[data-mode="day"] .promo-frame { rotate: 1.2deg; }
.promo-copy h2 { margin-bottom: 18px; }
.promo-copy .lede { margin-bottom: 0; }
.points { list-style: none; margin: 28px 0 0; padding: 0; max-width: 46ch; }
.points li { position: relative; padding: 14px 0; padding-inline-start: 34px; border-top: var(--st-rule); }
.points li:last-child { border-bottom: var(--st-rule); }
.points li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 21px; width: 13px; height: 7px; border-left: 3px solid var(--teal-dark); border-bottom: 3px solid var(--teal-dark); transform: rotate(-45deg); }
.points b { display: block; font-weight: 600; }
.points span { color: var(--text-soft); }

/* ---------- Access flow ---------- */
.policy-flow { gap: clamp(14px, 2vw, 26px); counter-reset: none; }
.policy-flow > li { position: relative; display: flex; }
.policy-flow .flow-step { display: flex; flex-direction: column; gap: 10px; width: 100%; height: auto; padding: 22px 22px 24px; overflow: visible; }
.policy-flow .flow-number { width: 44px; height: 44px; margin-bottom: 6px; border-radius: 999px; background: var(--st-badge-bg); color: var(--st-badge-fg); box-shadow: var(--st-badge-shadow); font-family: var(--display); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.policy-flow h3 { font-size: 1.2rem; }
.policy-flow .flow-step p { padding: 0; margin: 0; color: var(--text-soft); }
.policy-flow .flow-eg { margin-top: auto !important; padding-top: 14px !important; border-top: var(--st-rule); color: var(--text) !important; font-weight: 600; font-size: 0.95rem; }
/* the link between steps: a short run of travelling dashes */
.policy-flow > li + li::before { content: ""; position: absolute; top: 43px; inset-inline-end: 100%; width: clamp(14px, 2vw, 26px); height: 3px; z-index: 1; background: repeating-linear-gradient(90deg, var(--teal-dark) 0 5px, transparent 5px 10px); background-size: 10px 3px; animation: st-travel 0.9s linear infinite; }
[dir="rtl"] .policy-flow > li + li::before { animation-direction: reverse; }
@keyframes st-travel { to { background-position: 10px 0; } }

/* ---------- Pills: zone filter, routine choices, pause length ---------- */
.zone-controls { margin-bottom: 12px; }
.zone-controls button,
.family-choice-group button { min-height: 44px; padding: 6px 16px; border: 0; border-radius: var(--st-radius-s); background: var(--st-pill-bg); box-shadow: var(--st-pill-shadow); color: var(--text); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: translate 0.12s cubic-bezier(0.22, 1, 0.36, 1); }
.zone-controls button:hover,
.family-choice-group button:hover { translate: 0 -1px; }
.zone-controls button:active,
.family-choice-group button:active { translate: 0 2px; }
.zone-controls button[aria-pressed="true"],
.family-choice-group button[aria-pressed="true"] { background: var(--st-pill-on-bg); color: var(--st-pill-on-fg); box-shadow: var(--st-pill-on-shadow); }
.family-duration-options label { min-height: 44px; padding: 6px 14px; border: 0; border-radius: var(--st-radius-s); background: var(--st-pill-bg); box-shadow: var(--st-pill-shadow); color: var(--text); }
.family-duration-options label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--teal-dark); }
.family-duration-options input { accent-color: var(--teal-dark); }
.zone-status, .faq-search-result { font-size: 0.92rem; }
.zone[hidden] { display: none; }

/* ---------- Fields ---------- */
.faq-search label,
.family-fields label,
.family-duration legend { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.faq-search input,
.family-fields select { min-height: 50px; padding: 10px 16px; border: 1px solid var(--st-field-border); border-radius: var(--radius-input, 14px); background: var(--st-field-bg); color: var(--text); font: inherit; }
.faq-search input::placeholder { color: var(--text-soft); opacity: 1; }
.family-fields select { appearance: none; -webkit-appearance: none; padding-inline-end: 42px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 21px) 55%, calc(100% - 15px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
[dir="rtl"] .family-fields select { background-position: 15px 55%, 21px 55%; }
:root[data-mode="night"] .family-fields select option { background: var(--color-paper-2); color: var(--color-ink); }
.faq-search input:focus-visible,
.family-fields select:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.faq details[hidden] { display: none; }

/* ---------- Family tools ---------- */
.family-preview-disclaimer { margin: -12px 0 28px; padding: 12px 18px; border: 0; border-radius: var(--st-radius-s); background: var(--st-tint); color: var(--text); font-size: 0.95rem; }
[dir="rtl"] .family-preview-disclaimer { border-radius: var(--st-radius-s); }
.family-preview-disclaimer strong { color: inherit; }
.family-tool { padding: clamp(20px, 2.6vw, 30px); }
.family-tool-top { margin-bottom: 14px; }
.family-tool-top h3 { margin: 0; }
.preview-pill { border: 0; background: var(--st-pill-bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-soft); font-weight: 600; }
.family-tool > p:not([class]) { color: var(--text-soft); }
.family-status, .usage-summary { color: var(--text); font-weight: 600; }
.routine-timeline li { border-top: var(--st-rule); }
.routine-timeline time { color: var(--teal-dark); font-weight: 600; }
.routine-timeline strong { color: var(--text); font-weight: 600; }
.family-preview-actions .btn { min-height: 48px; }
.family-action-status { border: 0; border-radius: var(--st-radius-s); background: var(--st-tint-calm); color: var(--text); font-weight: 500; }
.family-reward-total { color: var(--text-soft); font-weight: 600; }
.usage-bars li { border-top: var(--st-rule); }
.usage-bars li strong { color: var(--text); font-weight: 600; }
.usage-track { height: 14px; border: 0; background: var(--st-pill-bg); box-shadow: inset 0 0 0 1px var(--line); }
.usage-track span { background: var(--teal-dark); }
:root[data-mode="day"] .usage-bars li:nth-child(2) .usage-track span { background: var(--color-accent-deep); }
:root[data-mode="day"] .usage-bars li:nth-child(3) .usage-track span { background: var(--color-accent-2); }
:root[data-mode="day"] .usage-bars li:nth-child(4) .usage-track span { background: var(--color-accent-3); }
:root[data-mode="night"] .usage-bars li:nth-child(2) .usage-track span { background: var(--color-accent-2); }
:root[data-mode="night"] .usage-bars li:nth-child(3) .usage-track span { background: var(--color-dusk); }
:root[data-mode="night"] .usage-bars li:nth-child(4) .usage-track span { background: var(--color-success); }

/* ---------- App demo restart ---------- */
.demo-reset { min-height: 36px; padding: 4px 12px; border: 0; border-radius: var(--st-radius-s); background: var(--st-pill-bg); box-shadow: var(--st-pill-shadow); color: var(--text); font-weight: 600; }
.demo-reset:hover { background: var(--st-pill-bg); translate: 0 -1px; }
.wait-result b { font-weight: 600; }

/* ---------- Child's view (parents) ---------- */
.child-view { padding: clamp(20px, 3vw, 32px); max-width: 440px; margin-inline-start: auto; }
.child-view h3 { margin-bottom: 4px; }
.child-view .cv-sub { margin: 0 0 18px; color: var(--text-soft); font-size: 0.95rem; }
.cv-left { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 600; }
.cv-left b { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.child-view .usage-track { margin-bottom: 20px; }
.child-view .routine-timeline { margin-bottom: 20px; }
.cv-ask { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: var(--st-radius-s); background: var(--st-badge-bg); color: var(--st-badge-fg); box-shadow: var(--st-badge-shadow); font-weight: 600; }
:root[data-mode="night"] .flow .child-view { background: var(--st-surface); }

/* ---------- Network map (router) ---------- */
.netmap { padding: clamp(20px, 3vw, 40px); }
.nm-chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); }
.nm-chain > li { position: relative; padding: 18px 20px; border-radius: var(--st-radius-s); background: var(--st-pill-bg); box-shadow: var(--st-pill-shadow); }
.nm-chain > li + li::before { content: ""; position: absolute; top: 50%; inset-inline-end: 100%; width: clamp(28px, 5vw, 72px); height: 3px; margin-top: -1px; background: repeating-linear-gradient(90deg, var(--teal-dark) 0 6px, transparent 6px 12px); background-size: 12px 3px; animation: st-travel-12 1s linear infinite; }
[dir="rtl"] .nm-chain > li + li::before { animation-direction: reverse; }
@keyframes st-travel-12 { to { background-position: 12px 0; } }
.nm-chain b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.nm-chain span { color: var(--text-soft); font-size: 0.93rem; }
.nm-chain > li.nm-us { background: var(--st-pill-on-bg); color: var(--st-pill-on-fg); box-shadow: var(--st-pill-on-shadow); }
.nm-chain > li.nm-us span { color: inherit; opacity: 0.78; }
.nm-branch { margin: 0; padding: 26px 0 14px; text-align: end; color: var(--text-soft); font-size: 0.93rem; font-weight: 600; }
.nm-zones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.nm-zones li { padding: 16px 20px 18px; border-top: var(--st-rule); }
.nm-zones b { display: block; margin-bottom: 4px; font-weight: 600; }
.nm-zones span { color: var(--text-soft); font-size: 0.95rem; }
.nm-zones i { display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; border-radius: 4px; vertical-align: -1px; background: var(--teal-dark); }
.nm-zones li:nth-child(2) i { background: var(--amber); }
.nm-zones li:nth-child(3) i { background: var(--coral); }

/* ---------- Contact card (support) ---------- */
.contact-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(20px, 4vw, 56px); align-items: start; padding: clamp(22px, 3vw, 40px); }
.contact-card h3 { margin-bottom: 10px; }
.contact-card p { color: var(--text-soft); }
.contact-card ul { list-style: none; margin: 0; padding: 0; }
.contact-card li { padding: 12px 0; border-top: var(--st-rule); }
.contact-card li:last-child { border-bottom: var(--st-rule); }
.contact-card li b { display: block; font-weight: 600; }
.contact-card li span { color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Footer extras ---------- */
.site-footer .foot-meta { margin: 14px 0 0; font-size: 0.93rem; }
.site-footer .foot-meta a { text-decoration: underline; text-decoration-thickness: 1px; }
.site-footer .legal { row-gap: 8px; }

/* ---------- Tables on small screens ---------- */
.table-scroll { -webkit-overflow-scrolling: touch; }
.table-scroll:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .promo-split { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .promo-frame { width: min(100%, 300px); justify-self: center; }
  .policy-flow > li + li::before { display: none; }
  .contact-card { grid-template-columns: minmax(0, 1fr); }
  .family-preview-grid { grid-template-columns: minmax(0, 1fr); }
  .child-view { margin-inline: auto; }
  .nm-chain, .nm-zones { grid-template-columns: minmax(0, 1fr); }
  .nm-chain { gap: 30px; }
  .nm-chain > li + li::before { top: auto; bottom: 100%; inset-inline-end: auto; inset-inline-start: 32px; width: 3px; height: 30px; margin: 0; background: repeating-linear-gradient(180deg, var(--teal-dark) 0 6px, transparent 6px 12px); background-size: 3px 12px; animation-name: st-travel-12v; animation-direction: normal; }
  .nm-branch { text-align: start; }
}
@keyframes st-travel-12v { to { background-position: 0 12px; } }
@media (max-width: 520px) {
  .hero-facts li { font-size: 0.86rem; }
  .family-preview-actions .btn { width: 100%; }
  .usage-bars li { grid-template-columns: minmax(5.2rem, 1fr) minmax(60px, 2fr) minmax(3.6rem, auto); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .policy-flow > li + li::before, .nm-chain > li + li::before { animation: none !important; }
}

/* ---------- v0.01: the three short films ---------- */
.reel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 32px); align-items: start; }
.reel-card { margin: 0; min-width: 0; }
.reel-video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border: 0; border-radius: var(--st-radius); background: var(--color-paper-3); box-shadow: var(--st-ring); filter: var(--st-lift); }
.reel-card figcaption { margin-top: 16px; }
.reel-card figcaption b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.reel-card figcaption span { display: block; margin-top: 4px; color: var(--text-soft); font-size: 0.95rem; }
:root[data-mode="day"] .reel-grid .reel-card:nth-child(1) { rotate: -0.8deg; }
:root[data-mode="day"] .reel-grid .reel-card:nth-child(3) { rotate: 0.8deg; }
.reel-split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: center; }
.reel-split h2 { margin-bottom: 18px; }
:root[data-mode="day"] .reel-solo { rotate: -1deg; }
[dir="rtl"]:root[data-mode="day"] .reel-solo { rotate: 1deg; }
@media (max-width: 900px) {
  .reel-grid { grid-template-columns: minmax(0, 1fr); max-width: 360px; margin-inline: auto; }
  .reel-split { grid-template-columns: minmax(0, 1fr); }
  .reel-solo { width: min(100%, 300px); justify-self: center; }
}
