/* ============================================================
   MISOGI WORKS · SHARED COMPONENTS
   Loaded second on every page, after tokens.css.
   One version of each shared piece: base, buttons, chips, answer
   options, the 1 to 10 scale, cards, section headers, quotes,
   price lines, progress dots, form fields, notices, nav, footer.
   Page sections live in new_design.css. Nothing here uses a raw
   colour or size: everything comes from tokens.css.
   ============================================================ */

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
ul[role="list"], ol[role="list"] { list-style: none; }
[hidden] { display: none !important; }

/* Focus: always visible. The ring is dark orange on light, bright orange on dark, black on orange. */
:focus-visible {
    outline: 2px solid var(--focus-ring, var(--accent-ink));
    outline-offset: 3px;
}
/* Dark areas: brighter orange for text and focus rings.
   New dark sections should use class="on-dark". The rest of this list covers
   existing sections until phase 3 rebuilds them. */
.nav, .footer, .on-dark, .f-hero, .f-collapse, .f-ways, .f-testimonials, .f-cred.dark,
.rep-section.dark, .rep-header, .rep-toc, .f-abt-track, .dx-land-map, .f-f48-video, .f-f48-timeline, .f-f48-stories, .f-f48-who,
[style*="background: var(--f-dark)"], [style*="background: var(--f-charcoal)"], [style*="background: var(--f-black)"] {
    --focus-ring: var(--accent);
    --accent-text: var(--accent);
}
.f-cta-banner { --focus-ring: var(--black); }

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Skip link: hidden until a keyboard user tabs to it */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 2000;
    padding: var(--space-3) var(--space-5);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius);
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Scroll reveal (switched off under reduced motion, see the end of this file) */
.sr {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.sr.is-visible { opacity: 1; transform: none; }
.sr-d1 { transition-delay: 0.12s; }
.sr-d2 { transition-delay: 0.22s; }
.sr-d3 { transition-delay: 0.34s; }
.sr-d4 { transition-delay: 0.46s; }

/* ── Buttons ───────────────────────────────────────────────────
   Primary: orange fill, dark text, 48px tall. Never two side by side.
   .f-btn names are the older spelling of the same button. */
.btn, .f-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 48px;
    padding: var(--space-3) var(--space-6);
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary, .f-btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}
.btn-primary:hover, .f-btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
/* Outlined buttons, kept for existing sections. New work uses primary + quiet only. */
.f-btn-outline { background: transparent; color: var(--accent-ink); border-color: var(--accent-ink); }
.f-btn-outline:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.f-btn-outline-light { background: transparent; color: var(--on-dark); border-color: rgba(255, 255, 255, 0.45); }
.f-btn-outline-light:hover { border-color: var(--on-dark); }

/* Quiet: an underlined text link that reads as a button target (44px tall hit area) */
.btn-quiet {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0;
    background: none;
    border: 0;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
    cursor: pointer;
}
.btn-quiet:hover { text-decoration-color: var(--accent); }
.on-dark .btn-quiet, .btn-quiet.on-dark { color: var(--on-dark); }

/* ── Chip: small pill choice ───────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: var(--text-sm);
    line-height: 1.35;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}
.chip:hover { border-color: var(--ink-muted); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* ── Option: a full-sentence answer (the Reading) ──────────── */
.option {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: var(--space-4) calc(var(--space-4) + 28px) var(--space-4) var(--space-4);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--text-base);
    line-height: 1.4;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}
