/* ==========================================================================
   VidSaver — Material 3 inspired design system
   ========================================================================== */

/* ---------- Tokens ------------------------------------------------------- */
:root {
    color-scheme: light;

    --bg: #ffffff;
    --bg-soft: #f8fafd;
    --surface: #ffffff;
    --surface-2: #f0f4f9;
    --surface-3: #e9eef6;

    --text: #1f1f1f;
    --text-2: #444746;
    --text-3: #5f6368;

    --line: #e3e3e3;
    --outline: #c4c7c5;

    --primary: #0b57d0;
    --primary-hover: #0842a0;
    --on-primary: #ffffff;
    --primary-soft: #d3e3fd;
    --on-primary-soft: #041e49;

    --success: #146c2e;
    --error: #b3261e;
    --error-soft: #fce8e6;

    --grad-a: #0b57d0;
    --grad-b: #6a5cff;
    --grad-c: #00a1e4;

    --shadow-1: 0 1px 2px rgba(60, 64, 67, .10), 0 1px 3px 1px rgba(60, 64, 67, .06);
    --shadow-2: 0 2px 6px 2px rgba(60, 64, 67, .08), 0 1px 2px rgba(60, 64, 67, .12);
    --shadow-3: 0 12px 32px rgba(60, 64, 67, .16);

    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 999px;

    --font: "Google Sans", "Google Sans Text", "Inter", -apple-system, BlinkMacSystemFont,
            "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --appbar-h: 72px;
    --ease: cubic-bezier(.2, 0, 0, 1);
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #131314;
    --bg-soft: #131314;
    --surface: #1e1f20;
    --surface-2: #282a2c;
    --surface-3: #303134;

    --text: #e3e3e3;
    --text-2: #c4c7c5;
    --text-3: #9aa0a6;

    --line: #3c4043;
    --outline: #5f6368;

    --primary: #a8c7fa;
    --primary-hover: #d3e3fd;
    --on-primary: #062e6f;
    --primary-soft: #0842a0;
    --on-primary-soft: #d3e3fd;

    --success: #6dd58c;
    --error: #f2b8b5;
    --error-soft: #3a1a1a;

    --grad-a: #a8c7fa;
    --grad-b: #c5b8ff;
    --grad-c: #6dd3ff;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px 1px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px 2px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-3: 0 12px 32px rgba(0, 0, 0, .55);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        color-scheme: dark;

        --bg: #131314;
        --bg-soft: #131314;
        --surface: #1e1f20;
        --surface-2: #282a2c;
        --surface-3: #303134;

        --text: #e3e3e3;
        --text-2: #c4c7c5;
        --text-3: #9aa0a6;

        --line: #3c4043;
        --outline: #5f6368;

        --primary: #a8c7fa;
        --primary-hover: #d3e3fd;
        --on-primary: #062e6f;
        --primary-soft: #0842a0;
        --on-primary-soft: #d3e3fd;

        --success: #6dd58c;
        --error: #f2b8b5;
        --error-soft: #3a1a1a;

        --grad-a: #a8c7fa;
        --grad-b: #c5b8ff;
        --grad-c: #6dd3ff;

        --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 3px 1px rgba(0, 0, 0, .3);
        --shadow-2: 0 2px 6px 2px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-3: 0 12px 32px rgba(0, 0, 0, .55);
    }
}

/* ---------- Reset & base ------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--appbar-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

button,
a {
    touch-action: manipulation;
}

[hidden] {
    display: none !important;
}

h1, h2, h3, p, ol, ul, figure {
    margin: 0;
}

ol, ul {
    padding: 0;
    list-style: none;
}

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

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

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

button {
    cursor: pointer;
    border: 0;
    background: none;
}

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 6px;
}

::selection {
    background: var(--primary-soft);
    color: var(--on-primary-soft);
}

/* ---------- Utilities ---------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 24px;
}

.container--narrow {
    max-width: 800px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 200;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 600;
    transition: top .2s var(--ease);
}

.skip-link:focus {
    top: 16px;
}

/* ---------- App bar ------------------------------------------------------ */
.appbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--appbar-h);
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--ease), background .25s var(--ease);
}

.appbar.is-scrolled {
    border-bottom-color: var(--line);
}

