/* ═══════════════════════════════════════════════════
   GOLDEN RATIO TOKEN SYSTEM  φ = 1.618
   Base unit: 1rem → scale × φ at each step
   ═══════════════════════════════════════════════════ */
:root {
    /* Palette — Da Vinci's sfumato + parchment + ink */
    --ink: #1A1510;
    --parchment: #F5EFE0;
    --sepia: #8B6914;
    --ochre: #C8952A;
    --smoke: #5A5249;
    --gold: #D4A853;
    --cream: #FAF6EC;
    --shadow: rgba(26, 21, 16, 0.12);

    /* Golden Ratio spacing (base 1rem × φ) */
    --phi: 1.618;
    --sp1: 0.382rem;
    /* 1/φ² */
    --sp2: 0.618rem;
    /* 1/φ  */
    --sp3: 1rem;
    --sp4: 1.618rem;
    --sp5: 2.618rem;
    --sp6: 4.236rem;
    --sp7: 6.854rem;

    /* Typography */
    --font-display: 'Cormorant Garamond', serif;
    --font-mono: 'DM Mono', monospace;
    --font-body: 'Inter', sans-serif;

    /* φ-scaled type */
    --t-xs: 0.618rem;
    --t-sm: 0.764rem;
    --t-base: 1rem;
    --t-md: 1.272rem;
    --t-lg: 1.618rem;
    --t-xl: 2.618rem;
    --t-2xl: 4.236rem;
    --t-3xl: 6.854rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: var(--phi);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── GOLDEN GRID BACKGROUND ────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(200, 149, 42, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 149, 42, 0.04) 1px, transparent 1px);
    background-size: 61.8px 61.8px;
    pointer-events: none;
    z-index: 0;
}

/* ── HEADER ─────────────────────────────────────────── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245, 239, 224, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(200, 149, 42, 0.2);
    padding: var(--sp3) var(--sp5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--sp3);
}

.logo-mark {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--ochre);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--t-md);
    color: var(--ochre);
    position: relative;
}

.logo-mark::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(200, 149, 42, 0.4);
    border-radius: 50%;
}

.logo-text {
    font-family: var(--font-display);
    font-size: var(--t-md);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--ink);
}

.logo-text span {
    color: var(--ochre);
    font-style: italic;
}

nav {
    display: flex;
    gap: var(--sp4);
    align-items: center;
}

nav a {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--smoke);
    transition: color 0.3s;
}

nav a:hover {
    color: var(--ochre);
}

/* ── HERO ────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: var(--sp7) var(--sp5) var(--sp6);
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 0.618fr;
    gap: var(--sp6);
    align-items: center;
    z-index: 1;
}

/* φ-spiral SVG watermark */
.hero-spiral {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 420px;
    opacity: 0.06;
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ochre);
    margin-bottom: var(--sp3);
    display: flex;
    align-items: center;
    gap: var(--sp2);
}

.hero-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--ochre);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, var(--t-3xl));
    font-weight: 300;
    line-height: 1.1;
    color: var(--ink);
    margin-bottom: var(--sp4);
}

.hero-title em {
    font-style: italic;
    color: var(--ochre);
}

.hero-body {
    font-size: var(--t-base);
    color: var(--smoke);
    line-height: var(--phi);
    margin-bottom: var(--sp5);
    max-width: 480px;
}

.hero-cta {
    display: flex;
    gap: var(--sp3);
    flex-wrap: wrap;
}

.btn-primary {
    padding: var(--sp3) var(--sp5);
    background: var(--ink);
    color: var(--parchment);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-primary:hover {
    background: var(--sepia);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: var(--sp3) var(--sp5);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--ink);
    color: var(--parchment);
}

/* Hero stats — φ proportioned */
.hero-stats {
    display: flex;
    flex-direction: column;
    gap: var(--sp4);
    padding: var(--sp5);
    border: 1px solid rgba(200, 149, 42, 0.3);
    background: var(--cream);
    position: relative;
}

.hero-stats::before {
    content: 'φ = 1.618';
    position: absolute;
    top: var(--sp2);
    right: var(--sp3);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: rgba(200, 149, 42, 0.5);
    letter-spacing: 0.1em;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--sp1);
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--t-xl);
    font-weight: 600;
    color: var(--ochre);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--smoke);
}

.stat-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--ochre), transparent);
}

/* ── SECTION SHARED ─────────────────────────────────── */
section {
    position: relative;
    z-index: 1;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--sp6) var(--sp5);
}

.section-label {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ochre);
    margin-bottom: var(--sp3);
    display: flex;
    align-items: center;
    gap: var(--sp2);
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(200, 149, 42, 0.4), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, var(--t-xl));
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: var(--sp4);
}

