/* ═══════════════════════════════════════════
   haunt.love — main stylesheet
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

@font-face {
    font-family: 'figure';
    src: url('FigureWriting-V8vl.ttf') format('truetype');
}
@font-face {
    font-family: 'paintblack';
    src: url('Paintblack-nDY4.ttf') format('truetype');
}

/* === RESET === */

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

/* === VARIABLES === */

:root {
    --bg:           #070508;
    --surface:      #0d090c;
    --border:       #1e141a;
    --border-dim:   #281820;
    --border-glow:  #3c2230;
    --text:         #bfadb3;
    --text-dim:     #5c4850;
    --text-muted:   #36242c;
    --accent:       #8c1a33;
    --accent-soft:  #c4647a;
    --accent-pale:  #e8a8b4;
    --title:        #ede0e4;
    --white:        #f5eef0;
}

/* === SCROLLBAR === */

html {
    scrollbar-color: var(--border-glow) var(--bg);
    scrollbar-width: thin;
}
html::-webkit-scrollbar { width: 5px; }
html::-webkit-scrollbar-track { background: var(--bg); }
html::-webkit-scrollbar-thumb { background: var(--border-glow); }

/* === BASE === */

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(7, 5, 8, 0.82) 0%, rgba(7, 5, 8, 0.82) 100%),
        url('background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.78;
    min-height: 100vh;
    cursor: url('cursors/General.cur'), auto;
}

/* === LAYOUT === */

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 62px 28px 150px;
    animation: fadein 0.45s ease both;
}

/* === SITE HEADER === */

.site-header {
    text-align: center;
    margin-bottom: 58px;
}

.site-logo {
    font-family: 'figure';
    color: var(--title);
    text-decoration: none;
    display: block;
    line-height: 1;
    transition: color 0.3s;
}
.site-logo:hover  { color: var(--accent-soft); text-decoration: none; }
.site-logo.hero   { font-size: 90px; letter-spacing: -2px; }
.site-logo.sm     { font-size: 46px; letter-spacing: -1px; }

.site-nav {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.site-nav a {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    padding: 3px 10px;
    font-family: 'Cormorant Garamond', serif;
    transition: color 0.2s;
    cursor: url('cursors/General.cur'), pointer;
}
.site-nav a:hover,
.site-nav a.active { color: var(--accent-soft); text-decoration: none; }
.site-nav .dot {
    color: var(--border-glow);
    font-size: 13px;
    pointer-events: none;
    user-select: none;
}

/* === TYPOGRAPHY === */

h1, h2, h3, h4 {
    font-family: 'figure';
    font-weight: normal;
    color: var(--title);
    line-height: 1.15;
}
h2 { font-size: 44px; margin-bottom: 14px; }
h3 { font-size: 28px; margin-bottom: 10px; }
h4 { font-size: 20px; margin-bottom: 8px; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--accent-soft);
    text-decoration: none;
    cursor: url('cursors/General.cur'), pointer;
    transition: color 0.2s;
}
a:hover {
    color: var(--accent-pale);
    text-decoration: underline;
    text-underline-offset: 3px;
}

em  { font-style: italic; }
strong { color: var(--title); font-weight: 400; }

/* === PAGE HEADING === */

.page-heading {
    font-family: 'figure';
    font-size: 58px;
    color: var(--title);
    font-weight: normal;
    margin-bottom: 4px;
    line-height: 1;
}
.page-sub {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 44px;
}

/* === DECORATIVE DIVIDER === */

.hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 48px 0;
    position: relative;
}
.hr::before {
    content: '✦';
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    color: var(--text-muted);
    padding: 0 12px;
    font-size: 9px;
}

/* === LETTER CARD (homepage) === */

.letter-card {
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    overflow: hidden;
}
.letter-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 30%, var(--accent-soft) 60%, transparent 100%);
    opacity: 0.6;
}
.letter-from {
    padding: 12px 28px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.letter-from span { color: var(--accent-soft); }
.letter-body {
    padding: 28px 28px 32px;
    font-size: 18px;
    line-height: 1.85;
    color: var(--text);
}

/* === GENERAL CARD === */

.card {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-soft) 60%, transparent);
    opacity: 0.5;
}

/* === STICKY DECORATION === */

.sticky-decor {
    position: fixed;
    bottom: 55px;
    right: 22px;
    width: 112px;
    pointer-events: none;
    z-index: 9996;
    opacity: 0.65;
    mix-blend-mode: screen;
}