.appbar__inner {
    height: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -.01em;
    font-size: 18px;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand__name {
    font-size: 18px;
    font-weight: 600;
}

.brand__by {
    margin-top: 2px;
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.brand__mark {
    display: inline-flex;
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 6px rgba(11, 87, 208, .28));
}

.brand__mark--sm {
    width: 26px;
    height: 26px;
    color: var(--primary);
    filter: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.nav__link {
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease);
}

.nav__link:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* More tools ------------------------------------------------------------- */
.nav__more {
    position: static;
}

.nav__more-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--text-2);
    font: inherit;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .18s var(--ease), color .18s var(--ease);
}

.nav__more-trigger:hover,
.nav__more-trigger[aria-expanded="true"] {
    background: var(--surface-2);
    color: var(--text);
}

.nav__chev {
    transition: transform .2s var(--ease);
}

.nav__more-trigger[aria-expanded="true"] .nav__chev {
    transform: rotate(180deg);
}

.nav__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 24px;
    z-index: 120;
    width: min(680px, calc(100vw - 48px));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-3);
    animation: rise .18s var(--ease);
}

.nav__panel[hidden] {
    display: none;
}

.nav__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 4px 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.nav__panel-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.nav__panel-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    transition: background .18s var(--ease);
}

.nav__panel-all:hover {
    background: var(--surface-2);
}

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

.nav__group-title {
    padding: 4px 8px 6px;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav__tool {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px;
    border-radius: var(--radius-xs);
    transition: background .16s var(--ease);
}

.nav__tool:hover {
    background: var(--surface-2);
}

.nav__tool-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav__tool-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav__tool-tag {
    flex: none;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    color: var(--text-3);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.nav__tool-desc {
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--text-3);
}

.appbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu-btn {
    display: none;
}

.menu-btn .icon-close {
    display: none;
}

.menu-btn[aria-expanded="true"] .icon-menu {
    display: none;
}

.menu-btn[aria-expanded="true"] .icon-close {
    display: block;
}

.icon-btn {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-pill);
    color: var(--text-2);
    transition: background .18s var(--ease), color .18s var(--ease);
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.icon-moon {
    display: none;
}

:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .icon-sun { display: none; }
    :root[data-theme="auto"] .icon-moon { display: block; }
}

/* ---------- Hero --------------------------------------------------------- */
.hero {
    position: relative;
    padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px);
    overflow: hidden;
}

.hero__glow {
    position: absolute;
    inset: -20% 0 auto 50%;
    width: min(1100px, 130vw);
    height: 700px;
    transform: translateX(-50%);
    background:
        radial-gradient(closest-side, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
        radial-gradient(closest-side at 30% 30%, color-mix(in srgb, var(--grad-b) 10%, transparent), transparent 70%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
    animation: rise .6s var(--ease) both;
}

.badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34a853;
    box-shadow: 0 0 0 4px rgba(52, 168, 83, .16);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    color: var(--text-3);
    font-size: 13px;
    animation: rise .5s var(--ease) both;
}

.breadcrumbs a {
    color: var(--text-2);
    font-weight: 500;
    transition: color .18s var(--ease);
}

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

.breadcrumbs svg {
    flex: none;
    color: var(--text-3);
}

.breadcrumbs [aria-current="page"] {
    color: var(--text-2);
    font-weight: 500;
}

.display {
    margin-top: 22px;
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -.035em;
    text-wrap: balance;
    animation: rise .7s var(--ease) both;
}

.grad {
    background: linear-gradient(100deg, var(--grad-a) 0%, var(--grad-b) 48%, var(--grad-c) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--grad-a);
}

.lede {
    margin-top: 20px;
    max-width: 600px;
    color: var(--text-2);
    font-size: clamp(1rem, 2.1vw, 1.15rem);
    line-height: 1.6;
    text-wrap: pretty;
    animation: rise .8s var(--ease) both;
}

/* ---------- Fetcher ------------------------------------------------------ */
.fetcher {
    width: 100%;
    max-width: 760px;
    margin-top: 36px;
    animation: rise .9s var(--ease) both;
}

.fetcher__inner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 8px 20px;
    background: var(--surface);
    border: 1px solid var(--outline);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-2);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.fetcher__inner:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent), var(--shadow-2);
}

