@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --outer-bg: #aeaba4;
    --page-bg: #f3f0e8;
    --ink: #1a1917;
    --ink-muted: #5c5a56;
    --ink-faint: #9a978f;
    --rule: #cac6bc;
    --link: #0000cc;
    --link-visited: #551a8b;
    --header-bg: #0b1f1f;
    --header-ink: #00e87a;
    --header-glow: rgba(0, 232, 122, 0.5);
    --header-dim: rgba(0, 232, 122, 0.38);
    --accent: #005c3d;
    --tag-bg: transparent;
    --tag-color: #005c3d;
    --card-shadow: #1a1917;
    --stamp-rule: #b8b4aa;
    --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo,
        "Yu Gothic", system-ui, sans-serif;
    --font-pixel: "VT323", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --outer-bg: #080807;
        --page-bg: #0e0d0b;
        --ink: #ccc8bf;
        --ink-muted: #888480;
        --ink-faint: #504e4a;
        --rule: #232220;
        --link: #6699ff;
        --link-visited: #bb88ff;
        --header-bg: #060e0e;
        --header-ink: #00ff88;
        --header-glow: rgba(0, 255, 136, 0.6);
        --header-dim: rgba(0, 255, 136, 0.38);
        --accent: #00bb60;
        --tag-color: #00aa55;
        --card-shadow: #00aa55;
        --stamp-rule: #2e2c28;
    }
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ── Page frame ── */
html {
    background: var(--outer-bg);
    min-height: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font);
    line-height: 1.75;
    color: var(--ink);
    background: var(--page-bg);
    margin: 0 auto;
    max-width: 680px;
    min-height: 100vh;
    border-left: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    position: relative;
}

/* Grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)' opacity='0.055'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
}

a {
    color: var(--link);
    text-underline-offset: 3px;
}
a:visited {
    color: var(--link-visited);
}

/* ── Header ── */
.site-header {
    background: var(--header-bg);
    padding: 2rem 2rem 1.9rem;
    position: relative;
    overflow: hidden;
}

/* CRT scanlines */
.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.2) 2px,
        rgba(0, 0, 0, 0.2) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* CRT vignette */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 40%,
        transparent 55%,
        rgba(0, 0, 0, 0.5) 100%
    );
    pointer-events: none;
    z-index: 2;
}

.site-header .inner {
    position: relative;
    z-index: 3;
}

.site-name {
    font-family: var(--font-pixel);
    font-size: 2.4rem;
    font-weight: normal;
    letter-spacing: 0.04em;
    color: var(--header-ink);
    text-shadow:
        0 0 6px var(--header-glow),
        0 0 20px var(--header-glow),
        0 0 45px rgba(0, 232, 122, 0.18);
    text-decoration: none;
    display: block;
    margin: 0 0 0.5rem;
    line-height: 1;
    transition: text-shadow 0.2s ease;
}
.site-name::before {
    content: "> ";
    color: var(--header-dim);
    text-shadow: none;
}
.site-name:visited {
    color: var(--header-ink);
}
.site-name:hover {
    text-shadow:
        0 0 8px var(--header-glow),
        0 0 30px var(--header-glow),
        0 0 70px rgba(0, 232, 122, 0.25);
}

.site-tagline {
    margin: 0;
    font-family: var(--font-pixel);
    font-size: 1.15rem;
    color: var(--header-dim);
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    animation: blink 1.1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 0.85; }
    50%       { opacity: 0; }
}

/* ── Main ── */
main {
    padding: 2.25rem 2rem 4rem;
}

.section {
    margin-bottom: 2.5rem;
}

/* Section label — ASCII bracket style */
.section-label {
    font-family: var(--font-pixel);
    font-size: 1.3rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 1.25rem;
    padding: 0.35rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 0.35em;
}
.section-label::before {
    content: "──[";
    opacity: 0.45;
    letter-spacing: 0;
    flex-shrink: 0;
}
.section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
    margin-left: 0.2em;
}

/* ── Product list ── */
.product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.product-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0.35rem 1.1rem;
    padding: 1rem 1.1rem;
    border: 2px solid var(--ink);
    box-shadow: 5px 5px 0 var(--card-shadow);
    background: var(--page-bg);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    position: relative;
}
.product-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--card-shadow);
}

.product-item > a {
    font-size: 0.97rem;
    font-weight: bold;
    line-height: 1.4;
}

.product-desc {
    grid-column: 1 / -1;
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--ink-muted);
    line-height: 1.65;
}

.product-tags {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-top: 0.1rem;
}
.tag {
    font-family: var(--font-pixel);
    font-size: 0.95rem;
    color: var(--tag-color);
    border: 1px solid currentColor;
    padding: 0 0.45em;
    line-height: 1.5;
    letter-spacing: 0.03em;
}
.tag + .tag {
    margin-left: 0.4em;
}

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--stamp-rule);
    padding: 1rem 2rem 1.1rem;
    font-family: var(--font-pixel);
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    position: relative;
}
/* Double rule at top — stamp effect */
.site-footer::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 2rem;
    right: 2rem;
    height: 1px;
    background: var(--stamp-rule);
    opacity: 0.5;
}
.site-footer a {
    font-family: var(--font-pixel);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

/* ── Mobile ── */
@media (max-width: 540px) {
    body {
        border-left: none;
        border-right: none;
    }
    .product-item {
        grid-template-columns: 1fr;
    }
    .product-tags {
        justify-content: flex-start;
    }
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .section-label::after {
        display: none;
    }
}
