/* Sen-yū gaido — Styles */
/* Aesthetic: Organic / contemplative / Japanese-influenced */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@200;300;400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@200;300;400&display=swap');

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

:root {
    --white:      #FFFFFF;
    --off-white:  #F8F5F0;
    --cream:      #F2EDE4;
    --parchment:  #EDE5D8;
    --moss:       #2A3D22;
    --fern:       #3D5C30;
    --sage:       #6A8F5C;
    --sage-light: #A8C49A;
    --earth:      #8B6E4E;
    --warm-dark:  #5C4A2A;
    --text:       #1E2E18;
    --text-muted: #5A6E52;
    --enso:       #2A3D22;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── ENSO ORB ─────────────────────────────────────────────────── */

.gaido-orb {
    position: fixed;
    bottom: 52px;
    left: 28px;
    width: 62px;
    height: 62px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.gaido-orb:hover { transform: scale(1.08); }

.enso-img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    animation: ensoBreath 4s ease-in-out infinite;
    mix-blend-mode: multiply;
    transition: filter 0.5s ease;
}

@keyframes ensoBreath {
    0%,100% { transform: scale(1);    opacity: 0.82; }
    50%      { transform: scale(1.06); opacity: 1;    }
}

/* Orb states */
.gaido-orb.state-thinking .enso-img {
    animation: ensoSpin 3s linear infinite;
    filter: sepia(0.3) saturate(0.4) brightness(0.7);
}
@keyframes ensoSpin {
    from { transform: rotate(0deg) scale(1); }
    to   { transform: rotate(360deg) scale(1); }
}

.gaido-orb.state-speaking .enso-img {
    filter: sepia(0.2) saturate(0.8) brightness(0.75) hue-rotate(40deg);
    animation: ensoPulse 0.6s ease-in-out 3;
}
@keyframes ensoPulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.12); }
}

.gaido-orb.state-challenge .enso-img {
    filter: sepia(0.5) saturate(1.2) brightness(0.75) hue-rotate(-20deg);
    animation: ensoAmber 1.5s ease-in-out infinite;
}
@keyframes ensoAmber {
    0%,100% { transform: scale(1);    opacity: 0.85; }
    50%     { transform: scale(1.08); opacity: 1;    }
}

.gaido-orb.state-insight .enso-img {
    filter: sepia(0.1) saturate(0.6) brightness(0.9) hue-rotate(60deg);
    animation: ensoInsight 0.4s ease-out;
}
@keyframes ensoInsight {
    0%   { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1.1);  opacity: 1;   }
}

.gaido-orb.open .enso-img {
    filter: sepia(0.2) saturate(0.6) brightness(0.8);
    animation: ensoBreath 4s ease-in-out infinite;
}

.gaido-pulse {
    display: none;
}

.gaido-orb.open .gaido-pulse { animation: none; opacity: 0; }

/* ─── GAIDO PANEL ─────────────────────────────────────────────── */

.gaido-panel {
    position: fixed;
    bottom: 130px;
    left: 20px;
    width: 380px;
    max-height: 560px;
    background: var(--off-white);
    border: 1px solid rgba(106, 143, 92, 0.25);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(42, 61, 34, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    animation: panelIn 0.3s ease;
    overflow: hidden;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gaido-panel.hidden { display: none; }

.gaido-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(106, 143, 92, 0.15);
    background: var(--cream);
}

.gaido-title {
    font-family: 'Noto Serif JP', 'Cormorant Garamond', serif;
    font-size: 0.82rem;
    color: var(--moss);
}

.gaido-title em {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    margin-left: 6px;
    color: var(--text-muted);
}

.gaido-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.gaido-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gaido-message {
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 90%;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gaido-message-guide {
    background: var(--cream);
    color: var(--moss);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.gaido-message-user {
    background: var(--fern);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
}

.gaido-choice-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.gaido-choice-btn {
    background: var(--fern);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.gaido-choice-btn:hover { background: var(--moss); }
.gaido-choice-btn-secondary { background: transparent; color: var(--text-muted); border: 1px solid rgba(106,143,92,0.3); }
.gaido-choice-btn-secondary:hover { background: var(--cream); color: var(--moss); }

.gaido-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(106, 143, 92, 0.15);
    background: var(--white);
}

#gaido-input {
    flex: 1;
    resize: none;
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    background: var(--off-white);
    outline: none;
}
#gaido-input:focus { border-color: var(--sage); }

#gaido-send {
    background: var(--fern);
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}
#gaido-send:hover { background: var(--moss); }

/* ─── INLINE GAIDO RESPONSE ──────────────────────────────────── */

.gaido-inline-response { margin-top: 10px; }

.gaido-inline-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(200, 170, 100, 0.08);
    border-left: 2px solid #C4913A;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    animation: msgIn 0.4s ease;
}