.fetcher__icon {
    flex: none;
    color: var(--text-3);
    margin-right: 4px;
}

.fetcher input {
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    border: 0;
    background: transparent;
    font-size: 16.5px;
    letter-spacing: -.005em;
}

.fetcher input::placeholder {
    color: var(--text-3);
}

.fetcher input:focus {
    outline: none;
}

.text-btn {
    flex: none;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    transition: background .18s var(--ease);
}

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

.btn--fetch {
    flex: none;
    min-width: 108px;
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease), opacity .18s var(--ease);
    user-select: none;
}

.btn:active {
    transform: scale(.98);
}

.btn--primary {
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-1);
}

.btn--primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-2);
}

.btn--tonal {
    background: var(--surface-2);
    color: var(--text);
}

.btn--tonal:hover {
    background: var(--surface-3);
}

.btn--lg {
    height: 54px;
    padding: 0 30px;
    font-size: 15.5px;
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.is-loading {
    pointer-events: none;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}

.btn.is-loading .spinner {
    display: inline-block;
}

.btn.is-loading .btn__label {
    opacity: .8;
}

/* ---------- Chips -------------------------------------------------------- */
.platforms {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    animation: rise 1s var(--ease) both;
}

.chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease);
}

.chip:hover {
    background: var(--surface-3);
    color: var(--text);
}

.chip--muted {
    background: transparent;
    border-color: var(--line);
    color: var(--text-3);
}

/* ---------- Detected platform -------------------------------------------- */
.detected-wrap {
    display: flex;
    justify-content: center;
    min-height: 30px;
    margin-top: 12px;
}

.detected {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    animation: rise .25s var(--ease) both;
}

.detected__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex: none;
}

/* ---------- Alert -------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 760px;
    margin-top: 22px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: var(--error-soft);
    color: var(--error);
    font-size: 14.5px;
    text-align: left;
    animation: rise .3s var(--ease) both;
}

.alert svg {
    flex: none;
    margin-top: 1px;
}

.alert--info {
    background: var(--surface-2);
    color: var(--text-2);
}

/* ---------- Result card -------------------------------------------------- */
.result {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 28px;
    width: 100%;
    max-width: 860px;
    margin-top: 32px;
    padding: 20px;
    scroll-margin-top: calc(var(--appbar-h) + 20px);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    animation: rise .45s var(--ease) both;
}

.result__media {
    position: relative;
    align-self: start;
}

.result__thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface-2);
}

.result__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .3s var(--ease);
}

.result__thumb.is-broken {
    opacity: 0;
}

.result__duration {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.result__duration:empty {
    display: none;
}

.result__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    scroll-margin-top: calc(var(--appbar-h) + 16px);
}

