:root {
    --ivory: #fffef6;
    --paper: #f5efdf;
    --paper-deep: #efe7d2;
    --green: #0b3d2e;
    --green-soft: #145741;
    --gold: #d4af37;
    --ink: #17362c;
    --muted: rgba(23, 54, 44, 0.72);
    --line: rgba(11, 61, 46, 0.14);
    --shadow: 0 28px 80px rgba(15, 43, 33, 0.1);
    --font-display: "Cormorant Garamond", Georgia, serif;
    --font-body: "Manrope", system-ui, sans-serif;
    --transition: 800ms cubic-bezier(0.16, 1, 0.3, 1);
    --terminal-height: 26rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: var(--font-body);
    color: var(--ink);
    background: linear-gradient(180deg, #fffef7 0%, #f8f3e6 100%);
    overflow-x: hidden;
}

body.is-locked {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.experience {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 1.25rem clamp(1.2rem, 4vw, 3rem);
    pointer-events: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--green);
    text-decoration: none;
    pointer-events: auto;
}

.brand-flower {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.8rem;
    object-fit: cover;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
    gap: clamp(2rem, 6vw, 7rem);
    align-items: center;
    padding: clamp(6rem, 10vw, 8rem) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 8vw, 6rem);
    transition: opacity var(--transition), transform var(--transition);
}

.hero-shell.is-dormant {
    opacity: 0;
    pointer-events: none;
}

.hero-copy {
    display: grid;
    gap: 1rem;
    align-content: center;
}

h1,
h2 {
    margin: 0;
    font-family: var(--font-body);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: var(--green);
}

h1 {
    font-size: clamp(4rem, 10vw, 7rem);
    max-width: 8ch;
}

h2 {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
}

.hero-mark {
    display: grid;
    place-items: center;
}

.hero-logo-shell {
    width: min(24rem, 72vw);
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transition: transform var(--transition), opacity var(--transition);
}

.hero-logo-shell.is-blooming {
    transform: scale(2.6);
    opacity: 0;
}

.hero-flower-spin,
.hero-flower-pulse {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-flower-spin {
    animation: flower-spin 3.5s linear infinite;
    transform-origin: 50% 50%;
}

.hero-flower-pulse {
    animation: flower-pulse 1.5s ease-in-out infinite alternate;
    transform-origin: 50% 50%;
}

.hero-flower {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(11, 61, 46, 0.12));
}

@keyframes flower-spin {
    from {
        transform: rotate(0deg) scale(0.8);
    }
    to {
        transform: rotate(360deg) scale(0.8);
    }
}

