@import url("assets/fonts/inter.css");

:root {
    --page-bg: #060806;
    --surface: #101510;
    --surface-strong: #171f18;
    --surface-soft: #202820;
    --line: #2f3a31;
    --line-strong: #526256;
    --text: #f5f7ef;
    --muted: #a9b4aa;
    --quiet: #7f8b82;
    --accent: #62f0d1;
    --accent-ink: #06110e;
    --amber: #ffb454;
    --coral: #ff7768;
    --green: #9ee37d;
    --container: 1180px;
    --header-height: 72px;
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
    scroll-behavior: smooth;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--text);
    background:
        linear-gradient(90deg, rgba(98, 240, 209, 0.06) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 180, 84, 0.05) 1px, transparent 1px),
        var(--page-bg);
    background-size: 56px 56px;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.shell {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--header-height);
    border-bottom: 1px solid rgba(245, 247, 239, 0.08);
    background: rgba(6, 8, 6, 0.88);
    backdrop-filter: blur(18px);
}

.nav-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 26px;
    min-height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(98, 240, 209, 0.55);
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--green));
    color: var(--accent-ink);
    box-shadow: 0 14px 34px rgba(98, 240, 209, 0.18);
}

.brand-text {
    display: grid;
    line-height: 1.05;
}

.brand-text span:first-child {
    font-size: 1rem;
}

.brand-text span:last-child {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-nav a,
.footer-links a,
.legal-links a {
    color: var(--muted);
}

.primary-nav a {
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 9px 14px;
    font-size: 0.9rem;
    font-weight: 800;
}

.primary-nav a:hover,
.primary-nav a.is-active {
    border-color: rgba(98, 240, 209, 0.28);
    background: rgba(98, 240, 209, 0.08);
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
}

.tool-toggle,
.mobile-toggle,
.ghost-button,
.solid-button,
.clear-button,
.restart-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    background: var(--surface);
    color: var(--text);
    font-weight: 900;
}

.tool-toggle,
.solid-button,
.restart-button {
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-ink);
}

.ghost-button:hover,
.clear-button:hover,
.mobile-toggle:hover,
.tool-toggle:hover,
.solid-button:hover,
.restart-button:hover {
    transform: translateY(-1px);
}

.mobile-toggle {
    display: none;
    width: 44px;
    padding: 0;
}

.tool-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(84vw, 340px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d120e;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.tool-popover.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tool-menu {
    display: grid;
    gap: 6px;
    max-height: 68vh;
    overflow: auto;
    padding: 10px;
}

.tool-menu a,
.tool-card,
.metric-tile,
.info-card,
.article-tile,
.faq-item,
.table-wrap,
.notice-box {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(16, 21, 16, 0.9);
}

.tool-menu a {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    padding: 9px;
    color: var(--muted);
    font-weight: 800;
}

.tool-menu a:hover {
    border-color: rgba(98, 240, 209, 0.4);
    color: var(--text);
}

.tool-menu img,
.tool-card img,
.mini-tool img {
    width: 24px;
    height: 24px;
    filter: brightness(0) saturate(100%) invert(90%) sepia(31%) saturate(888%) hue-rotate(102deg) brightness(99%) contrast(93%);
}

.page-main {
    min-height: 70vh;
}

.hero-band,
.section-band,
.test-band,
.article-hero {
    border-bottom: 1px solid rgba(245, 247, 239, 0.08);
}

.hero-band {
    padding: 70px 0 44px;
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
    gap: 36px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--amber);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    max-width: 780px;
    font-size: 3.7rem;
    line-height: 1.04;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 14px;
    font-size: 2rem;
    line-height: 1.18;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 8px;
    font-size: 1.15rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.lede {
    max-width: 650px;
    color: var(--muted);
    font-size: 1.06rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.hero-console,
.trainer-board {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(32, 40, 32, 0.94), rgba(12, 17, 13, 0.94));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.hero-console {
    padding: 18px;
}

.console-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--quiet);
    font-size: 0.82rem;
    font-weight: 800;
}

.console-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.console-cell {
    min-height: 88px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(6, 8, 6, 0.46);
}

.console-cell strong {
    display: block;
    color: var(--accent);
    font-size: 1.6rem;
    line-height: 1;
}

.console-cell span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.pulse-strip {
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    gap: 5px;
    margin-top: 16px;
}

.pulse-strip i {
    height: 44px;
    border-radius: 4px;
    background: var(--line);
}

.pulse-strip i:nth-child(3n) {
    background: var(--accent);
}

.pulse-strip i:nth-child(4n) {
    background: var(--amber);
}

.pulse-strip i:nth-child(5n) {
    background: var(--coral);
}