/* ── CURRICULUM ─────────────────────────────────────── */
.curriculum {
    background: var(--cream);
    border-top: 1px solid rgba(200, 149, 42, 0.15);
    border-bottom: 1px solid rgba(200, 149, 42, 0.15);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--sp4);
    margin-top: var(--sp5);
}

.module-card {
    background: var(--parchment);
    border: 1px solid rgba(200, 149, 42, 0.2);
    padding: var(--sp4);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background: var(--ochre);
    transition: height 0.4s;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px var(--shadow);
}

.module-card:hover::before {
    height: 100%;
}

.module-num {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ochre);
    letter-spacing: 0.12em;
    margin-bottom: var(--sp2);
}

.module-title {
    font-family: var(--font-display);
    font-size: var(--t-lg);
    font-weight: 400;
    margin-bottom: var(--sp2);
    line-height: 1.2;
}

.module-desc {
    font-size: var(--t-sm);
    color: var(--smoke);
    line-height: var(--phi);
    margin-bottom: var(--sp3);
}

.module-topics {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp1);
}

.module-topics li {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--smoke);
    display: flex;
    align-items: center;
    gap: var(--sp2);
}

.module-topics li::before {
    content: '—';
    color: var(--ochre);
    font-size: 0.5rem;
}

/* ── AI TUTOR ────────────────────────────────────────── */
.ai-tutor-section {
    padding-top: var(--sp6);
}

.tutor-wrapper {
    display: grid;
    grid-template-columns: 0.382fr 1fr;
    gap: var(--sp5);
    margin-top: var(--sp5);
    align-items: start;
}

.tutor-sidebar {
    padding: var(--sp4);
    border: 1px solid rgba(200, 149, 42, 0.2);
    background: var(--cream);
}

.tutor-avatar {
    width: 100%;
    aspect-ratio: 1;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp3);
    position: relative;
    overflow: hidden;
}

.tutor-avatar-inner {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--gold);
    font-style: italic;
}

/* Vitruvian circle decoration */
.tutor-avatar::before,
.tutor-avatar::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 50%;
}

.tutor-avatar::before {
    width: 80%;
    height: 80%;
}

.tutor-avatar::after {
    width: 60%;
    height: 60%;
}

.tutor-name {
    font-family: var(--font-display);
    font-size: var(--t-lg);
    font-weight: 300;
    margin-bottom: var(--sp1);
}

.tutor-role {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--ochre);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: var(--sp3);
}

.tutor-bio {
    font-size: var(--t-sm);
    color: var(--smoke);
    line-height: var(--phi);
    margin-bottom: var(--sp3);
}

.tutor-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp1);
}

.tag {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    padding: var(--sp1) var(--sp2);
    border: 1px solid rgba(200, 149, 42, 0.35);
    color: var(--smoke);
    letter-spacing: 0.08em;
}

/* ── CHAT INTERFACE ──────────────────────────────────── */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 580px;
    border: 1px solid rgba(200, 149, 42, 0.25);
    background: var(--cream);
    overflow: hidden;
}

.chat-header {
    padding: var(--sp3) var(--sp4);
    border-bottom: 1px solid rgba(200, 149, 42, 0.2);
    background: var(--ink);
    display: flex;
    align-items: center;
    gap: var(--sp3);
}

.chat-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5BBA5B;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.chat-title {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp4);
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(200, 149, 42, 0.3);
    border-radius: 2px;
}

.msg {
    display: flex;
    gap: var(--sp3);
    max-width: 88%;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg.assistant {
    align-self: flex-start;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--t-sm);
    font-style: italic;
}

.msg.assistant .msg-avatar {
    background: var(--ink);
    color: var(--gold);
    border: 1px solid var(--ochre);
}

.msg.user .msg-avatar {
    background: var(--ochre);
    color: var(--ink);
}

.msg-bubble {
    padding: var(--sp3) var(--sp4);
    font-size: var(--t-sm);
    line-height: var(--phi);
    border-radius: 0;
}

.msg.assistant .msg-bubble {
    background: var(--parchment);
    border: 1px solid rgba(200, 149, 42, 0.18);
    color: var(--ink);
    border-left: 3px solid var(--ochre);
}

.msg.user .msg-bubble {
    background: var(--ink);
    color: var(--parchment);
}

.msg-bubble code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(200, 149, 42, 0.1);
    padding: 1px 4px;
    color: var(--sepia);
}

.msg-bubble pre {
    background: #1A1510;
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    padding: var(--sp3);
    overflow-x: auto;
    margin-top: var(--sp2);
    border-left: 2px solid var(--ochre);
}