@keyframes flower-pulse {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

.navigator {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.62fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    padding: clamp(1.5rem, 5vw, 4rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.navigator.is-live {
    opacity: 1;
    pointer-events: auto;
}

.content-stage {
    padding-right: clamp(0rem, 2vw, 1rem);
    position: relative;
}

.content-stage::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 7rem;
    background: linear-gradient(180deg,
        var(--ivory) 0%,
        var(--ivory) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.landing-zone {
    min-height: 120vh;
}

.content-panel {
    display: grid;
    gap: 1.25rem;
    max-width: 44rem;
    min-height: var(--terminal-height);
    align-content: start;
    margin-bottom: 50rem;
}

.content-panel.is-active {
    animation: panel-rise 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.content-empty {
    min-height: 22rem;
}

.content-panel h2 {
    margin: 0;
    padding: 0;
}

.terminal-shell {
    position: sticky;
    top: 50vh;
    transform: translateY(-50%);
    align-self: start;
    min-height: var(--terminal-height);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.8rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(11, 61, 46, 0.16);
    border-radius: 0.75rem;
    background: rgba(255, 252, 244, 0.9);
    box-shadow: 0 34px 90px rgba(15, 43, 33, 0.2);
    color: var(--green);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.84rem;
    transition: all 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-shell.is-maximized {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 56rem;
    height: 85vh;
    z-index: 100;
}

.terminal-shell.is-minimizing {
    transform: translateY(-50%) scale(0.1);
    opacity: 0;
}

.terminal-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(11, 61, 46, 0.14);
}

.terminal-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.terminal-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 120ms ease-out;
}

.terminal-dot:hover {
    transform: scale(1.15);
}

.terminal-dot:active {
    transform: scale(0.95);
}

.terminal-dot-close {
    background: #ff5f57;
}

.terminal-dot-min {
    background: #febc2e;
}

.terminal-dot-max {
    background: #28c840;
}

.terminal-body {
    display: grid;
    gap: 0.35rem;
    align-content: start;
    overflow-y: auto;
    min-height: 0;
}

.terminal-body p {
    margin: 0;
    line-height: 1.5;
}

.terminal-ascii {
    margin: 0;
    white-space: pre-wrap;
    color: #9d7a26;
    font-size: 0.96rem;
    line-height: 1.3;
}

.terminal-question {
    margin: 0.15rem 0 0;
    color: var(--green);
    line-height: 1.5;
}

.terminal-options {
    margin: 0;
    white-space: pre-wrap;
    color: var(--green);
    line-height: 1.6;
}

#terminal-content p {
    margin: 0.3rem 0;
    line-height: 1.5;
}

#terminal-content .user-message {
    color: var(--gold);
}

#terminal-content .assistant-message {
    color: var(--green);
    margin-top: 0.5rem;
}

#terminal-content .typing {
    color: var(--muted);
    font-style: italic;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(11, 61, 46, 0.14);
}

.prompt {
    color: var(--gold);
}

#terminal-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--green);
    caret-color: var(--gold);
    font-size: 0.84rem;
}

.terminal-shell.is-invalid {
    box-shadow: 0 34px 90px rgba(94, 22, 22, 0.24);
}

.terminal-shell.is-invalid .terminal-input-row {
    border-top-color: rgba(220, 38, 38, 0.34);
}

.terminal-chat {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 0.8rem;
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.4rem 0;
}

.chat-message {
    display: grid;
    gap: 0.4rem;
    max-width: 85%;
}

.chat-message.user {
    justify-self: end;
}

.chat-message.assistant {
    justify-self: start;
}

.chat-bubble {
    padding: 0.6rem 0.85rem;
    border-radius: 0.65rem;
    line-height: 1.5;
    font-size: 0.88rem;
}

.chat-message.user .chat-bubble {
    background: var(--green);
    color: var(--ivory);
}

.chat-message.assistant .chat-bubble {
    background: rgba(11, 61, 46, 0.08);
    color: var(--green);
}

.chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.55rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(11, 61, 46, 0.14);
}

#chat-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--green);
    caret-color: var(--gold);
    font-size: 0.88rem;
}

.chat-send {
    padding: 0.4rem 0.7rem;
    border: 0;
    background: var(--green);
    color: var(--ivory);
    border-radius: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 150ms ease-out;
}

.chat-send:hover {
    background: var(--green-soft);
    transform: translateX(2px);
}

.chat-send:active {
    transform: scale(0.95);
}

.typing-indicator {
    display: flex;
    gap: 0.3rem;
    padding: 0.6rem 0.85rem;
}

.typing-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--green);
    opacity: 0.4;
    animation: typing-bounce 1.4s infinite;
}

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

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

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@media (max-width: 960px) {
    body.is-locked {
        overflow: auto;
    }

    .hero-shell,
    .navigator {
        grid-template-columns: 1fr;
    }

    .navigator {
        min-height: auto;
    }

    .hero-shell {
        padding-top: 7rem;
        min-height: auto;
    }

    .content-stage {
        padding-top: 1rem;
    }

    .content-panel.is-active {
        min-height: auto;
    }

    .terminal-shell {
        position: relative;
        top: 0;
        min-height: 28rem;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
