/* =====================================================================
   fd.kk7ma.com — promo site for FD ASSIST
   Organized top-down:
     1. Tokens
     2. Reset + base
     3. Typography
     4. Layout primitives (container, sections, bands)
     5. Components (button, card, badge)
     6. Named sections (hero, why, features, downloads, changelog, footer)
     7. Media queries
   ===================================================================== */

/* ---- 1. Tokens ------------------------------------------------------- */
:root {
    --fd-blue:   #1e4fa8;
    --fd-yellow: #f5c518;
    --fd-cyan:   #4ec9ff;
    --ink:       #0d1b2a;
    --ink-soft:  #3b4a5b;
    --paper:     #f4f7fb;
    --paper-2:   #e8eef6;
    --slate:     #152033;
    --slate-2:   #1c2a42;
    --line:      rgba(13, 27, 42, 0.12);
    --line-dark: rgba(255, 255, 255, 0.10);

    --radius:    10px;
    --radius-lg: 16px;
    --shadow:    0 8px 24px rgba(13, 27, 42, 0.08);
    --shadow-lg: 0 16px 48px rgba(13, 27, 42, 0.18);

    --space-1:   .25rem;
    --space-2:   .5rem;
    --space-3:   .75rem;
    --space-4:   1rem;
    --space-5:   1.5rem;
    --space-6:   2rem;
    --space-7:   3rem;
    --space-8:   4rem;
    --space-9:   6rem;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- 2. Reset + base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--fd-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: color-mix(in srgb, var(--fd-blue) 70%, black); }

:focus-visible {
    outline: 3px solid var(--fd-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- 3. Typography --------------------------------------------------- */
h1, h2, h3, h4 { font-weight: 800; line-height: 1.15; margin: 0 0 var(--space-4); color: inherit; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 var(--space-4); }
code, .mono { font-family: var(--font-mono); }

/* ---- 4. Layout primitives ------------------------------------------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}
.band { padding: var(--space-9) 0; }
.band--dark  { background: var(--slate); color: var(--paper); }
.band--dark h1, .band--dark h2, .band--dark h3 { color: var(--paper); }
.band--dark a { color: var(--fd-cyan); }
.band--light { background: var(--paper); }
.band--paper { background: var(--paper-2); }

/* ---- 5. Components --------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    white-space: nowrap;
    border: 2px solid transparent;
}
.btn--primary {
    background: var(--fd-yellow);
    color: var(--ink);
    box-shadow: var(--shadow);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: var(--ink); }
.btn--ghost {
    background: transparent;
    color: var(--paper);
    border-color: var(--line-dark);
}
.btn--ghost:hover { background: rgba(255,255,255,0.06); color: var(--paper); }

.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border: none;
    border-radius: 999px;
    background: rgba(78, 201, 255, 0.15);
    color: var(--fd-cyan);
    font-family: var(--font-mono);
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .02em;
    cursor: pointer;
}

/* ---- 6. Named sections ---------------------------------------------- */

/* Hero */
.hero {
    position: relative;
    padding: var(--space-9) 0 calc(var(--space-9) + var(--space-6));
    background: var(--slate);
    color: var(--paper);
    isolation: isolate;
    z-index: 5; /* lift hero's stacking context above sibling <section>s so
                   the download dropdown can overflow into them */
}
.hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden; /* keep the grid/radial bg clipped to hero bounds now
                         that .hero no longer clips its own overflow */
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(rgba(78,201,255,0.035) 1px, transparent 1px) 0 0 / 60px 60px,
        linear-gradient(90deg, rgba(78,201,255,0.035) 1px, transparent 1px) 0 0 / 60px 60px,
        radial-gradient(circle at 78% 40%, rgba(78,201,255,0.22), transparent 55%),
        radial-gradient(circle at 15% 90%, rgba(245,197,24,0.08), transparent 60%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
}
.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-7);
    align-items: center;
}
.hero__content {
    max-width: 620px;
    animation: heroFadeUp .7s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--fd-cyan);
    font-family: var(--font-mono);
    font-size: .8125rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: var(--space-5);
    padding: .25rem var(--space-3);
    background: rgba(78,201,255,0.08);
    border: 1px solid rgba(78,201,255,0.2);
    border-radius: 999px;
}
.hero__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fd-cyan);
    box-shadow: 0 0 0 0 rgba(78,201,255,0.6);
    animation: heroPulse 2s ease-in-out infinite;
}
@keyframes heroPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(78,201,255,0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(78,201,255,0); }
}

.wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: .08em;
    font-weight: 900;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: .95;
    letter-spacing: -0.035em;
    margin: 0 0 var(--space-5);
}
.wordmark__fd {
    color: var(--fd-yellow);
    text-shadow: 0 0 40px rgba(245,197,24,0.35);
}
.wordmark__assist { color: var(--paper); }

.hero__tagline {
    font-size: clamp(1.125rem, 1.7vw, 1.375rem);
    color: color-mix(in srgb, var(--paper) 82%, transparent);
    max-width: 580px;
    margin-bottom: var(--space-6);
    line-height: 1.55;
}
.hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

/* Hero download dropdown (<details>-driven; no JS) */
.hero-dl {
    position: relative;
    display: inline-block;
}
.hero-dl__toggle {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.hero-dl__toggle::-webkit-details-marker { display: none; }
.hero-dl__toggle::marker { display: none; }
.hero-dl__chevron {
    transition: transform .2s ease;
    display: inline-block;
    font-size: .8em;
    line-height: 1;
}
.hero-dl[open] .hero-dl__chevron { transform: rotate(180deg); }

.hero-dl__menu {
    position: absolute;
    top: calc(100% + var(--space-3));
    left: 0;
    z-index: 20;
    min-width: 360px;
    padding: var(--space-3);
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.4), 0 8px 20px -8px rgba(0, 0, 0, 0.2);
    animation: hero-dl-pop .18s ease-out;
}
@keyframes hero-dl-pop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-dl__menu::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 28px;
    width: 12px;
    height: 12px;
    background: var(--paper);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    transform: rotate(45deg);
}
.hero-dl__heading {
    padding: var(--space-1) var(--space-3) var(--space-2);
    font-family: var(--font-mono);
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--ink-soft);
}
.hero-dl__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hero-dl__item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background .15s ease, transform .15s ease;
}
.hero-dl__item:hover,
.hero-dl__item:focus-visible {
    background: rgba(245, 197, 24, 0.16);
    outline: none;
    transform: translateX(2px);
}
.hero-dl__item--disabled {
    cursor: not-allowed;
    opacity: .55;
}
.hero-dl__item--disabled:hover {
    background: transparent;
    transform: none;
}
.hero-dl__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(13, 27, 42, 0.06);
    flex-shrink: 0;
}
.hero-dl__icon svg {
    width: 24px;
    height: 24px;
    display: block;
}
.hero-dl__icon--windows { background: rgba(0, 120, 212, 0.12); color: #0078d4; }
.hero-dl__icon--linux   { background: rgba(245, 197, 24, 0.22); color: #7a5d00; }
.hero-dl__icon--mac     { background: rgba(13, 27, 42, 0.08);  color: var(--ink); }
.hero-dl__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.hero-dl__os {
    font-weight: 700;
    font-size: .95rem;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.hero-dl__tag {
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .125rem .375rem;
    border-radius: 4px;
    background: var(--fd-blue);
    color: #fff;
}
.hero-dl__meta {
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: var(--ink-soft);
}
.hero-dl__size {
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.hero-dl__pill {
    font-family: var(--font-mono);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .25rem var(--space-2);
    border-radius: 999px;
    background: rgba(245, 197, 24, 0.22);
    color: #7a5d00;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .hero-dl__menu { min-width: min(92vw, 360px); }
}

.hero__chip-soft {
    opacity: .65;
    font-style: italic;
}

.hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0;
}
.hero__chips li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: .375rem var(--space-3);
    font-family: var(--font-mono);
    font-size: .8125rem;
    color: color-mix(in srgb, var(--paper) 85%, transparent);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.hero__chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fd-cyan);
    box-shadow: 0 0 8px rgba(78,201,255,0.5);
}

.hero__visual {
    justify-self: center;
    width: 100%;
    max-width: 420px;
    display: none;
    color: var(--fd-cyan);
    opacity: .8;
    animation: heroFadeUp .9s cubic-bezier(.2,.7,.2,1) both;
    animation-delay: .15s;
}
.hero__signal { width: 100%; height: auto; display: block; }
.hero__waves circle {
    transform-origin: 200px 280px;
    animation: heroWave 3.2s ease-out infinite;
    opacity: 0;
}
.hero__waves circle:nth-child(1) { animation-delay: 0s; }
.hero__waves circle:nth-child(2) { animation-delay: .8s; }
.hero__waves circle:nth-child(3) { animation-delay: 1.6s; }
.hero__waves circle:nth-child(4) { animation-delay: 2.4s; }
@keyframes heroWave {
    0%   { transform: scale(.55); opacity: 0; stroke-width: 3; }
    15%  { opacity: .9; }
    100% { transform: scale(1.15); opacity: 0; stroke-width: .5; }
}
.hero__beacon {
    animation: heroBeacon 1.8s ease-in-out infinite;
    transform-origin: 200px 78px;
}
@keyframes heroBeacon {
    0%, 100% { opacity: 1; }
    50%      { opacity: .4; }
}

@media (min-width: 880px) {
    .hero__inner {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
        gap: var(--space-8);
    }
    .hero__visual { display: block; }
}

/* Why */
.why__lede { font-size: 1.125rem; max-width: 640px; margin-bottom: var(--space-7); color: var(--ink-soft); }
.why__grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: 1fr;
}
.why__item h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.why__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: var(--fd-blue);
}
.why__item p { margin-top: var(--space-2); color: var(--ink-soft); }