/* === WEBRING === */

.webring {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    text-align: center;
    padding: 6px 12px 8px;
    background: linear-gradient(transparent, var(--bg) 55%);
    z-index: 9999;
}

/* ═══════════════════════════════════════════
   BLOG
   ═══════════════════════════════════════════ */

.blog-list { list-style: none; }

.blog-post {
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
}
.blog-post:first-child { padding-top: 0; }
.blog-post:last-child  { border-bottom: none; }

.post-date {
    font-size: 11px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 9px;
    display: block;
}
.post-title {
    font-family: 'figure';
    font-size: 36px;
    color: var(--title);
    font-weight: normal;
    margin-bottom: 16px;
    display: block;
    text-decoration: none;
    line-height: 1.1;
    transition: color 0.2s;
}
.post-title:hover { color: var(--accent-soft); text-decoration: none; }

.post-body { color: var(--text); font-size: 17px; line-height: 1.82; }
.post-body p { margin-bottom: 0.9em; }
.post-body p:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════
   MUSIC PLAYER
   ═══════════════════════════════════════════ */

.player-layout {
    display: grid;
    grid-template-columns: 1fr 218px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 580px) {
    .player-layout { grid-template-columns: 1fr; }
}

.player-stage {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 28px;
    position: relative;
}
.player-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-soft), transparent);
    opacity: 0.5;
}

/* Record visual */
.record-wrap {
    width: 172px;
    margin: 0 auto 24px;
    aspect-ratio: 1;
}
.record {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: #0b0710;
    border: 1px solid var(--border-dim);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record.spinning {
    animation: spin 5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.record-grooves {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0,
        transparent 9px,
        rgba(255, 255, 255, 0.016) 9px,
        rgba(255, 255, 255, 0.016) 10px
    );
}
.record-label {
    width: 36%; aspect-ratio: 1;
    border-radius: 50%;
    background: #1a0c14;
    border: 1px solid var(--border-glow);
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1; flex-shrink: 0;
}
.record-label::after {
    content: '';
    width: 22%; aspect-ratio: 1;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border-glow);
}

/* Track info */
.player-info {
    text-align: center;
    margin-bottom: 22px;
}
.player-track-title {
    font-family: 'figure';
    font-size: 28px;
    color: var(--title);
    display: block;
    line-height: 1.1;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-track-artist {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* Progress */
.player-progress-area { margin-bottom: 18px; }
.player-seek {
    width: 100%;
    height: 2px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-dim);
    cursor: pointer;
    display: block;
    margin-bottom: 5px;
    border-radius: 0;
}
.player-seek::-webkit-slider-runnable-track { background: var(--border-dim); height: 2px; }
.player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    background: var(--accent-soft);
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}
.player-seek::-moz-range-thumb {
    width: 10px; height: 10px;
    background: var(--accent-soft);
    border-radius: 50%;
    border: none; cursor: pointer;
}
.player-times {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}

/* Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}
.ctrl-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: url('cursors/General.cur'), pointer;
    font-size: 15px;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.ctrl-btn:hover { color: var(--accent-soft); }
.ctrl-btn.play {
    width: 42px; height: 42px;
    border: 1px solid var(--border-glow);
    background: var(--bg);
    color: var(--title);
    font-size: 13px;
    transition: all 0.2s;
}
.ctrl-btn.play:hover {
    border-color: var(--accent-soft);
    color: var(--accent-soft);
    box-shadow: 0 0 14px rgba(196, 100, 122, 0.1);
}

/* Volume */
.player-vol {
    display: flex;
    align-items: center;
    gap: 9px;
}
.vol-icon { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.vol-slider {
    flex: 1;
    height: 2px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-dim);
    cursor: pointer;
    border-radius: 0;
}
.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px; height: 8px;
    background: var(--text-dim);
    border-radius: 50%;
    cursor: pointer;
}
.vol-slider::-moz-range-thumb {
    width: 8px; height: 8px;
    background: var(--text-dim);
    border-radius: 50%;
    border: none; cursor: pointer;
}

/* Playlist */
.playlist {
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}
.playlist-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.18);
}
.playlist-list {
    list-style: none;
    max-height: 390px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-glow) transparent;
}
.playlist-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.playlist-item:last-child { border-bottom: none; }
.playlist-item:hover  { background: rgba(255, 255, 255, 0.018); }
.playlist-item.active { background: rgba(140, 26, 51, 0.1); }

