/* ==========================================================================
   ClearCut — main stylesheet
   1. Tokens  2. Base  3. Layout  4. Typography  5. Buttons & links
   6. Header & navigation  7. Page hero  8. Upload tool  9. Content sections
   10. Cards & blog  11. Article  12. Forms & alerts  13. Footer  14. Utilities
   ========================================================================== */

/* 1. Tokens --------------------------------------------------------------- */
:root {
    /* Brand */
    --c-primary: #0f766e;
    --c-primary-hover: #115e59;
    --c-primary-active: #134e4a;
    --c-primary-soft: #ccfbf1;
    --c-primary-subtle: #f0fdfa;
    --c-accent: #14b8a6;

    /* Neutrals */
    --c-heading: #0f172a;
    --c-text: #334155;
    --c-muted: #475569;
    --c-bg: #f8fafc;
    --c-surface: #ffffff;
    --c-surface-muted: #f1f5f9;
    --c-border: #e2e8f0;
    --c-border-strong: #cbd5e1;
    --c-border-hover: #94a3b8;
    --c-placeholder: #64748b;
    --c-on-primary: #ffffff;

    /* Status */
    --c-success: #15803d;
    --c-success-bg: #f0fdf4;
    --c-success-border: #bbf7d0;
    --c-error: #b91c1c;
    --c-error-bg: #fef2f2;
    --c-error-border: #fecaca;
    --c-error-text: #7f1d1d;
    --c-success-text: #14532d;
    --c-info-bg: #f1f5f9;
    --c-info-border: #cbd5e1;

    /* Footer */
    --c-footer-bg: #0f172a;
    --c-footer-text: #cbd5e1;
    --c-footer-heading: #ffffff;
    --c-footer-border: #1e293b;

    --c-focus: #0f766e;

    /* Type */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
    --fs-h1: clamp(2rem, 1.55rem + 2.2vw, 3rem);
    --fs-h2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --fs-h3: 1.25rem;
    --fs-h4: 1.0625rem;

    /* Space & shape */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;
    --section-y: clamp(3rem, 2rem + 4vw, 5rem);
    --gutter: clamp(1rem, 4vw, 2rem);
    --container: 72rem;
    --container-narrow: 46rem;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
    --shadow: 0 1px 3px rgb(15 23 42 / 0.06), 0 10px 28px -14px rgb(15 23 42 / 0.2);
    --header-h: 4rem;
}

/* 2. Base ----------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.65;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
}

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

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
}

/* 3. Layout --------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
    padding-block: var(--section-y);
}

.section--surface {
    background: var(--c-surface);
    border-block: 1px solid var(--c-border);
}

.section-head {
    max-width: 40rem;
    margin-bottom: clamp(var(--s-5), 4vw, var(--s-7));
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head p {
    margin-top: var(--s-3);
    color: var(--c-muted);
}

.section-foot {
    margin-top: var(--s-6);
}

.section-head--spaced {
    margin-top: var(--section-y);
}

/* Text beside an illustration */
.media-split {
    display: grid;
    gap: var(--s-6);
    align-items: center;
}

@media (min-width: 56em) {
    .media-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--s-7);
    }

    .media-split--reverse .media-split__figure {
        order: -1;
    }
}

.media-split__figure img {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
}

.media-split__figure figcaption {
    margin-top: var(--s-3);
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5) var(--s-7);
}

@media (min-width: 56em) {
    .split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    }
}

/* 4. Typography ----------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    color: var(--c-heading);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

h1 {
    font-size: var(--fs-h1);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }
h5 { font-size: var(--fs-base); font-weight: 600; }

p,
ul,
ol,
figure {
    margin: 0;
}

.lead {
    font-size: var(--fs-lead);
    color: var(--c-muted);
    max-width: 38rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: var(--s-3);
    color: var(--c-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.muted {
    color: var(--c-muted);
}

.small {
    font-size: var(--fs-sm);
}

/* 5. Buttons & links ------------------------------------------------------ */
a {
    color: var(--c-primary);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--c-primary-hover);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 48px;
    padding: 0 var(--s-5);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn .icon {
    width: 1.125em;
    height: 1.125em;
}

