
/* =====================================
   AFTERIMAGE — VISUAL SYSTEM
===================================== */

:root {
    --background: #11100e;
    --surface: #1b1915;
    --surface-light: #242019;
    --paper: #d8c9a9;
    --muted: #938875;
    --orange: #c47742;
    --gold: #d4a64e;
    --green: #a5b58b;
    --line: rgba(216, 201, 169, 0.17);
    --mono: 'DM Mono', monospace;
    --display: 'Playfair Display', serif;
    --sans: 'Space Grotesk', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background: var(--background);
    color: var(--paper);
    font-family: var(--sans);
    overflow-x: hidden;
}

button, input, textarea {
    font: inherit;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--orange);
    color: white;
}

/* GRAIN */

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* TOPBAR */

.topbar {
    height: 75px;
    padding: 0 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.logo {
    font-size: 21px;
    letter-spacing: -1.5px;
    font-weight: 700;
}

.logo span {
    color: var(--orange);
}

.logo sup {
    font-family: var(--mono);
    font-size: 8px;
    color: var(--muted);
}

.system-status,
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1.3px;
    color: var(--muted);
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(165,181,139,.5);
    animation: blink 2s infinite;
}

@keyframes blink {
    50% { opacity: .35; }
}

.menu-button {
    display: none;
    background: none;
    color: var(--paper);
    border: none;
    font-size: 22px;
}

/* NAVIGATION */

.navigation {
    display: flex;
    justify-content: center;
    gap: 44px;
    min-height: 54px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.navigation a {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--muted);
    transition: color .3s;
}

.navigation a:hover {
    color: var(--gold);
}

/* HERO */

.hero {
    min-height: 620px;
    padding: 90px 10% 65px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    align-items: center;
    gap: 40px;
    position: relative;
}

.hero-left {
    position: relative;
    z-index: 2;
}

.eyebrow {
    margin-bottom: 35px;
}

.hero h1 {
    font-family: var(--display);
    font-size: clamp(46px, 6vw, 82px);
    line-height: 1.08;
    font-weight: 400;
    letter-spacing: -3px;
}

.hero h1 em,
.intro-content h2 em,
.terminal-heading h2 em,
.vault-heading h2 em,
.ofrenda-intro h2 em,
.frequency-heading h2 em {
    color: var(--orange);
    font-weight: 400;
}

.hero-description {
    max-width: 400px;
    color: var(--muted);
    line-height: 1.9;
    margin: 28px 0 32px;
    font-size: 14px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 21px;
    border: 1px solid var(--orange);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .7px;
    transition: .3s;
}

.primary-button {
    background: var(--orange);
    color: #17110c;
}

.primary-button:hover {
    background: var(--gold);
    border-color: var(--gold);
    transform: translateY(-3px);
}

.secondary-button {
    color: var(--paper);
    border-color: var(--line);
    background: transparent;
}

.secondary-button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.hero-footnote {
    display: flex;
    gap: 30px;
    margin-top: 65px;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted);
}

/* HERO ART */

.hero-art {
    min-height: 390px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(196,119,66,.23);
    border-radius: 50%;
}

.orbit-one {
    width: 340px;
    height: 340px;
    animation: rotate 35s linear infinite;
}

.orbit-two {
    width: 270px;
    height: 270px;
    border-style: dashed;
    animation: rotate 50s linear infinite reverse;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.artifact {
    position: relative;
    z-index: 1;
    width: 225px;
    height: 290px;
    background: linear-gradient(145deg, #403329, #211c17);
    border: 1px solid #7a593e;
    box-shadow: 20px 25px 60px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
    transform: rotate(-5deg);
    transition: transform .5s;
}

.artifact:hover {
    transform: rotate(0deg) translateY(-8px);
}

.artifact-label,
.artifact-bottom {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 1px;
    color: #b79a72;
}

.artifact-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 7px;
}

.artifact-symbol {
    font-size: 105px;
    text-align: center;
    color: var(--gold);
    text-shadow: 0 0 40px rgba(212,166,78,.25);
}

.floating-note {
    position: absolute;
    background: #d7c6a3;
    color: #33271c;
    padding: 12px 16px;
    font-family: var(--mono);
    font-size: 9px;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    z-index: 3;
}

.note-one {
    top: 55px;
    right: 0;
    transform: rotate(5deg);
}

.note-two {
    bottom: 55px;
    left: 0;
    background: #303d2e;
    color: #bdc99e;
    transform: rotate(-4deg);
}

/* TICKER */

.ticker {
    overflow: hidden;
    background: var(--orange);
    color: #21150e;
    padding: 14px 0;
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
}

.ticker-content {
    display: inline-block;
    min-width: max-content;
    animation: ticker 28s linear infinite;
}

@keyframes ticker {
    to { transform: translateX(-35%); }
}

/* SHARED SECTIONS */

.section-label {
    color: var(--orange);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    margin-bottom: 35px;
}

.intro-section,
.terminal-section,
.vault-section,
.ofrenda-section,
.frequencies-section {
    padding: 110px 12%;
    border-bottom: 1px solid var(--line);
}

h2 {
    font-family: var(--display);
    font-size: clamp(36px, 4.5vw, 56px);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -1px;
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr .8fr;
    gap: 80px;
    align-items: center;
}

.intro-content p,
.terminal-heading p,
.vault-heading p,
.ofrenda-intro p,
.frequency-heading p {
    font-size: 13px;
    line-height: 2;
    color: var(--muted);
    max-width: 470px;
}

/* TERMINAL */

.terminal-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 45px;
}