.playlist-item-num {
    font-size: 10px;
    color: var(--text-muted);
    width: 14px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.playlist-item.active .playlist-item-num { color: var(--accent-soft); }

.playlist-item-info { min-width: 0; }
.playlist-item-title {
    font-size: 13px;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}
.playlist-item.active .playlist-item-title { color: var(--accent-soft); }
.playlist-item-artist {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    font-style: italic;
}

/* ═══════════════════════════════════════════
   PICTURES
   ═══════════════════════════════════════════ */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (max-width: 480px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

.photo-item {
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    cursor: url('cursors/General.cur'), pointer;
    display: flex; align-items: center; justify-content: center;
}
.photo-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease, filter 0.38s ease;
    filter: saturate(0.6) brightness(0.9);
}
.photo-item:hover img {
    transform: scale(1.07);
    filter: saturate(1) brightness(1.02);
}
.photo-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 8px 10px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.72));
    font-size: 12px;
    color: var(--text);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.photo-item:hover .photo-caption { opacity: 1; }
.photo-placeholder {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.5;
    padding: 10px;
    pointer-events: none;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadein 0.18s ease;
    cursor: url('cursors/General.cur'), pointer;
}
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border: 1px solid var(--border-glow);
    display: block;
    cursor: default;
}
.lightbox-close {
    position: fixed;
    top: 18px; right: 22px;
    background: none;
    border: 1px solid var(--border-glow);
    color: var(--text-dim);
    font-size: 16px;
    width: 34px; height: 34px;
    cursor: url('cursors/General.cur'), pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    font-family: inherit;
}
.lightbox-close:hover { color: var(--accent-soft); border-color: var(--accent-soft); }
.lightbox-caption {
    position: fixed;
    bottom: 22px; left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.06em;
    text-align: center;
    pointer-events: none;
}

/* ═══════════════════════════════════════════
   POEMS
   ═══════════════════════════════════════════ */

.poem-list { list-style: none; }

.poem {
    padding: 46px 0;
    border-bottom: 1px solid var(--border);
}
.poem:first-child { padding-top: 0; }
.poem:last-child  { border-bottom: none; }

.poem-title {
    font-family: 'figure';
    font-size: 38px;
    color: var(--title);
    font-weight: normal;
    margin-bottom: 4px;
}
.poem-date {
    font-size: 11px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 26px;
    display: block;
}
.poem-body {
    font-size: 18px;
    line-height: 2.15;
    color: var(--text);
    font-style: italic;
    white-space: pre-line;
}
.poem-body em {
    font-style: normal;
    color: var(--accent-soft);
}

/* ═══════════════════════════════════════════
   PORTFOLIO
   ═══════════════════════════════════════════ */

.portfolio-empty {
    text-align: center;
    padding: 90px 20px;
}
.portfolio-glyph {
    font-family: 'paintblack';
    font-size: 110px;
    color: var(--border-dim);
    display: block;
    margin-bottom: 22px;
    line-height: 1;
}
.portfolio-empty p { color: var(--text-dim); font-style: italic; font-size: 16px; }

/* ═══════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════ */

.links-section     { margin-bottom: 46px; }
.links-section h3  { margin-bottom: 18px; }

.buttons-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.buttons-grid a { display: inline-block; line-height: 0; }
.buttons-grid img {
    width: 88px; height: 31px;
    image-rendering: pixelated;
    filter: saturate(0.8);
    transition: filter 0.2s, transform 0.15s;
}
.buttons-grid img:hover {
    filter: saturate(1.1);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════
   404
   ═══════════════════════════════════════════ */

.notfound {
    text-align: center;
    padding: 70px 20px;
}
.notfound-num {
    font-family: 'paintblack';
    font-size: 140px;
    color: var(--border-dim);
    line-height: 1;
    display: block;
    margin-bottom: 10px;
}
.notfound h2    { font-size: 30px; color: var(--text-dim); margin-bottom: 14px; }
.notfound p     { color: var(--text-dim); }

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes fadein {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 500px) {
    .site-logo.hero { font-size: 62px; }
    .site-logo.sm   { font-size: 36px; }
    .page-heading   { font-size: 46px; }
    .wrap           { padding: 38px 16px 120px; }
    .letter-body, .card { padding: 20px; }
    .player-stage   { padding: 20px; }
}
