:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-top: #081424;
    --bg-bottom: #050b14;
    --bg-secondary: rgba(7, 17, 31, 0.72);
    --panel: rgba(13, 25, 43, 0.78);
    --panel-strong: rgba(16, 31, 52, 0.96);
    --panel-soft: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #edf4ff;
    --muted: #99a8c4;
    --title: #ffffff;
    --primary: #63e6be;
    --primary-strong: #29c98a;
    --accent: #7cc7ff;
    --accent-soft: rgba(124, 199, 255, 0.18);
    --warning: #ffcf7d;
    --shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --container: 1240px;
    --transition: 180ms ease;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #eef3fb;
    --bg-top: #ffffff;
    --bg-bottom: #dfe9f7;
    --bg-secondary: rgba(255, 255, 255, 0.7);
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --panel-soft: rgba(15, 34, 55, 0.05);
    --border: rgba(15, 34, 55, 0.1);
    --border-strong: rgba(15, 34, 55, 0.15);
    --text: #19314d;
    --muted: #59708f;
    --title: #091a2f;
    --primary: #0f9d73;
    --primary-strong: #0c7e5c;
    --accent: #1769ff;
    --accent-soft: rgba(23, 105, 255, 0.1);
    --warning: #8f5f00;
    --shadow: 0 30px 70px rgba(33, 53, 85, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Instrument Sans', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(99, 230, 190, 0.16), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(124, 199, 255, 0.14), transparent 32%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 55%, var(--bg-bottom) 100%);
    color: var(--text);
    line-height: 1.72;
    padding: 24px;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -1;
}

body::before {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, rgba(99, 230, 190, 0.18), transparent 70%);
    filter: blur(20px);
}

body::after {
    width: 360px;
    height: 360px;
    bottom: 10%;
    left: -100px;
    background: radial-gradient(circle, rgba(124, 199, 255, 0.18), transparent 70%);
    filter: blur(28px);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.page-shell {
    max-width: var(--container);
    margin: 0 auto;
}

.site-header,
.workspace-shell,
.site-footer,
.feature-card,
.guide-card,
.faq-list details {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 24px;
    overflow: hidden;
    position: relative;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 199, 255, 0.1), transparent 35%, rgba(99, 230, 190, 0.08));
    pointer-events: none;
}