.gaido-inline-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #C4913A;
    margin-top: 6px;
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%,100% { transform: scale(1);   opacity: 0.7; }
    50%     { transform: scale(1.4); opacity: 1;   }
}

.gaido-inline-message p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.98rem;
    color: var(--warm-dark);
    line-height: 1.7;
    font-style: italic;
}

/* ─── SCREENS ─────────────────────────────────────────────────── */

.screen { display: none; }
.screen.active { display: block; }

.screen-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 24px 120px;
    animation: fadeUp 0.6s ease;
}

.screen-inner-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px 120px;
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.screen-header {
    margin-bottom: 3rem;
}

.step-label {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.step-label::before {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--sage);
}

.screen-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--moss);
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.screen-intro {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.9;
}
.screen-intro em { font-style: italic; color: var(--fern); }

/* ─── WELCOME SCREEN — CINEMATIC HERO ────────────────────────── */

.welcome-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('hero.jpg') center center / cover no-repeat;
    background-color: var(--moss); /* fallback while image loads */
}

.welcome-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(30, 46, 24, 0.45) 0%,
        rgba(30, 46, 24, 0.65) 40%,
        rgba(30, 46, 24, 0.80) 100%
    );
}

.welcome-hero-content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    width: 100%;
    padding: 60px 24px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeUp 0.8s ease;
}

.welcome-hero-content .welcome-kana {
    color: rgba(248, 245, 240, 0.6);
}

.welcome-hero-content h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.8rem, 5vw, 4rem);
    font-weight: 300;
    color: var(--off-white);
    margin-bottom: 0.6rem;
    line-height: 1.1;
    letter-spacing: 0.04em;
}

.welcome-hero-content .welcome-greeting {
    text-align: left;
    margin-bottom: 2.5rem;
}

.welcome-hero-content .welcome-greeting p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 300;
    color: rgba(248, 245, 240, 0.8);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.welcome-hero-content .welcome-greeting p:first-child {
    font-size: 1.1rem;
    color: var(--off-white);
    font-style: italic;
}

.welcome-hero-content .name-entry input {
    background: rgba(248, 245, 240, 0.12);
    border: 1px solid rgba(248, 245, 240, 0.3);
    color: var(--off-white);
}
.welcome-hero-content .name-entry input::placeholder {
    color: rgba(248, 245, 240, 0.5);
}
.welcome-hero-content .name-entry input:focus {
    border-color: rgba(248, 245, 240, 0.6);
    background: rgba(248, 245, 240, 0.18);
}

.welcome-hero-content .btn-begin {
    background: rgba(248, 245, 240, 0.15);
    color: var(--off-white);
    border: 1px solid rgba(248, 245, 240, 0.35);
    backdrop-filter: blur(4px);
}
.welcome-hero-content .btn-begin:hover {
    background: rgba(248, 245, 240, 0.25);
    border-color: rgba(248, 245, 240, 0.5);
    transform: translateY(-2px);
}

.welcome-hero-content .persistence-note {
    color: rgba(248, 245, 240, 0.45);
}

/* Welcome screen: hide the orb and nudge entirely */
body.on-welcome #gaido-orb,
body.on-welcome #gaido-nudge {
    display: none;
}