/* Features */
#features h2 { margin-bottom: var(--space-3); }
.features__lede { color: var(--ink-soft); max-width: 640px; margin-bottom: var(--space-8); }
.band--dark .features__lede { color: color-mix(in srgb, var(--paper) 80%, transparent); }

.feature {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    align-items: center;
    margin-bottom: var(--space-9);
}
.feature:last-child { margin-bottom: 0; }
.feature__copy h3 { color: var(--fd-cyan); font-size: .875rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--space-2); }
.band--light .feature__copy h3 { color: var(--fd-blue); }
.feature__copy h4 { font-size: 1.5rem; margin: 0 0 var(--space-3); }
.feature__copy p { color: var(--ink-soft); }
.band--dark .feature__copy p { color: color-mix(in srgb, var(--paper) 80%, transparent); }
.feature__shot {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    background: var(--paper-2);
}
.band--dark .feature__shot { border-color: var(--line-dark); background: var(--slate-2); }

@media (min-width: 880px) {
    .feature { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
    .feature--reverse .feature__copy { order: 2; }
    .feature--reverse .feature__media { order: 1; }
}

/* Downloads */
.downloads__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-top: var(--space-6);
    align-items: stretch;
}
.download-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow);
}
.download-card--primary {
    border-color: var(--fd-yellow);
    border-width: 2px;
    box-shadow: var(--shadow-lg);
}
.download-card--pending { opacity: .92; }

.download-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
}
.download-card__platform {
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: .12em;
}
.download-card__status {
    display: inline-block;
    padding: .125rem var(--space-3);
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    white-space: nowrap;
}
.download-card__status--ready  { background: rgba(30, 79, 168, 0.12);  color: var(--fd-blue); }
.download-card__status--wanted { background: rgba(245, 197, 24, 0.22); color: #7a5d00; }
.download-card__status--dev    { background: rgba(13, 27, 42, 0.08);   color: var(--ink-soft); }

.download-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}
.download-card__specs {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
    font-size: .875rem;
}
.download-card__specs dt {
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: .8125rem;
    white-space: nowrap;
}
.download-card__specs dd {
    margin: 0;
    color: var(--ink);
}
.download-card__note {
    margin: 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    font-size: .875rem;
    color: var(--ink-soft);
}
.download-card__cta {
    margin-top: auto;
    align-self: flex-start;
}
.download-card__variants {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: auto;
}
.download-card__variant {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    line-height: 1.2;
}
/* btn--ghost is designed for the dark hero bg; on the light paper card,
   re-tint it so the outline + text read against --paper. */
