/* ========================================================================== 
   THE MARRIAGE ORACLE
   Clean production stylesheet
   ========================================================================== */

:root {
    color-scheme: light;

    --ink: #2c211d;
    --ink-soft: #5a4840;
    --ink-faint: #78665c;

    --paper: #efe0bd;
    --paper-light: #fbf4df;
    --paper-bright: #fffaf0;
    --paper-deep: #d4b987;

    --burgundy: #6f2635;
    --burgundy-hover: #823246;
    --burgundy-dark: #451720;
    --burgundy-soft: rgba(111, 38, 53, 0.12);

    --gold: #9f742d;
    --gold-light: #d6b66c;
    --gold-pale: #f0cf78;

    --green: #3f5b46;
    --green-dark: #23432e;
    --green-soft: #e9f3e7;
    --green-border: #7d9f82;

    --danger: #68151f;
    --danger-soft: #fbe8df;
    --danger-border: #b36a71;

    --info-dark: #4a3a2f;
    --info-soft: #f7edcf;
    --info-border: #b79555;

    --border: rgba(77, 51, 35, 0.34);
    --border-soft: rgba(77, 51, 35, 0.2);
    --border-strong: rgba(77, 51, 35, 0.52);

    --shadow-large: 0 18px 45px rgba(47, 30, 21, 0.18);
    --shadow-medium: 0 12px 28px rgba(47, 30, 21, 0.15);
    --shadow-small: 0 8px 20px rgba(47, 30, 21, 0.13);

    --serif-display: "Cormorant Garamond", Georgia, serif;
    --serif-body: "Libre Baskerville", Georgia, serif;

    --content-width: 1180px;
    --page-gutter: clamp(18px, 3vw, 36px);
    --section-gap: 26px;

    --radius-small: 4px;
    --radius-medium: 7px;
    --radius-large: 10px;

    --transition-fast: 160ms ease;
    --transition-medium: 320ms ease;
}

/* ========================================================================== 
   RESET, DOCUMENT AND ACCESSIBILITY
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% 15%, rgba(255, 248, 225, 0.8), transparent 28%),
        radial-gradient(circle at 82% 30%, rgba(117, 60, 46, 0.09), transparent 28%),
        linear-gradient(180deg, #d9c69e, #cdb78a);
    font-family: var(--serif-body);
    font-size: 18px;
    line-height: 1.65;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 0.32;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(70, 47, 29, 0.025) 4px),
        repeating-linear-gradient(90deg, transparent 0, transparent 4px, rgba(70, 47, 29, 0.018) 5px);
    pointer-events: none;
}

[hidden] {
    display: none !important;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 4px solid var(--gold-pale);
    outline-offset: 4px;
}

::selection {
    color: #fff8e6;
    background: var(--burgundy);
}

.paper-noise {
    position: fixed;
    inset: 0;
    z-index: 100;
    opacity: 0.075;
    pointer-events: none;
    mix-blend-mode: multiply;
    background-image:
        radial-gradient(circle, #2d211b 0.7px, transparent 0.9px),
        radial-gradient(circle, #2d211b 0.5px, transparent 0.8px);
    background-position: 0 0, 7px 9px;
    background-size: 13px 13px, 17px 17px;
}

/* ========================================================================== 
   TYPE
   ========================================================================== */

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--burgundy-dark);
    font-family: var(--serif-display);
    line-height: 1.05;
    text-wrap: balance;
}

h1 {
    max-width: 720px;
    margin-bottom: 22px;
    font-size: clamp(3.25rem, 7vw, 5.375rem);
    letter-spacing: -0.025em;
}

h2 {
    margin-bottom: 16px;
    font-size: clamp(2.5rem, 5vw, 3.875rem);
}

h3 {
    margin-bottom: 10px;
    font-size: 1.875rem;
}

p {
    text-wrap: pretty;
}

