/* ============================================================
   NOTEROOM LANDING 33 — Warm Paper Scroll-Timeline
   Refined landing2 timeline + landing21/27 warm paper aesthetic
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }

/* CSS variables for auth-widget + dropdown theming (matches paper aesthetic) */
:root {
    --bg-color: #faf8f2;
    --surface-color: #faf8f2;
    --surface-1: rgba(196,184,154,0.1);
    --text-primary: #433422;
    --text-secondary: #8b7964;
    --text-tertiary: #b0a488;
    --on-accent-color: #faf8f2;
    --accent-color: #5a4632;
    --accent-subtle: rgba(90,70,50,0.08);
    --grid-color: #c4b89a;
    --shadow-lg: 0 10px 40px rgba(67,52,34,0.15);
    --note-bg: #fff;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #18181b;
    background: #faf8f2;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(232,228,220,0.3) 39px, rgba(232,228,220,0.3) 40px);
    background-size: 100% 40px;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    scrollbar-width: none;
}
html {
    scrollbar-width: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0 !important; display: none !important; }

/* Paper grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-radial-gradient(circle at 50% 50%, transparent 0, rgba(180,170,150,0.03) 1px, transparent 2px);
    background-size: 4px 4px;
    pointer-events: none;
    z-index: 0;
}

/* Red margin line on desktop */
@media (min-width: 768px) {
    body::before {
        content: '';
        position: fixed;
        top: 0; bottom: 0; left: 80px;
        width: 1px;
        background: rgba(220,80,80,0.12);
        z-index: 0;
        pointer-events: none;
    }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- TYPOGRAPHY --- */
.caveat {
    font-family: 'Caveat', cursive;
}

/* --- BUTTONS: Hand-Drawn Paper Style --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 12px;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid #c4b89a;
    background: rgba(255,255,255,0.65);
    color: #5a4632;
    position: relative;
    transform: rotate(-0.4deg);
    box-shadow: 2px 3px 0 rgba(196,184,154,0.25);
}
.btn:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 3px 4px 0 rgba(196,184,154,0.35);
    transform: rotate(0deg) translateY(-2px);
}
.btn.btn-paper-accent {
    background: #5a4632;
    color: #faf8f2;
    border-color: #5a4632;
    transform: rotate(0.3deg);
    box-shadow: 2px 3px 0 rgba(90,70,50,0.3);
}
.btn.btn-paper-accent:hover {
    background: #433422;
    border-color: #433422;
    box-shadow: 3px 4px 0 rgba(90,70,50,0.4);
    transform: rotate(0deg) translateY(-2px);
}

/* ================================================================
   NAVIGATION
   ================================================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(250,248,242,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(196,184,154,0.2);
    transition: box-shadow 0.3s;
}
.nav.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}
.nav-logo img { width: 28px; height: 28px; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 0.88rem;
    font-weight: 500;
}
.nav-links a {
    color: #666;
    transition: color 0.2s;
}
.nav-links a:hover { color: #18181b; }
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav .btn, .nav-actions .btn {
    padding: 6px 18px;
    font-size: 1rem;
    transform: rotate(0deg);
    box-shadow: 1px 2px 0 rgba(196,184,154,0.2);
}
/* Auth widget sign-in button override to match paper theme */
.nav-actions .aw-signin-btn {
    font-family: 'Caveat', cursive !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    background: rgba(255,255,255,0.65) !important;
    color: #5a4632 !important;
    border: 2px solid #c4b89a !important;
    border-radius: 12px !important;
    padding: 5px 16px !important;
    box-shadow: 1px 2px 0 rgba(196,184,154,0.2) !important;
    cursor: pointer;
    transition: all 0.2s ease;
}
.nav-actions .aw-signin-btn:hover {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 2px 3px 0 rgba(196,184,154,0.3) !important;
}

/* ====== AUTH MODAL — Paper Theme Overrides ====== */
.aw-modal-overlay {
    background: rgba(67,52,34,0.4) !important;
}
.aw-modal-card {
    background: #faf8f2 !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 16px !important;
    box-shadow: 4px 6px 0 rgba(196,184,154,0.25), 0 20px 60px rgba(67,52,34,0.15) !important;
}
.aw-modal-close {
    background: rgba(255,255,255,0.6) !important;
    border-color: #c4b89a !important;
    color: #8b7964 !important;
}
.aw-modal-close:hover {
    background: #fff !important;
    border-color: #5a4632 !important;
    color: #5a4632 !important;
}
.aw-auth-header h2 {
    font-family: 'Caveat', cursive !important;
    font-size: 1.5rem !important;
    color: #433422 !important;
}
.aw-auth-header p {
    color: #8b7964 !important;
}
.aw-auth-tabs {
    border-color: #c4b89a !important;
    border-radius: 10px !important;
}
.aw-auth-tab {
    background: rgba(196,184,154,0.1) !important;
    color: #8b7964 !important;
    font-family: 'Caveat', cursive !important;
    font-size: 1rem !important;
}
.aw-auth-tab.active {
    background: #5a4632 !important;
    color: #faf8f2 !important;
}
.aw-auth-input {
    background: rgba(255,255,255,0.7) !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 10px !important;
    color: #433422 !important;
}
.aw-auth-input:focus {
    border-color: #5a4632 !important;
    box-shadow: 0 0 0 2px rgba(90,70,50,0.1) !important;
}
.aw-auth-input::placeholder {
    color: #b0a488 !important;
}
.aw-auth-submit {
    background: #5a4632 !important;
    color: #faf8f2 !important;
    border-radius: 12px !important;
    font-family: 'Caveat', cursive !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    box-shadow: 2px 3px 0 rgba(90,70,50,0.2) !important;
}
.aw-auth-submit:hover {
    background: #433422 !important;
}
.aw-auth-google {
    background: rgba(255,255,255,0.7) !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 12px !important;
    color: #433422 !important;
}
.aw-auth-google:hover {
    border-color: #5a4632 !important;
    background: rgba(255,255,255,0.9) !important;
}
.aw-auth-divider {
    color: #b0a488 !important;
}
.aw-auth-divider::before, .aw-auth-divider::after {
    background: #c4b89a !important;
}
.aw-auth-legal {
    color: #b0a488 !important;
}
.aw-auth-legal a {
    color: #5a4632 !important;
}
/* Dropdown menu paper styling */
.aw-dropdown {
    background: #faf8f2 !important;
    border: 1.5px solid #c4b89a !important;
    border-radius: 12px !important;
    box-shadow: 3px 4px 0 rgba(196,184,154,0.2), 0 10px 30px rgba(67,52,34,0.1) !important;
}
.aw-dropdown-email {
    color: #8b7964 !important;
    border-color: rgba(196,184,154,0.3) !important;
}
.aw-dropdown-item {
    color: #433422 !important;
    border-radius: 8px !important;
}
.aw-dropdown-item:hover {
    background: rgba(196,184,154,0.12) !important;
}
.aw-avatar-btn {
    background: #5a4632 !important;
    color: #faf8f2 !important;
}

@media (max-width: 840px) {
    .nav-links { display: none; }
}
@media (max-width: 520px) {
    .nav-actions .nav-cta { display: none; }
}

/* ================================================================
   HERO
   ================================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
.hero-content {
    max-width: 800px;
}
.hero-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(3.8rem, 9.5vw, 6rem);
    font-weight: 700;
    color: #333;
    line-height: 1.05;
    margin-bottom: 20px;
}
.hero-subtitle {
    font-size: 1.15rem;
    color: #666;
    max-width: 480px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero doodles */
.hero-doodle {
    position: absolute;
    opacity: 0.4;
    z-index: 0;
}
.hero-doodle-star {
    top: 18%;
    left: 12%;
    animation: doodle-float 4s ease-in-out infinite alternate;
}
.hero-doodle-arrow {
    top: 25%;
    right: 10%;
    animation: doodle-float 5s ease-in-out infinite alternate-reverse;
}
.hero-doodle-squiggle {
    bottom: 18%;
    left: 20%;
    animation: doodle-float 3.5s ease-in-out infinite alternate;
}
@keyframes doodle-float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-6px) rotate(2deg); }
}