.terminal-window {
    background: #0c100d;
    border: 1px solid #536344;
    box-shadow: 0 20px 80px rgba(0,0,0,.25);
}

.terminal-top {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 25px;
    background: #1b211a;
    border-bottom: 1px solid #394735;
    font-family: var(--mono);
    font-size: 10px;
    color: #9ca98d;
}

.terminal-lights {
    display: flex;
    gap: 6px;
}

.terminal-lights span {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: #a46b46;
}

.terminal-lights span:nth-child(2) {
    background: #c8a451;
}

.terminal-lights span:nth-child(3) {
    background: #77936a;
}

.terminal-version {
    margin-left: auto;
}

.terminal-body {
    padding: 35px;
    color: #a6b995;
    font-family: var(--mono);
    font-size: 11px;
}

.terminal-welcome {
    line-height: 1.9;
    margin-bottom: 30px;
    color: #83967b;
}

.terminal-body label,
.memory-form label,
.ofrenda-form label {
    display: block;
    margin: 20px 0 10px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 1px;
}

.terminal-body textarea {
    width: 100%;
    height: 105px;
    resize: vertical;
    padding: 15px;
    background: #131a14;
    border: 1px solid #46563f;
    color: #c0d0a7;
    outline: none;
    font-family: var(--mono);
    font-size: 12px;
}

.terminal-body textarea:focus {
    border-color: var(--green);
}

.terminal-body textarea::placeholder {
    color: #65755c;
}

.terminal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 18px 0 30px;
}

#modelStatus {
    font-size: 9px;
    color: #8a9c80;
}

.terminal-button,
.frequency-button {
    background: #a5b58b;
    border: none;
    padding: 13px 20px;
    color: #10170f;
    font-family: var(--mono);
    font-size: 10px;
    transition: .3s;
}

.terminal-button:hover,
.frequency-button:hover {
    background: #d4dcb9;
}

.terminal-button:disabled {
    opacity: .5;
    cursor: wait;
}

.terminal-output {
    min-height: 130px;
    padding: 20px;
    border: 1px dashed #46563f;
    background: rgba(165,181,139,.035);
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.output-label {
    display: block;
    color: #c18c52;
    margin-bottom: 12px;
    font-size: 9px;
}

.terminal-output p {
    color: #c0d0a7;
}

.terminal-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
    font-size: 8px;
    color: #65755c;
}

.terminal-disclaimer {
    color: var(--muted);
    font-size: 10px;
    margin-top: 18px;
}

/* MEMORY VAULT */

.vault-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 50px;
}

.vault-heading p {
    margin-top: 20px;
}

.vault-count {
    text-align: center;
    border-left: 1px solid var(--line);
    padding-left: 35px;
    min-width: 125px;
}

.vault-count span {
    display: block;
    color: var(--gold);
    font-family: var(--display);
    font-size: 45px;
}

.vault-count small {
    font-family: var(--mono);
    font-size: 8px;
    color: var(--muted);
}

.memory-layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 35px;
}

.memory-form,
.memory-collection {
    padding: 30px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.form-label {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--orange);
    letter-spacing: 1px;
}

.memory-form input,
.memory-form textarea,
.ofrenda-form input,
.ofrenda-form textarea {
    width: 100%;
    background: #13120f;
    border: 1px solid var(--line);
    padding: 14px;
    color: var(--paper);
    outline: none;
    font-size: 12px;
    resize: vertical;
}