.kicker {
    margin: 0 0 12px;
    color: var(--burgundy);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.text-link {
    color: var(--burgundy);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.text-link:hover {
    color: var(--burgundy-dark);
}

.small-note,
.input-note,
.payment-note {
    color: var(--ink-soft);
    font-size: 0.8125rem;
}

.small-note {
    max-width: 760px;
    margin: 28px auto 0;
    text-align: center;
}

/* ========================================================================== 
   SHARED SURFACES AND BUTTONS
   ========================================================================== */

.hero-section,
.content-section,
.stat-strip,
.app-panel,
.quiz-layout,
.loading-panel,
.result-page {
    position: relative;
    background:
        linear-gradient(rgba(255, 250, 236, 0.92), rgba(247, 236, 205, 0.96)),
        var(--paper-light);
    border: 1px solid rgba(72, 47, 31, 0.38);
    box-shadow: var(--shadow-large);
}

.hero-section::before,
.content-section::before,
.app-panel::before,
.quiz-layout::before,
.loading-panel::before,
.result-page::before {
    content: "";
    position: absolute;
    inset: 13px;
    z-index: 0;
    border: 1px solid rgba(111, 38, 53, 0.3);
    pointer-events: none;
}

.hero-section > *,
.content-section > *,
.app-panel > *,
.quiz-layout > *,
.loading-panel > *,
.result-page > * {
    position: relative;
    z-index: 1;
}

.step-card,
.feature-grid article,
.preview-cards article,
.choice-card,
.question-card,
.teaser-panel,
.silhouette-panel,
.reading-card {
    background: rgba(255, 250, 235, 0.78);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-small);
}

.primary-button,
.secondary-button,
.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 14px 24px;
    border-radius: var(--radius-small);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.primary-button {
    color: #fff8e6;
    background: linear-gradient(180deg, #7c3040, #5a1f2d);
    border: 2px solid #43141f;
    box-shadow:
        inset 0 0 0 2px rgba(255, 232, 181, 0.15),
        0 8px 18px rgba(68, 23, 32, 0.22);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #8d3849, #661f31);
    box-shadow:
        inset 0 0 0 2px rgba(255, 232, 181, 0.17),
        0 11px 22px rgba(68, 23, 32, 0.25);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.header-button:active:not(:disabled) {
    transform: translateY(0);
}

.secondary-button {
    color: var(--burgundy-dark);
    background: #fff8e6;
    border: 2px solid var(--burgundy);
    box-shadow: inset 0 0 0 2px rgba(111, 38, 53, 0.08);
}

.secondary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #f4e3b8;
}

.back-home-button,
.quiet-button {
    padding: 4px 2px;
    color: var(--burgundy);
    background: none;
    border: 0;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.back-home-button:hover,
.quiet-button:hover {
    color: var(--burgundy-dark);
}

.wide-button {
    display: flex;
    width: min(520px, 100%);
    margin: 0 auto;
}

/* ========================================================================== 
   HEADER
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(67, 43, 29, 0.35);
    background: rgba(44, 33, 29, 0.965);
    box-shadow: 0 7px 18px rgba(34, 22, 16, 0.18);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.header-inner {
    width: min(var(--content-width), calc(100% - (2 * var(--page-gutter))));
    min-height: 84px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
    color: #fff5dc;
    text-decoration: none;
}

.brand-seal {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 2px solid #d5b56c;
    border-radius: 50%;
    color: #f7df9c;
    font-family: var(--serif-display);
    font-size: 1.9375rem;
    font-weight: 700;
    box-shadow: inset 0 0 0 4px rgba(213, 181, 108, 0.11);
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.1;
}

.brand-copy strong {
    font-family: var(--serif-display);
    font-size: 1.6875rem;
    letter-spacing: 0.015em;
    white-space: nowrap;
}

.brand-copy small {
    margin-top: 5px;
    color: #d8c7a6;
    font-size: 0.75rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.main-nav a,
.footer-links a,
.footer-links button {
    color: #f7ead0;
    background: none;
    border: 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.main-nav a:hover,
.footer-links a:hover,
.footer-links button:hover {
    color: #ffd98c;
}

.header-button {
    min-height: 48px;
    padding: 10px 20px;
    color: var(--ink);
    background: #dfc17a;
    border: 2px solid #f2da9d;
    box-shadow: inset 0 0 0 2px rgba(77, 50, 27, 0.2);
}

.header-button:hover {
    transform: translateY(-1px);
    background: #ebcf88;
}

/* ========================================================================== 
   GLOBAL PAGE LAYOUT
   ========================================================================== */

.screen {
    width: 100%;
}

.home-screen,
.app-screen {
    width: min(var(--content-width), calc(100% - (2 * var(--page-gutter))));
    margin-right: auto;
    margin-left: auto;
}

.home-screen {
    margin-top: 32px;
    margin-bottom: 70px;
}

.app-screen {
    min-height: calc(100vh - 120px);
    margin-top: 34px;
    margin-bottom: 70px;
}

/* ========================================================================== 
   HOME: HERO AND MATCHMAKER
   ========================================================================== */

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: clamp(38px, 5vw, 62px);
    align-items: center;
    min-height: 650px;
    padding: clamp(48px, 6.2vw, 74px);
    overflow: hidden;
    border-radius: var(--radius-large);
}

.hero-section::after {
    content: "❦";
    position: absolute;
    right: 30px;
    bottom: 8px;
    z-index: 0;
    color: rgba(111, 38, 53, 0.2);
    font-family: var(--serif-display);
    font-size: clamp(4.5rem, 7vw, 6rem);
    line-height: 1;
    pointer-events: none;
}

.hero-copy {
    min-width: 0;
}

.hero-description {
    max-width: 720px;
    margin: 0 0 30px;
    color: var(--ink-soft);
    font-size: 1.25rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.trust-row span {
    padding: 8px 12px;
    color: #3f3029;
    background: rgba(222, 197, 137, 0.34);
    border: 1px solid rgba(111, 38, 53, 0.22);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.oracle-display {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.matchmaker-frame {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: min(100%, 440px);
    aspect-ratio: 0.74;
    margin: 0 auto;
    padding: 54px 12px 16px;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 34%, rgba(246, 221, 165, 0.54), transparent 52%),
        linear-gradient(180deg, #f7e6bd, #c89f6d);
    border: 6px double #76513c;
    border-radius: 48% 48% 22px 22px;
    box-shadow:
        inset 0 0 34px rgba(69, 40, 28, 0.2),
        0 18px 38px rgba(50, 29, 21, 0.22);
}

.matchmaker-frame::before,
.matchmaker-frame::after {
    content: none;
}

.matchmaker-image {
    width: 112%;
    max-width: none;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    transform: translateY(12px);
    transform-origin: center bottom;
    filter:
        sepia(0.08)
        contrast(1.04)
        saturate(0.92)
        drop-shadow(0 14px 14px rgba(46, 27, 17, 0.18));
}

.frame-stars {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 3;
    color: #b18a45;
    font-size: 1.75rem;
    line-height: 1;
    text-shadow:
        -280px 110px 0 rgba(177, 138, 69, 0.85),
        -235px 330px 0 rgba(177, 138, 69, 0.65);
    animation: slowTwinkle 3s ease-in-out infinite;
}

.guide-message {
    position: relative;
    width: min(94%, 460px);
    margin: 28px auto 0;
    padding: 36px 52px 34px;
    overflow: hidden;
    isolation: isolate;
    color: #3d302a;
    background: #fff7df;
    border: 1px solid #806249;
    box-shadow: var(--shadow-small);
    text-align: center;
}

.guide-message::before,
.guide-message::after {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: rgba(111, 38, 53, 0.27);
    pointer-events: none;
}

.guide-message::before {
    left: 10px;
}

.guide-message::after {
    right: 10px;
}

.guide-message p {
    position: relative;
    z-index: 2;
    margin: 0;
    color: #3d302a;
    font-family: var(--serif-display);
    font-size: 1.4375rem;
    font-weight: 700;
    line-height: 1.32;
    text-align: center;
}

.guide-quote {
    position: absolute;
    z-index: 3;
    display: block;
    margin: 0;
    color: var(--burgundy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.96;
    pointer-events: none;
}

.guide-quote-open {
    top: 10px;
    left: 22px;
}

.guide-quote-close {
    right: 22px;
    bottom: 3px;
}

/* ========================================================================== 
   HOME: STATS AND CONTENT SECTIONS
   ========================================================================== */

.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: var(--section-gap) 0;
    overflow: hidden;
    border-radius: var(--radius-medium);
}

.stat-strip article {
    min-width: 0;
    min-height: 140px;
    padding: 26px 20px;
    text-align: center;
    border-right: 1px solid rgba(80, 54, 35, 0.28);
}

.stat-strip article:last-child {
    border-right: 0;
}

.stat-strip strong {
    display: block;
    color: var(--burgundy);
    font-family: var(--serif-display);
    font-size: clamp(2.4rem, 4vw, 2.875rem);
    line-height: 1;
}

.stat-strip span {
    display: block;
    margin-top: 9px;
    color: var(--ink-soft);
    font-size: 0.875rem;
    font-weight: 700;
}

.content-section {
    margin: var(--section-gap) 0;
    padding: clamp(44px, 6vw, 70px);
    border-radius: var(--radius-medium);
}

.section-heading {
    max-width: 780px;
    margin: 0 auto 38px;
    text-align: center;
}

.section-heading p:last-child {
    color: var(--ink-soft);
}

.steps-grid,
.feature-grid,
.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.step-card {
    padding: 30px;
    text-align: center;
}

.step-number {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    margin: 0 auto 18px;
    color: #fff4d6;
    background: var(--burgundy);
    border-radius: 50%;
    font-family: var(--serif-display);
    font-size: 1.6875rem;
    font-weight: 700;
}

.step-card p,
.feature-grid p,
.preview-cards p {
    margin-bottom: 0;
    color: var(--ink-soft);
}

.parchment-panel {
    background:
        linear-gradient(rgba(223, 198, 141, 0.4), rgba(255, 249, 228, 0.82)),
        var(--paper);
}

.feature-grid article {
    min-height: 210px;
    padding: 28px;
}

.feature-grid article > span {
    display: block;
    margin-bottom: 10px;
    color: var(--burgundy);
    font-family: var(--serif-display);
    font-size: 2.375rem;
}

.feature-grid h3 {
    font-size: 1.6875rem;
}

.preview-cards {
    gap: 18px;
    margin-bottom: 30px;
}

.preview-cards article {
    padding: 24px;
}

.preview-cards span {
    display: block;
    margin-bottom: 10px;
    color: var(--burgundy);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.preview-cards strong {
    font-family: var(--serif-display);
    font-size: 1.5rem;
    line-height: 1.2;
}

/* ========================================================================== 
   PROFILE / ENTRY SCREEN
   ========================================================================== */

.app-panel {
    padding: clamp(42px, 6vw, 70px);
    border-radius: var(--radius-medium);
}

.compact-heading {
    margin-top: 15px;
}

.profile-choice-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 24px;
    align-items: stretch;
}

.choice-card {
    min-width: 0;
    padding: 32px;
}

.featured-choice {
    border-color: rgba(111, 38, 53, 0.58);
    background: rgba(255, 248, 228, 0.93);
}

.choice-icon {
    display: block;
    margin-bottom: 10px;
    color: var(--burgundy);
    font-size: 2.6875rem;
}

.choice-card p {
    color: var(--ink-soft);
}

.choice-card form {
    display: grid;
    gap: 11px;
    margin-top: 20px;
}

.choice-card label {
    font-size: 0.875rem;
    font-weight: 700;
}

.text-input,
.number-input,
.select-input {
    width: 100%;
    min-height: 58px;
    padding: 13px 15px;
    color: var(--ink);
    background: var(--paper-bright);
    border: 2px solid rgba(76, 49, 32, 0.38);
    border-radius: var(--radius-small);
    font-size: 1.125rem;
    transition:
        border-color var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast);
}

.text-input:hover,
.number-input:hover,
.select-input:hover {
    border-color: rgba(111, 38, 53, 0.62);
}

.text-input:focus,
.number-input:focus,
.select-input:focus {
    border-color: var(--burgundy);
    background: #fffdf7;
    box-shadow: 0 0 0 3px rgba(111, 38, 53, 0.1);
}

.form-error {
    width: 100%;
    margin: 16px 0 0;
}

/* ========================================================================== 
   QUIZ
   ========================================================================== */

.quiz-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    min-height: 700px;
    overflow: hidden;
    border-radius: var(--radius-medium);
}

.quiz-guide-panel {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 28px;
    color: #fff5dc;
    background:
        radial-gradient(circle at 50% 20%, rgba(215, 182, 108, 0.2), transparent 26%),
        linear-gradient(180deg, #44342e, #241b18);
    border-right: 1px solid rgba(36, 24, 18, 0.55);
}

.mini-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 205px;
    height: 260px;
    margin: 0 auto 22px;
    padding: 7px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 38%, #f4e1b7, #c59c68);
    border: 6px double #76513c;
    border-radius: 45% 45% 15% 15%;
    box-shadow:
        inset 0 0 18px rgba(63, 38, 27, 0.22),
        0 12px 24px rgba(52, 30, 21, 0.22);
}

.mini-matchmaker-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter:
        sepia(0.1)
        contrast(1.04)
        saturate(0.92)
        drop-shadow(0 6px 6px rgba(46, 27, 17, 0.14));
}

.guide-speech {
    position: relative;
    width: 100%;
    margin: 6px 0 18px;
    padding: 18px;
    color: #342824;
    background: #fff4d4;
    border: 1px solid #bb9551;
    font-family: var(--serif-display);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.guide-speech::before {
    content: "";
    position: absolute;
    top: -13px;
    left: calc(50% - 12px);
    width: 24px;
    height: 24px;
    background: #fff4d4;
    border-top: 1px solid #bb9551;
    border-left: 1px solid #bb9551;
    transform: rotate(45deg);
}

.quiz-guide-panel .quiet-button {
    color: #e5d3b2;
}

.quiz-guide-panel .quiet-button:hover {
    color: #fff3ce;
}

.quiz-main-panel {
    min-width: 0;
    padding: 48px;
}

.progress-panel {
    margin-bottom: 26px;
    padding: 20px 22px;
    background: rgba(226, 205, 154, 0.28);
    border: 1px solid rgba(76, 49, 32, 0.28);
}

.progress-topline,
.progress-details {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.progress-topline {
    color: var(--burgundy-dark);
    font-weight: 700;
}

.progress-details {
    color: var(--ink-soft);
    font-size: 0.75rem;
}

.progress-ornament {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin: 11px 0;
    color: var(--gold);
}

.progress-track,
.loading-progress-track {
    height: 18px;
    overflow: hidden;
    background: #c9b68e;
    border: 1px solid #7d6044;
    box-shadow: inset 0 2px 5px rgba(53, 35, 24, 0.22);
}

.progress-bar,
.loading-progress-bar {
    width: 0;
    height: 100%;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 8px, transparent 8px 16px),
        linear-gradient(90deg, #6f2635, #9a4a55);
    transition: width 350ms ease;
}

.question-card {
    padding: 44px;
}

.question-number-label {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.115em;
    text-transform: uppercase;
}

.question-card h2 {
    font-size: clamp(2.375rem, 4.5vw, 3.4375rem);
    overflow-wrap: anywhere;
}

.question-help {
    max-width: 700px;
    margin: -2px 0 26px;
    color: var(--ink-soft);
}

.answer-area {
    display: grid;
    gap: 13px;
}

.answer-label {
    position: relative;
    display: block;
}

.answer-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.answer-button {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 64px;
    padding: 14px 17px;
    color: var(--ink);
    background: var(--paper-bright);
    border: 2px solid rgba(76, 49, 32, 0.35);
    border-radius: var(--radius-small);
    font-weight: 700;
    transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.answer-button::before {
    content: "";
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    background: #fffdf7;
    border: 2px solid #7d6044;
    border-radius: 50%;
}

.answer-label:hover .answer-button {
    transform: translateY(-1px);
    background: #f7e9c5;
    border-color: var(--burgundy);
}

.answer-radio:checked + .answer-button {
    color: var(--burgundy-dark);
    background: #f1dcaa;
    border-color: var(--burgundy);
    box-shadow: inset 0 0 0 2px rgba(111, 38, 53, 0.1);
}

.answer-radio:checked + .answer-button::before {
    background: var(--burgundy);
    border-color: var(--burgundy);
    box-shadow: inset 0 0 0 5px #fff8e6;
}

.answer-radio:focus-visible + .answer-button {
    outline: 4px solid var(--gold-pale);
    outline-offset: 4px;
}

.input-wrapper {
    display: grid;
    gap: 10px;
}

.input-note {
    margin: 0;
}

.quiz-navigation {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 14px;
    margin-top: 28px;
}

/* ========================================================================== 
   ANALYSIS / LOADING
   ========================================================================== */

.loading-panel {
    min-height: 680px;
    padding: 80px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-medium);
    text-align: center;
}

.analysis-seal {
    position: relative;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    margin-bottom: 26px;
}

.analysis-seal::before,
.analysis-seal::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--burgundy);
    border-radius: 50%;
    animation: rotateSeal 7s linear infinite;
}

.analysis-seal::after {
    inset: 12px;
    border-style: dashed;
    animation-direction: reverse;
    animation-duration: 9s;
}

.seal-ring {
    display: grid;
    place-items: center;
    width: 90px;
    height: 90px;
    color: #fff3d0;
    background: var(--burgundy);
    border-radius: 50%;
    font-size: 3rem;
    box-shadow: 0 10px 20px rgba(92, 29, 43, 0.25);
}

.loading-message {
    color: var(--ink-soft);
    font-size: 1.1875rem;
}

.analysis-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: min(780px, 100%);
    margin: 24px 0;
}

.analysis-item {
    padding: 13px 10px;
    color: var(--ink-soft);
    background: rgba(218, 194, 139, 0.25);
    border: 1px solid rgba(76, 49, 32, 0.25);
    font-size: 0.75rem;
    font-weight: 700;
    transition:
        color var(--transition-medium),
        background var(--transition-medium),
        border-color var(--transition-medium);
}

.analysis-item.active,
.analysis-item.complete {
    color: #fff7e1;
    background: var(--burgundy);
    border-color: var(--burgundy-dark);
}

.loading-progress-track {
    width: min(700px, 100%);
    margin: 10px 0 12px;
}

/* ========================================================================== 
   RESULTS
   ========================================================================== */

.result-page {
    padding: clamp(42px, 5.5vw, 65px);
    overflow: hidden;
    border-radius: var(--radius-medium);
}

.result-heading {
    max-width: 820px;
    margin: 0 auto 35px;
    text-align: center;
}

.result-heading p:last-child {
    color: var(--ink-soft);
    font-size: 1.1875rem;
}

.result-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 24px;
}