/* Koan on dark hero — bright and readable */
body.on-welcome .gaido-koan p {
    color: rgba(248, 245, 240, 0.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}


.quote-enso-img {
    width: 240px;
    height: 240px;
    object-fit: contain;
    
    animation: welcomeEnsoBreath 6s ease-in-out infinite;
}

@keyframes welcomeEnsoBreath {
    0%,100% { transform: scale(1);    opacity: 0.75; }
    50%     { transform: scale(1.04); opacity: 1;    }
}

.welcome-kana {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.85rem;
    color: var(--sage);
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

/* ─── GAIDO NUDGE ─────────────────────────────────────────────── */

.gaido-nudge {
    position: fixed;
    bottom: 12px;
    left: 28px;
    text-align: left;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: nudgeFadeIn 1s ease 1.5s both;
    z-index: 999;
    pointer-events: auto;
}

.gaido-nudge.hidden { display: none; }
.gaido-nudge.visible { opacity: 0.75; animation: none; }
.gaido-nudge.visible p { display: none; }
.gaido-nudge:hover { opacity: 1 !important; }

@keyframes nudgeFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 0.75; transform: translateY(0); }
}

.gaido-nudge p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--moss);
    line-height: 1.4;
    margin-bottom: 2px;
}

.gaido-nudge span {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sage);
}


/* ─── GAIDO KOAN ──────────────────────────────────────────────── */

.gaido-koan {
    position: fixed;
    top: 32px;
    right: 32px;
    text-align: right;
    max-width: 260px;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.gaido-koan.visible {
    opacity: 0.55;
}

.gaido-koan p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--moss);
    line-height: 1.7;
    margin: 0;
    transition: color 0.6s ease, text-shadow 0.6s ease;
}




.name-entry input {
    flex: 1;
    min-width: 180px;
    padding: 12px 18px;
    border: 1px solid rgba(106, 143, 92, 0.3);
    border-radius: 100px;
    background: var(--white);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.3s;
}
.name-entry input:focus { border-color: var(--sage); }

.persistence-note {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 1.4rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    max-width: 400px;
}

/* ─── BUTTONS ─────────────────────────────────────────────────── */

.btn-begin, .btn-next {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-style: italic;
    background: var(--fern);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(61, 92, 48, 0.25);
}
.btn-begin:hover, .btn-next:hover {
    background: var(--moss);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(42, 61, 34, 0.3);
}

.btn-secondary {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(106, 143, 92, 0.3);
    padding: 10px 22px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-secondary:hover { border-color: var(--sage); color: var(--moss); }

.btn-print {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-style: italic;
    background: var(--moss);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-print:hover { background: var(--earth); transform: translateY(-2px); }

.btn-email {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    background: transparent;
    color: var(--fern);
    border: 1px solid var(--sage);
    padding: 10px 22px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-email:hover { background: var(--fern); color: white; }

.nav-row {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

/* ─── VIDEO ───────────────────────────────────────────────────── */

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(42, 61, 34, 0.12);
}

.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ─── QUOTE SCREEN ────────────────────────────────────────────── */

.screen-quote-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: center;
    min-height: 80vh;
}

.quote-enso { display: flex; justify-content: center; background: none; }

.quote-enso-img {
    width: 240px;
    height: 240px;
    object-fit: contain;
    background: transparent;
    
    animation: welcomeEnsoBreath 6s ease-in-out infinite;
}

.quote-kana {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.4rem;
    color: var(--sage);
    margin-bottom: 1.5rem;
    opacity: 0.6;
    letter-spacing: 0.15em;
}

.opening-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-style: italic;
    font-weight: 300;
    color: var(--moss);
    line-height: 1.8;
    border: none;
    padding: 0;
    margin: 0 0 1.2rem 0;
}

.quote-attribution {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.quote-attribution em { font-style: italic; }

/* ─── PHILOSOPHY SCREEN ───────────────────────────────────────── */

.philosophy-content {
    max-width: 680px;
}

.philosophy-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 1.4rem;
}

.philosophy-text strong {
    color: var(--moss);
    font-weight: 600;
}

.philosophy-guide-note {
    font-style: italic;
    color: var(--fern);
    opacity: 0.85;
    margin-top: 0.5rem;
}

.philosophy-closing {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--moss);
    margin-top: 2rem;
    text-align: center;
}

/* ─── BRIDGE TABLE ────────────────────────────────────────────── */

