/* ==========================================================================
   Local Fonts: IBM Plex Mono (Weights: 400, 600, 700)
   ========================================================================== */
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl1FgtIU.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlRFgtIU.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl9FgtIU.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3vAOwl5FgtIU.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3vAOwlBFgg.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3pQPwl1FgtIU.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3pQPwlRFgtIU.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3pQPwl9FgtIU.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3pQPwl5FgtIU.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/-F6qfjptAgt5VM-kVkqdyU8n3pQPwlBFgg.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Zex Commander — Website Styles
   Color palette derived from the TUI application (styles.go)
   ========================================================================== */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
    /* Core palette — matches TUI app */
    --color-bg:              #1c1c1c;
    --color-bg-card:         #252525;
    --color-bg-card-hover:   #303030;
    --color-selection:       #303030;
    --color-border:          #585858;
    --color-accent:          #ffaf00;
    --color-accent-dim:      #cc8c00;
    --color-text-primary:    #d0d0d0;
    --color-text-bright:     #ffffff;
    --color-text-secondary:  #585858;
    --color-link-hover:      #ffd966;
    --color-green:           #00ff00;
    --color-cyan:            #00ffff;

    /* Typography */
    --font-mono: "IBM Plex Mono", "Cascadia Mono", "Fira Mono", "Consolas",
                 "Liberation Mono", "Courier New", monospace;

    /* Spacing scale */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Layout */
    --max-width: 860px;
    --border-radius: 4px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-mono);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
    color: var(--color-link-hover);
}

/* ---------- Utility: Container ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--space-lg);
}

/* ---------- Scanline overlay (subtle retro CRT feel) ---------- */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 2px,
        rgba(0, 0, 0, 0.06) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* ---------- Header ---------- */
.site-header {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-xl);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.site-header__logo-wrapper {
    display: inline-block;
    margin-bottom: var(--space-lg);
}

.site-header__logo {
    width: 200px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 18px rgba(255, 175, 0, 0.25));
    transition: filter 0.3s ease;
}

.site-header__logo:hover {
    filter: drop-shadow(0 0 28px rgba(255, 175, 0, 0.45));
}

.site-header__title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    margin-bottom: var(--space-xs);
}

.site-header__version {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-bg);
    background: var(--color-accent);
    padding: 0.1em 0.55em;
    border-radius: var(--border-radius);
    vertical-align: middle;
    margin-left: var(--space-sm);
    font-weight: 600;
}

.site-header__tagline {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-inline: auto;
    margin-top: var(--space-sm);
}

/* ---------- Section (generic) ---------- */
.section {
    padding-block: var(--space-2xl);
}

.section + .section {
    border-top: 1px solid var(--color-border);
}

.section__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-left: var(--space-md);
}

.section__title::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--color-green);
    animation: blink-cursor 1.2s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* ---------- Features grid ---------- */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.feature-card:hover {
    border-color: var(--color-accent);
    background-color: var(--color-bg-card-hover);
}

.feature-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-bright);
    margin-bottom: var(--space-xs);
}

.feature-card__desc {
    font-size: 0.85rem;
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* ---------- Formats badge list ---------- */
.formats-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    list-style: none;
    margin-top: var(--space-md);
}

.formats-list__item {
    display: inline-block;
    padding: 0.2em 0.7em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-bg);
    background: var(--color-accent);
    border-radius: var(--border-radius);
    letter-spacing: 0.05em;
}

/* ---------- Downloads section ---------- */
.download-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.download-card__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.download-card__version {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-bright);
}

.download-card__date {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.download-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    list-style: none;
    margin-bottom: var(--space-lg);
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.45em 1em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-bg);
    background: var(--color-accent);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-accent);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.download-link:hover,
.download-link:focus-visible {
    background: transparent;
    color: var(--color-accent);
    transform: translateY(-1px);
}

.download-link__icon {
    font-size: 1em;
}

.download-card__changelog-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

.download-card__changelog {
    list-style: none;
    padding: 0;
}

.download-card__changelog li {
    position: relative;
    padding-left: var(--space-lg);
    font-size: 0.85rem;
    color: var(--color-text-primary);
    line-height: 1.7;
}

.download-card__changelog li::before {
    content: "•";
    position: absolute;
    left: var(--space-sm);
    color: var(--color-accent);
    font-weight: 700;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding-block: var(--space-xl);
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.site-footer a {
    color: var(--color-text-secondary);
    border-bottom: 1px dashed var(--color-text-secondary);
}

.site-footer a:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ---------- Responsive: ≥ 640px ---------- */
@media (min-width: 640px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-header__logo {
        width: 240px;
    }

    .site-header__title {
        font-size: 2.4rem;
    }
}

/* ---------- Responsive: ≥ 960px ---------- */
@media (min-width: 960px) {
    .features {
        grid-template-columns: repeat(3, 1fr);
    }

    .site-header__logo {
        width: 280px;
    }
}

/* ---------- Focus-visible for keyboard nav ---------- */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ---------- Selection color ---------- */
::selection {
    background: var(--color-accent);
    color: var(--color-bg);
}