.silhouette-panel,
.teaser-panel {
    min-width: 0;
    min-height: 470px;
    padding: 35px;
}

.silhouette-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff4d3;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 249, 227, 0.58), transparent 22%),
        linear-gradient(160deg, #88725f, #3e312b);
    border: 9px double #b79555;
}

.silhouette-panel > p {
    margin: 15px 0 0;
    font-family: var(--serif-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.teaser-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.teaser-label {
    margin: 0;
    color: var(--burgundy);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-align: center;
    text-transform: uppercase;
}

.initial-seal {
    display: grid;
    place-items: center;
    width: 125px;
    height: 125px;
    margin: 15px auto 24px;
    color: #fff4d2;
    background: var(--burgundy);
    border: 8px double #d4b46d;
    border-radius: 50%;
    font-family: var(--serif-display);
    font-size: 4.625rem;
    font-weight: 700;
    box-shadow: 0 12px 24px rgba(91, 28, 42, 0.24);
}

.compatibility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 18px;
    background: #ead8aa;
    border: 1px solid #a17a3e;
}

.compatibility-row span {
    font-weight: 700;
}

.compatibility-row strong {
    color: var(--burgundy);
    font-family: var(--serif-display);
    font-size: 2.375rem;
}

.free-clues {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.free-clues div {
    padding: 14px;
    background: rgba(255, 250, 235, 0.75);
    border: 1px solid rgba(76, 49, 32, 0.25);
}

.free-clues span,
.reading-card small {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-soft);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.free-clues strong {
    font-family: var(--serif-display);
    font-size: 1.3125rem;
}

.locked-reading-section {
    margin-top: 28px;
}

.locked-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
}

.locked-heading h3 {
    margin: 0;
    font-size: 2.375rem;
}

.price-badge {
    flex: 0 0 auto;
    padding: 10px 16px;
    color: #fff4d2;
    background: var(--burgundy);
    border: 3px double #d5b66c;
    font-family: var(--serif-display);
    font-size: 1.75rem;
    font-weight: 700;
}

.premium-reading {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.reading-card {
    display: flex;
    min-width: 0;
    min-height: 145px;
    gap: 15px;
    padding: 22px;
}

.reading-card:last-of-type {
    grid-column: 1 / -1;
}

.reading-icon {
    flex: 0 0 auto;
    color: var(--burgundy);
    font-family: var(--serif-display);
    font-size: 2.1875rem;
}

.reading-card strong {
    display: block;
    color: var(--burgundy-dark);
    font-family: var(--serif-display);
    font-size: 1.5625rem;
    line-height: 1.1;
}

.reading-card p {
    margin: 7px 0 0;
    color: var(--ink-soft);
    font-size: 0.875rem;
}

.premium-reading.locked .reading-card {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

.locked-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px;
    text-align: center;
    background: rgba(246, 234, 201, 0.76);
    border: 1px solid rgba(76, 49, 32, 0.32);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.locked-overlay h3 {
    margin-bottom: 10px;
    font-size: 2.4375rem;
}

.locked-overlay p {
    max-width: 560px;
    margin: 0 0 22px;
    color: var(--ink-soft);
}

.lock-symbol {
    color: var(--burgundy);
    font-size: 3.125rem;
}

.locked-overlay small {
    margin-top: 12px;
    color: var(--ink-soft);
}

.premium-reading.unlocked .locked-overlay {
    display: none;
}

.result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.large-quiet-button {
    grid-column: 1 / -1;
    justify-self: center;
    padding: 10px 15px;
}

/* ========================================================================== 
   COMPANION PORTRAIT DEVELOPMENT AND REVEAL
   ========================================================================== */

.companion-portrait-wrap {
    position: relative;
    width: min(100%, 390px);
    aspect-ratio: 4 / 5;
    margin-inline: auto;
    overflow: hidden;
    isolation: isolate;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 38%, rgba(240, 216, 166, 0.9), rgba(177, 137, 85, 0.7) 62%, rgba(78, 47, 28, 0.88));
    box-shadow: inset 0 0 28px rgba(50, 28, 18, 0.23);
}

.companion-portrait {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transform: scale(1.035);
    transition:
        opacity 1.1s ease,
        transform 1.5s ease,
        filter 1.25s ease;
}

.portrait-developing {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    opacity: 1;
    background:
        linear-gradient(115deg, transparent 25%, rgba(255, 244, 208, 0.23) 42%, transparent 58%),
        repeating-linear-gradient(0deg, rgba(71, 42, 23, 0.05) 0, rgba(71, 42, 23, 0.05) 1px, transparent 1px, transparent 4px);
    transition:
        opacity 0.8s ease,
        visibility 0.8s ease;
}

.portrait-paper-grain {
    position: absolute;
    inset: 0;
    opacity: 0.38;
    background:
        radial-gradient(circle at 20% 20%, rgba(83, 48, 25, 0.12) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 66%, rgba(255, 244, 210, 0.15) 0 1px, transparent 2px);
    background-size: 13px 17px, 19px 23px;
    animation: portraitGrain 0.35s steps(2) infinite;
}

.portrait-ink-line {
    position: absolute;
    left: 13%;
    width: 74%;
    height: 2px;
    opacity: 0;
    transform-origin: left center;
    background: linear-gradient(90deg, transparent, rgba(71, 41, 22, 0.75), transparent);
    box-shadow:
        0 4px 0 rgba(71, 41, 22, 0.09),
        0 -4px 0 rgba(71, 41, 22, 0.06);
}

.portrait-ink-line-one {
    top: 29%;
    animation: drawPortraitLine 1.9s ease-in-out infinite;
}

.portrait-ink-line-two {
    top: 47%;
    animation: drawPortraitLine 1.9s 0.4s ease-in-out infinite;
}

.portrait-ink-line-three {
    top: 64%;
    animation: drawPortraitLine 1.9s 0.8s ease-in-out infinite;
}

.portrait-spark {
    position: absolute;
    z-index: 3;
    color: #f6d778;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0;
    text-shadow:
        0 0 6px rgba(246, 215, 120, 0.8),
        0 0 14px rgba(246, 215, 120, 0.46);
    animation: portraitSpark 2.4s ease-in-out infinite;
}

.portrait-spark-one {
    top: 16%;
    left: 19%;
}

.portrait-spark-two {
    top: 33%;
    right: 15%;
    animation-delay: 0.55s;
}

.portrait-spark-three {
    right: 22%;
    bottom: 21%;
    animation-delay: 1.1s;
}

.portrait-spark-four {
    bottom: 31%;
    left: 17%;
    animation-delay: 1.55s;
}

.portrait-loading-copy {
    position: absolute;
    left: 50%;
    bottom: 8%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 9px;
    width: max-content;
    max-width: 88%;
    padding: 9px 14px;
    transform: translateX(-50%);
    color: #50321f;
    background: rgba(244, 225, 183, 0.84);
    border: 1px solid rgba(91, 56, 33, 0.3);
    border-radius: 999px;
    box-shadow: 0 7px 20px rgba(52, 30, 17, 0.13);
    font-size: 0.84rem;
    text-align: center;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.portrait-quill {
    display: inline-block;
    font-size: 1.1rem;
    animation: quillWriting 1.2s ease-in-out infinite;
}

.portrait-is-loaded .companion-portrait {
    opacity: 1;
    transform: scale(1);
}

.portrait-is-loaded .portrait-developing {
    visibility: hidden;
    opacity: 0;
}

.companion-portrait.portrait-obscured {
    filter: sepia(0.95) blur(17px) brightness(0.63) contrast(1.16);
    transform: scale(1.09);
}

.portrait-reveal-flash {
    position: absolute;
    inset: -25%;
    z-index: 5;
    opacity: 0;
    transform: translateX(-75%) rotate(8deg);
    background: linear-gradient(110deg, transparent 34%, rgba(255, 236, 172, 0.07) 43%, rgba(255, 236, 172, 0.72) 50%, rgba(255, 236, 172, 0.08) 57%, transparent 66%);
    pointer-events: none;
}

.portrait-is-revealing .companion-portrait {
    animation: oldPhotoReveal 1.65s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.portrait-is-revealing .portrait-reveal-flash {
    animation: portraitRevealSweep 1.45s ease-out forwards;
}

.portrait-is-revealing .portrait-spark {
    z-index: 7;
    animation-duration: 1.15s;
}

.portrait-is-revealed .companion-portrait {
    opacity: 1;
    filter: sepia(0.26) blur(0) brightness(1) contrast(1.04);
    transform: scale(1);
}

.portrait-load-failed {
    background:
        radial-gradient(circle at 50% 38%, rgba(240, 216, 166, 0.9), rgba(130, 92, 59, 0.82) 66%, rgba(63, 39, 26, 0.95));
}

.portrait-load-failed .portrait-developing {
    opacity: 0.35;
}

/* ========================================================================== 
   FOOTER
   ========================================================================== */

.site-footer {
    color: #f2e4c9;
    background: #2c211d;
    border-top: 5px double #9f7a3d;
}

.footer-inner,
.footer-disclosure {
    width: min(var(--content-width), calc(100% - (2 * var(--page-gutter))));
    margin-right: auto;
    margin-left: auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 45px 0 28px;
}

.footer-brand {
    color: #fff1cd;
    font-family: var(--serif-display);
    font-size: 1.9375rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-inner p {
    margin: 7px 0 0;
    color: #cdbd9f;
    font-size: 0.8125rem;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
}

.footer-disclosure {
    padding: 18px 0 32px;
    color: #bfae91;
    border-top: 1px solid rgba(236, 213, 169, 0.18);
    font-size: 0.6875rem;
    line-height: 1.5;
}

.footer-disclosure p {
    margin: 5px 0;
}

/* ========================================================================== 
   DIALOG
   ========================================================================== */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(31, 22, 18, 0.74);
}

.dialog-card {
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    padding: 36px;
    overflow-y: auto;
    background: #fff4d4;
    border: 8px double #8c683c;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.dialog-card h2 {
    font-size: 2.625rem;
}

.dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

/* ========================================================================== 
   ANIMATIONS
   ========================================================================== */

@keyframes slowTwinkle {
    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes rotateSeal {
    to {
        transform: rotate(360deg);
    }
}

@keyframes drawPortraitLine {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }

    18% {
        opacity: 0.72;
    }

    66% {
        opacity: 0.42;
        transform: scaleX(1);
    }

    100% {
        opacity: 0;
        transform: scaleX(1);
    }
}

@keyframes portraitSpark {
    0%,
    100% {
        opacity: 0;
        transform: translateY(8px) scale(0.35) rotate(0);
    }

    35% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(20deg);
    }

    65% {
        opacity: 0.65;
        transform: translateY(-8px) scale(0.72) rotate(42deg);
    }
}

@keyframes portraitGrain {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-1px, 1px);
    }

    50% {
        transform: translate(1px, -1px);
    }

    75% {
        transform: translate(1px, 1px);
    }
}

@keyframes quillWriting {
    0%,
    100% {
        transform: translate(0, 0) rotate(-7deg);
    }

    50% {
        transform: translate(3px, -2px) rotate(3deg);
    }
}

@keyframes portraitRevealSweep {
    0% {
        opacity: 0;
        transform: translateX(-75%) rotate(8deg);
    }

    24% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(78%) rotate(8deg);
    }
}