.btn--sm {
    min-height: 40px;
    padding: 0 var(--s-4);
    font-size: var(--fs-sm);
}

.btn--block {
    width: 100%;
}

.btn--primary {
    background: var(--c-primary);
    color: var(--c-on-primary);
}

.btn--primary:hover {
    background: var(--c-primary-hover);
    color: var(--c-on-primary);
}

.btn--primary:active {
    background: var(--c-primary-active);
}

.btn--secondary {
    background: var(--c-surface);
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.btn--secondary:hover {
    background: var(--c-primary-subtle);
    color: var(--c-primary-hover);
}

.btn--secondary:active {
    background: var(--c-primary-soft);
}

.btn--ghost {
    background: var(--c-surface);
    border-color: var(--c-border-strong);
    color: var(--c-heading);
}

.btn--ghost:hover {
    background: var(--c-surface-muted);
    color: var(--c-heading);
}

.btn--ghost:active {
    background: var(--c-border);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-weight: 600;
    text-decoration: none;
}

.link-arrow:hover {
    text-decoration: underline;
}

.link-arrow .icon {
    width: 1em;
    height: 1em;
}

/* 6. Header & navigation -------------------------------------------------- */
.skip-link {
    position: absolute;
    top: var(--s-2);
    left: var(--s-2);
    z-index: 200;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-sm);
    background: var(--c-primary);
    color: var(--c-on-primary);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: none;
    color: var(--c-on-primary);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2) var(--s-5);
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--c-heading);
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand:hover {
    color: var(--c-heading);
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    background: var(--c-primary);
    color: var(--c-on-primary);
}

.brand__mark .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-heading);
    cursor: pointer;
}

.nav-toggle:hover {
    background: var(--c-surface-muted);
}

.nav-toggle__bars {
    position: relative;
    width: 18px;
    height: 12px;
}

.nav-toggle__bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 5px; }
.nav-toggle__bars span:nth-child(3) { top: 10px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-4);
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1);
    padding: 0;
    list-style: none;
}

.site-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 var(--s-3);
    border-radius: var(--radius-sm);
    color: var(--c-text);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav__link:hover {
    background: var(--c-surface-muted);
    color: var(--c-heading);
}

.site-nav__link[aria-current],
.site-nav__trigger.is-current {
    color: var(--c-primary);
    font-weight: 600;
}

/* Tools dropdown */
.site-nav__item {
    position: relative;
}