/* ====== HERO 3D STAMP ENTRANCE (Three.js) ====== */

/* Three.js canvas overlay */
.hero-stamp-entrance {
    position: relative;
}

.hero-three-canvas {
    position: absolute;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

/* All hero content starts invisible */
.hero-stamp-entrance .hero-el {
    opacity: 0;
    transform: scale(0.88) translateY(6px);
    filter: blur(4px);
}

/* Stamped-in appearance: fast, punchy, slight overshoot */
.hero-stamp-entrance .hero-el.stamped {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    transition: opacity 0.12s ease-out, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease-out;
}

/* Paper shake on impact */
@keyframes paperShake {
    0%   { transform: translate(0, 0) rotate(0); }
    12%  { transform: translate(-4px, 3px) rotate(-0.3deg); }
    25%  { transform: translate(5px, -3px) rotate(0.4deg); }
    37%  { transform: translate(-3px, 4px) rotate(-0.2deg); }
    50%  { transform: translate(3px, -2px) rotate(0.2deg); }
    62%  { transform: translate(-2px, 1px) rotate(-0.1deg); }
    75%  { transform: translate(1px, -1px) rotate(0.05deg); }
    100% { transform: translate(0, 0) rotate(0); }
}

.hero-stamp-entrance.shaking .hero-content {
    animation: paperShake 0.4s ease-out;
}

/* Impact flash overlay */
.stamp-impact-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 48;
    background: radial-gradient(ellipse at 50% 42%, rgba(255,250,235,0.9) 0%, transparent 60%);
    opacity: 0;
}

@keyframes impactFlash {
    0%   { opacity: 0; transform: scale(0.6); }
    25%  { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.8); }
}

.stamp-impact-flash.active {
    animation: impactFlash 0.35s ease-out forwards;
}

/* Ink ring expanding outward from impact point */
.stamp-ink-ring {
    position: absolute;
    border-radius: 50%;
    border: 2.5px solid rgba(67, 52, 34, 0.25);
    pointer-events: none;
    z-index: 45;
    animation: inkRingExpand 0.9s ease-out forwards;
}

@keyframes inkRingExpand {
    0%   { width: 10px; height: 10px; opacity: 0.7; margin: -5px 0 0 -5px; }
    100% { width: 500px; height: 500px; opacity: 0; margin: -250px 0 0 -250px; }
}