@keyframes oldPhotoReveal {
    0% {
        filter: sepia(1) blur(17px) brightness(0.58) contrast(1.2);
        transform: scale(1.09);
    }

    48% {
        filter: sepia(0.82) blur(7px) brightness(1.15) contrast(1.07);
    }

    100% {
        filter: sepia(0.26) blur(0) brightness(1) contrast(1.04);
        transform: scale(1);
    }
}

/* ========================================================================== 
   RESPONSIVE: TABLETS AND SMALL LAPTOPS
   ========================================================================== */

@media (max-width: 1020px) {
    .main-nav a {
        display: none;
    }

    .hero-section {
        grid-template-columns: minmax(0, 1fr);
        padding: 58px 42px;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-copy h1,
    .hero-description,
    .section-heading {
        margin-right: auto;
        margin-left: auto;
    }

    .hero-actions,
    .trust-row {
        justify-content: center;
    }

    .oracle-display {
        margin-top: 20px;
    }

    .matchmaker-frame {
        width: min(100%, 420px);
    }

    .steps-grid,
    .feature-grid,
    .preview-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quiz-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .quiz-guide-panel {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr) auto;
        align-items: center;
        gap: 18px;
        padding: 20px 24px;
        border-right: 0;
        border-bottom: 1px solid rgba(36, 24, 18, 0.55);
    }

    .mini-frame {
        width: 118px;
        height: 150px;
        margin: 0;
        padding: 5px;
        border-width: 5px;
    }

    .guide-speech {
        margin: 0;
        padding: 16px;
        font-size: 1.1875rem;
    }

    .guide-speech::before {
        top: calc(50% - 12px);
        left: -13px;
        border-top: 0;
        border-bottom: 1px solid #bb9551;
    }

    .quiz-guide-panel .quiet-button {
        white-space: nowrap;
    }

    .result-hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .silhouette-panel,
    .teaser-panel {
        min-height: auto;
    }
}