.bridge-table {
    margin: 2.5rem 0;
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.bridge-table-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sage);
    padding: 14px 20px 10px;
    border-bottom: 1px solid rgba(106, 143, 92, 0.1);
    background: var(--cream);
}

.bridge-rows { padding: 8px 0; }

.bridge-row {
    display: grid;
    grid-template-columns: 1fr 32px 1fr;
    align-items: center;
    padding: 10px 20px;
    gap: 12px;
    transition: background 0.2s;
}
.bridge-row:hover { background: var(--cream); }

.bridge-row-centre .bridge-pillar-name,
.bridge-row-centre .bridge-circle-name {
    color: var(--earth);
}

.bridge-pillar,
.bridge-circle {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bridge-pillar-name,
.bridge-circle-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--moss);
    font-weight: 600;
}

.bridge-pillar-seed,
.bridge-circle-fruit {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.bridge-arrow {
    text-align: center;
    color: var(--sage);
    font-size: 1rem;
    opacity: 0.5;
}

/* ─── PILLAR QUESTIONS ────────────────────────────────────────── */

.pillar-question {
    border-left: 2px solid rgba(106, 143, 92, 0.2);
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s;
}
.pillar-question:focus-within {
    border-left-color: var(--sage);
}

.pillar-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.pillar-number {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.pillar-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--moss);
    font-weight: 600;
}

.pillar-jp {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.78rem;
    color: var(--sage);
    opacity: 0.7;
}

.pillar-bridge {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    letter-spacing: 0.02em;
}
.pillar-bridge em { font-style: italic; color: var(--fern); }

.pillar-hint {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.7;
    background: var(--cream);
    border-left: 2px solid var(--sage-light);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1rem;
}

.circle-description-note {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--fern);
    margin-top: 0.6rem;
    line-height: 1.7;
    opacity: 0.85;
}

.question-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.question-optional {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--sage);
    font-style: italic;
    background: rgba(106, 143, 92, 0.08);
    padding: 2px 8px;
    border-radius: 100px;
}

@media (max-width: 760px) {
    .screen-quote-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        min-height: auto;
        padding-top: 40px;
    }
    .quote-enso-img { width: 140px; height: 140px; }
    .bridge-row { grid-template-columns: 1fr 20px 1fr; padding: 8px 12px; }
}

/* ─── GLOBAL BACK BUTTON ──────────────────────────────────────── */

.global-back {
    position: fixed;
    top: 24px;
    left: 24px;
    background: rgba(248, 245, 240, 0.9);
    border: 1px solid rgba(106, 143, 92, 0.25);
    border-radius: 100px;
    padding: 8px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}
.global-back:hover { border-color: var(--sage); color: var(--moss); }

/* ─── SAVE LINK ───────────────────────────────────────────────── */

#save-link-container {
    position: fixed;
    bottom: 100px;
    left: 24px;
    max-width: 340px;
    z-index: 90;
    animation: fadeUp 0.4s ease;
}

.save-link-box {
    background: var(--white);
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(42, 61, 34, 0.08);
}

.save-link-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.save-link-row { display: flex; gap: 6px; }