/* Ink specks flying outward */
.ink-speck {
    position: absolute;
    border-radius: 50%;
    background: #433422;
    pointer-events: none;
    z-index: 46;
    animation: speckFly 0.65s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes speckFly {
    0%   { transform: translate(0, 0) scale(1); opacity: 0.75; }
    100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* Doodles fade in after stamp */
.hero-stamp-entrance .hero-doodle {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.hero-stamp-entrance .hero-doodle.visible {
    opacity: 0.4;
}

/* Animations always run — no reduced motion skip */
/* @media (prefers-reduced-motion: reduce) {
    .hero-stamp-entrance .hero-el { opacity: 1; transform: none; filter: none; }
    .hero-stamp-entrance .hero-doodle { opacity: 0.4; }
    .hero-three-canvas { display: none; }
} */

@media (max-width: 640px) {
    .hero-doodle, .hero-draw { display: none !important; }
}

/* ================================================================
   SCROLL TIMELINE
   ================================================================ */
.timeline-section {
    position: relative;
    z-index: 2;
}
.timeline-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.timeline-spacer {
    height: 600vh;
}

/* ================================================================
   SCENE (App simulation area)
   ================================================================ */
.scene {
    position: relative;
    width: min(90vw, 900px);
    height: min(70vh, 560px);
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Grid background */
.scene-grid {
    position: absolute;
    inset: 0;
    background-color: #f4f4f5;
    background-image:
        linear-gradient(#d6d9df 1px, transparent 1px),
        linear-gradient(90deg, #d6d9df 1px, transparent 1px);
    background-size: 40px 40px;
    border-radius: 12px;
    opacity: 0;
    z-index: 0;
    transition: opacity 0.3s;
}

/* Dock */
.scene-dock {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(24,24,27,0.12);
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    z-index: 15;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s;
}
.dock-tool {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s;
}
.dock-tool img { width: 20px; height: 20px; opacity: 0.7; }
.dock-tool.active {
    background: rgba(99,102,241,0.12);
}
.dock-tool.active img { opacity: 1; }

/* Cursor */
.scene-cursor {
    position: absolute;
    z-index: 18;
    opacity: 0;
    transition: left 0.3s ease-out, top 0.3s ease-out, opacity 0.2s;
    pointer-events: none;
}

/* Note card */
.scene-note {
    position: absolute;
    top: 8%;
    left: 5%;
    width: 240px;
    background: #fff;
    border: 1px solid #d6d9df;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    font-size: 13px;
    opacity: 0;
    z-index: 2;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
    pointer-events: none;
}
/* Full-border matching app's ::after pseudo-element approach */
.has-border {
    position: relative;
}
.has-border::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    border: 2.5px solid var(--note-border-color, #6366f1);
    border-radius: calc(8px + 3px);
    pointer-events: none;
    z-index: 0;
}
.scene-note.has-border::after { --note-border-color: attr(data-border-color); }
/* Set border colors explicitly since attr() support is limited */
.scene-note.has-border::after { --note-border-color: #6366f1; }
.scene-checklist.has-border::after { --note-border-color: #22c55e; }
.scene-note-header {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    background: rgba(0,0,0,0.04);
    font-weight: 600;
    font-size: 0.82rem;
    color: #18181b;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.scene-note-body {
    padding: 10px 12px;
    font-size: 12.5px;
    color: #444;
    line-height: 1.55;
    white-space: pre-wrap;
    min-height: 40px;
}

/* Checklist card */
.scene-checklist {
    position: absolute;
    top: 8%;
    left: 55%;
    width: 220px;
    background: #fff;
    border: 1px solid #d6d9df;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    font-size: 13px;
    opacity: 0;
    z-index: 2;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
    pointer-events: none;
}
.scene-checklist-body {
    padding: 8px 12px;
}
.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #444;
}
.check-item .cb {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(24,24,27,0.28);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.check-item.checked .cb {
    background: #6366f1;
    border-color: #6366f1;
}
.check-item.checked .cb::after {
    content: '';
    width: 6px;
    height: 3px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    margin-top: -1px;
}
.check-item.checked span:last-child {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Stickies — all 5 colors */
.scene-sticky {
    position: absolute;
    padding: 12px 14px;
    border-radius: 2px 2px 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    z-index: 3;
    transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
    pointer-events: none;
}
.scene-sticky-yellow { background:#fff9c4; border-top:3px solid #f9e547; color:#5d4e00; top:65%; left:5%; transform:rotate(-2deg); }
.scene-sticky-green  { background:#e8f5e9; border-top:3px solid #66bb6a; color:#1b5e20; top:15%; left:75%; transform:rotate(1deg); border-radius:12px; }
.scene-sticky-blue   { background:#e3f2fd; border-top:3px solid #42a5f5; color:#0d47a1; top:70%; left:40%; transform:rotate(-1deg); border-radius:50%; aspect-ratio:1; width:90px; height:90px; display:flex; align-items:center; justify-content:center; text-align:center; font-size:11px; padding:8px; }
.scene-sticky-purple { background:#f3e5f5; border-top:3px solid #ab47bc; color:#4a148c; top:60%; left:70%; transform:rotate(2deg); width:120px; }
.scene-sticky-red    { background:#ffebee; border-top:3px solid #ef5350; color:#b71c1c; top:15%; left:35%; transform:rotate(-3deg); border-radius:12px; }

/* Moodboard */
.scene-moodboard {
    position: absolute;
    left: 5%; top: 5%;
    width: 90%; height: 80%;
    opacity: 0;
    z-index: 4;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.mood-label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}
.mood-rect {
    position: absolute;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.3s;
}
.mood-rect:hover { transform: scale(1.06); z-index: 2; }
.mood-tag {
    position: absolute;
    bottom: 3px; left: 5px;
    font-size: 9px;
    font-weight: 600;
    color: rgba(0,0,0,0.45);
    background: rgba(255,255,255,0.7);
    padding: 1px 5px;
    border-radius: 3px;
}

/* PDF document on canvas */
.scene-pdf {
    position: absolute;
    top: 55%;
    left: 20%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #d6d9df;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    font-size: 12px;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.2s;
    pointer-events: none;
    transform: translateY(10px);
}
.pdf-icon { flex-shrink: 0; }
.pdf-name { font-weight: 600; color: #333; font-size: 12px; white-space: nowrap; }
.pdf-meta { font-size: 10px; color: #999; margin-top: 1px; }

/* Code block — matches app note card style */
.scene-code {
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 420px;
    background: #fff;
    border: 1px solid #d6d9df;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 20px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    opacity: 0;
    z-index: 4;
    overflow: hidden;
    transition: transform 0.3s, opacity 0.2s;
    pointer-events: none;
}
.scene-code .scene-note-header {
    font-family: 'Inter', system-ui, sans-serif;
}
.scene-code-body {
    display: flex;
    padding: 8px 0;
    overflow: hidden;
    background: #fafafa;
}
.code-lines {
    width: 40px;
    text-align: right;
    padding-right: 8px;
    color: #a1a1aa;
    user-select: none;
    font-size: 13px;
    line-height: 20px;
    border-right: 1px solid #d6d9df;
}
.code-content {
    flex: 1;
    margin: 0;
    padding: 0 12px;
    color: #27272a;
    font-size: 13px;
    line-height: 20px;
    font-family: inherit;
    overflow: hidden;
}

/* Syntax highlighting — light mode */
.syn-kw { color: #7c3aed; }
.syn-fn { color: #2563eb; }
.syn-def { color: #2563eb; }
.syn-par { color: #27272a; }
.syn-self { color: #db2777; }
.syn-dot { color: #27272a; }
.syn-op { color: #27272a; }
.syn-str { color: #059669; }
.syn-cursor { animation: blink 1.06s step-end infinite; }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* Dark theme code block overrides */
.scene.theme-dark .scene-code,
.scene.theme-midnight .scene-code,
.scene.theme-amoled .scene-code,
.scene.theme-neon .scene-code,
.scene.theme-contrast .scene-code {
    background: #1e1e1e; border-color: #333;
}
.scene.theme-dark .scene-code .scene-code-body,
.scene.theme-midnight .scene-code .scene-code-body,
.scene.theme-amoled .scene-code .scene-code-body,
.scene.theme-neon .scene-code .scene-code-body,
.scene.theme-contrast .scene-code .scene-code-body {
    background: #1e1e2e;
}
.scene.theme-dark .scene-code .code-lines,
.scene.theme-midnight .scene-code .code-lines,
.scene.theme-amoled .scene-code .code-lines,
.scene.theme-neon .scene-code .code-lines,
.scene.theme-contrast .scene-code .code-lines {
    color: #555; border-right-color: #333;
}
.scene.theme-dark .scene-code .code-content,
.scene.theme-midnight .scene-code .code-content,
.scene.theme-amoled .scene-code .code-content,
.scene.theme-neon .scene-code .code-content,
.scene.theme-contrast .scene-code .code-content {
    color: #d4d4d4;
}
.scene.theme-dark .scene-code .syn-par,
.scene.theme-dark .scene-code .syn-dot,
.scene.theme-dark .scene-code .syn-op,
.scene.theme-midnight .scene-code .syn-par,
.scene.theme-midnight .scene-code .syn-dot,
.scene.theme-midnight .scene-code .syn-op,
.scene.theme-amoled .scene-code .syn-par,
.scene.theme-amoled .scene-code .syn-dot,
.scene.theme-amoled .scene-code .syn-op,
.scene.theme-neon .scene-code .syn-par,
.scene.theme-neon .scene-code .syn-dot,
.scene.theme-neon .scene-code .syn-op,
.scene.theme-contrast .scene-code .syn-par,
.scene.theme-contrast .scene-code .syn-dot,
.scene.theme-contrast .scene-code .syn-op {
    color: #d4d4d4;
}

/* Drawing layer */
.scene-drawing {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.1s;
}
.draw-label {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Color palette */
.scene-palette {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 24px;
    padding: 8px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    opacity: 0;
    z-index: 8;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.pal-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}
.pal-dot.active { border-color: #18181b; }

/* Voice memo */
.scene-voice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #6366f1;
    border-radius: 999px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
    opacity: 0;
    z-index: 5;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.voice-rec {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
}
.voice-rec.active {
    animation: rec-pulse 1s ease-in-out infinite;
}
@keyframes rec-pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.voice-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
}
.voice-bars span {
    width: 3px;
    height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 2px;
    transition: height 0.1s;
}
.voice-time {
    font-size: 12px;
    opacity: 0.8;
    min-width: 30px;
}

/* Ghost cursor */
.ghost-cursor {
    position: absolute;
    z-index: 10;
    opacity: 0;
    transition: left 0.3s ease-out, top 0.3s ease-out, opacity 0.2s;
    pointer-events: none;
}
.ghost-label {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 2px;
    white-space: nowrap;
}

/* Notification */
.scene-notif {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    opacity: 0;
    z-index: 12;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.notif-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* Collab sticky (blue) */
.scene-collab-sticky {
    position: absolute;
    top: 42%;
    left: 60%;
    padding: 12px 14px;
    background: #80d8ff;
    color: #003d5c;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-size: 13px;
    font-weight: 500;
    transform: rotate(1deg);
    opacity: 0;
    z-index: 6;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

/* Theme label */
.scene-theme-label {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    font-weight: 700;
    color: #18181b;
    opacity: 0;
    z-index: 12;
    transition: color 0.2s, opacity 0.15s;
    pointer-events: none;
}

/* Theme variations for scene — background on .scene itself so dark themes don't bleed paper */
.scene.theme-light { background: #f4f4f5; }
.scene.theme-light .scene-grid { background-color: #f4f4f5; }

.scene.theme-dark { background: #121212; }
.scene.theme-dark .scene-grid {
    background-color: #121212;
    background-image:
        linear-gradient(#2c2c2c 1px, transparent 1px),
        linear-gradient(90deg, #2c2c2c 1px, transparent 1px);
}
.scene.theme-dark .scene-theme-label { color: #e0e0e0; }
.scene.theme-dark .scene-note,
.scene.theme-dark .scene-checklist { background: #1e1e1e; border-color: #333; }
.scene.theme-dark .has-border::after { border-color: #4da6ff; }
.scene.theme-dark .scene-note-header { color: #e0e0e0; background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); }
.scene.theme-dark .scene-note-body,
.scene.theme-dark .check-item { color: #bbb; }
.scene.theme-dark .scene-sticky { background: #5d4e00; color: #fff176; }
.scene.theme-dark .scene-dock { background: rgba(30,30,30,0.92); border-color: rgba(255,255,255,0.1); }
.scene.theme-dark .dock-tool img { filter: invert(0.85); }

.scene.theme-midnight { background: #0f172a; }
.scene.theme-midnight .scene-grid {
    background-color: #0f172a;
    background-image:
        linear-gradient(#1e293b 1px, transparent 1px),
        linear-gradient(90deg, #1e293b 1px, transparent 1px);
}
.scene.theme-midnight .scene-theme-label { color: #818cf8; }
.scene.theme-midnight .scene-note,
.scene.theme-midnight .scene-checklist { background: #1e293b; border-color: #334155; }
.scene.theme-midnight .has-border::after { border-color: #38bdf8; }
.scene.theme-midnight .scene-note-header { color: #c7d2fe; background: rgba(99,102,241,0.1); border-color: #334155; }
.scene.theme-midnight .scene-note-body,
.scene.theme-midnight .check-item { color: #94a3b8; }
.scene.theme-midnight .scene-dock { background: rgba(15,23,42,0.95); border-color: #334155; }
.scene.theme-midnight .dock-tool img { filter: invert(0.75); }

.scene.theme-sepia { background: #f4ecd8; }
.scene.theme-sepia .scene-grid {
    background-color: #f4ecd8;
    background-image:
        linear-gradient(#d6c9b1 1px, transparent 1px),
        linear-gradient(90deg, #d6c9b1 1px, transparent 1px);
}
.scene.theme-sepia .scene-theme-label { color: #433422; }
.scene.theme-sepia .scene-note,
.scene.theme-sepia .scene-checklist { background: #fdf6e3; border-color: #d6c9b1; }
.scene.theme-sepia .has-border::after { border-color: #d37a42; }
.scene.theme-sepia .scene-note-header { color: #433422; background: rgba(67,52,34,0.06); border-color: #d6c9b1; }
.scene.theme-sepia .scene-note-body,
.scene.theme-sepia .check-item { color: #8b7964; }
.scene.theme-sepia .scene-dock { background: rgba(244,236,216,0.92); border-color: #d6c9b1; }

.scene.theme-mint { background: #DEF4C6; }
.scene.theme-mint .scene-grid {
    background-color: #DEF4C6;
    background-image:
        linear-gradient(#B8D8A0 1px, transparent 1px),
        linear-gradient(90deg, #B8D8A0 1px, transparent 1px);
}
.scene.theme-mint .scene-theme-label { color: #1B512D; }
.scene.theme-mint .scene-note,
.scene.theme-mint .scene-checklist { background: #EEFADE; border-color: #B8D8A0; }
.scene.theme-mint .has-border::after { border-color: #1C7C54; }
.scene.theme-mint .scene-note-header { color: #1B512D; background: rgba(27,81,45,0.06); border-color: #B8D8A0; }
.scene.theme-mint .scene-note-body,
.scene.theme-mint .check-item { color: #4A7B5C; }
.scene.theme-mint .scene-dock { background: rgba(222,244,198,0.92); border-color: #B8D8A0; }

.scene.theme-neon { background: #0b0014; }
.scene.theme-neon .scene-grid {
    background-color: #0b0014;
    background-image:
        linear-gradient(#3e2669 1px, transparent 1px),
        linear-gradient(90deg, #3e2669 1px, transparent 1px);
}
.scene.theme-neon .scene-theme-label { color: #00ffde; }
.scene.theme-neon .scene-note,
.scene.theme-neon .scene-checklist { background: #1a0b2e; border-color: #3e2669; }
.scene.theme-neon .has-border::after { border-color: #ff00ff; }
.scene.theme-neon .scene-note-header { color: #00ffde; background: rgba(255,0,255,0.1); border-color: #3e2669; }
.scene.theme-neon .scene-note-body,
.scene.theme-neon .check-item { color: #b16bea; }
.scene.theme-neon .scene-dock { background: rgba(11,0,20,0.95); border-color: #3e2669; }
.scene.theme-neon .dock-tool img { filter: invert(0.8) hue-rotate(260deg); }

.scene.theme-blush { background: #EEABC4; }
.scene.theme-blush .scene-grid {
    background-color: #EEABC4;
    background-image:
        linear-gradient(#D9A0B8 1px, transparent 1px),
        linear-gradient(90deg, #D9A0B8 1px, transparent 1px);
}
.scene.theme-blush .scene-theme-label { color: #861388; }
.scene.theme-blush .scene-note,
.scene.theme-blush .scene-checklist { background: #F8D0E2; border-color: #D9A0B8; }
.scene.theme-blush .has-border::after { border-color: #E15A97; }
.scene.theme-blush .scene-note-header { color: #861388; background: rgba(134,19,136,0.06); border-color: #D9A0B8; }
.scene.theme-blush .scene-note-body,
.scene.theme-blush .check-item { color: #A64A8C; }
.scene.theme-blush .scene-dock { background: rgba(248,208,226,0.92); border-color: #D9A0B8; }

.scene.theme-amoled { background: #000000; }
.scene.theme-amoled .scene-grid {
    background-color: #000;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
}
.scene.theme-amoled .scene-theme-label { color: #fff; }
.scene.theme-amoled .scene-note,
.scene.theme-amoled .scene-checklist { background: #0a0a0a; border-color: #202020; }
.scene.theme-amoled .has-border::after { border-color: #ffffff; }
.scene.theme-amoled .scene-note-header { color: #fff; background: rgba(255,255,255,0.04); border-color: #202020; }
.scene.theme-amoled .scene-note-body,
.scene.theme-amoled .check-item { color: #888; }
.scene.theme-amoled .scene-dock { background: rgba(0,0,0,0.92); border-color: #202020; }
.scene.theme-amoled .dock-tool img { filter: invert(1); }

.scene.theme-contrast { background: #000000; }
.scene.theme-contrast .scene-grid {
    background-color: #000;
    background-image:
        linear-gradient(rgba(0,255,255,0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,255,0.12) 1px, transparent 1px);
}
.scene.theme-contrast .scene-theme-label { color: #00ffff; }
.scene.theme-contrast .scene-note,
.scene.theme-contrast .scene-checklist { background: #000; border-color: #00ffff44; }
.scene.theme-contrast .has-border::after { border-color: #00ffff; }
.scene.theme-contrast .scene-note-header { color: #fff; background: rgba(0,255,255,0.08); border-color: #00ffff44; }
.scene.theme-contrast .scene-note-body,
.scene.theme-contrast .check-item { color: #ffff00; }
.scene.theme-contrast .scene-dock { background: rgba(0,0,0,0.95); border-color: #00ffff44; }
.scene.theme-contrast .dock-tool img { filter: invert(1); }

/* Grid style variants */
.scene.grid-dots .scene-grid {
    background-image: radial-gradient(circle, rgba(0,0,0,0.12) 1px, transparent 1px);
    background-size: 24px 24px;
}
.scene.grid-none .scene-grid { opacity: 0 !important; }

/* Final overlay */
.scene-final {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    /* warm paper overlay */
    background: rgba(250,248,242,0.92);
    backdrop-filter: blur(4px);
}
.scene-final.visible {
    opacity: 1;
    pointer-events: auto;
}
.final-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.final-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 24px;
}
.final-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ================================================================
   SIDE PANELS
   ================================================================ */
.side-panel {
    position: absolute;
    right: calc(50% + min(45vw, 450px) + 20px);
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    width: 200px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 25;
}
.side-panel.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.panel-chapter {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    font-weight: 700;
    color: #c4b89a;
    line-height: 1;
    display: block;
    margin-bottom: 6px;
}
.side-panel p {
    font-size: 0.88rem;
    color: #888;
    line-height: 1.55;
    font-style: italic;
}

/* Move panels to left on smaller screens, or below */
@media (max-width: 1200px) {
    .side-panel {
        right: auto;
        left: 20px;
        top: auto;
        bottom: 80px;
        transform: translateX(-10px);
        width: 240px;
    }
    .side-panel.visible {
        transform: translateX(0);
    }
}
@media (max-width: 640px) {
    .side-panel {
        left: 16px;
        right: 16px;
        bottom: 70px;
        width: auto;
        max-width: 300px;
    }
}

/* ================================================================
   CHAPTER DOODLES (between chapters, in margins)
   ================================================================ */
.chapter-doodles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
.doodle {
    position: absolute;
    opacity: 0;
    transition: opacity 0.4s;
}
.doodle-star {
    top: 8%;
    right: 8%;
}
.doodle-arrow-r {
    bottom: 30%;
    left: 5%;
}
.doodle-squig {
    top: 60%;
    right: 5%;
}

/* ================================================================
   PROGRESS BAR (hand-drawn wavy)
   ================================================================ */
.progress-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(80vw, 500px);
    height: 30px;
    z-index: 30;
}
.progress-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 8px;
    transform: translateY(-50%);
}
.progress-fill-wrap {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0%;
    height: 8px;
    transform: translateY(-50%);
    overflow: hidden;
    transition: width 0.15s;
}
.progress-fill-svg {
    width: 100%;
    height: 8px;
    /* width set dynamically via the wrap */
}
.progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.progress-dot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e8e4dc;
    border: 2px solid #c4b89a;
    transition: all 0.3s;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}
.progress-dot::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Caveat', cursive;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.progress-dot:hover::after {
    opacity: 1;
}
.progress-dot.passed {
    background: #6366f1;
    border-color: #6366f1;
}

@media (max-width: 640px) {
    .progress-bar { width: 90vw; bottom: 12px; }
    .progress-dot::after { display: none; }
}

/* ================================================================
   BUILT FOR EVERYONE — Paper sticky-note style
   ================================================================ */
.everyone {
    position: relative;
    z-index: 2;
    padding: 100px 24px;
}
.everyone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}
@media (max-width: 900px) { .everyone-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .everyone-grid { grid-template-columns: 1fr; max-width: 380px; } }

.everyone-card {
    background: rgba(255,255,255,0.55);
    border: 1.5px solid #c4b89a;
    border-radius: 4px 4px 10px 10px;
    padding: 28px 22px 22px;
    box-shadow: 2px 3px 0 rgba(196,184,154,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.everyone-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #c4b89a;
    border-radius: 4px 4px 0 0;
}
.everyone-card:hover {
    box-shadow: 4px 5px 0 rgba(196,184,154,0.3);
}
.card-sketch {
    margin-bottom: 10px;
    opacity: 0.7;
}
.everyone-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #433422;
    margin-bottom: 6px;
}
.everyone-card p {
    font-size: 0.85rem;
    color: #8b7964;
    line-height: 1.55;
    font-style: italic;
}
/* Mini PDF preview inside Students card */
.card-pdf-preview {
    margin-top: 12px;
}
.card-pdf-doc {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.6);
    border: 1.5px dashed #c4b89a;
    border-radius: 8px;
    padding: 6px 12px 6px 8px;
}
.card-pdf-label {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.72rem;
    font-style: normal;
    color: #8b7964;
    font-weight: 500;
}

/* ================================================================
   PRICING
   ================================================================ */
.pricing {
    position: relative;
    z-index: 2;
    padding: 100px 24px;
}
.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.section-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.section-subtitle {
    font-size: 1rem;
    color: #777;
    max-width: 520px;
    margin: 0 auto 48px;
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .pricing-grid { grid-template-columns: 1fr; max-width: 340px; }
}

/* Paper-style pricing cards */
.price-card {
    background: rgba(255,255,255,0.55);
    border: 1.5px solid #c4b89a;
    border-radius: 4px 4px 10px 10px;
    padding: 28px 22px;
    text-align: left;
    box-shadow: 2px 3px 0 rgba(196,184,154,0.2);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: visible;
}
.price-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #c4b89a;
    border-radius: 4px 4px 0 0;
}
.price-card:hover {
    box-shadow: 4px 5px 0 rgba(196,184,154,0.3);
}
.price-card.featured {
    border-color: #5a4632;
    box-shadow: 3px 4px 0 rgba(90,70,50,0.25);
}
.price-card.featured::before {
    background: #5a4632;
}
.price-doodle {
    position: absolute;
    opacity: 0.35;
}
.price-doodle-1 { top: -12px; right: -8px; }
.price-doodle-2 { top: -18px; right: -10px; }
.price-doodle-3 { top: -10px; right: -6px; }
.price-doodle-4 { top: -6px; right: 8px; }
.price-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    background: #5a4632;
    color: #faf8f2;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 14px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 1px 2px 0 rgba(90,70,50,0.2);
}
.price-tier {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-weight: 700;
    color: #433422;
    margin-bottom: 4px;
}
.price-amount {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: #333;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
}
.price-currency {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 2px;
    align-self: flex-start;
    margin-top: 0.35rem;
}
.price-main {
    font-size: 2.4rem;
    line-height: 1;
}
.price-decimal {
    font-size: 1rem;
    font-weight: 700;
    align-self: flex-start;
    margin-top: 0.35rem;
}
.price-period {
    font-size: 0.82rem;
    color: #8b7964;
    margin-bottom: 16px;
    font-style: italic;
}
.price-features {
    list-style: none;
    margin-bottom: 20px;
}
.price-features li {
    font-size: 0.82rem;
    color: #5a4632;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}
.price-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 4px;
    border-left: 2px solid #8b7964;
    border-bottom: 2px solid #8b7964;
    transform: rotate(-45deg);
}
.price-card .btn {
    width: 100%;
    font-size: 1rem;
    padding: 10px 16px;
}

/* ================================================================
   DOWNLOAD
   ================================================================ */
.download {
    position: relative;
    z-index: 2;
    padding: 80px 24px;
    text-align: center;
}
.download-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.download-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: rgba(255,255,255,0.55);
    border: 1.5px solid #c4b89a;
    border-radius: 10px;
    box-shadow: 2px 3px 0 rgba(196,184,154,0.2);
    text-decoration: none;
    color: #433422;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
}
.download-card.primary {
    border-color: #5a4632;
}
.download-card.primary:hover {
    box-shadow: 3px 4px 0 rgba(90,70,50,0.25);
}
.download-card.disabled {
    opacity: 0.5;
    cursor: default;
}
.download-info {
    text-align: left;
}
.download-info strong {
    display: block;
    font-size: 0.95rem;
}
.download-info span {
    font-size: 0.78rem;
    color: #888;
}
.download-badge {
    margin-left: auto;
    background: #5a4632;
    color: #faf8f2;
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    box-shadow: 1px 2px 0 rgba(90,70,50,0.2);
}
.download-note {
    font-size: 0.88rem;
    color: #888;
    margin-bottom: 12px;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    position: relative;
    z-index: 2;
    padding: 40px 24px 32px;
}
.footer-wave {
    display: block;
    width: 100%;
    height: 30px;
    margin-bottom: 24px;
}
.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: #555;
}
.footer-links {
    display: flex;
    gap: 20px;
    font-size: 0.82rem;
    color: #888;
}
.footer-links a:hover { color: #18181b; }
.footer-copy {
    font-size: 0.75rem;
    color: #aaa;
    width: 100%;
    text-align: center;
    margin-top: 12px;
}

/* Reduced motion — disabled, animations always run */

/* ================================================================
   ANIMATED BACKGROUND DOODLES — Self-drawing SVG shapes
   ================================================================ */
.bg-doodles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-doodle {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    stroke: #c4b89a;
    stroke-width: 1.5px;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.8s ease;
}

.bg-doodle.drawing {
    animation: doodleDraw 3.5s ease-out forwards;
}

.bg-doodle.fading {
    opacity: 0 !important;
    transition: opacity 0.8s ease;
}

@keyframes doodleDraw {
    0% {
        opacity: 0;
    }
    8% {
        opacity: 0.22;
    }
    75% {
        opacity: 0.22;
    }
    100% {
        opacity: 0.22;
    }
}

/* Animate the actual stroke drawing via JS-set dashoffset */
.bg-doodle.drawing path,
.bg-doodle.drawing circle,
.bg-doodle.drawing rect,
.bg-doodle.drawing polygon,
.bg-doodle.drawing polyline,
.bg-doodle.drawing line,
.bg-doodle.drawing text {
    transition: stroke-dashoffset 2.5s ease-out;
    stroke-dashoffset: 0 !important;
}

/* Background doodles always active */

/* ================================================================
   MOBILE RESPONSIVE — Comprehensive breakpoints
   ================================================================ */

/* --- TABLET (max 900px) --- */
@media (max-width: 900px) {
    .hero {
        padding: 100px 20px 60px;
    }
    .hero-title {
        font-size: clamp(2.6rem, 8vw, 4rem);
    }
    .hero-content {
        max-width: 600px;
    }
    .everyone, .pricing {
        padding: 70px 20px;
    }
    .download {
        padding: 60px 20px;
    }
    /* Scene scales down */
    .scene {
        width: min(94vw, 800px);
        height: min(65vh, 480px);
    }
    .scene-code {
        width: 340px;
    }
    /* Side panels already handled at 1200px */
}

/* --- SMALL TABLET / LARGE PHONE (max 768px) --- */
@media (max-width: 768px) {
    .hero {
        padding: 90px 18px 50px;
        min-height: 85vh;
    }
    .hero-title {
        font-size: clamp(2.4rem, 9vw, 3.5rem);
    }
    .hero-subtitle {
        font-size: 1rem;
        max-width: 400px;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
        justify-content: center;
    }
    /* Three.js stamp — keep full size on tablet */
    /* Scene shrinks */
    .scene {
        width: 96vw;
        height: min(55vh, 420px);
    }
    .scene-code {
        width: 300px;
        font-size: 11px;
    }
    .code-lines {
        width: 30px;
        font-size: 11px;
    }
    .code-content {
        font-size: 11px;
        padding: 0 8px;
    }
    /* Scene stickies reposition for smaller viewport */
    .scene-sticky-green  { left: 60% !important; }
    .scene-sticky-purple { left: 55% !important; }
    /* Pricing/everyone grids already 2-col at 900px */
    .price-amount {
        font-size: 2rem;
    }
    /* Nav actions tighter */
    .nav-actions {
        gap: 8px;
    }
    .nav .btn, .nav-actions .btn {
        padding: 5px 14px;
        font-size: 0.9rem;
    }
    /* Download cards stack */
    .download-grid {
        flex-direction: column;
        align-items: center;
    }
    .download-card {
        width: 100%;
        max-width: 320px;
    }
    /* Footer tighter */
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
}

/* --- PHONE (max 640px) --- */
@media (max-width: 640px) {
    body {
        font-size: 15px;
    }
    /* Red margin line hidden on phone */
    body::before {
        display: none !important;
    }
    .hero {
        padding: 100px 20px 60px;
        min-height: 100vh;
        min-height: 100dvh;
    }
    .hero-title {
        font-size: clamp(2.8rem, 12vw, 4rem);
        margin-bottom: 14px;
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
        max-width: 340px;
    }
    .hero-content {
        max-width: 100%;
    }
    /* Three.js stamp — keep full size on phone */
    /* Scene for phone */
    .scene {
        width: 98vw;
        height: min(50vh, 360px);
        border-radius: 8px;
    }
    .scene-dock {
        padding: 4px 6px;
        gap: 2px;
    }
    .dock-tool {
        width: 28px;
        height: 28px;
    }
    .dock-tool img {
        width: 16px;
        height: 16px;
    }
    /* Code block fits phone */
    .scene-code {
        width: min(85vw, 280px);
        font-size: 10px;
        line-height: 16px;
    }
    .code-lines {
        width: 24px;
        font-size: 10px;
        line-height: 16px;
    }
    .code-content {
        font-size: 10px;
        line-height: 16px;
        padding: 0 6px;
    }
    /* Note cards scale down */
    .scene-note {
        width: 180px;
        font-size: 11px;
    }
    .scene-note-header {
        height: 26px;
        line-height: 26px;
        font-size: 0.75rem;
        padding: 0 8px;
    }
    .scene-note-body {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 30px;
    }
    .scene-checklist {
        width: 170px;
        font-size: 11px;
    }
    .check-item {
        font-size: 10px;
        gap: 5px;
    }
    .check-item .cb {
        width: 13px;
        height: 13px;
    }
    /* Stickies smaller and repositioned */
    .scene-sticky {
        padding: 8px 10px;
        font-size: 11px;
    }
    .scene-sticky-yellow { left: 3% !important; top: 60% !important; }
    .scene-sticky-green  { left: 55% !important; top: 12% !important; }
    .scene-sticky-blue   { width: 65px !important; height: 65px !important; font-size: 9px !important; left: 30% !important; }
    .scene-sticky-purple { width: 90px !important; left: 55% !important; top: 55% !important; }
    .scene-sticky-red    { left: 25% !important; top: 12% !important; }
    /* Moodboard tighter */
    .mood-label {
        font-size: 11px;
    }
    .mood-tag {
        font-size: 7px;
        padding: 1px 3px;
    }
    /* Voice memo smaller */
    .scene-voice {
        padding: 8px 14px;
        font-size: 11px;
    }
    .voice-bars span {
        width: 2px;
    }
    /* Ghost cursors scale */
    .ghost-label {
        font-size: 8px;
        padding: 1px 4px;
    }
    /* Notification smaller */
    .scene-notif {
        padding: 6px 10px;
        font-size: 10px;
    }
    /* Color palette smaller */
    .scene-palette {
        padding: 6px 10px;
        gap: 5px;
    }
    .pal-dot {
        width: 16px;
        height: 16px;
    }
    /* Theme label smaller */
    .scene-theme-label {
        font-size: 1.1rem;
    }
    /* Progress bar tighter */
    .progress-bar {
        width: 92vw;
        bottom: 8px;
    }
    .progress-dot {
        width: 8px;
        height: 8px;
    }
    /* Side panel mobile */
    .side-panel {
        left: 12px;
        right: 12px;
        bottom: 56px;
        width: auto;
        max-width: 260px;
    }
    .panel-chapter {
        font-size: 2rem;
    }
    .side-panel p {
        font-size: 0.8rem;
    }
    /* Section padding reduced */
    .everyone, .pricing {
        padding: 50px 16px;
    }
    .section-title {
        font-size: clamp(1.6rem, 5vw, 2.2rem);
    }
    .section-subtitle {
        font-size: 0.88rem;
        margin-bottom: 32px;
    }
    /* Everyone cards */
    .everyone-card {
        padding: 20px 16px 16px;
    }
    .everyone-card h3 {
        font-size: 1.15rem;
    }
    .everyone-card p {
        font-size: 0.8rem;
    }
    /* Pricing cards */
    .price-card {
        padding: 22px 18px;
    }
    .price-tier {
        font-size: 1.4rem;
    }
    .price-amount {
        font-size: 1.8rem;
    }
    .price-currency {
        font-size: 1rem;
    }
    .price-decimal {
        font-size: 0.9rem;
    }
    .price-features li {
        font-size: 0.78rem;
    }
    .price-card .btn {
        font-size: 0.9rem;
        padding: 8px 14px;
    }
    /* Download section */
    .download {
        padding: 50px 16px;
    }
    .download-note {
        font-size: 0.82rem;
    }
    /* Final overlay */
    .final-text {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }
    .final-subtitle {
        font-size: 0.88rem;
    }
    .final-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    .final-actions .btn {
        width: 100%;
        max-width: 240px;
    }
    /* Background doodles smaller/fewer on phone */
    .bg-doodles-container {
        opacity: 0.6;
    }
    /* Flowchart SVG — ensure it scales with viewBox */
    .scene-drawing {
        /* viewBox handles scaling automatically */
    }
}

/* --- SMALL PHONE (max 400px) --- */
@media (max-width: 400px) {
    .hero-title {
        font-size: clamp(2.4rem, 13vw, 3rem);
    }
    .hero-subtitle {
        font-size: 0.92rem;
    }
    .nav-inner {
        padding: 8px 12px;
    }
    .nav-logo span {
        font-size: 1rem;
    }
    .scene {
        height: min(45vh, 300px);
    }
    .scene-note {
        width: 150px;
    }
    .scene-checklist {
        width: 140px;
    }
    .scene-code {
        width: min(80vw, 240px);
    }
    .timeline-spacer {
        height: 400vh;
    }
    .price-amount {
        font-size: 1.6rem;
    }
    .everyone-card, .price-card {
        padding: 16px 14px 14px;
    }
}

/* --- Landscape phone orientation fix --- */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 60px 20px 30px;
    }
    .timeline-sticky {
        height: 100vh;
    }
    .scene {
        height: min(75vh, 340px);
    }
}