/* ========================================================================== 
   RESPONSIVE: PHONES
   ========================================================================== */

@media (max-width: 760px) {
    :root {
        --page-gutter: 10px;
    }

    body {
        font-size: 16px;
    }

    .paper-noise {
        opacity: 0.055;
    }

    .header-inner {
        min-height: 72px;
        gap: 10px;
    }

    .brand {
        flex: 1 1 auto;
        gap: 9px;
    }

    .brand-seal {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .brand-copy strong {
        font-size: 1.25rem;
        white-space: normal;
    }

    .brand-copy small {
        display: none;
    }

    .header-button {
        flex: 0 0 108px;
        width: 108px;
        min-height: 46px;
        padding: 7px 8px;
        font-size: 0.8125rem;
    }

    .home-screen,
    .app-screen {
        margin-top: 12px;
        margin-bottom: 42px;
    }

    .hero-section,
    .content-section,
    .app-panel,
    .result-page {
        padding-right: 18px;
        padding-left: 18px;
    }

    .hero-section::before,
    .content-section::before,
    .app-panel::before,
    .quiz-layout::before,
    .loading-panel::before,
    .result-page::before {
        inset: 8px;
    }

    .hero-section {
        display: block;
        min-height: 0;
        padding-top: 38px;
        padding-bottom: 38px;
    }

    .hero-section::after {
        right: 14px;
        bottom: 7px;
        font-size: 4.75rem;
    }

    .hero-copy h1 {
        width: 100%;
        margin-bottom: 22px;
        font-size: clamp(2.5rem, 11.2vw, 3rem);
        line-height: 1.08;
        letter-spacing: -0.015em;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.7;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .hero-actions .text-link {
        text-align: center;
    }

    .trust-row {
        flex-direction: column;
        gap: 10px;
    }

    .trust-row span {
        width: 100%;
        text-align: center;
    }

    .oracle-display {
        margin-top: 32px;
    }

    .matchmaker-frame {
        width: min(100%, 330px);
        aspect-ratio: 0.725;
        padding: 38px 8px 12px;
    }

    .matchmaker-image {
        width: 106%;
        transform: translateY(8px);
    }

    .frame-stars {
        top: 20px;
        right: 20px;
        font-size: 1.4rem;
        text-shadow:
            -215px 85px 0 rgba(177, 138, 69, 0.8),
            -185px 255px 0 rgba(177, 138, 69, 0.6);
    }

    .guide-message {
        width: min(94%, 430px);
        margin-top: 24px;
        padding: 33px 42px 31px;
    }

    .guide-message p {
        font-size: 1.25rem;
        line-height: 1.35;
    }

    .guide-quote {
        font-size: 2.375rem;
    }

    .guide-quote-open {
        top: 8px;
        left: 17px;
    }

    .guide-quote-close {
        right: 17px;
        bottom: 1px;
    }

    .stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-strip article:nth-child(2n) {
        border-right: 0;
    }

    .stat-strip article:nth-child(-n + 2) {
        border-bottom: 1px solid rgba(80, 54, 35, 0.28);
    }

    .steps-grid,
    .feature-grid,
    .preview-cards,
    .profile-choice-grid,
    .premium-reading,
    .result-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .reading-card:last-of-type,
    .large-quiet-button {
        grid-column: auto;
    }

    .choice-card,
    .step-card,
    .feature-grid article,
    .preview-cards article {
        padding: 24px;
    }

    .quiz-guide-panel {
        grid-template-columns: 92px minmax(0, 1fr);
        grid-template-areas:
            "portrait speech"
            "portrait exit";
        align-items: center;
        gap: 8px 14px;
        padding: 14px;
    }

    .mini-frame {
        grid-area: portrait;
        width: 92px;
        height: 118px;
        padding: 4px;
        border-width: 4px;
        border-radius: 42% 42% 13px 13px;
    }

    .guide-speech {
        grid-area: speech;
        padding: 12px;
        font-size: 1.0625rem;
        line-height: 1.3;
    }

    .guide-speech::before {
        top: calc(50% - 10px);
        left: -10px;
        width: 20px;
        height: 20px;
    }

    .quiz-guide-panel .quiet-button {
        grid-area: exit;
        justify-self: start;
        margin: 0;
        padding: 0 2px 2px;
        font-size: 0.9375rem;
        white-space: normal;
    }

    .quiz-main-panel {
        padding: 18px 12px 24px;
    }

    .progress-panel {
        margin-bottom: 18px;
        padding: 16px;
    }

    .progress-topline,
    .progress-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .question-card {
        padding: 25px 18px 28px;
    }

    .question-card h2 {
        font-size: clamp(2.125rem, 9.7vw, 2.5rem);
        line-height: 1.06;
    }

    .question-help {
        margin-bottom: 22px;
        font-size: 1rem;
        line-height: 1.55;
    }

    .answer-button {
        min-height: 58px;
        gap: 12px;
        padding: 13px 14px;
        font-size: 1rem;
        line-height: 1.35;
    }

    .answer-button::before {
        width: 23px;
        height: 23px;
    }

    .quiz-navigation,
    .dialog-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    #next-button {
        grid-row: 1;
    }

    #back-button {
        grid-row: 2;
    }

    .loading-panel {
        min-height: 630px;
        padding: 58px 24px;
    }

    .analysis-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-page {
        padding-top: 52px;
    }

    .silhouette-panel,
    .teaser-panel {
        padding: 28px 20px;
    }

    .locked-heading,
    .compatibility-row,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .locked-overlay {
        position: relative;
        min-height: 390px;
        margin-top: 10px;
    }

    .premium-reading.locked .reading-card {
        display: none;
    }

    .footer-links {
        gap: 15px;
    }
}