.save-link-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 6px;
    font-size: 0.72rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-muted);
    background: var(--off-white);
    outline: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy {
    background: var(--fern);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-copy:hover { background: var(--moss); }

.copy-confirm {
    font-size: 0.7rem;
    color: var(--sage);
    margin-top: 6px;
    min-height: 16px;
}

@media (max-width: 760px) {
    #save-link-container { left: 10px; right: 10px; max-width: none; bottom: 90px; }
    .global-back { top: 12px; left: 12px; }
}

.warmup-container {
    display: flex;
    flex-direction: column;
}

.warmup-question {
    animation: fadeUp 0.5s ease both;
}

.pillar-question-single {
    animation: fadeUp 0.4s ease both;
}

.circle-question-single {
    animation: fadeUp 0.4s ease both;
    margin-bottom: 1rem;
}

/* ─── PROGRESS BAR ────────────────────────────────────────────── */

.pillar-progress {
    margin-bottom: 2rem;
}

.pillar-progress-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.pillar-progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(106, 143, 92, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.pillar-progress-fill {
    height: 100%;
    background: var(--sage);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.circle-progress-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.circle-progress-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.circle-q-of {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ─── PILLAR / CIRCLE NAVIGATION BUTTONS ─────────────────────── */

.pillar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.8rem;
}

.btn-pillar-next {
    background: var(--moss);
    color: var(--cream);
    border: none;
    border-radius: 100px;
    padding: 12px 28px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.04em;
}
.btn-pillar-next:hover:not(:disabled) { background: var(--fern); transform: translateY(-1px); }
.btn-pillar-next:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-pillar-prev {
    background: none;
    border: 1px solid rgba(106, 143, 92, 0.25);
    border-radius: 100px;
    padding: 11px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-pillar-prev:hover { border-color: var(--sage); color: var(--moss); }

/* ─── AUTOSAVE INDICATOR ──────────────────────────────────────── */

.textarea-wrap {
    position: relative;
}

.autosave-indicator {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    color: var(--sage);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    letter-spacing: 0.05em;
}

.autosave-indicator.visible {
    opacity: 0.7;
}

/* ─── GAIDO ESCAPE HATCH ──────────────────────────────────────── */

.gaido-escape {
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 0 0;
    display: block;
    letter-spacing: 0.04em;
    opacity: 0.6;
    transition: opacity 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.gaido-escape:hover { opacity: 1; color: var(--moss); }

/* ─── REFLECTION TEXTAREA ────────────────────────────────────── */

.reflection-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 12px;
    background: var(--white);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-top: 14px;
}

.reflection-textarea:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(106, 143, 92, 0.08);
}

/* ─── QUESTIONS ───────────────────────────────────────────────── */

.question-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--moss);
    line-height: 1.8;
}

.question-number {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ─── CIRCLE TABS ─────────────────────────────────────────────── */

.circles-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 3rem;
}

.circle-tab {
    background: var(--white);
    border: 1px solid rgba(106, 143, 92, 0.2);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.circle-tab:hover {
    border-color: var(--sage);
    background: var(--cream);
}

.circle-tab.active {
    background: var(--fern);
    border-color: var(--fern);
}

.circle-tab-jp {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
}

.circle-tab.active .circle-tab-jp {
    color: rgba(255,255,255,0.7);
}

.circle-tab-en {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.circle-tab.active .circle-tab-en {
    color: white;
}

/* ─── CIRCLE CONTENT ─────────────────────────────────────────── */

.circle-header {
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid rgba(106, 143, 92, 0.15);
    margin-bottom: 2.5rem;
}

.circle-jp {
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    color: var(--circle-colour, var(--sage));
    margin-bottom: 0.4rem;
    opacity: 0.7;
}

.circle-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--circle-colour, var(--moss));
    margin-bottom: 0.8rem;
}

.circle-description {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
}

.circle-questions {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.circle-question {
    animation: fadeUp 0.4s ease both;
}

/* ─── DIAGRAM ─────────────────────────────────────────────────── */

.ikigai-diagram {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.ikigai-svg {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 4px;
}

.diagram-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
}

.loading-enso {
    width: 48px;
    height: 48px;
    border: 2px solid var(--sage);
    border-top-color: transparent;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1.5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ikigai-statement {
    max-width: 640px;
    margin: 0 auto 2rem;
    text-align: center;
}

.statement-container {
    padding: 2rem;
    background: var(--cream);
    border-radius: 12px;
    border-left: 3px solid var(--sage);
}

.statement-label {
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 1rem;
}

.statement-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    font-weight: 300;
    color: var(--moss);
    line-height: 1.9;
    border: none;
    padding: 0;
}

.statement-loading {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.diagram-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn-finish {
    background: var(--moss);
    color: var(--cream);
    border: none;
    border-radius: 100px;
    padding: 12px 28px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}
.btn-finish:hover { background: var(--fern); transform: translateY(-2px); }

/* ─── GAIDO CLOSING MESSAGE ───────────────────────────────────── */

.gaido-closing {
    max-width: 680px;
    margin: 3rem auto 2.5rem;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
    border: 1px solid rgba(106, 143, 92, 0.15);
    border-left: 3px solid rgba(106, 143, 92, 0.4);
    border-radius: 0 16px 16px 0;
}

.closing-enso-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    
    animation: ensoBreath 6s ease-in-out infinite;
    transition: all 3s ease;
}

.closing-enso-img.enso-settled {
    filter: grayscale(1) brightness(0.5) opacity(0.2) !important;
    animation: none !important;
}

.gaido-closing-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 1.2rem;
    opacity: 0.8;
}

.gaido-closing-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 1rem;
}