.memory-form input:focus,
.memory-form textarea:focus,
.ofrenda-form input:focus,
.ofrenda-form textarea:focus {
    border-color: var(--orange);
}

.memory-form input::placeholder,
.memory-form textarea::placeholder,
.ofrenda-form input::placeholder,
.ofrenda-form textarea::placeholder {
    color: #70695c;
}

.memory-form textarea {
    height: 150px;
}

.full-button {
    width: 100%;
    margin-top: 20px;
}

.privacy-note {
    color: var(--muted);
    font-size: 9px;
    margin-top: 17px;
    line-height: 1.7;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--mono);
    font-size: 8px;
    color: var(--muted);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.memory-list {
    min-height: 280px;
    max-height: 450px;
    overflow-y: auto;
}

.empty-state {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    text-align: center;
}

.empty-state span {
    color: var(--gold);
    font-size: 35px;
}

.empty-state p {
    font-family: var(--mono);
    font-size: 10px;
}

.empty-state small {
    font-size: 9px;
}

.memory-entry {
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.memory-entry h3 {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 400;
}

.memory-entry .entry-author {
    display: block;
    margin-top: 7px;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
}

.memory-entry p {
    margin-top: 13px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.entry-date {
    display: block;
    margin-top: 13px;
    color: #777064;
    font-family: var(--mono);
    font-size: 8px;
}

.delete-entry {
    background: transparent;
    border: none;
    color: #a76d50;
    font-family: var(--mono);
    font-size: 9px;
    margin-top: 12px;
}

.delete-entry:hover {
    color: #e4a079;
}

.export-button {
    width: 100%;
    padding: 13px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 9px;
    transition: .3s;
}

.export-button:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* OFRENDA */

.ofrenda-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 45px;
}

.ofrenda-intro p {
    margin-top: 20px;
}

.flower-decoration {
    color: var(--gold);
    font-size: 90px;
    opacity: .7;
}

.ofrenda-card {
    position: relative;
    background:
        radial-gradient(ellipse at center, #55402d 0%, #34271d 55%, #231d17 100%);
    border: 1px solid #8d673b;
    padding: 25px;
    box-shadow: 0 25px 70px rgba(0,0,0,.25);
}

.ofrenda-decoration {
    color: var(--gold);
    font-size: 25px;
    text-align: center;
    letter-spacing: 15px;
    opacity: .8;
}

.ofrenda-inner {
    max-width: 650px;
    margin: 20px auto;
    text-align: center;
    padding: 35px;
    background: rgba(18,15,12,.6);
    border: 1px solid rgba(212,166,78,.3);
}

.candle {
    font-size: 35px;
    margin-bottom: 10px;
}

.ofrenda-symbol {
    color: var(--gold);
    font-size: 65px;
    margin-bottom: 15px;
}

.ofrenda-form {
    text-align: left;
}

.ofrenda-form label {
    color: #d0b783;
}

.ofrenda-form input,
.ofrenda-form textarea {
    background: rgba(10,10,8,.5);
    border-color: rgba(212,166,78,.25);
}

.ofrenda-form textarea {
    height: 110px;
}

.ofrenda-form .primary-button {
    margin-top: 25px;
}

.bottom-decoration {
    transform: rotate(180deg);
}

.tribute-display {
    margin-top: 30px;
    padding: 50px 20px;
    text-align: center;
    border: 1px solid rgba(212,166,78,.3);
    background: var(--surface);
}

.tribute-flower {
    font-size: 50px;
    color: var(--gold);
}

.tribute-display > span {
    display: block;
    color: var(--orange);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 2px;
    margin: 20px 0;
}

.tribute-display h3 {
    font-family: var(--display);
    font-size: 40px;
    font-weight: 400;
}

.tribute-display p,
.tribute-display blockquote {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.9;
    margin: 15px auto;
    max-width: 450px;
}

.tribute-display blockquote {
    font-family: var(--display);
    font-size: 18px;
    font-style: italic;
}

.tribute-display .secondary-button {
    margin-top: 20px;
}

.hidden {
    display: none;
}

/* FREQUENCIES */

.frequency-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 30px;
    margin-bottom: 45px;
}

.frequency-display {
    text-align: center;
    padding: 35px;
    border: 1px solid var(--line);
    background:
        radial-gradient(ellipse at center, #22291e 0%, #141711 70%);
}

.frequency-top {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
}

.signal-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.frequency-number {
    color: var(--green);
    font-family: var(--mono);
    font-size: clamp(45px, 8vw, 85px);
    margin: 25px 0;
    text-shadow: 0 0 25px rgba(165,181,139,.3);
}

.waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 65px;
    margin-bottom: 25px;
}

.waveform span {
    width: 3px;
    height: 12px;
    background: var(--green);
    opacity: .65;
    transition: height .5s;
}

.waveform.active span {
    animation: wave .6s ease-in-out infinite alternate;
}

.waveform span:nth-child(3n) {
    animation-delay: .2s;
}

.waveform span:nth-child(3n + 1) {
    animation-delay: .4s;
}

@keyframes wave {
    from { height: 8px; }
    to { height: 50px; }
}

.frequency-display > p {
    color: #a8b697;
    font-family: var(--display);
    font-style: italic;
    font-size: 18px;
    margin-bottom: 25px;
}

.frequency-button {
    background: transparent;
    color: var(--green);
    border: 1px solid #657b59;
}

.frequency-button:hover {
    background: var(--green);
    color: #141711;
}

/* FOOTER */

.footer {
    padding: 65px 12% 25px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 55px;
}

.footer-top p {
    color: var(--muted);
    font-size: 11px;
    margin-top: 17px;
    line-height: 1.8;
    max-width: 270px;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted);
}

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-family: var(--mono);
    font-size: 8px;
    color: var(--muted);
}