@media (max-width: 430px) {
    :root {
        --page-gutter: 7px;
    }

    .header-inner {
        gap: 7px;
    }

    .brand-seal {
        width: 40px;
        height: 40px;
        font-size: 1.4375rem;
    }

    .brand-copy strong {
        font-size: 1.125rem;
        line-height: 1.03;
    }

    .header-button {
        flex-basis: 104px;
        width: 104px;
        min-height: 46px;
        padding: 7px;
        font-size: 0.75rem;
    }

    .hero-section,
    .content-section,
    .app-panel,
    .result-page {
        padding-right: 15px;
        padding-left: 15px;
    }

    .hero-copy h1 {
        font-size: 2.45rem;
    }

    .matchmaker-frame {
        max-width: 312px;
    }

    .guide-message {
        width: 96%;
        margin-top: 22px;
        padding: 31px 35px 29px;
    }

    .guide-message p {
        font-size: 1.18rem;
    }

    .guide-quote {
        font-size: 2.125rem;
    }

    .guide-quote-open {
        left: 14px;
    }

    .guide-quote-close {
        right: 14px;
    }

    .quiz-guide-panel {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 7px 11px;
        padding: 12px;
    }

    .mini-frame {
        width: 84px;
        height: 108px;
        padding: 3px;
    }

    .guide-speech {
        padding: 11px 10px;
        font-size: 1rem;
    }

    .quiz-guide-panel .quiet-button {
        font-size: 0.875rem;
    }

    .quiz-main-panel {
        padding: 14px 8px 20px;
    }

    .progress-panel {
        padding: 14px;
    }

    .question-card {
        padding: 22px 15px 25px;
    }

    .question-card h2 {
        font-size: 2.1875rem;
    }

    .answer-button {
        font-size: 0.9375rem;
    }
}

/* ========================================================================== 
   MOTION, CONTRAST AND PRINT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .primary-button,
    .secondary-button,
    .header-button,
    .answer-button,
    .price-badge,
    .initial-seal {
        forced-color-adjust: auto;
    }

    .paper-noise,
    body::before {
        display: none;
    }
}

@media print {
    .site-header,
    .site-footer,
    .paper-noise,
    .result-actions,
    .back-home-button,
    .quiet-button {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
        font-size: 11pt;
    }

    .app-screen,
    .result-page {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .result-page::before {
        display: none;
    }

    .premium-reading.locked .reading-card {
        display: none !important;
    }

    .premium-reading.locked .locked-overlay {
        position: relative;
        display: block !important;
        padding: 24px;
        background: #fff;
        border: 1px solid #777;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .premium-reading.unlocked .locked-overlay {
        display: none !important;
    }

    .reading-card,
    .silhouette-panel,
    .teaser-panel {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* ========================================================================== 
   SUPABASE ACCOUNT ACCESS AND SAVED READINGS
   ========================================================================== */

.account-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 9px 17px;
    color: #fff4d4;
    background: transparent;
    border: 1px solid rgba(231, 203, 143, 0.72);
    border-radius: var(--radius-small);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast);
}

.account-nav-button:hover:not(:disabled) {
    color: #2c211d;
    background: #f1d58e;
    border-color: #f1d58e;
    transform: translateY(-1px);
}

.account-loading-panel {
    display: grid;
    place-items: center;
    min-height: 260px;
    padding: 38px;
    color: var(--ink-soft);
    text-align: center;
}

.account-loading-seal {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 14px;
    color: #fff4d4;
    background: var(--burgundy);
    border: 6px double var(--gold-light);
    border-radius: 50%;
    font-family: var(--serif-display);
    font-size: 2.25rem;
    font-weight: 700;
    animation: accountSealPulse 1.6s ease-in-out infinite;
}

.account-access-card {
    position: relative;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 22px;
    padding: 5px;
    background: rgba(211, 183, 121, 0.28);
    border: 1px solid rgba(83, 54, 36, 0.24);
    border-radius: var(--radius-small);
}

.auth-tab {
    min-height: 46px;
    padding: 9px 12px;
    color: var(--ink-soft);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 700;
}

.auth-tab:hover:not(:disabled) {
    color: var(--burgundy-dark);
    background: rgba(255, 250, 235, 0.62);
}

.auth-tab.active {
    color: #fff7e2;
    background: var(--burgundy);
    border-color: var(--burgundy-dark);
    box-shadow: 0 5px 13px rgba(67, 20, 31, 0.18);
}

.auth-form {
    display: grid;
    gap: 11px;
    margin-top: 20px;
}

.auth-form h4 {
    margin: 0 0 2px;
    color: var(--burgundy-dark);
    font-family: var(--serif-display);
    font-size: 1.75rem;
    line-height: 1.1;
}

.auth-form label {
    margin-top: 3px;
    font-size: 0.875rem;
    font-weight: 700;
}

.auth-form .primary-button {
    width: 100%;
    margin-top: 8px;
}

.auth-text-button {
    justify-self: center;
    margin-top: 3px;
    white-space: normal;
}

.auth-message {
    width: 100%;
    max-width: 760px;
    margin: 18px auto 0;
}

.auth-form > .auth-message {
    margin-top: 7px;
}

.account-dashboard > .auth-message {
    max-width: none;
    margin: 0;
}

.dialog-card .auth-message {
    margin-top: 7px;
}

.account-dashboard {
    display: grid;
    gap: 22px;
}

.account-summary-card,
.saved-readings-panel {
    background: rgba(255, 250, 235, 0.82);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-small);
}

.account-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 28px 30px;
}

.account-summary-card h3 {
    margin-bottom: 4px;
}

.account-eyebrow {
    margin: 0 0 4px;
    color: var(--burgundy);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.account-email {
    margin: 0;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.compact-button {
    min-height: 46px;
    padding: 10px 17px;
    font-size: 0.875rem;
}

.account-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.saved-readings-panel {
    padding: 30px;
}

.saved-readings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.saved-readings-heading .kicker {
    margin-bottom: 4px;
}

.saved-readings-heading h3 {
    margin-bottom: 0;
}

.saved-readings-list {
    display: grid;
    gap: 12px;
}

.saved-reading-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 20px;
    background: #fffaf0;
    border: 1px solid rgba(81, 53, 35, 0.28);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius-small);
}

.saved-reading-copy {
    min-width: 0;
}