.topbar,
.hero,
.workspace,
.feature-strip,
.guide-section,
.faq-section,
.site-footer {
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 48px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.brand span {
    display: grid;
    gap: 2px;
}

.brand strong,
.hero h1,
.section-heading h2,
.tool-card h3,
.feature-card h3,
.guide-card h3,
.site-footer strong {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

.brand strong {
    color: var(--title);
    font-size: 1.1rem;
}

.brand small {
    color: var(--muted);
    font-size: 0.92rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.text-link {
    color: var(--muted);
    transition: color var(--transition), transform var(--transition);
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--title);
    transform: translateY(-1px);
}

.theme-toggle {
    width: 52px;
    height: 52px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    display: grid;
    place-items: center;
    position: relative;
    transition: border-color var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(124, 199, 255, 0.42);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.theme-toggle:focus-visible {
    outline: 3px solid rgba(124, 199, 255, 0.2);
    outline-offset: 2px;
}

.theme-glyph {
    position: absolute;
    width: 22px;
    height: 22px;
    color: var(--title);
    transition: opacity 160ms ease, transform 200ms ease;
}

.theme-glyph svg {
    width: 100%;
    height: 100%;
    display: block;
}

.theme-glyph-sun {
    color: #f5b400;
}

.theme-glyph.is-hidden {
    opacity: 0;
    transform: scale(0.6) rotate(-12deg);
    pointer-events: none;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: stretch;
}

.hero-copy,
.hero-panel,
.tool-card,
.feature-card,
.guide-card,
.faq-list details,
.site-footer {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.hero-copy {
    padding: 38px;
}

.eyebrow,
.workspace-badge,
.panel-label,
.section-kicker,
.status-dot,
.preset-chip,
.device-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
}

.eyebrow {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    padding: 10px 16px;
    font-size: 0.95rem;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4.6rem);
    line-height: 0.98;
    color: var(--title);
    max-width: 11ch;
    margin-bottom: 18px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-text,
.section-heading p,
.card-heading p,
.helper-copy,
.feature-card p,
.guide-card p,
.faq-list p,
.site-footer p,
.footer-meta span {
    color: var(--muted);
}

.hero-text {
    max-width: 60ch;
    font-size: 1.02rem;
}

.hero-actions,
.action-row,
.preset-row,
.device-presets,
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions {
    margin: 28px 0 20px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

.button:hover,
.button:focus-visible,
.mode-button:hover,
.mode-button:focus-visible,
.preset-chip:hover,
.preset-chip:focus-visible,
.device-chip:hover,
.device-chip:focus-visible {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #05111d;
    font-weight: 700;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--title);
}

.button.compact {
    min-height: 42px;
}

.hero-points {
    list-style: none;
    display: grid;
    gap: 10px;
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.hero-points i,
.feature-card i,
.guide-card i {
    color: var(--primary);
}

.hero-panel {
    padding: 28px;
    display: grid;
    gap: 18px;
}

.hero-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-label,
.workspace-badge,
.section-kicker {
    background: rgba(255, 255, 255, 0.06);
    color: var(--title);
    padding: 8px 14px;
}

.status-dot {
    color: var(--muted);
    font-size: 0.92rem;
}

.status-dot span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 8px rgba(99, 230, 190, 0.12);
}

.hero-metrics,
.workspace-grid,
.feature-strip,
.guide-grid {
    display: grid;
    gap: 18px;
}

.hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
    padding: 22px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.metric-card span,
.result-box span,
.field-label,
.helper-copy,
.share-feedback,
.card-heading p,
.viewport-meta span {
    font-size: 0.95rem;
}

.metric-card strong,
.result-box strong {
    display: block;
    color: var(--title);
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    margin-top: 6px;
}

.accent-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(124, 199, 255, 0.12), rgba(99, 230, 190, 0.12));
}

.hero-note {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.hero-note i {
    color: var(--warning);
    margin-top: 4px;
}

main {
    display: grid;
    gap: 34px;
    margin-top: 36px;
}

.workspace {
    display: grid;
    gap: 20px;
}

.section-heading {
    display: grid;
    gap: 12px;
    max-width: 68ch;
    margin: 10px;
}

.section-heading.narrow {
    max-width: 62ch;
}

.section-kicker {
    width: fit-content;
    color: var(--primary);
}

.section-heading h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: var(--title);
}

.section-heading p,
.card-heading p,
.guide-card p,
.feature-card p,
.faq-list p {
    max-width: 62ch;
}

.workspace-shell {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 24px;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mode-switch {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-button,
.preset-chip,
.device-chip {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--title);
    cursor: pointer;
    padding: 10px 14px;
}

.mode-button.active {
    background: linear-gradient(135deg, rgba(99, 230, 190, 0.2), rgba(124, 199, 255, 0.18));
    border-color: rgba(99, 230, 190, 0.4);
}

.workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-card,
.feature-card,
.guide-card,
.faq-list details,
.site-footer {
    padding: 24px;
}

.tool-card {
    display: grid;
    gap: 14px;
}

.card-heading {
    display: grid;
    gap: 6px;
}

.card-heading h3,
.feature-card h3,
.guide-card h3 {
    color: var(--title);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.24rem;
}

.card-heading p {
    line-height: 1.64;
}

.field-label {
    color: var(--text);
    font-weight: 600;
}

.input-frame {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-frame:focus-within {
    border-color: rgba(124, 199, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(124, 199, 255, 0.12);
}

.input-icon,
.input-unit {
    padding: 0 16px;
    color: var(--muted);
}

.input-frame input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--title);
    padding: 16px 0;
    outline: none;
}

.input-frame input.read-only {
    cursor: not-allowed;
}

.result-box {
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(124, 199, 255, 0.1), rgba(124, 199, 255, 0.04));
    border: 1px solid rgba(124, 199, 255, 0.16);
}

.result-box p,
.viewport-meta,
.share-feedback,
.copyright {
    color: var(--muted);
}

.result-box p {
    line-height: 1.6;
    margin-top: 6px;
}

.alt-result {
    background: linear-gradient(180deg, rgba(99, 230, 190, 0.1), rgba(99, 230, 190, 0.04));
    border-color: rgba(99, 230, 190, 0.18);
}

.viewport-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.snippet-block {
    background: #04101d;
    color: #dcf4ff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(124, 199, 255, 0.18);
    padding: 18px;
    overflow-x: auto;
    font-family: Consolas, 'Courier New', monospace;
    line-height: 1.7;
}

html[data-theme="light"] .snippet-block {
    background: #eaf2ff;
    color: #12304f;
}

.share-feedback {
    min-height: 24px;
}

.feature-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.guide-card {
    display: grid;
    gap: 12px;
}

.feature-card i,
.guide-card i {
    font-size: 1.3rem;
}

.guide-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-list details summary {
    list-style: none;
    cursor: pointer;
    color: var(--title);
    font-weight: 600;
    line-height: 1.4;
}

.faq-list details summary::-webkit-details-marker {
    display: none;
}

.faq-list details p {
    margin-top: 12px;
}

.site-footer {
    margin: 30px 0 20px;
    display: grid;
    gap: 14px;
}

.footer-meta {
    color: var(--muted);
}

.copyright {
    font-size: 0.94rem;
}

@media (max-width: 1080px) {
    .hero,
    .workspace-grid,
    .feature-strip,
    .guide-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        max-width: none;
    }
}

@media (max-width: 720px) {
    body {
        padding: 16px;
    }

    .site-header,
    .workspace-shell,
    .site-footer,
    .hero-copy,
    .hero-panel,
    .tool-card,
    .feature-card,
    .guide-card,
    .faq-list details {
        padding: 20px;
    }

    .topbar,
    .workspace-toolbar {
        align-items: flex-start;
    }

    .topbar,
    .topbar-actions,
    .hero-actions,
    .action-row,
    .viewport-meta,
    .footer-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .theme-toggle {
        width: 48px;
        height: 48px;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .button,
    .mode-button,
    .preset-chip,
    .device-chip {
        width: 100%;
    }
}