.option:hover { border-color: var(--ink-muted); }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
/* A check mark, so the choice reads without colour */
.option[aria-checked="true"]::after {
    content: '';
    position: absolute;
    right: var(--space-4);
    top: 50%;
    width: 7px;
    height: 13px;
    margin-top: -9px;
    border: solid var(--accent-ink);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.options { display: grid; gap: var(--space-2); }
.options-2 { grid-template-columns: 1fr; }
.options-3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
    .options-2 { grid-template-columns: 1fr 1fr; }
    .options-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Scale: 1 to 10 ────────────────────────────────────────── */
.scale {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-2);
}
@media (min-width: 768px) {
    .scale { grid-template-columns: repeat(10, 52px); }
}
.scale-btn {
    min-height: 52px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    cursor: pointer;
    transition: border-color var(--dur-fast), background var(--dur-fast);
}
.scale-btn:hover { border-color: var(--ink-muted); }
.scale-btn[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.scale-ends {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(var(--space-5), 4vw, var(--space-7));
    box-shadow: var(--shadow);
}
.card.on-dark { background: var(--dark-2); color: var(--on-dark); box-shadow: none; }

/* ── Section header: eyebrow + heading ─────────────────────── */
.eyebrow {
    display: block;
    margin-bottom: var(--space-3);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--accent-text);
}
.h1, .h2, .h3 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: var(--leading-display);
    letter-spacing: -0.015em;
}
.h1 { font-size: var(--text-3xl); font-weight: 300; }
.h2 { font-size: var(--text-2xl); }
.h3 { font-size: var(--text-xl); }
.h1 em, .h2 em, .h3 em { font-style: italic; }
.section-head { max-width: 60ch; margin-bottom: var(--space-7); }
.lead { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-muted); }
.on-dark .lead { color: var(--on-dark-muted); }

/* ── Quote ─────────────────────────────────────────────────── */
.quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-lg);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.quote-by {
    display: block;
    margin-top: var(--space-4);
    font-family: var(--font-body);
    font-style: normal;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--ink-muted);
}
.on-dark .quote-by { color: var(--on-dark-muted); }

/* ── Price line ────────────────────────────────────────────── */
.price-line {
    font-size: var(--text-sm);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.price-line .muted { font-weight: 400; color: var(--ink-muted); }

/* ── Progress dots ─────────────────────────────────────────── */
.dots { display: flex; gap: var(--space-2); align-items: center; }
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-muted);
}
.dot.is-done, .dot.is-current { background: var(--accent); border-color: var(--accent); }
.dot.is-current { transform: scale(1.25); }

/* ── Form field and checkbox ───────────────────────────────── */
.field { display: grid; gap: var(--space-2); }
.field-label { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
.field-input {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--text-base);
    color: var(--ink);
}
.field-input::placeholder { color: var(--ink-muted); }
.field-input:hover { border-color: var(--ink-muted); }
.field-input:focus { border-color: var(--accent-ink); }
textarea.field-input { min-height: 96px; resize: vertical; line-height: 1.5; }
.on-dark .field-label { color: var(--on-dark); }
.on-dark .field-input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--on-dark);
}
.on-dark .field-input::placeholder { color: var(--on-dark-muted); }

.check {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: var(--space-3);
    align-items: start;
    min-height: var(--tap);
    font-size: var(--text-sm);
    line-height: 1.5;
    cursor: pointer;
}
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent-ink); }
.check a { text-decoration: underline; text-underline-offset: 0.2em; }

/* ── Notice: a short line that needs attention ─────────────── */
.notice {
    padding: var(--space-3) var(--space-4);
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ink);
}
.on-dark .notice { background: rgba(233, 130, 30, 0.14); color: var(--on-dark); }
/* Links inside running text are underlined, so they read as links without colour */
.notice a, .prose a, .faq-a a, .lead a, .article-body a { text-decoration: underline; text-underline-offset: 0.2em; font-weight: 600; }

/* ============================================================
   NAV · dark blurred bar, full-height panel on phones
   ============================================================ */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(7, 7, 7, 0.72);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: background var(--dur) var(--ease);
}
.nav.scrolled, .nav.is-open { background: rgba(7, 7, 7, 0.9); }
.nav-bar {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    max-width: 1400px;
    min-height: var(--nav-h);
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);   /* fixed 32px, as the approved nav had */
}
@media (max-width: 640px) { .nav-bar { padding: var(--space-3) var(--space-5); } }
.nav-logo { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); margin-right: auto; color: var(--on-dark); }
.nav-logo img { width: auto; height: 40px; object-fit: contain; filter: brightness(0) invert(1); }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.nav-logo-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-logo-tagline { margin-top: 3px; font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.8; }