/* Quick prompts */
.quick-prompts {
    padding: var(--sp2) var(--sp4);
    display: flex;
    gap: var(--sp2);
    flex-wrap: wrap;
    border-top: 1px solid rgba(200, 149, 42, 0.12);
    background: var(--parchment);
}

.quick-btn {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    padding: var(--sp1) var(--sp3);
    border: 1px solid rgba(200, 149, 42, 0.35);
    background: transparent;
    color: var(--smoke);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.quick-btn:hover {
    background: var(--ochre);
    color: var(--ink);
    border-color: var(--ochre);
}

/* Chat input */
.chat-input-row {
    display: flex;
    border-top: 1px solid rgba(200, 149, 42, 0.2);
    background: var(--parchment);
}

.chat-input {
    flex: 1;
    padding: var(--sp3) var(--sp4);
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: var(--t-sm);
    color: var(--ink);
    outline: none;
    resize: none;
    line-height: var(--phi);
}

.chat-input::placeholder {
    color: rgba(90, 82, 73, 0.5);
}

.send-btn {
    padding: var(--sp3) var(--sp4);
    background: var(--ink);
    color: var(--gold);
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background 0.2s;
    white-space: nowrap;
}

.send-btn:hover:not(:disabled) {
    background: var(--sepia);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: var(--sp2) 0;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ochre);
    animation: dot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── PLATFORMS (Earn) ───────────────────────────────── */
.platforms-section {
    background: var(--ink);
}

.platforms-section .section-label {
    color: var(--gold);
}

.platforms-section .section-label::after {
    background: linear-gradient(90deg, rgba(212, 168, 83, 0.4), transparent);
}

.platforms-section .section-title {
    color: var(--parchment);
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp3);
    margin-top: var(--sp5);
}

.platform-card {
    padding: var(--sp4);
    border: 1px solid rgba(212, 168, 83, 0.2);
    background: rgba(212, 168, 83, 0.04);
    transition: all 0.3s;
    position: relative;
}

.platform-card:hover {
    border-color: var(--gold);
    background: rgba(212, 168, 83, 0.1);
}

.platform-icon {
    font-size: 2rem;
    margin-bottom: var(--sp3);
}

.platform-name {
    font-family: var(--font-display);
    font-size: var(--t-lg);
    color: var(--parchment);
    margin-bottom: var(--sp1);
}

.platform-rate {
    font-family: var(--font-mono);
    font-size: var(--t-md);
    color: var(--gold);
    margin-bottom: var(--sp2);
}

.platform-desc {
    font-size: var(--t-sm);
    color: rgba(245, 239, 224, 0.6);
    line-height: var(--phi);
}

/* ── INCOME CALCULATOR ───────────────────────────────── */
.calc-wrapper {
    display: grid;
    grid-template-columns: 1fr 0.618fr;
    gap: var(--sp5);
    margin-top: var(--sp5);
    align-items: start;
}

.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--sp3);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--sp1);
}

.input-group label {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--smoke);
}

.input-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 2px;
    background: rgba(200, 149, 42, 0.25);
    outline: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--ochre);
    cursor: pointer;
}

.range-val {
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--ochre);
    text-align: right;
}

.calc-result {
    padding: var(--sp5);
    border: 1px solid rgba(200, 149, 42, 0.3);
    background: var(--cream);
    text-align: center;
}

.result-num {
    font-family: var(--font-display);
    font-size: var(--t-2xl);
    font-weight: 600;
    color: var(--ochre);
    line-height: 1;
    margin-bottom: var(--sp2);
}

.result-label {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--smoke);
    margin-bottom: var(--sp3);
}

.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--sp2);
    padding-top: var(--sp3);
    border-top: 1px solid rgba(200, 149, 42, 0.2);
    text-align: left;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: var(--smoke);
}

.breakdown-row span:last-child {
    color: var(--ochre);
}

/* ── FOOTER ─────────────────────────────────────────── */
footer {
    background: var(--ink);
    padding: var(--sp5);
    text-align: center;
    border-top: 1px solid rgba(200, 149, 42, 0.15);
    z-index: 1;
    position: relative;
}

.footer-phi {
    font-family: var(--font-display);
    font-size: var(--t-xl);
    color: rgba(212, 168, 83, 0.15);
    line-height: 1;
    margin-bottom: var(--sp2);
    font-style: italic;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    color: rgba(245, 239, 224, 0.4);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        gap: var(--sp4);
    }

    .hero-spiral {
        display: none;
    }

    .tutor-wrapper {
        grid-template-columns: 1fr;
    }

    .calc-wrapper {
        grid-template-columns: 1fr;
    }

    nav {
        display: none;
    }

    .hero-title {
        font-size: 2.4rem;
    }
}