/* RESPONSIVE */

@media (max-width: 850px) {

    .hero {
        padding: 75px 7%;
        grid-template-columns: 1fr;
    }

    .hero-art {
        min-height: 350px;
    }

    .intro-content,
    .memory-layout {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .intro-section,
    .terminal-section,
    .vault-section,
    .ofrenda-section,
    .frequencies-section {
        padding: 85px 7%;
    }

    .terminal-heading,
    .vault-heading,
    .frequency-heading {
        align-items: start;
        flex-direction: column;
    }

    .vault-count {
        border-left: none;
        padding-left: 0;
        display: flex;
        gap: 15px;
        align-items: center;
    }

    .vault-count span {
        font-size: 30px;
    }

}

@media (max-width: 600px) {

    .topbar {
        padding: 0 6%;
    }

    .system-status {
        display: none;
    }

    .menu-button {
        display: block;
    }

    .navigation {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 6%;
    }

    .navigation.open {
        display: flex;
    }

    .navigation a {
        padding: 15px 0;
        border-bottom: 1px solid var(--line);
    }

    .hero {
        padding: 65px 7% 35px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero-footnote {
        flex-wrap: wrap;
        gap: 12px;
        font-size: 8px;
    }

    .hero-art {
        min-height: 310px;
    }

    .orbit-one {
        width: 280px;
        height: 280px;
    }

    .orbit-two {
        width: 225px;
        height: 225px;
    }

    .artifact {
        width: 175px;
        height: 230px;
    }

    .artifact-symbol {
        font-size: 80px;
    }

    .note-one {
        right: -5px;
    }

    .note-two {
        left: -5px;
    }

    .intro-section,
    .terminal-section,
    .vault-section,
    .ofrenda-section,
    .frequencies-section {
        padding: 70px 6%;
    }

    .section-label {
        margin-bottom: 25px;
    }

    h2 {
        font-size: 38px;
    }

    .terminal-body {
        padding: 18px;
    }

    .terminal-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .terminal-footer {
        flex-direction: column;
    }

    .memory-form,
    .memory-collection {
        padding: 20px;
    }

    .collection-header {
        font-size: 7px;
    }

    .ofrenda-card {
        padding: 15px;
    }

    .ofrenda-inner {
        padding: 20px 12px;
    }

    .ofrenda-decoration {
        letter-spacing: 5px;
        font-size: 19px;
    }

    .flower-decoration {
        font-size: 45px;
    }

    .frequency-display {
        padding: 20px 12px;
    }

    .footer {
        padding: 55px 7% 20px;
    }

    .footer-top {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

/* PRINT TRIBUTE */

@media print {

    body * {
        visibility: hidden;
    }

    .tribute-display,
    .tribute-display * {
        visibility: visible;
    }

    .tribute-display {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: white;
        color: #222;
        border: 2px solid #b58a46;
    }

    .tribute-display h3 {
        color: #222;
    }

    .tribute-display p,
    .tribute-display blockquote {
        color: #444;
    }

    .tribute-display button {
        display: none;
    }

}
