:root {
    --bg: #0a0a0a;
    --bg-raised: #111111;
    --bg-card: #141414;
    --bg-highlight: #1a1a1a;
    --text: #e8e4df;
    --text-secondary: #d4d0ca;
    --text-dim: #908a82;
    --text-muted: #6a655e;
    --accent: #e05a30;
    --accent-glow: rgba(224, 90, 48, 0.15);
    --accent-2: #c8a84e;
    --cyan: #5bb8b0;
    --rule: #222;
    --rule-light: #1a1a1a;
    --heading: 'DM Sans', 'Helvetica Neue', sans-serif;
    --body: 'DM Sans', 'Helvetica Neue', sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
    --measure: 52rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: #fff;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ---- NAV ---- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 2rem;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.3s;
}
nav.hidden { transform: translateY(-100%); }
nav a { text-decoration: none; }
.nav-brand { font-weight: 700; }
.nav-brand a { color: var(--text); }
.nav-brand a:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 0.5rem; align-items: center; overflow-x: auto; }
.nav-links a {
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    transition: color 0.15s;
    font-size: 12px;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-sep { color: var(--text-muted); font-size: 10px; }

/* ---- HERO (index) ---- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--rule-light) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule-light) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.hero-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
    position: relative;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s forwards;
}
.hero-label::before,
.hero-label::after {
    content: '//';
    color: var(--text-muted);
    margin: 0 0.75rem;
}
.hero-title {
    font-family: var(--heading);
    font-size: clamp(4rem, 13vw, 11rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 0.5rem;
    position: relative;
    opacity: 0;
    animation: fadeUp 0.6s 0.4s forwards;
}
.hero-title em {
    font-style: italic;
    color: var(--accent);
}
.hero-sub {
    font-family: var(--body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 34rem;
    margin: 1.5rem auto 2.5rem;
    position: relative;
    line-height: 1.65;
    opacity: 0;
    animation: fadeUp 0.6s 0.6s forwards;
}
.hero-stats {
    display: flex;
    gap: 3rem;
    position: relative;
    opacity: 0;
    animation: fadeUp 0.6s 0.8s forwards;
}
.hero-stat { text-align: center; }
.hero-stat-value {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.hero-stat-value span {
    font-size: 0.6em;
    color: var(--text-dim);
}
.hero-stat-label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.35rem;
}
.scroll-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    opacity: 0;
    animation: fadeUp 0.6s 1.2s forwards, scrollPulse 2.5s 1.8s infinite;
}

/* ---- MODULE GRID (index) ---- */
.module-grid-section {
    max-width: 68rem;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}
.grid-label {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.module-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    overflow: hidden;
}
.module-card:hover {
    background: var(--bg-raised);
    text-decoration: none;
}
.module-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: grayscale(20%) brightness(0.9);
    transition: filter 0.3s;
}
.module-card:hover .module-card-img {
    filter: none;
}
.module-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.module-card-rank {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}
.module-card-name {
    font-family: var(--heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.module-card-maker {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.module-card-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
}
.module-card-cat {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan);
}
.module-card-type {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--rule);
}
.module-card-type.analog { color: var(--accent-2); border-color: var(--accent-2); }
.module-card-type.digital { color: var(--cyan); border-color: var(--cyan); }

/* ---- PAGE HEADER (module pages) ---- */
.page-header {
    padding: 7rem 2rem 2.5rem;
    max-width: var(--measure);
    margin: 0 auto;
    border-bottom: 1px solid var(--rule);
}
.section-label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.section-title {
    font-family: var(--heading);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}
.section-maker {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.section-divider {
    width: 40px;
    height: 2px;
    background: var(--accent);
}

/* ---- PAGE IMAGE ---- */
.page-img {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    display: block;
}
.page-img img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

/* ---- SPECS STRIP ---- */
.specs-strip {
    max-width: var(--measure);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--rule);
}
.spec {
    flex: 1 1 auto;
    min-width: 100px;
    padding: 0.85rem 1.5rem;
    border-right: 1px solid var(--rule);
}
.spec:last-child { border-right: none; }
.spec-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.1rem;
}
.spec-value {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

/* ---- MODULE BADGE ---- */
.badge-strip {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.badge-type {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--rule);
}
.badge-type.analog { color: var(--accent-2); border-color: var(--accent-2); }
.badge-type.digital { color: var(--cyan); border-color: var(--cyan); }
.badge-cat {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

/* ---- REVIEW SECTION ---- */
.review-section {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--rule);
}
.review-label {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.25rem;
}
.review-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}
.review-section p:last-child { margin-bottom: 0; }
.review-section p:first-of-type {
    font-size: 1.2rem;
    color: var(--text);
}

/* ---- FEATURES SECTION ---- */
.features-section {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--rule);
}
.features-label {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 1.25rem;
}
.feature-list {
    list-style: none;
}
.feature-list li {
    position: relative;
    padding: 0.75rem 0 0.75rem 1.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-bottom: 1px solid var(--rule-light);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1rem;
    width: 8px;
    height: 1px;
    background: var(--accent);
}

/* ---- TECH NOTE ---- */
.tech-section {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2rem;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}
.tech-icon {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 0.25rem 0.6rem;
    flex-shrink: 0;
    letter-spacing: 0.1em;
    margin-top: 0.15rem;
}
.tech-text {
    font-family: var(--body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-dim);
}

/* ---- PREV/NEXT NAV ---- */
.page-nav {
    max-width: var(--measure);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--rule);
}
.page-nav a {
    display: block;
    padding: 1.5rem 2rem;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}
.page-nav a:hover {
    background: var(--bg-raised);
    text-decoration: none;
}
.page-nav a:first-child {
    border-right: 1px solid var(--rule);
}
.page-nav-label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}
.page-nav-title {
    font-family: var(--heading);
    font-size: 1.1rem;
    font-weight: 700;
}
.page-nav .next { text-align: right; }

/* ---- FOOTER ---- */
footer {
    border-top: 1px solid var(--rule);
    padding: 4rem 2rem;
    text-align: center;
}
.footer-mark {
    font-family: var(--heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.footer-mark em { color: var(--accent); font-style: italic; }
footer p {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    line-height: 1.8;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.7; }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .specs-strip { flex-direction: column; }
    .spec { border-right: none; border-bottom: 1px solid var(--rule); }
    .spec:last-child { border-bottom: none; }
    .hero-stats { gap: 1.5rem; }
    .hero-stat-value { font-size: 1.4rem; }
    .page-nav { grid-template-columns: 1fr; }
    .page-nav a:first-child { border-right: none; border-bottom: 1px solid var(--rule); }
    .nav-links { display: none; }
    nav { padding: 0 1.25rem; }
    .page-img img { height: 260px; }
    .module-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 500px) {
    .hero-stats { flex-direction: column; gap: 1rem; }
    .module-grid { grid-template-columns: 1fr; }
    .page-header { padding: 6rem 1.25rem 2rem; }
    .review-section, .features-section { padding: 2.5rem 1.25rem; }
    .tech-section { padding: 1.5rem 1.25rem; }
    .page-nav a { padding: 1.25rem; }
    .badge-strip { padding: 0.75rem 1.25rem; }
}