.gaido-closing-handoff {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--moss);
    line-height: 1.9;
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(106, 143, 92, 0.06);
    border-radius: 8px;
}

.gaido-closing-farewell {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.9;
    margin-top: 0.5rem;
    opacity: 0.75;
}

/* ─── PRINT STYLES FOR CLOSING ────────────────────────────────── */

@media print {
    .gaido-closing {
        grid-template-columns: 1fr;
        border: none;
        border-top: 1px solid rgba(106, 143, 92, 0.2);
        border-left: none;
        border-radius: 0;
        margin-top: 2rem;
        padding: 2rem 0 0;
        background: none;
        page-break-inside: avoid;
    }
    .gaido-closing-enso { display: none; }
    .gaido-closing-label {
        font-size: 7pt;
        letter-spacing: 0.3em;
    }
    .gaido-closing-body,
    .gaido-closing-farewell {
        font-size: 10pt;
        color: #3a3a3a;
        font-family: 'Noto Serif JP', 'Cormorant Garamond', Georgia, serif;
    }
    .gaido-closing-handoff {
        font-size: 10pt;
        font-weight: 600;
        color: #1a2e14;
        font-family: 'Noto Serif JP', 'Cormorant Garamond', Georgia, serif;
        background: none;
        border-left: 2px solid #6A8F5C;
        padding-left: 12pt;
        border-radius: 0;
    }
}

/* ─── EMAIL SECTION ───────────────────────────────────────────── */

.email-section {
    max-width: 420px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    border: 1px solid rgba(106, 143, 92, 0.2);
}

.email-section input[type="email"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(106, 143, 92, 0.25);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 10px;
    outline: none;
}
.email-section input[type="email"]:focus { border-color: var(--sage); }

.email-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    cursor: pointer;
}

#email-status {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--sage);
}

/* ─── PROGRESS DOTS ───────────────────────────────────────────── */

.progress-dots {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(106, 143, 92, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background: var(--sage);
    transform: scale(1.4);
}

/* ─── PRINT STYLES ────────────────────────────────────────────── */

@media print {
    /* 1. Hide all interactive and UI elements */
    button,
    #gaido-orb,
    #gaido-nudge,
    #gaido-koan,
    #gaido-panel,
    .pillar-nav,
    .dot,
    .dot-container,
    .progress-dots,
    .circles-nav,
    .no-print,
    #email-section,
    #save-link-container,
    #global-back,
    .diagram-actions,
    .screen-header,
    .gaido-closing {
        display: none !important;
    }

    /* 2. Force browser to print background colours and blend modes */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 3. Page size and margins */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }

    /* 4. Reset body, hide all screens except diagram */
    body {
        background-color: #F8F5F0 !important;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .screen {
        display: none !important;
    }

    #screen-diagram {
        display: block !important;
        min-height: auto;
        padding: 0;
    }

    .screen-inner,
    .screen-inner-wide {
        padding: 0;
        max-width: 100%;
    }

    /* 5. Scale SVG to fit A4 perfectly */
    #ikigai-diagram {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    #ikigai-diagram svg {
        width: 100%;
        max-width: 18cm;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    /* Hide loading state if printing early */
    .diagram-loading {
        display: none !important;
    }

    /* Statement sits below diagram */
    .statement-container {
        max-width: 18cm;
        margin: 1rem auto 0;
    }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */

@media (max-width: 760px) {
    .welcome-hero-content {
        padding-top: 30px;
        padding-bottom: 60px;
    }

    .welcome-hero-content h1 {
        font-size: 2.6rem;
    }

    .circles-nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .gaido-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 90px;
        top: auto;
    }

    .progress-dots { display: none; }

    .diagram-actions { flex-direction: column; align-items: center; }
}
