/* Fontit itse hostattuina (Fontsource, SIL OFL) Google Fontsin sijaan.
   Variable-versiot kattavat alkuperäisen sivun painot 400–600 ja 300–400. */
@font-face {
    font-family: 'EB Garamond';
    src: url('fonts/eb-garamond.woff2') format('woff2');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'EB Garamond';
    src: url('fonts/eb-garamond-italic.woff2') format('woff2');
    font-weight: 400 800;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('fonts/jetbrains-mono.woff2') format('woff2');
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #060607;
    --text: #e2ddd5;
    --text-dim: #5a564f;
    --accent: #c4a265;
    --accent-glow: rgba(196, 162, 101, 0.15);
    --mono: 'JetBrains Mono', monospace;
    --serif: 'EB Garamond', Georgia, serif;
}

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

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Grain */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* === PROMPT OVERLAY === */
.prompt-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: promptFade 0.8s ease 1.8s forwards;
    pointer-events: none;
}

.prompt-text {
    font-family: var(--mono);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    opacity: 0;
    animation: softIn 0.8s ease 0.2s forwards;
}

.prompt-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--accent);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }
@keyframes softIn { to { opacity: 1; } }
@keyframes promptFade { to { opacity: 0; visibility: hidden; } }

/* === VINYL RECORD === */
.vinyl-container {
    position: fixed;
    right: -5vw;
    top: 50%;
    transform: translateY(-50%);
    width: 55vmin;
    height: 55vmin;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: vinylIn 3s ease 2.5s forwards;
}

@keyframes vinylIn { to { opacity: 0.15; } }

.vinyl-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    animation: spin 8s linear 2.5s infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Grooves */
.vinyl-disc::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 10%, transparent 11%, rgba(196,162,101,0.04) 11.5%, transparent 12%),
        radial-gradient(circle, transparent 15%, transparent 16%, rgba(196,162,101,0.03) 16.5%, transparent 17%),
        radial-gradient(circle, transparent 20%, transparent 21%, rgba(196,162,101,0.04) 21.5%, transparent 22%),
        radial-gradient(circle, transparent 25%, transparent 26%, rgba(196,162,101,0.03) 26.5%, transparent 27%),
        radial-gradient(circle, transparent 30%, transparent 31%, rgba(196,162,101,0.04) 31.5%, transparent 32%),
        radial-gradient(circle, transparent 35%, transparent 36%, rgba(196,162,101,0.03) 36.5%, transparent 37%),
        radial-gradient(circle, transparent 40%, transparent 41%, rgba(196,162,101,0.04) 41.5%, transparent 42%),
        radial-gradient(circle, transparent 45%, transparent 46%, rgba(196,162,101,0.03) 46.5%, transparent 47%),
        radial-gradient(circle, transparent 50%, transparent 51%, rgba(196,162,101,0.04) 51.5%, transparent 52%),
        radial-gradient(circle, transparent 55%, transparent 56%, rgba(196,162,101,0.03) 56.5%, transparent 57%),
        radial-gradient(circle, transparent 60%, transparent 61%, rgba(196,162,101,0.04) 61.5%, transparent 62%),
        radial-gradient(circle, transparent 65%, transparent 66%, rgba(196,162,101,0.03) 66.5%, transparent 67%),
        radial-gradient(circle, transparent 70%, transparent 71%, rgba(196,162,101,0.04) 71.5%, transparent 72%),
        radial-gradient(circle, transparent 75%, transparent 76%, rgba(196,162,101,0.03) 76.5%, transparent 77%),
        radial-gradient(circle, transparent 80%, transparent 81%, rgba(196,162,101,0.04) 81.5%, transparent 82%),
        radial-gradient(circle, transparent 85%, transparent 86%, rgba(196,162,101,0.03) 86.5%, transparent 87%),
        radial-gradient(circle, transparent 90%, transparent 91%, rgba(196,162,101,0.04) 91.5%, transparent 92%),
        radial-gradient(circle, transparent 95%, transparent 96%, rgba(196,162,101,0.03) 96.5%, transparent 97%);
}

/* Center label */
.vinyl-disc::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 12%;
    height: 12%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(196, 162, 101, 0.06);
    box-shadow: 0 0 0 2px rgba(196, 162, 101, 0.03);
}

.vinyl-center-dot {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 4px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(196, 162, 101, 0.4);
    z-index: 2;
}

/* === TEXT CONTENT === */
/* Tekstipalsta keskellä näyttöä: vaakasuunnassa margin-inline: auto,
   pystysuunnassa flex + min-height. Pitkä teksti kasvattaa palstaa ja
   sivu vierii normaalisti, lyhyt jää pystysuunnassa keskelle. */
.content {
    position: relative;
    z-index: 10;
    max-width: 640px;
    min-height: 100vh;
    min-height: 100dvh;
    margin-inline: auto;
    padding: 10vh 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.line {
    opacity: 0;
    transform: translateY(16px);
    margin-bottom: 2rem;
}

.line:last-child { margin-bottom: 0; }

.line:nth-child(1) { animation: lineIn 1s ease 2.6s forwards; }
.line:nth-child(2) { animation: lineIn 1s ease 3.2s forwards; }
.line:nth-child(3) { animation: lineIn 1.2s ease 3.9s forwards; }
.line:nth-child(4) { animation: lineIn 1.2s ease 5.2s forwards; }
.line:nth-child(5) { animation: lineIn 1.2s ease 6.6s forwards; }
.line:nth-child(6) { animation: lineIn 1.2s ease 8.0s forwards; }
.line:nth-child(7) { animation: lineIn 1s ease 9.4s forwards; }

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

/* Typography */
.title {
    font-family: var(--serif);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

/* Kaksi riviä: "The present" / "doesn't exist." — ei katkeamista rivin sisällä */
.title-row {
    display: block;
    white-space: nowrap;
}

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

.dot-divider {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

.body-text {
    font-family: var(--serif);
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    font-weight: 400;
    line-height: 1.85;
    color: var(--text-dim);
}

.body-text strong {
    color: var(--text);
    font-weight: 500;
}

.body-text em {
    font-style: italic;
    color: var(--text);
}

.vinyl-quote {
    font-family: var(--serif);
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    font-weight: 400;
    line-height: 1.85;
    color: var(--text-dim);
    padding-left: 1.5rem;
    border-left: 2px solid var(--accent-glow);
}

.vinyl-quote strong {
    color: var(--text);
    font-weight: 500;
}

.closing {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2.8vw, 1.65rem);
    font-weight: 400;
    line-height: 1.5;
}

.closing em {
    font-style: italic;
    color: var(--accent);
}

.footer-line {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding-top: 2rem;
    border-top: 1px solid rgba(196, 162, 101, 0.08);
}

.footer-line a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-line a:hover { opacity: 0.6; }

/* Ambient glow — keskellä, palstan takana */
.glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    margin: -250px 0 0 -250px;
    background: radial-gradient(circle, rgba(196, 162, 101, 0.025) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Mobile */
@media (max-width: 768px) {
    .vinyl-container {
        right: -25vw;
        width: 70vmin;
        height: 70vmin;
    }
    .content {
        padding: 8vh 1.5rem;
    }
}

/* Liikettä vähentävä asetus: teksti näkyy heti, levy ja hehku pysyvät paikallaan */
@media (prefers-reduced-motion: reduce) {
    .prompt-overlay { display: none; }
    .line { opacity: 1; transform: none; animation: none !important; }
    .vinyl-container { opacity: 0.15; animation: none; }
    .vinyl-disc, .glow, .prompt-text::after { animation: none; }
}
