:root {
    --psy-bg: #080b12;
    --psy-panel: rgba(11, 16, 28, .82);
    --psy-panel-strong: rgba(12, 17, 29, .96);
    --psy-border: rgba(226, 229, 239, .18);
    --psy-border-soft: rgba(226, 229, 239, .10);
    --psy-ink: #eee9df;
    --psy-muted: #a7aab5;
    --psy-accent: #e7ddcf;
    --psy-shell: 1280px;
    --psy-radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--psy-bg); }
body {
    margin: 0;
    color: var(--psy-ink);
    background: var(--psy-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.psy-shell {
    width: min(calc(100% - 48px), var(--psy-shell));
    margin-inline: auto;
}

.psy-site { min-height: 100vh; overflow: clip; }
.psy-hero {
    position: relative;
    min-height: 790px;
    padding: clamp(80px, 11vh, 132px) 0 46px;
    background: #0a0d15 url('../images/hero-rainy-night.jpg') center center / cover no-repeat;
    isolation: isolate;
}
.psy-hero-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 76% 30%, rgba(72, 73, 118, .08), transparent 36%),
        linear-gradient(180deg, rgba(3, 6, 12, .18), rgba(3, 6, 12, .50) 67%, #080b12 100%);
}
.psy-hero-inner { display: flex; min-height: 660px; flex-direction: column; }
.psy-brand { max-width: 660px; margin-bottom: auto; }
.psy-brand h1 {
    margin: 0;
    color: var(--psy-accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(64px, 7.4vw, 112px);
    font-weight: 400;
    letter-spacing: -.055em;
    line-height: .92;
    text-shadow: 0 8px 42px rgba(0, 0, 0, .44);
}
.psy-star-line { display: flex; align-items: center; width: min(420px, 70%); margin: 34px 0 27px; color: rgba(235, 226, 214, .72); }
.psy-star-line span { height: 1px; flex: 1; background: currentColor; opacity: .48; }
.psy-star-line b { padding: 0 16px; font-size: 20px; font-weight: 400; }
.psy-brand p { margin: 0; color: rgba(235, 232, 229, .80); font-family: Georgia, "Times New Roman", serif; font-size: clamp(16px, 1.45vw, 21px); }

.psy-sound-console,
.psy-social-bar,
.psy-wallpaper-toolbar,
.psy-masonry,
.psy-empty-gallery { width: 100%; }

.psy-sound-console {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .96fr) 56px minmax(0, 1.04fr);
    min-height: 255px;
    margin-top: 56px;
    overflow: hidden;
    border: 1px solid var(--psy-border);
    border-radius: var(--psy-radius);
    background: linear-gradient(135deg, rgba(16, 22, 36, .90), rgba(10, 14, 26, .79));
    box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
    backdrop-filter: blur(22px) saturate(115%);
}
.psy-music-panel,
.psy-noise-panel { min-width: 0; padding: 26px 28px 24px; }
.psy-section-heading { display: flex; flex-direction: column; padding-bottom: 14px; border-bottom: 1px solid var(--psy-border-soft); }
.psy-section-heading > span { font-size: 12px; font-weight: 700; letter-spacing: .2em; }
.psy-section-heading small { margin-top: 3px; color: var(--psy-muted); font-family: Georgia, "Times New Roman", serif; }
.psy-mode-divider { display: flex; align-items: center; justify-content: center; position: relative; }
.psy-mode-divider::before { position: absolute; inset: 26px 50% 26px auto; width: 1px; content: ''; background: var(--psy-border-soft); }
.psy-mode-divider span { position: relative; z-index: 1; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--psy-border); border-radius: 50%; background: #101522; color: var(--psy-muted); font-family: Georgia, serif; }

.psy-music-controls { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 24px; align-items: center; padding-top: 22px; }
.psy-cover { position: relative; display: grid; aspect-ratio: 1; place-items: center; overflow: hidden; border: 1px solid var(--psy-border-soft); border-radius: 14px; background: radial-gradient(circle at 50% 65%, #7a7088 0 2%, transparent 20%), linear-gradient(180deg, #10182c, #252943 55%, #0a0f18); box-shadow: inset 0 0 30px rgba(0, 0, 0, .35); }
.psy-cover::before { position: absolute; inset: 54% 0 0; content: ''; background: linear-gradient(165deg, transparent 45%, rgba(217, 218, 232, .20) 46% 48%, transparent 49%); }
.psy-cover span { position: relative; margin-top: -24px; color: #ddd1c4; font-size: 27px; }
.psy-track { min-width: 0; }
.psy-track-top { display: flex; gap: 16px; align-items: center; }
.psy-play, .psy-icon-button, .psy-mini-button, .psy-restore-music { border: 0; background: none; cursor: pointer; }
.psy-icon-button { padding: 10px 2px; color: #d8d2c8; font-size: 17px; }
.psy-play { display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(232, 225, 215, .38); border-radius: 50%; font-size: 17px; }
.psy-play:hover, .psy-play:focus-visible { border-color: var(--psy-accent); background: rgba(255, 255, 255, .06); }
.psy-track-name { display: flex; min-width: 92px; margin-left: 4px; flex-direction: column; }
.psy-track-name strong { font-family: Georgia, serif; font-weight: 400; }
.psy-track-name span { color: var(--psy-muted); font-size: 12px; }
.psy-track-bottom { display: grid; grid-template-columns: auto minmax(70px, 1fr) auto auto auto; gap: 10px; align-items: center; margin-top: 22px; color: var(--psy-muted); font-size: 11px; }
input[type="range"] { accent-color: #e7ddcf; }
.psy-track-bottom input { width: 100%; height: 3px; }
.psy-mini-button { color: var(--psy-muted); font-size: 18px; }
.psy-mini-button:hover { color: var(--psy-ink); }
.psy-restore-music { display: none; margin: 54px auto 0; padding: 12px 18px; border: 1px solid var(--psy-border); border-radius: 999px; }
.psy-music-panel.is-closed .psy-music-controls, .psy-music-panel.is-closed .psy-section-heading { display: none; }
.psy-music-panel.is-closed .psy-restore-music { display: block; }

.psy-noise-grid { display: grid; grid-template-columns: repeat(6, minmax(48px, 1fr)); gap: 12px; padding-top: 18px; }
.psy-noise-channel { display: flex; min-width: 0; align-items: center; flex-direction: column; gap: 4px; color: #dad7d2; font-size: 11px; text-align: center; }
.psy-noise-icon { height: 25px; color: #d8d2c8; font-size: 23px; line-height: 1; }
.psy-noise-channel input { width: 74px; margin-top: 12px; }
.psy-noise-actions { display: flex; gap: 7px; justify-content: flex-end; margin-top: 16px; }
.psy-noise-actions button { padding: 6px 11px; border: 1px solid var(--psy-border-soft); border-radius: 999px; background: rgba(255, 255, 255, .035); color: var(--psy-muted); cursor: pointer; font-size: 11px; }
.psy-noise-actions button:hover, .psy-noise-actions button.is-active { border-color: rgba(231, 221, 207, .58); color: var(--psy-ink); background: rgba(231, 221, 207, .08); }

.psy-social-bar { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 12px; overflow: hidden; border: 1px solid var(--psy-border); border-radius: 14px; background: rgba(10, 14, 24, .82); backdrop-filter: blur(18px); }
.psy-social-button { display: flex; min-height: 58px; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: background .2s ease, color .2s ease; }
.psy-social-button + .psy-social-button { border-left: 1px solid var(--psy-border-soft); }
.psy-social-button:hover, .psy-social-button:focus-visible { background: rgba(255, 255, 255, .065); color: #fff; }
.psy-social-button.is-unconfigured { color: #777d88; }
.psy-social-icon { display: grid; min-width: 28px; height: 28px; place-items: center; font-family: Georgia, serif; font-size: 21px; }

.psy-wallpapers { min-height: 540px; padding: 58px 0 80px; background: radial-gradient(circle at 50% 0, rgba(49, 57, 84, .20), transparent 48%), #080b12; }
.psy-wallpaper-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.psy-eyebrow { color: #7f8492; font-size: 11px; font-weight: 700; letter-spacing: .18em; }
.psy-wallpaper-toolbar h2 { margin: 7px 0 0; font-family: Georgia, serif; font-size: clamp(30px, 4vw, 48px); font-weight: 400; letter-spacing: -.035em; }
.psy-filters { display: flex; gap: 10px; }
.psy-filters select { min-width: 150px; padding: 11px 38px 11px 16px; border: 1px solid var(--psy-border); border-radius: 999px; color: var(--psy-ink); background: #111622; cursor: pointer; }
.psy-masonry { column-count: 4; column-gap: 14px; }
.psy-wallpaper-card { margin: 0 0 14px; break-inside: avoid; }
.psy-wallpaper-card.is-filtered { display: none; }
.psy-wallpaper-preview { position: relative; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--psy-border-soft); border-radius: 14px; background: #111622; cursor: zoom-in; }
.psy-wallpaper-preview img { width: 100%; height: auto; transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s ease; }
.psy-wallpaper-preview:hover img { transform: scale(1.025); filter: brightness(.72); }
.psy-wallpaper-overlay { position: absolute; inset: auto 0 0; display: flex; padding: 34px 16px 14px; align-items: flex-end; justify-content: space-between; gap: 10px; background: linear-gradient(transparent, rgba(3, 5, 10, .88)); opacity: 0; transition: opacity .25s ease; text-align: left; }
.psy-wallpaper-preview:hover .psy-wallpaper-overlay, .psy-wallpaper-preview:focus-visible .psy-wallpaper-overlay { opacity: 1; }
.psy-wallpaper-overlay b { font-family: Georgia, serif; font-weight: 400; }
.psy-wallpaper-overlay small { color: var(--psy-muted); }
.psy-empty-gallery { display: grid; min-height: 300px; place-items: center; align-content: center; gap: 14px; border: 1px dashed var(--psy-border); border-radius: var(--psy-radius); color: #7f8492; background: rgba(255, 255, 255, .015); }
.psy-empty-gallery span { font-size: 42px; }
.psy-empty-gallery p { margin: 0; font-family: Georgia, serif; font-size: 18px; }
.psy-no-results { text-align: center; color: var(--psy-muted); }

.psy-footer { border-top: 1px solid var(--psy-border-soft); color: #777d88; background: #07090e; font-size: 12px; }
.psy-footer .psy-shell { display: flex; padding: 22px 0; justify-content: space-between; }

.psy-modal { position: fixed; inset: 0; z-index: 100000; display: grid; padding: 24px; place-items: center; background: rgba(2, 4, 9, .72); backdrop-filter: blur(8px); }
.psy-modal-card { position: relative; width: min(360px, calc(100vw - 40px)); padding: 30px 30px 24px; border: 1px solid rgba(232, 225, 215, .23); border-radius: 20px; background: var(--psy-panel-strong); box-shadow: 0 32px 100px rgba(0, 0, 0, .58); text-align: center; }
.psy-modal-card h2 { margin: 0 0 20px; font-family: Georgia, serif; font-size: 26px; font-weight: 400; }
.psy-modal-card p { margin: 16px 0 0; color: var(--psy-muted); font-family: Georgia, serif; }
.psy-modal-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; background: transparent; color: #d6d1ca; cursor: pointer; font-size: 28px; line-height: 1; }
.psy-qr-frame { display: grid; width: min(240px, 70vw); aspect-ratio: 1; margin: auto; padding: 14px; place-items: center; border-radius: 10px; background: #f4f1eb; }
.psy-qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.psy-qr-placeholder { display: grid; width: 100%; height: 100%; place-items: center; border: 3px dashed #111622; color: #111622; font-weight: 800; letter-spacing: .18em; }
body.psy-modal-open { overflow: hidden; }

.psy-wallpaper-modal-card { position: relative; width: min(1120px, calc(100vw - 44px)); max-height: calc(100vh - 44px); overflow: auto; border: 1px solid var(--psy-border); border-radius: var(--psy-radius); background: #0d111b; box-shadow: 0 34px 100px rgba(0, 0, 0, .64); }
.psy-wallpaper-modal-card > img { width: 100%; max-height: calc(100vh - 150px); object-fit: contain; background: #05070b; }
.psy-wallpaper-modal-info { display: flex; min-height: 88px; padding: 16px 24px; align-items: center; justify-content: space-between; gap: 18px; }
.psy-wallpaper-modal-info h2 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.psy-wallpaper-modal-info span { color: var(--psy-muted); font-size: 12px; }
.psy-wallpaper-modal-info a { padding: 10px 18px; border: 1px solid var(--psy-border); border-radius: 999px; text-decoration: none; }

.psy-basic { min-height: 80vh; padding: 120px 0; }
.psy-basic h1 { font-family: Georgia, serif; font-size: 52px; font-weight: 400; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
    .psy-sound-console { grid-template-columns: 1fr; }
    .psy-mode-divider { height: 42px; }
    .psy-mode-divider::before { inset: 50% 26px auto; width: auto; height: 1px; }
    .psy-masonry { column-count: 3; }
}

@media (max-width: 680px) {
    .psy-shell { width: min(calc(100% - 28px), var(--psy-shell)); }
    .psy-hero { min-height: 100svh; padding: 88px 0 26px; background-position: 61% center; }
    .psy-hero-inner { min-height: auto; }
    .psy-brand { margin-bottom: 110px; }
    .psy-brand h1 { font-size: clamp(54px, 17vw, 76px); }
    .psy-star-line { width: 78%; margin: 24px 0 19px; }
    .psy-brand p { max-width: 92%; font-size: 15px; }
    .psy-sound-console { margin-top: 0; border-radius: 17px; }
    .psy-music-panel, .psy-noise-panel { padding: 20px 16px; }
    .psy-music-controls { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
    .psy-track-top { gap: 8px; }
    .psy-play { width: 48px; height: 48px; }
    .psy-icon-button { font-size: 14px; }
    .psy-track-name { display: none; }
    .psy-track-bottom { grid-template-columns: minmax(60px, 1fr) auto auto; }
    .psy-track-bottom > span { display: none; }
    .psy-noise-grid { grid-template-columns: repeat(3, 1fr); row-gap: 20px; }
    .psy-noise-channel input { width: min(82px, 22vw); }
    .psy-noise-actions { flex-wrap: wrap; justify-content: center; }
    .psy-social-bar { grid-template-columns: repeat(5, 1fr); }
    .psy-social-button { min-width: 0; min-height: 62px; flex-direction: column; gap: 2px; font-size: 9px; }
    .psy-social-button + .psy-social-button { border-left-color: rgba(226,229,239,.07); }
    .psy-social-icon { font-size: 19px; }
    .psy-wallpapers { padding: 38px 0 56px; }
    .psy-wallpaper-toolbar { align-items: flex-start; flex-direction: column; }
    .psy-filters { width: 100%; }
    .psy-filters label { flex: 1; }
    .psy-filters select { width: 100%; min-width: 0; }
    .psy-masonry { column-count: 2; column-gap: 10px; }
    .psy-wallpaper-card { margin-bottom: 10px; }
    .psy-wallpaper-preview { border-radius: 10px; }
    .psy-wallpaper-overlay { opacity: 1; padding: 30px 10px 9px; }
    .psy-wallpaper-overlay b { font-size: 12px; }
    .psy-wallpaper-overlay small { display: none; }
    .psy-modal { padding: 14px; }
    .psy-modal-card { width: min(330px, calc(100vw - 28px)); }
    .psy-footer .psy-shell { padding: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