.section-band {
    padding: 58px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.section-head p {
    max-width: 560px;
    color: var(--muted);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tool-card,
.mini-tool,
.article-tile {
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tool-card {
    display: grid;
    gap: 14px;
    min-height: 190px;
    padding: 18px;
}

.tool-card:hover,
.mini-tool:hover,
.article-tile:hover {
    border-color: rgba(98, 240, 209, 0.42);
    background: var(--surface-strong);
    transform: translateY(-2px);
}

.tool-card .tool-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(98, 240, 209, 0.35);
    border-radius: var(--radius);
    background: rgba(98, 240, 209, 0.08);
}

.tool-card p,
.article-tile p,
.info-card p,
.faq-item p,
.copy-block p,
.legal-copy p,
.legal-copy li {
    color: var(--muted);
}

.tool-link {
    align-self: end;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 900;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.info-card {
    overflow: hidden;
}

.info-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    padding: 18px;
    background: #0c110d;
}

.info-card .copy {
    padding: 18px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrap {
    overflow-x: auto;
}

.comparison-table th,
.comparison-table td {
    min-width: 160px;
    border-bottom: 1px solid var(--line);
    padding: 15px 16px;
    text-align: left;
    vertical-align: top;
}

.comparison-table th {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.comparison-table tr:last-child td {
    border-bottom: 0;
}

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-item {
    padding: 16px 18px;
}

.faq-item summary {
    color: var(--text);
    cursor: pointer;
    font-weight: 900;
}

.mini-tool-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.mini-tool {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: rgba(16, 21, 16, 0.86);
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 900;
}

.test-band {
    padding: 52px 0;
}

.test-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.18fr);
    gap: 30px;
    align-items: start;
}

.test-intro {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.test-intro ul,
.legal-copy ul {
    margin: 18px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.trainer-board {
    padding: 18px;
}

.meter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.metric-tile {
    padding: 14px;
}

.metric-label {
    display: block;
    color: var(--quiet);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.target-pad {
    display: grid;
    min-height: 330px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(98, 240, 209, 0.08), transparent 45%),
        linear-gradient(315deg, rgba(255, 180, 84, 0.12), transparent 46%),
        #080c09;
    color: var(--text);
    text-align: center;
    user-select: none;
    touch-action: manipulation;
}

.target-pad.is-hot {
    border-color: var(--accent);
    transform: scale(0.995);
}

.target-inner {
    display: grid;
    gap: 10px;
    place-items: center;
    padding: 24px;
}

.target-icon {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border: 1px solid rgba(98, 240, 209, 0.45);
    border-radius: var(--radius);
    background: rgba(98, 240, 209, 0.1);
}

.target-icon img {
    width: 34px;
    height: 34px;
    filter: brightness(0) saturate(100%) invert(90%) sepia(31%) saturate(888%) hue-rotate(102deg) brightness(99%) contrast(93%);
}

.target-kicker {
    color: var(--muted);
    font-weight: 800;
}

.target-command {
    color: var(--accent);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.duration-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.duration-choice {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0b100c;
    color: var(--muted);
    font-weight: 900;
}

.duration-choice.is-selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.history-panel {
    margin-top: 18px;
}

.history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
}

.history-table th {
    color: var(--quiet);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.history-empty {
    color: var(--muted);
    font-size: 0.92rem;
}

.copy-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 30px;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.article-tile {
    padding: 18px;
}

.article-hero {
    padding: 64px 0 38px;
}

.legal-copy {
    max-width: 860px;
    padding: 42px 0 70px;
}

.legal-copy h2 {
    margin-top: 34px;
    font-size: 1.35rem;
}

.notice-box {
    margin-top: 24px;
    padding: 18px;
    border-color: rgba(255, 180, 84, 0.35);
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid rgba(245, 247, 239, 0.08);
    background: #080b08;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 0.9fr;
    gap: 24px;
    padding: 34px 0;
}

.footer-links,
.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.footer-links {
    flex-direction: column;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(245, 247, 239, 0.08);
    padding: 18px 0;
    color: var(--quiet);
    font-size: 0.86rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 1040px) {
    .hero-layout,
    .test-layout,
    .copy-grid {
        grid-template-columns: 1fr;
    }

    .test-intro {
        position: static;
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mini-tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .info-grid,
    .article-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 24px, var(--container));
    }

    .nav-row {
        grid-template-columns: 1fr auto auto;
        gap: 10px;
    }

    .primary-nav {
        position: fixed;
        inset: var(--header-height) 0 auto 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid var(--line);
        background: #080b08;
        padding: 12px;
    }

    body.menu-open .primary-nav {
        display: flex;
    }

    .mobile-toggle {
        display: inline-grid;
        place-items: center;
    }

    .brand-text span:last-child {
        display: none;
    }

    .hero-band,
    .section-band,
    .test-band,
    .article-hero {
        padding: 38px 0;
    }

    h1 {
        font-size: 2.45rem;
    }

    h2 {
        font-size: 1.55rem;
    }

    .section-head,
    .footer-bottom {
        display: block;
    }

    .console-grid,
    .meter-grid,
    .duration-row,
    .tool-grid,
    .mini-tool-grid {
        grid-template-columns: 1fr;
    }

    .target-pad {
        min-height: 280px;
    }
}