.download-card__variant.btn--ghost {
    color: var(--ink);
    border-color: var(--line);
    background: var(--paper);
}
.download-card__variant.btn--ghost:hover {
    background: rgba(13, 27, 42, 0.04);
    color: var(--ink);
    border-color: var(--fd-blue);
}
.download-card__variant-name {
    font-weight: 700;
    font-size: .95rem;
}
.download-card__variant-meta {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 500;
    opacity: .78;
}
.download-card__you {
    color: var(--fd-blue);
    font-weight: 700;
}
.download-card__details {
    margin: 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
    font-size: .875rem;
    color: var(--ink-soft);
}
.download-card__details > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.download-card__details > summary::-webkit-details-marker { display: none; }
.download-card__details > summary::before {
    content: "▸";
    font-size: .75rem;
    color: var(--ink-soft);
    transition: transform .15s ease;
    display: inline-block;
}
.download-card__details[open] > summary::before { transform: rotate(90deg); }
.download-card__details ol {
    padding-left: 1.25rem;
    margin: var(--space-3) 0;
}
.download-card__details ol li { margin-bottom: var(--space-2); }
.download-card__details p { margin: var(--space-3) 0; }
.download-card__details code {
    font-size: .8125rem;
    padding: 0 .25rem;
    background: rgba(13, 27, 42, 0.06);
    border-radius: 3px;
}
.download-card__aside {
    font-size: .8125rem;
    font-style: italic;
    color: var(--ink-soft);
}

@media (min-width: 720px) {
    .downloads__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Changelog per-OS switcher */
.changelog__switcher {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.changelog__tab {
    padding: .35rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink-soft);
    font-size: .8125rem;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: .04em;
    cursor: pointer;
    transition: all .15s ease;
}
.changelog__tab:hover { color: var(--ink); border-color: var(--fd-blue); }
.changelog__tab:focus-visible {
    outline: 2px solid var(--fd-blue);
    outline-offset: 2px;
}
.changelog__tab.is-active {
    background: var(--fd-yellow);
    color: var(--ink);
    border-color: var(--fd-yellow);
    box-shadow: 0 2px 6px rgba(245, 197, 24, 0.3);
}
.changelog__panel { display: none; }
.changelog__panel.is-active { display: block; }
.changelog__panel[hidden] { display: none; }

/* Changelog */
.changelog {
    max-height: 420px;
    overflow-y: auto;
    padding: var(--space-5);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-top: var(--space-5);
}
.changelog-entry:not(:last-child) {
    padding-bottom: var(--space-5);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--line);
}
.changelog-entry h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--fd-blue);
    margin: 0 0 var(--space-3);
}
.changelog-entry ul { margin: 0; padding-left: 1.25rem; }
.changelog-entry li { margin-bottom: var(--space-1); color: var(--ink-soft); }
.changelog-empty { color: var(--ink-soft); font-style: italic; }

/* Footer */
.footer {
    background: var(--slate);
    color: color-mix(in srgb, var(--paper) 75%, transparent);
    padding: var(--space-8) 0;
    font-size: .9375rem;
}
.footer a { color: var(--fd-cyan); }
.footer__grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: 1fr;
}
.footer__sig strong { color: var(--paper); }
.footer__disclaimer {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line-dark);
    font-size: .8125rem;
    color: color-mix(in srgb, var(--paper) 55%, transparent);
}
.footer__copyright {
    margin-top: var(--space-2);
    font-size: .8125rem;
    color: color-mix(in srgb, var(--paper) 55%, transparent);
}

@media (min-width: 720px) {
    .footer__grid { grid-template-columns: 2fr 1fr; }
}

/* ---- 7. Media queries (global overrides) ---------------------------- */

@media (max-width: 720px) {
    .band { padding: var(--space-8) 0; }
    .hero { padding: var(--space-8) 0; }
    .hero__ctas { flex-direction: column; align-items: stretch; }
    .hero__ctas .btn { justify-content: center; }
}

@media (min-width: 880px) {
    .why__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Make images loadable-gracefully before they paint */
img[loading] { background: var(--paper-2); }

/* Scroll-spy active state, if/when a nav gains one */
a.is-active { color: var(--fd-cyan); }