.site-nav__trigger {
    gap: var(--s-1);
    border: 0;
    background: none;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.site-nav__trigger .icon {
    width: 1rem;
    height: 1rem;
    transition: transform 0.15s ease;
}

.site-nav__trigger[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

.site-nav__submenu {
    display: grid;
    gap: 2px;
    padding: 0 0 0 var(--s-3);
    list-style: none;
}

.js .site-nav__submenu {
    display: none;
}

.js .site-nav__trigger[aria-expanded="true"] + .site-nav__submenu {
    display: grid;
}

.site-nav__sublink {
    display: grid;
    gap: 2px;
    padding: var(--s-3);
    border-radius: var(--radius-sm);
    color: var(--c-heading);
    font-weight: 600;
    text-decoration: none;
}

.site-nav__sublink span {
    color: var(--c-muted);
    font-size: var(--fs-sm);
    font-weight: 400;
}

.site-nav__sublink:hover {
    background: var(--c-surface-muted);
    color: var(--c-heading);
}

.site-nav__sublink[aria-current] {
    background: var(--c-primary-subtle);
    color: var(--c-primary-active);
}

@media (min-width: 56em) {
    .js .site-nav__submenu {
        position: absolute;
        top: calc(100% + var(--s-2));
        left: 0;
        z-index: 110;
        width: 18.5rem;
        padding: var(--s-2);
        background: var(--c-surface);
        border: 1px solid var(--c-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
}

/* Mobile: collapsible panel (only when JS is available) */
/* Below 56em (896px) the six navigation items no longer fit beside the logo */
@media (max-width: 55.99em) {
    .js .nav-toggle {
        display: inline-flex;
    }

    .js .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        padding: var(--s-3) var(--gutter) var(--s-5);
        background: var(--c-surface);
        border-bottom: 1px solid var(--c-border);
        box-shadow: 0 18px 24px -18px rgb(15 23 42 / 0.25);
    }

    .js .site-nav.is-open {
        display: flex;
    }

    .js .site-nav__list {
        flex-direction: column;
        gap: 2px;
    }

    .js .site-nav__link {
        min-height: 48px;
        padding: 0 var(--s-3);
    }

    .js .site-nav__link[aria-current] {
        background: var(--c-primary-subtle);
    }

    .js .site-nav__trigger {
        width: 100%;
        justify-content: space-between;
    }

    .js .site-nav__cta {
        min-height: 48px;
        margin-top: var(--s-2);
    }
}

/* Desktop: current page marked with an underline bar */
@media (min-width: 56em) {
    .site-nav__link[aria-current]::after,
    .site-nav__trigger.is-current::after {
        content: "";
        position: absolute;
        left: var(--s-3);
        right: var(--s-3);
        bottom: 2px;
        height: 2px;
        border-radius: 2px;
        background: var(--c-primary);
    }
}

/* 7. Page hero ------------------------------------------------------------ */
.page-hero {
    padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
}

.page-hero .lead {
    margin-top: var(--s-4);
}

.page-hero--home {
    background: linear-gradient(180deg, var(--c-primary-subtle) 0%, var(--c-surface) 70%);
}

.home-hero {
    display: grid;
    gap: var(--s-6);
    align-items: center;
}

@media (min-width: 64em) {
    .home-hero {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: var(--s-7);
    }

    .home-hero h1 {
        font-size: clamp(2.25rem, 1.4rem + 1.5vw, 2.75rem);
    }
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: var(--s-2);
    color: var(--c-border-strong);
}

.breadcrumb a {
    color: var(--c-muted);
}

.breadcrumb a:hover {
    color: var(--c-primary);
}

/* 8. Upload tool ---------------------------------------------------------- */
.tool {
    container-type: inline-size;
    padding: clamp(var(--s-3), 2.5vw, var(--s-5));
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.tool__panel {
    display: none;
}

.tool[data-state="idle"] .tool__panel--idle,
.tool[data-state="loading"] .tool__panel--loading,
.tool[data-state="success"] .tool__panel--success,
.tool[data-state="error"] .tool__panel--error,
.tool[data-state="ready"] .tool__panel--ready,
.tool[data-state="done"] .tool__panel--done {
    display: block;
}

/* Browser-side tools (converter, compressor) */
.tool--wide {
    max-width: none;
}

.local-note {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.local-note .icon {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 2px;
    color: var(--c-primary);
}

.workbench {
    display: grid;
    gap: var(--s-5);
}

@container (min-width: 44rem) {
    .workbench {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: start;
    }
}

.settings {
    display: grid;
    gap: var(--s-5);
    align-content: start;
}

.settings fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.settings legend,
.settings .field > label {
    margin-bottom: var(--s-2);
    padding: 0;
    color: var(--c-heading);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.field__hint {
    color: var(--c-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.choice {
    position: relative;
}

.choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.choice span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-4);
    border: 1.5px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-heading);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice span::before {
    content: "";
    width: 0.875rem;
    height: 0.875rem;
    margin-right: var(--s-2);
    border: 2px solid var(--c-border-hover);
    border-radius: 50%;
}

.choice:hover span {
    border-color: var(--c-primary);
}

.choice input:checked + span {
    border-color: var(--c-primary);
    background: var(--c-primary-subtle);
    color: var(--c-primary-active);
}

.choice input:checked + span::before {
    border-color: var(--c-primary);
    background: radial-gradient(circle, var(--c-primary) 0 45%, transparent 50%);
}

.choice input:focus-visible + span {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

.choice input:disabled + span {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: dashed;
}

.range-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.range-row output {
    min-width: 3.25rem;
    color: var(--c-heading);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

input[type="range"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    margin: 0;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.color-row {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

input[type="color"] {
    width: 3rem;
    height: 44px;
    padding: 4px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    cursor: pointer;
}

.file-info {
    color: var(--c-muted);
    font-size: var(--fs-sm);
    overflow-wrap: anywhere;
}

.target-row {
    display: flex;
    gap: var(--s-2);
}

.target-row input {
    flex: 1 1 auto;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.target-row select {
    flex: 0 0 6rem;
}

.alert > div > * + * {
    margin-top: var(--s-2);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    gap: var(--s-2);
    margin: 0;
}

.stats div {
    padding: var(--s-3);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
}

.stats dt {
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.stats dd {
    margin: 2px 0 0;
    color: var(--c-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stats [data-direction="smaller"] {
    color: var(--c-success);
}

/* Tool cards (homepage, tool pages) */
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    height: 100%;
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover,
.tool-card:focus-within {
    border-color: var(--c-primary);
    box-shadow: var(--shadow);
}

.tool-card .feature__icon {
    margin-bottom: var(--s-2);
}

.tool-card h3 {
    font-size: 1.125rem;
}

.tool-card h3 a {
    color: var(--c-heading);
    text-decoration: none;
}

.tool-card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.tool-card h3 a:focus-visible {
    outline: none;
}

.tool-card h3 a:focus-visible::after {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

.tool-card p {
    color: var(--c-muted);
}

.tool-card__tag {
    align-self: flex-start;
    margin-top: auto;
    padding: 2px var(--s-2);
    border-radius: 999px;
    background: var(--c-surface-muted);
    color: var(--c-text);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.tool-grid {
    display: grid;
    gap: var(--s-4);
    padding: 0;
    list-style: none;
}

@media (min-width: 48em) {
    .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tool__panel > * + * {
    margin-top: var(--s-4);
}

.tool__title {
    font-size: var(--fs-h4);
}

.tool__title:focus {
    outline: none;
}

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    min-height: 18rem;
    padding: var(--s-6) var(--s-4);
    border: 2px dashed var(--c-border-strong);
    border-radius: var(--radius);
    background: var(--c-bg);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-subtle);
}

.dropzone.is-dragover {
    border-style: solid;
    border-color: var(--c-primary);
    background: var(--c-primary-soft);
}

.dropzone:has(input:focus-visible) {
    border-color: var(--c-primary);
    background: var(--c-primary-subtle);
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

.dropzone__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.dropzone__icon {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary-hover);
}

.dropzone__icon .icon {
    width: 1.5rem;
    height: 1.5rem;
}

.dropzone__title {
    color: var(--c-heading);
    font-size: 1.125rem;
    font-weight: 600;
}

.dropzone__or {
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.dropzone__hint {
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.compare {
    display: grid;
    gap: var(--s-4);
}

@container (min-width: 32rem) {
    .compare {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.compare figcaption {
    margin-bottom: var(--s-2);
    color: var(--c-heading);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.preview {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 12rem;
    padding: var(--s-3);
    overflow: hidden;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface-muted);
}

.preview--large {
    min-height: 16rem;
}

.preview img {
    max-height: 22rem;
    width: auto;
    border-radius: 4px;
}

.checkerboard {
    background-color: var(--c-surface);
    background-image: conic-gradient(var(--c-border) 25%, transparent 0 50%, var(--c-border) 0 75%, transparent 0);
    background-size: 18px 18px;
}

.preview__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-3);
    background: rgb(255 255 255 / 0.9);
    color: var(--c-heading);
    font-weight: 600;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--c-primary-soft);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Background Remover: processing state. Stages follow real points in the
   request (sent, response received); the scan line is decorative only. */
.preview--processing img {
    opacity: 0.6;
}

.preview__scan {
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: var(--c-primary);
    box-shadow: 0 0 14px 3px var(--c-primary-soft);
    animation: scan 2.2s ease-in-out infinite alternate;
}

@keyframes scan {
    from { top: 6%; }
    to { top: 94%; }
}

.progress-steps {
    display: grid;
    gap: var(--s-2);
    margin-inline: 0;
    padding: 0;
    list-style: none;
}

.progress-steps__item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--c-muted);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.progress-steps__marker {
    position: relative;
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--c-border-strong);
    border-radius: 50%;
}

.progress-steps__item.is-active {
    border-color: var(--c-primary-soft);
    background: var(--c-primary-subtle);
    color: var(--c-primary-active);
    font-weight: 600;
}

.progress-steps__item.is-active .progress-steps__marker {
    border-color: var(--c-primary-soft);
    border-top-color: var(--c-primary);
    animation: spin 0.9s linear infinite;
}

.progress-steps__item.is-done {
    color: var(--c-heading);
}

.progress-steps__item.is-done .progress-steps__marker {
    border-color: var(--c-primary);
    background: var(--c-primary);
}

.progress-steps__item.is-done .progress-steps__marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 45%;
    width: 0.3rem;
    height: 0.55rem;
    border: solid var(--c-on-primary);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.file-name {
    color: var(--c-muted);
    font-size: var(--fs-sm);
    overflow-wrap: anywhere;
}

.tool__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

.tool__actions .btn {
    flex: 1 1 12rem;
}

/* 9. Content sections ----------------------------------------------------- */
.feature-grid {
    display: grid;
    gap: var(--s-4);
    padding: 0;
    list-style: none;
}

@media (min-width: 36em) {
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
    .feature-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .feature-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.feature {
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.section--surface .feature {
    background: var(--c-bg);
}

.feature__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: var(--s-4);
    border-radius: var(--radius-sm);
    background: var(--c-primary-soft);
    color: var(--c-primary-hover);
}

.feature h3 {
    margin-bottom: var(--s-2);
    font-size: var(--fs-h4);
}

.feature p {
    color: var(--c-muted);
}

/* Phones: icon beside the text keeps single-column cards compact */
@media (max-width: 35.99em) {
    .feature {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--s-4);
        padding: var(--s-4);
    }

    .feature__icon {
        grid-row: span 2;
        margin-bottom: 0;
    }
}

.steps {
    display: grid;
    gap: var(--s-5);
    padding: 0;
    list-style: none;
    counter-reset: step;
}

@media (min-width: 48em) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.step {
    counter-increment: step;
}

.step::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: var(--s-4);
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-on-primary);
    font-weight: 700;
}

.step h3 {
    margin-bottom: var(--s-2);
    font-size: var(--fs-h4);
}

.step p {
    color: var(--c-muted);
}

.faq {
    display: grid;
    gap: var(--s-3);
    max-width: var(--container-narrow);
}

.faq details {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    min-height: 3.5rem;
    padding: var(--s-3) var(--s-5);
    color: var(--c-heading);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid var(--c-muted);
    border-bottom: 2px solid var(--c-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.faq details[open] summary::after {
    transform: rotate(-135deg) translateY(-2px);
}

.faq summary:focus-visible {
    border-radius: var(--radius);
}

.faq details p {
    padding: 0 var(--s-5) var(--s-5);
    color: var(--c-text);
}

.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
    padding: clamp(var(--s-5), 4vw, var(--s-6));
    background: var(--c-primary-subtle);
    border: 1px solid var(--c-primary-soft);
    border-radius: var(--radius-lg);
}

.cta-band h2 {
    font-size: 1.375rem;
}

.cta-band p {
    margin-top: var(--s-2);
    color: var(--c-muted);
}

.cta-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
}

/* 10. Cards & blog -------------------------------------------------------- */
.card {
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.post-grid {
    display: grid;
    gap: var(--s-5);
    padding: 0;
    list-style: none;
}

@media (min-width: 40em) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
    .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    height: 100%;
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
    border-color: var(--c-primary);
    box-shadow: var(--shadow);
}

.post-card:focus-within {
    border-color: var(--c-primary);
}

.post-card__title {
    font-size: 1.1875rem;
    line-height: 1.3;
}

.post-card__title a {
    color: var(--c-heading);
    text-decoration: none;
}

/* Whole card is clickable through the title link */
.post-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.post-card__title a:focus-visible {
    outline: none;
}

.post-card__title a:focus-visible::after {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

.post-card__excerpt {
    color: var(--c-muted);
}

.post-card__more {
    margin-top: auto;
    padding-top: var(--s-2);
    color: var(--c-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-1) var(--s-4);
    color: var(--c-muted);
    font-size: var(--fs-sm);
}

.meta > * {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}

.meta .icon {
    width: 1rem;
    height: 1rem;
}

/* 11. Article ------------------------------------------------------------- */
.article-header .meta {
    margin-top: var(--s-5);
}

.prose {
    color: var(--c-text);
    font-size: 1.0625rem;
    line-height: 1.75;
    overflow-wrap: break-word;
}

.prose > * + * {
    margin-top: 1.25em;
}

.prose h2 {
    margin-top: 2.2em;
    font-size: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
}

.prose h3 {
    margin-top: 1.8em;
    font-size: 1.25rem;
}

.prose h4 {
    margin-top: 1.6em;
    font-size: 1.0625rem;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
    margin-top: 0.6em;
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
}

.prose li + li {
    margin-top: 0.4em;
}

.prose li::marker {
    color: var(--c-primary);
}

.prose strong {
    color: var(--c-heading);
    font-weight: 600;
}

.prose > :first-child {
    margin-top: 0;
}

.prose figure {
    margin-block: 2em;
}

.prose figure img {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
}

.prose figcaption {
    margin-top: 0.6em;
    color: var(--c-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.prose code {
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--c-surface-muted);
    color: var(--c-heading);
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.table-wrap th,
.table-wrap td {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--c-border);
    text-align: left;
    vertical-align: top;
}

.table-wrap thead th {
    background: var(--c-surface-muted);
    color: var(--c-heading);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.table-wrap tbody th {
    color: var(--c-heading);
    font-weight: 600;
}

.table-wrap tbody tr:last-child > * {
    border-bottom: 0;
}

.table-wrap td {
    font-variant-numeric: tabular-nums;
}

/* Keep values like "1200 × 630" on one line (except on the narrowest phones) */
@media (min-width: 24em) {
    .table-wrap td:not(:last-child) {
        white-space: nowrap;
    }
}

@media (max-width: 23.99em) {
    .table-wrap th,
    .table-wrap td {
        padding: var(--s-2) var(--s-3);
    }
}

/* Article components (carried over from the original posts) */
.callout {
    padding: var(--s-5);
    background: var(--c-primary-subtle);
    border: 1px solid var(--c-primary-soft);
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
}

.callout > * + * {
    margin-top: 0.5em;
}

.callout ul {
    margin-top: 0.5em;
}

.callout .callout__title,
.callout h3,
.callout h4 {
    margin-top: 0;
    color: var(--c-primary-active);
    font-size: var(--fs-h4);
}

.card-block {
    padding: var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
}

.card-block > * + * {
    margin-top: 0.75em;
}

.card-block h3,
.card-block h4,
.card-block h5 {
    margin-top: 0;
}

.card-block > h3 {
    font-size: 1.125rem;
}

.card-grid,
.stat-grid,
.spec-grid,
.swatch-grid {
    display: grid;
    gap: var(--s-3);
}

.card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.spec-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.swatch-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }

.card-grid > .card-block {
    margin: 0;
}

.stat {
    padding: var(--s-5) var(--s-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-align: center;
}

.stat__value {
    color: var(--c-primary);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat p:not(.stat__value) {
    margin-top: var(--s-2);
    color: var(--c-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.spec {
    padding: var(--s-3) var(--s-4);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
}

.spec h4,
.spec h5 {
    margin-top: 0;
    font-size: var(--fs-sm);
}

.spec p {
    margin-top: 2px;
    color: var(--c-muted);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.swatch {
    padding: var(--s-4);
    border-radius: var(--radius);
    color: var(--c-on-primary);
    text-align: center;
}

.swatch h3,
.swatch h4 {
    margin: 0;
    color: inherit;
    font-size: var(--fs-h4);
}

.swatch p {
    margin-top: var(--s-1);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.swatch--white { background: var(--c-surface); border: 1px solid var(--c-border-strong); color: var(--c-heading); }
.swatch--black { background: #000; }
.swatch--gray { background: #4b5563; }
.swatch--blue { background: #1d4ed8; }
.swatch--green { background: #047857; }
.swatch--red { background: var(--c-error); }

.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    margin-top: var(--s-7);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-border);
}

.share__label {
    color: var(--c-heading);
    font-weight: 600;
}

.share__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    padding: 0;
    list-style: none;
}

/* 12. Forms & alerts ------------------------------------------------------ */
.form {
    display: grid;
    gap: var(--s-5);
}

.form__row {
    display: grid;
    gap: var(--s-5);
}

@media (min-width: 40em) {
    .form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field {
    display: grid;
    gap: var(--s-2);
}

.field label {
    color: var(--c-heading);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.input {
    width: 100%;
    min-height: 48px;
    padding: var(--s-3) var(--s-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    color: var(--c-heading);
    font-size: var(--fs-base);
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
    color: var(--c-placeholder);
}

.input:hover {
    border-color: var(--c-border-hover);
}

.input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgb(15 118 110 / 0.2);
    outline: none;
}

.input[aria-invalid="true"] {
    border-color: var(--c-error);
}

.input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgb(185 28 28 / 0.18);
}

select.input {
    appearance: none;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.1rem;
}

textarea.input {
    min-height: 9rem;
    resize: vertical;
}

.field__error {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    color: var(--c-error);
    font-size: var(--fs-sm);
    font-weight: 500;
}

.field__error .icon {
    width: 1rem;
    height: 1rem;
}

.alert {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-4);
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    line-height: 1.55;
}

.alert .icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 1px;
}

.alert__title {
    color: inherit;
    font-size: var(--fs-sm);
    font-weight: 700;
}

.alert:focus {
    outline: none;
}

.alert--info {
    background: var(--c-info-bg);
    border-color: var(--c-info-border);
    color: var(--c-heading);
}

.alert--error {
    background: var(--c-error-bg);
    border-color: var(--c-error-border);
    color: var(--c-error-text);
}

.alert--error .icon {
    color: var(--c-error);
}

.alert--success {
    background: var(--c-success-bg);
    border-color: var(--c-success-border);
    color: var(--c-success-text);
}

.alert--success .icon {
    color: var(--c-success);
}

.contact-list {
    display: grid;
    gap: var(--s-5);
    padding: 0;
    list-style: none;
}

.contact-list li {
    display: flex;
    gap: var(--s-4);
}

.contact-list .feature__icon {
    margin: 0;
    flex: none;
}

.contact-list h3 {
    font-size: var(--fs-base);
}

.contact-list p,
.contact-list a {
    overflow-wrap: anywhere;
}

.contact-layout {
    display: grid;
    gap: var(--s-5);
    align-items: start;
}

@media (min-width: 56em) {
    .contact-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
}

.card h2 + .form,
.card h2 + .contact-list {
    margin-top: var(--s-5);
}

/* 13. Footer -------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    padding-block: var(--s-7) var(--s-5);
    background: var(--c-footer-bg);
    color: var(--c-footer-text);
    font-size: var(--fs-sm);
}

.site-footer a {
    color: var(--c-footer-text);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--c-footer-heading);
    text-decoration: underline;
}

.site-footer :focus-visible {
    outline-color: var(--c-accent);
}

.site-footer__grid {
    display: grid;
    gap: var(--s-6);
}

@media (min-width: 36em) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer__about { grid-column: 1 / -1; }
}

@media (min-width: 48em) {
    .site-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
    .site-footer__grid { grid-template-columns: 1.5fr 1fr 1.3fr 0.8fr 0.9fr; }
    .site-footer__about { grid-column: auto; }
}

.site-footer .brand {
    color: var(--c-footer-heading);
}

.site-footer__about p {
    max-width: 22rem;
    margin-top: var(--s-4);
}

.site-footer__heading {
    margin-bottom: var(--s-3);
    color: var(--c-footer-heading);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0;
}

.site-footer__links {
    display: grid;
    gap: var(--s-2);
    padding: 0;
    list-style: none;
}

.site-footer__links a {
    overflow-wrap: anywhere;
}

.site-footer__bottom {
    margin-top: var(--s-6);
    padding-top: var(--s-5);
    border-top: 1px solid var(--c-footer-border);
}

/* 14. Utilities ----------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.stack > * + * {
    margin-top: var(--s-4);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }

    .spinner,
    .progress-steps__item.is-active .progress-steps__marker {
        animation-duration: 2.5s;
    }

    .preview__scan {
        display: none;
    }
}