.nav-links { display: flex; align-items: center; gap: clamp(var(--space-4), 2.2vw, var(--space-6)); list-style: none; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--on-dark);
    white-space: nowrap;
    transition: color var(--dur-fast);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%; right: 50%; bottom: 8px;
    height: 2px;
    background: var(--accent);
    transition: left var(--dur) var(--ease), right var(--dur) var(--ease);
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { left: 0; right: 0; }
.nav-talk { flex: none; }

.nav-toggle {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    background: none;
    border: 0;
    color: var(--on-dark);
    cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform var(--dur) var(--ease), opacity var(--dur-fast);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav.is-open .nav-toggle-bars { background: transparent; }
.nav.is-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* The phone panel: full height under the bar.
   Sized from the bar, because the bar's blur makes it the containing block for fixed children. */
.nav-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 100%);
    height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-6) var(--gutter) var(--space-8);
    background: var(--black);
}
.nav-panel ul { list-style: none; display: grid; }
.nav-panel a {
    display: flex;
    align-items: center;
    min-height: 60px;
    border-bottom: 1px solid var(--line-on-dark);
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--on-dark);
}
.nav-panel a[aria-current="page"] { color: var(--accent); }

@media (max-width: 1023px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
    .nav-bar { gap: var(--space-3); }
    .nav-talk { min-height: var(--tap); padding: var(--space-2) var(--space-4); font-size: 0.7rem; letter-spacing: 0.1em; }
}
@media (min-width: 1024px) {
    .nav-panel { display: none !important; }
}
/* Six links: between 1024 and 1179 px the gaps close up a little, so the bar stays on one line (the type keeps its size) */
@media (min-width: 1024px) and (max-width: 1179px) {
    .nav-links { gap: var(--space-4); }
}
@media (max-width: 479px) {
    .nav-logo-text { display: none; }
}

/* ============================================================
   FOOTER · Notes from the trail, links, one line
   ============================================================ */
.footer {
    background: var(--black);
    color: var(--on-dark-muted);
    padding: clamp(var(--space-7), 7vw, var(--space-8)) var(--gutter) var(--space-6);
    font-size: var(--text-sm);
}
.footer-inner {
    display: grid;
    gap: var(--space-7);
    max-width: 1400px;
    margin: 0 auto;
}
@media (min-width: 900px) {
    .footer-inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
}
.footer-notes h2 {
    margin-bottom: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--on-dark);
}
.footer-notes p { max-width: 60ch; }
.footer-notes-small { margin-top: var(--space-3); font-size: var(--text-xs); line-height: 1.6; color: var(--on-dark-muted); }
.footer-notes-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
    max-width: 520px;
}
.footer-notes-form .field-input { flex: 1 1 220px; }
.footer-notes-done { margin-top: var(--space-5); color: var(--on-dark); }
.footer-links ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    gap: 0 var(--space-7);
    list-style: none;
}
.footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--on-dark-muted);
    transition: color var(--dur-fast);
}
.footer-links a:hover, .footer-contact a:hover { color: var(--accent); }
.footer-contact { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); margin-top: var(--space-4); list-style: none; }
.footer-contact a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    color: var(--on-dark);
    transition: color var(--dur-fast);
}
@media (min-width: 900px) { .footer-contact { grid-column: 2; margin-top: calc(var(--space-7) * -1 + var(--space-4)); } }
.footer-line {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 1400px;
    margin: var(--space-7) auto 0;
    padding-top: var(--space-5);
    border-top: 1px solid var(--line-on-dark);
    color: var(--on-dark-muted);
}
.footer-line img { width: auto; height: 28px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.8; }

/* ── Video that loads nothing from YouTube until Play is pressed (site.js) ── */
.yt-lite { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--black); cursor: pointer; }
.yt-lite img { width: 100%; height: 100%; object-fit: cover; }
.yt-lite-play {
    position: absolute; inset: 0; width: 68px; height: 68px; margin: auto;
    display: grid; place-items: center; border-radius: 50%;
    background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-lg);
    transition: transform var(--dur-fast) var(--ease);
}
.yt-lite:hover .yt-lite-play { transform: scale(1.06); }
.yt-lite-play svg { margin-left: 3px; }

/* ── Reduced motion: everything at rest, instantly ─────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .sr { opacity: 1 !important; transform: none !important; }
}