.saved-reading-copy h4 {
    margin: 6px 0 4px;
    color: var(--burgundy-dark);
    font-family: var(--serif-display);
    font-size: 1.45rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.saved-reading-copy p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.reading-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.reading-status-completed {
    color: #fff7e2;
    background: var(--green);
}

.reading-status-in_progress {
    color: var(--burgundy-dark);
    background: #ead8aa;
    border: 1px solid #b78b48;
}

.saved-reading-actions {
    display: flex;
    align-items: center;
    gap: 13px;
}

.danger-text-button {
    color: #8b2837;
}

.danger-text-button:hover:not(:disabled) {
    color: #5e101c;
}

.empty-state {
    margin: 0;
    padding: 28px;
    color: var(--ink-soft);
    background: rgba(226, 205, 154, 0.22);
    border: 1px dashed rgba(76, 49, 32, 0.34);
    text-align: center;
}

.account-privacy-note {
    max-width: 850px;
}

@keyframes accountSealPulse {
    0%, 100% {
        transform: scale(0.97);
        box-shadow: 0 0 0 0 rgba(111, 38, 53, 0.18);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 12px rgba(111, 38, 53, 0);
    }
}

@media (max-width: 1020px) {
    .main-nav {
        gap: 11px;
    }

    .account-nav-button {
        padding-right: 14px;
        padding-left: 14px;
    }
}

@media (max-width: 760px) {
    .main-nav {
        flex: 0 0 auto;
        gap: 7px;
    }

    #header-start-button {
        display: none;
    }

    .account-nav-button {
        flex: 0 0 88px;
        width: 88px;
        min-height: 44px;
        padding: 7px 8px;
        font-size: 0.75rem;
    }

    .profile-choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .choice-card,
    .saved-readings-panel {
        padding: 24px 20px;
    }

    .account-summary-card {
        align-items: flex-start;
        padding: 23px 20px;
    }

    .account-dashboard-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .saved-reading-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .saved-reading-actions {
        justify-content: space-between;
    }
}

@media (max-width: 460px) {
    .account-nav-button {
        flex-basis: 80px;
        width: 80px;
    }

    .choice-card,
    .saved-readings-panel {
        padding-right: 17px;
        padding-left: 17px;
    }

    .auth-tabs {
        gap: 4px;
    }

    .auth-tab {
        padding-right: 7px;
        padding-left: 7px;
        font-size: 0.8125rem;
    }

    .account-summary-card,
    .saved-readings-heading,
    .saved-reading-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .account-summary-card .compact-button,
    .saved-reading-actions .compact-button {
        width: 100%;
    }

    .saved-readings-heading .quiet-button,
    .saved-reading-actions .quiet-button {
        align-self: flex-start;
    }
}

/* ==========================================================================
   FEEDBACK AND STATUS MESSAGES
   ========================================================================== */

.auth-message,
.payment-status-message,
.payment-inline-message,
.form-error {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 54px;
    padding: 15px 17px;
    overflow-wrap: anywhere;
    color: var(--info-dark);
    background: var(--info-soft);
    border: 1px solid var(--info-border);
    border-left-width: 5px;
    border-radius: 7px;
    box-shadow: 0 7px 18px rgba(47, 30, 21, 0.1);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.55;
    text-align: left;
}

.auth-message::before,
.payment-status-message::before,
.payment-inline-message::before,
.form-error::before {
    content: "i";
    display: grid;
    flex: 0 0 25px;
    place-items: center;
    width: 25px;
    height: 25px;
    margin-top: 1px;
    color: #fffaf0;
    background: var(--gold);
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
}

.auth-message[data-type="success"],
.payment-status-message[data-type="success"],
.payment-inline-message[data-type="success"] {
    color: var(--green-dark);
    background: var(--green-soft);
    border-color: var(--green-border);
}

.auth-message[data-type="success"]::before,
.payment-status-message[data-type="success"]::before,
.payment-inline-message[data-type="success"]::before {
    content: "✓";
    background: var(--green);
}

.auth-message[data-type="error"],
.payment-status-message[data-type="error"],
.payment-inline-message[data-type="error"],
.form-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: var(--danger-border);
}

.auth-message[data-type="error"]::before,
.payment-status-message[data-type="error"]::before,
.payment-inline-message[data-type="error"]::before,
.form-error::before {
    content: "!";
    background: var(--danger);
}

.auth-message[data-type="info"],
.payment-status-message[data-type="info"],
.payment-inline-message[data-type="info"] {
    color: var(--info-dark);
    background: var(--info-soft);
    border-color: var(--info-border);
}

@media (max-width: 560px) {
    .auth-message,
    .payment-status-message,
    .payment-inline-message,
    .form-error {
        gap: 10px;
        min-height: 50px;
        padding: 13px 14px;
        border-left-width: 4px;
        font-size: 0.8125rem;
    }

    .auth-message::before,
    .payment-status-message::before,
    .payment-inline-message::before,
    .form-error::before {
        flex-basis: 23px;
        width: 23px;
        height: 23px;
    }

    .payment-status-message {
        margin-top: 22px;
        margin-bottom: 20px;
    }
}

/* ========================================================================== 
   STRIPE CHECKOUT AND COMPLIMENTARY CODES
   ========================================================================== */

.payment-status-message {
    width: min(100%, 760px);
    margin: 28px auto 24px;
}

.payment-inline-message {
    width: 100%;
    margin: 8px 0 0;
}

.unlock-choice-panel {
    display: grid;
    gap: 14px;
    width: min(100%, 560px);
    margin-top: 4px;
}

.unlock-payment-button {
    width: 100%;
}

.unlock-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.unlock-divider::before,
.unlock-divider::after {
    content: "";
    height: 1px;
    background: rgba(111, 38, 53, 0.25);
}

.promo-code-form {
    display: grid;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.promo-code-form label {
    color: var(--burgundy-dark);
    font-size: 0.8125rem;
    font-weight: 700;
}

.promo-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
}

.promo-code-input {
    min-width: 0;
    min-height: 54px;
}

.promo-code-row .secondary-button {
    min-height: 54px;
    white-space: nowrap;
}


.locked-overlay #payment-note {
    display: block;
    max-width: 580px;
    margin-top: 16px;
    line-height: 1.5;
}

.reading-status-unlocked {
    color: #fff7e2;
    background: var(--burgundy);
}

@media (max-width: 560px) {
    .locked-overlay {
        padding: 28px 18px;
    }

    .locked-overlay h3 {
        font-size: 2rem;
    }

    .promo-code-row {
        grid-template-columns: 1fr;
    }

    .promo-code-row .secondary-button {
        width: 100%;
    }
}


/* =====================================================
   ACCOUNT DELETION
   ===================================================== */

.account-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-top: 30px;
    padding: 26px 28px;
    background: rgba(251, 232, 223, 0.62);
    border: 1px solid rgba(104, 21, 31, 0.46);
}

.account-danger-zone h3 {
    margin-bottom: 7px;
    color: var(--danger);
    font-size: 30px;
}

.account-danger-zone p:last-child {
    max-width: 680px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.danger-button {
    min-height: 48px;
    padding: 11px 18px;
    color: #fff8e6;
    background: linear-gradient(180deg, #822737, #5d1724);
    border: 2px solid #46101a;
    border-radius: 5px;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px rgba(255, 232, 181, 0.1);
    transition: transform 0.18s ease, background 0.18s ease;
}

.danger-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #942f42, #6b1929);
}

.danger-button:disabled {
    cursor: wait;
    opacity: 0.66;
}

.delete-account-dialog-card {
    width: min(620px, 100%);
}

.delete-account-dialog-card h2 {
    margin-bottom: 14px;
    color: var(--danger);
}

.deletion-list {
    margin: 20px 0 26px;
    padding-left: 24px;
    color: var(--ink-soft);
    font-size: 14px;
}

.deletion-list li + li {
    margin-top: 8px;
}

@media (max-width: 760px) {
    .account-danger-zone {
        flex-direction: column;
        align-items: stretch;
        padding: 22px 20px;
    }

    .account-danger-zone .danger-button {
        width: 100%;
    }
}

/* =====================================================
   LAUNCH LEGAL, CONSENT AND POLICY PAGES
   ===================================================== */

.reading-consent-panel {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 14px;
    margin: 0 0 28px;
    padding: 24px;
    background: rgba(255, 248, 228, 0.9);
    border: 1px solid rgba(111, 38, 53, 0.34);
    box-shadow: var(--shadow-small);
}

.reading-consent-panel h3 {
    margin-bottom: 8px;
}

.reading-consent-panel p {
    margin: 0;
    color: var(--ink-soft);
}

.legal-check-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 15px;
    color: var(--ink);
    background: rgba(255, 252, 243, 0.86);
    border: 1px solid rgba(76, 49, 32, 0.28);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.55;
    cursor: pointer;
}

