
:root {
    --bg: #0b0908;
    --panel: #15110e;
    --panel-light: #1d1712;
    --gold: #d5a64d;
    --gold-light: #f1cc7d;
    --text: #f4eee4;
    --muted: #a49a8c;
    --border: rgba(213, 166, 77, 0.22);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, #302013 0%, transparent 45%),
        var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

button, textarea, select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.background-glow {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.13;
    pointer-events: none;
    z-index: -1;
}

.glow-one {
    background: #d58a25;
    top: 15%;
    left: -180px;
}

.glow-two {
    background: #79351e;
    bottom: 5%;
    right: -180px;
}

/* NAVBAR */

.navbar {
    max-width: 1250px;
    margin: auto;
    padding: 25px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    text-decoration: none;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 2px;
}

.logo-icon {
    color: var(--gold);
    margin-right: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
}

.connection {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: #d49c39;
    border-radius: 50%;
}

.status-dot.online {
    background: #70c58a;
    box-shadow: 0 0 12px #70c58a;
}

.status-dot.offline {
    background: #d45b50;
}

.sound-btn {
    width: 37px;
    height: 37px;
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
}

/* HERO */

main {
    max-width: 1100px;
    margin: auto;
    padding: 0 30px;
}

.hero {
    min-height: 590px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 85px 0;
}

.hero-tag,
.section-label {
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 3px;
    font-weight: 600;
}

.hero h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(42px, 7vw, 78px);
    font-weight: 500;
    line-height: 1.25;
    margin: 27px 0;
}

.hero h1 span,
.about-section h2 span {
    color: var(--gold-light);
    font-style: italic;
}

.hero-description {
    max-width: 590px;
    color: var(--muted);
    font-size: 14px;
    line-height: 2;
}

.hero-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 35px 0;
    color: var(--gold);
}

.hero-divider div {
    width: 60px;
    height: 1px;
    background: var(--border);
}

.explore-btn {
    text-decoration: none;
    padding: 15px 27px;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 10px;
    letter-spacing: 2px;
    transition: 0.3s;
}

.explore-btn:hover {
    background: var(--gold);
    color: #100c08;
}

/* SECTION HEADINGS */

.archive-section,
.creation-section,
.saved-section {
    padding: 65px 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 35px;
}

.section-heading h2,
.result-heading h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 500;
    margin: 12px 0;
}

.section-heading p {
    font-size: 12px;
    color: var(--muted);
}

/* MODE CARDS */

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.mode-card {
    position: relative;
    min-height: 265px;
    padding: 27px 23px;
    text-align: left;
    color: var(--text);
    background: linear-gradient(145deg, #1c1712, #100e0c);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.35s;
}

.mode-card:hover,
.mode-card.active {
    border-color: var(--gold);
    background: linear-gradient(145deg, #302116, #17100b);
    transform: translateY(-5px);
}

.card-icon {
    font-size: 34px;
    color: var(--gold-light);
    margin-bottom: 20px;
}

.card-number {
    display: block;
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 2px;
}

.mode-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 500;
    margin: 13px 0;
}

.mode-card p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.9;
}

.card-link {
    display: block;
    color: var(--gold-light);
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-top: 22px;
}

/* CREATION PANEL */

.creation-section {
    padding-top: 80px;
}

.creation-panel {
    background: linear-gradient(145deg, #1c1712, #100e0c);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 35px;
}

.panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
}

.panel-top h3 {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 500;
    margin-top: 10px;
}

.ai-badge {
    border: 1px solid var(--border);
    padding: 9px 13px;
    color: var(--gold-light);
    font-size: 9px;
    letter-spacing: 1px;
}

.creation-panel > label,
.setting label {
    display: block;
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 19px;
    resize: vertical;
    color: var(--text);
    background: #0c0a09;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    font-size: 13px;
    line-height: 1.9;
    transition: 0.3s;
}