.result__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--primary-soft);
    color: var(--on-primary-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.tag__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.tag:empty {
    display: none;
}

.result__uploader {
    color: var(--text-3);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.result__title {
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

/* ---------- Select field ------------------------------------------------- */
.field {
    margin-top: 18px;
}

.field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.field__control {
    position: relative;
}

.field__hint {
    margin-top: 8px;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
}

.field__hint strong {
    color: var(--text-2);
    font-weight: 600;
}

.field__warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--warn-container, #fef7e0);
    color: var(--warn-text, #7a5900);
    font-size: 12px;
    line-height: 1.5;
}

.field__warn[hidden] {
    display: none;
}

.field__warn svg {
    flex: none;
    margin-top: 1px;
}

.field__warn strong {
    font-weight: 700;
}

@media (prefers-color-scheme: dark) {
    .field__warn {
        background: #3a2e00;
        color: #ffdf99;
    }
}

:root[data-theme="dark"] .field__warn {
    background: #3a2e00;
    color: #ffdf99;
}

:root[data-theme="light"] .field__warn {
    background: #fef7e0;
    color: #7a5900;
}

.field__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--info-container, #e8f0fe);
    color: var(--info-text, #0b4a8f);
    font-size: 12px;
    line-height: 1.5;
}

.field__note[hidden] {
    display: none;
}

.field__note svg {
    flex: none;
    margin-top: 1px;
}

.field__note strong {
    font-weight: 700;
}

@media (prefers-color-scheme: dark) {
    .field__note {
        background: #0d2c54;
        color: #c2d7ff;
    }
}

:root[data-theme="dark"] .field__note {
    background: #0d2c54;
    color: #c2d7ff;
}

:root[data-theme="light"] .field__note {
    background: #e8f0fe;
    color: #0b4a8f;
}

.field select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 54px;
    padding: 0 46px 0 16px;
    border: 1px solid var(--outline);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.field select:hover {
    background: var(--surface-3);
}

.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.field__chevron {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.field select option,
.field select optgroup {
    background: var(--surface);
    color: var(--text);
}

/* ---------- Result actions ----------------------------------------------- */
.result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.result__actions .btn--primary {
    flex: 1 1 auto;
}

.fineprint {
    margin-top: 14px;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
}

/* ---------- Sections ----------------------------------------------------- */
.section {
    padding: clamp(56px, 8vw, 96px) 0;
}

.section--compact {
    padding: 0 0 clamp(32px, 5vw, 48px);
}

.section--soft {
    background: var(--bg-soft);
    border-block: 1px solid var(--line);
}

.section__head {
    max-width: 680px;
    margin-bottom: clamp(32px, 5vw, 52px);
}

.section__head .headline {
    margin-top: 8px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.headline {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.025em;
    text-wrap: balance;
}

.section__lede {
    margin-top: 14px;
    color: var(--text-2);
    font-size: 1.02rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.prose {
    color: var(--text-2);
    font-size: 1.02rem;
    line-height: 1.75;
    text-wrap: pretty;
}

.prose p + p {
    margin-top: 1em;
}

.prose a:not(.btn) {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.prose a:not(.btn):hover {
    color: var(--primary-hover);
}

/* ---------- Cards -------------------------------------------------------- */
.grid {
    display: grid;
    gap: 18px;
}

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

.card {
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: transparent;
}

.card__icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--on-primary-soft);
}

.card__title {
    font-size: 16.5px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.card__body {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.6;
}

/* ---------- Platform cards ----------------------------------------------- */
.grid--platforms {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.platform-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 132px;
    padding: 22px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.platform-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: transparent;
}

.platform-card__top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.platform-card__dot {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
    background: var(--brand, var(--primary));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand, var(--primary)) 14%, transparent);
}

.platform-card__name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.platform-card__desc {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.55;
}

.platform-card__arrow {
    margin-top: auto;
    align-self: flex-end;
    color: var(--text-3);
    transition: transform .2s var(--ease), color .2s var(--ease);
}

.platform-card:hover .platform-card__arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* ---------- Steps -------------------------------------------------------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    counter-reset: step;
}

.step {
    position: relative;
    padding: 26px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
}

.step__num {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.step__title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.step__body {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.6;
}

/* ---------- FAQ ---------------------------------------------------------- */
.faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.faq__item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}

.faq__item[open] {
    border-color: var(--outline);
    background: var(--surface-2);
}

.faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -.005em;
    list-style: none;
}

.faq__q::-webkit-details-marker {
    display: none;
}

.faq__q svg {
    flex: none;
    color: var(--text-3);
    transition: transform .25s var(--ease);
}

.faq__item[open] .faq__q svg {
    transform: rotate(180deg);
}

.faq__a {
    padding: 0 20px 20px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.7;
    max-width: 68ch;
}

/* ---------- Footer ------------------------------------------------------- */
.footer {
    padding: 48px 0 56px;
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.footer__inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.footer__brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.footer__brand-name {
    font-size: 16px;
    font-weight: 600;
}

.footer__brand-by {
    margin-top: 2px;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: color .18s var(--ease);
}

.footer__brand-by:hover {
    color: var(--primary);
}

.footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
}

.footer__nav a {
    color: var(--text-2);
    font-size: 14px;
    transition: color .18s var(--ease);
}

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

.footer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr 0.8fr 1.4fr;
    gap: 32px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.footer__heading {
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer__list a {
    color: var(--text-3);
    font-size: 14px;
    transition: color .18s var(--ease);
}

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

.footer__note {
    max-width: 70ch;
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.6;
}

.footer__copy {
    color: var(--text-3);
    font-size: 13px;
}

/* ---------- Toast -------------------------------------------------------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 300;
    transform: translate(-50%, 16px);
    padding: 13px 22px;
    border-radius: var(--radius-pill);
    background: var(--text);
    color: var(--bg);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-3);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Animations --------------------------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    to { background-position: 200% 0; }
}

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 980px) {
    .grid--features,
    .grid--platforms {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer__grid > :last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .result {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .result__media {
        max-width: 460px;
    }

    .hero {
        padding-top: clamp(40px, 8vw, 64px);
    }
}

@media (max-width: 900px) {
    .menu-btn {
        display: inline-grid;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 10px 16px 20px;
        max-height: calc(100dvh - var(--appbar-h));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-3);
    }

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

    .nav__link {
        padding: 14px 16px;
        border-radius: var(--radius-sm);
        font-size: 16px;
    }

    .nav__more {
        position: static;
        width: 100%;
    }

    .nav__more-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 14px 16px;
        border-radius: var(--radius-sm);
        font-size: 16px;
    }

    .nav__panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 4px 0 8px;
        padding: 12px;
        border-radius: var(--radius-sm);
        box-shadow: none;
        background: var(--bg-soft);
        animation: none;
    }

    .nav__groups {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nav__tool {
        padding: 11px 12px;
    }

    .nav__tool-name {
        white-space: normal;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 720px) {
    :root {
        --appbar-h: 64px;
    }

    .steps,
    .grid--platforms,
    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__grid {
        gap: 24px;
    }

    .footer__grid > :last-child {
        grid-column: auto;
    }

    .footer__top {
        flex-direction: column;
        align-items: flex-start;
    }

    .icon-btn {
        width: 46px;
        height: 46px;
    }

    .fetcher {
        margin-top: 28px;
    }

    .fetcher__inner {
        flex-wrap: wrap;
        padding: 10px;
        border-radius: 26px;
        gap: 8px;
    }

    .fetcher__icon {
        display: none;
    }

    .fetcher input {
        flex-basis: 100%;
        height: 52px;
        padding-inline: 14px;
        background: var(--surface-2);
        border-radius: 16px;
    }

    #pasteBtn {
        display: none !important;
    }

    .btn--fetch {
        flex-basis: 100%;
        height: 52px;
    }

    .display {
        font-size: clamp(2.15rem, 9.5vw, 3.2rem);
    }

    .result__media {
        max-width: none;
    }

    .section {
        padding: clamp(46px, 8vw, 64px) 0;
    }

    .section__head {
        margin-bottom: 30px;
    }
}

@media (max-width: 560px) {
    .container,
    .appbar__inner {
        padding-inline: 18px;
    }

    .grid--features {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 36px;
        padding-bottom: 40px;
    }

    .badge {
        font-size: 12.5px;
    }

    .lede {
        margin-top: 16px;
        font-size: .98rem;
    }

    .platforms {
        gap: 6px;
        margin-top: 18px;
    }

    .chip {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .footer__nav a,
    .footer__list a {
        display: inline-block;
        padding-block: 4px;
    }

    .result {
        padding: 12px;
        border-radius: 20px;
        gap: 16px;
    }

    .result__thumb-wrap {
        border-radius: 16px;
    }

    .result__title {
        font-size: 1.05rem;
    }

    .result__actions {
        flex-direction: column;
        gap: 8px;
    }

    .result__actions .btn {
        width: 100%;
    }

    .card,
    .step {
        padding: 20px;
    }

    .faq__q {
        padding: 16px 18px;
        font-size: 15px;
    }

    .faq__a {
        padding: 0 18px 18px;
    }

    .display {
        letter-spacing: -.03em;
    }

    .display br {
        display: none;
    }

    .footer {
        padding-bottom: calc(44px + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(20px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 32px);
        text-align: center;
    }
}

@media (max-width: 380px) {
    .container,
    .appbar__inner {
        padding-inline: 16px;
    }

    .display {
        font-size: 2rem;
    }

    .btn {
        padding-inline: 18px;
    }
}

@media (hover: none) {
    .card:hover,
    .platform-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--line);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