.legal-check-row:hover {
    border-color: rgba(111, 38, 53, 0.6);
    background: #fff9e9;
}

.legal-check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--burgundy);
}

.legal-check-row a,
.footer-disclosure a,
.legal-document a:not(.primary-button):not(.secondary-button) {
    color: var(--burgundy);
    font-weight: 700;
    text-underline-offset: 3px;
}

.compact-legal-check {
    margin: 4px 0 8px;
}

.purchase-summary {
    display: grid;
    gap: 7px;
    width: min(620px, 100%);
    margin: 0 auto;
    padding: 15px 17px;
    text-align: left;
    background: rgba(255, 252, 242, 0.9);
    border: 1px solid rgba(76, 49, 32, 0.3);
}

.purchase-summary > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: baseline;
}

.purchase-summary span {
    font-weight: 700;
}

.purchase-summary strong {
    color: var(--burgundy);
    font-family: var(--serif-display);
    font-size: 26px;
}

.purchase-summary small {
    color: var(--ink-soft);
}

.purchase-consent-row {
    width: min(620px, 100%);
    margin: 0 auto;
    text-align: left;
}

.unlock-payment-button:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    transform: none;
    box-shadow: none;
}

.footer-disclosure a {
    color: #f0d99f;
}

/* Standalone policy pages */

.legal-body {
    min-height: 100vh;
}

.legal-main {
    width: min(980px, calc(100% - 36px));
    margin: 34px auto 70px;
}

.legal-document {
    position: relative;
    padding: clamp(34px, 6vw, 70px);
    background:
        linear-gradient(rgba(255, 250, 236, 0.94), rgba(247, 236, 205, 0.97)),
        var(--paper-light);
    border: 1px solid rgba(72, 47, 31, 0.38);
    box-shadow: var(--shadow-large);
}

.legal-document::before {
    content: "";
    position: absolute;
    inset: 13px;
    border: 1px solid rgba(111, 38, 53, 0.28);
    pointer-events: none;
}

.legal-document > * {
    position: relative;
    z-index: 1;
}

.legal-document-header {
    max-width: 760px;
    margin: 0 auto 42px;
    text-align: center;
}

.legal-document-header h1 {
    max-width: none;
    margin-bottom: 14px;
    font-size: clamp(44px, 7vw, 70px);
}

.legal-meta {
    color: var(--ink-soft);
    font-size: 14px;
}

.legal-summary {
    margin: 0 0 34px;
    padding: 20px 22px;
    background: rgba(222, 197, 137, 0.28);
    border-left: 5px solid var(--burgundy);
}

.legal-section {
    max-width: 780px;
    margin: 0 auto 34px;
}

.legal-section h2 {
    margin-bottom: 13px;
    font-size: clamp(30px, 4vw, 42px);
}

.legal-section h3 {
    margin: 24px 0 9px;
    font-size: 25px;
}

.legal-section p,
.legal-section li {
    color: #44352f;
}

.legal-section ul,
.legal-section ol {
    padding-left: 24px;
}

.legal-section li + li {
    margin-top: 8px;
}

.legal-contact-card {
    max-width: 780px;
    margin: 40px auto 0;
    padding: 24px;
    background: rgba(255, 248, 228, 0.94);
    border: 1px solid rgba(111, 38, 53, 0.38);
}

.legal-contact-card address {
    font-style: normal;
}

.legal-back-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(800px, 100%);
    margin: 38px auto 0;
}

.legal-nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.legal-nav-links a {
    color: #f7ead0;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.legal-nav-links a:hover {
    color: #ffd98c;
}

.legal-body .header-inner {
    min-height: 88px;
}

.legal-return-button {
    flex: 0 0 auto;
    min-width: 176px;
    min-height: 50px;
    padding: 11px 18px;
    color: #fff8e6;
    background: linear-gradient(180deg, #7c3040, #571d2a);
    border: 2px solid var(--gold-light);
    box-shadow:
        inset 0 0 0 2px rgba(255, 236, 190, 0.13),
        0 7px 16px rgba(38, 17, 22, 0.24);
    text-shadow: 0 1px 1px rgba(28, 10, 14, 0.45);
}

.legal-return-button:hover {
    color: #fffdf5;
    background: linear-gradient(180deg, #8c394c, #651f30);
    border-color: #f0cf78;
}

.legal-document .legal-bottom-return-button,
.legal-document .legal-bottom-return-button:visited {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    color: #fff8e6;
    background: linear-gradient(180deg, #7c3040, #5a1f2d);
    border-color: #43141f;
    text-shadow: 0 1px 1px rgba(28, 10, 14, 0.42);
}

.legal-document .legal-bottom-return-button:hover {
    color: #fffdf5;
    background: linear-gradient(180deg, #8d3849, #661f31);
}

.legal-back-row > a,
.legal-back-row > button {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    margin: 0;
}

@media (max-width: 760px) {
    .reading-consent-panel {
        padding: 18px 15px;
    }

    .legal-check-row {
        grid-template-columns: 22px minmax(0, 1fr);
        padding: 12px;
        font-size: 13px;
    }

    .purchase-summary > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .legal-main {
        width: calc(100% - 16px);
        margin-top: 14px;
    }

    .legal-document {
        padding: 42px 20px;
    }

    .legal-document::before {
        inset: 8px;
    }

    .legal-nav-links {
        display: none;
    }

    .legal-body .header-inner {
        min-height: 76px;
        gap: 12px;
    }

    .legal-return-button {
        min-width: 138px;
        min-height: 46px;
        padding: 9px 12px;
        font-size: 0.8125rem;
    }

    .legal-back-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .legal-back-row > a,
    .legal-back-row > button,
    .legal-bottom-return-button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 460px) {
    .legal-body .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .legal-body .brand-copy small {
        display: none;
    }

    .legal-body .brand-copy strong {
        font-size: 1.125rem;
    }

    .legal-return-button {
        min-width: 112px;
        max-width: 122px;
        padding: 8px 9px;
        font-size: 0.75rem;
        line-height: 1.25;
    }
}

@media print {
    .legal-body .site-header,
    .legal-body .site-footer,
    .legal-back-row,
    .paper-noise {
        display: none !important;
    }

    .legal-main {
        width: 100%;
        margin: 0;
    }

    .legal-document {
        padding: 0;
        border: 0;
        box-shadow: none;
        background: #fff;
    }

    .legal-document::before {
        display: none;
    }
}


/* ==========================================================================
   MOBILE ACCOUNT ACTION RELIABILITY
   ========================================================================== */

#guest-button,
#account-new-reading-button {
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

@media (max-width: 760px) {
    #guest-button,
    #account-new-reading-button {
        width: 100%;
        min-height: 58px;
    }

    .choice-card,
    .account-dashboard-actions {
        position: relative;
        isolation: isolate;
    }
}

/* =====================================================
   PAYMENT + SIGN-IN INTERACTION REPAIR
   ===================================================== */

.checkout-message {
    margin: 0;
}

.unlock-payment-button.needs-consent {
    opacity: 0.78;
}

.unlock-payment-button.needs-consent:hover {
    opacity: 1;
}

.unlock-choice-panel .purchase-consent-row:focus-within {
    border-color: var(--burgundy);
    box-shadow: 0 0 0 3px rgba(111, 38, 53, 0.12);
}

@media (max-width: 760px) {
    .unlock-choice-panel {
        gap: 16px;
    }

    .checkout-message,
    .promo-code-message {
        scroll-margin-top: 96px;
    }
}