textarea:focus {
    border-color: var(--gold);
}

textarea::placeholder {
    color: #756b60;
}

.input-information {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1px;
}

.settings-row {
    display: flex;
    gap: 20px;
    margin-top: 28px;
}

.setting {
    flex: 1;
}

.setting select {
    width: 100%;
    padding: 13px;
    color: var(--text);
    background: #0c0a09;
    border: 1px solid var(--border);
    border-radius: 5px;
    outline: none;
}

.generate-btn {
    width: 100%;
    margin-top: 28px;
    padding: 18px;
    color: #130e08;
    background: linear-gradient(100deg, #a46a2c, #edc16a);
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

.generate-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.privacy-note {
    text-align: center;
    color: var(--muted);
    font-size: 10px;
    margin-top: 18px;
}

/* RESULT */

.result-section {
    padding: 35px;
    margin: 35px 0 60px;
    background: #17120e;
    border: 1px solid var(--gold);
    border-radius: 9px;
    animation: appear 0.6s ease;
}

.result-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.story-content {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    color: #e0d5c7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 2.1;
    font-size: 14px;
}

.secondary-btn {
    padding: 11px 15px;
    color: var(--gold-light);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 9px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}

.secondary-btn:hover {
    border-color: var(--gold);
    background: rgba(213, 166, 77, 0.1);
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1px;
}

/* SAVED STORIES */

.saved-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 35px;
    text-align: center;
    border: 1px dashed var(--border);
    color: var(--muted);
}

.empty-state span {
    display: block;
    font-size: 28px;
    color: var(--gold);
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 12px;
}

.saved-card {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: 7px;
}

.saved-card h3 {
    font-family: 'Cinzel', serif;
    font-size: 15px;
    margin-bottom: 10px;
}

.saved-card p {
    font-size: 11px;
    line-height: 1.8;
    color: var(--muted);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.saved-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 17px;
}

/* ABOUT */

.about-section {
    padding: 85px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.about-section h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(30px, 5vw, 45px);
    font-weight: 500;
    line-height: 1.5;
    margin: 20px 0;
}

.about-section > p {
    max-width: 600px;
    margin: auto;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.tech-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 45px;
    margin-top: 45px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.tech-item strong {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 22px;
}

.tech-item span {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 1.5px;
}

/* FOOTER */

footer {
    text-align: center;
    padding: 55px 20px 35px;
    border-top: 1px solid var(--border);
}

.footer-symbol {
    color: var(--gold);
    font-size: 25px;
    margin-bottom: 12px;
}

footer h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 17px;
    letter-spacing: 3px;
}

footer p {
    color: var(--muted);
    font-size: 11px;
    margin: 12px 0 25px;
}

.copyright {
    color: #766b5e;
    font-size: 9px;
    letter-spacing: 1.5px;
}

/* TOAST */

.toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translate(-50%, 20px);
    background: #292016;
    color: var(--gold-light);
    border: 1px solid var(--gold);
    padding: 13px 20px;
    font-size: 12px;
    border-radius: 5px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.hidden {
    display: none !important;
}

/* ANIMATION */

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE */

@media (max-width: 750px) {

    .navbar {
        padding: 20px 15px;
    }

    .logo {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .nav-right {
        gap: 10px;
    }

    main {
        padding: 0 17px;
    }

    .hero {
        min-height: 510px;
    }

    .mode-grid {
        grid-template-columns: 1fr;
    }

    .mode-card {
        min-height: 220px;
    }

    .creation-panel {
        padding: 22px;
    }

    .settings-row {
        flex-direction: column;
    }

    .result-section {
        padding: 22px;
    }

    .result-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .saved-grid {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        gap: 25px;
    }
}

@media (max-width: 400px) {
    .connection {
        font-size: 9px;
    }

    .hero h1 {
        font-size: 37px;
    }

    .input-information {
        font-size: 8px;
    }
}
