@font-face {
    font-family: "ANS-Regular";
    src: url("../fonts/ANS-Regular.otf") format("opentype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    font-family:
        "ANS-Regular",
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    margin: 0;
}

html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

body {
    color: var(--text);
    background:
        var(--background-image),
        var(--background);
    background-attachment: fixed;
    background-position: center;
    background-size: cover;

    transition:
        color 180ms ease,
        background-color 180ms ease;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.theme-preview {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 72px;
}

.preview-toolbar,
.preview-hero,
.preview-card {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--blur)) saturate(135%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 18px 20px;
    border-radius: 22px;
}

.preview-toolbar h1,
.preview-toolbar p,
.preview-hero h2,
.preview-hero p,
.preview-card h3,
.preview-card p {
    margin-top: 0;
}

.preview-toolbar h1 {
    margin-bottom: 4px;
    font-size: clamp(22px, 3vw, 30px);
}

.preview-toolbar p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.preview-kicker,
.preview-label {
    display: block;
    margin-bottom: 7px;

    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
}

.theme-switcher {
    display: flex;
    gap: 8px;
    padding: 6px;

    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--control-surface);
}

.theme-switcher button,
.button-primary,
.button-secondary {
    min-height: 42px;
    padding: 9px 15px;

    color: var(--text);
    border-radius: 11px;
    border: 1px solid var(--line-soft);

    transition:
        transform 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.theme-switcher button {
    background: transparent;
}

.theme-switcher button[aria-pressed="true"] {
    color: var(--active-text);
    background: var(--active);
    border-color: var(--active-line);
}

.theme-switcher button:hover,
.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-1px);
}

.preview-stage {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.preview-hero {
    min-height: 300px;
    padding: clamp(28px, 6vw, 70px);

    border-radius: 28px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    overflow: hidden;
    position: relative;
}

.preview-hero::after {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    right: -90px;
    top: -120px;

    border-radius: 50%;
    background: var(--ambient);
    filter: blur(20px);
    pointer-events: none;
}

.preview-hero h2 {
    margin-bottom: 12px;

    font-size: clamp(30px, 5vw, 54px);
    line-height: 1.02;
}

.preview-hero p {
    max-width: 670px;
    margin-bottom: 22px;

    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-primary {
    color: var(--active-text);
    background: var(--active);
    border-color: var(--active-line);
}

.button-secondary {
    background: var(--control-surface);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.preview-card {
    min-height: 185px;
    padding: 22px;
    border-radius: 22px;
}

.preview-card h3 {
    margin-bottom: 9px;
}

.preview-card p {
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.preview-field {
    display: grid;
    gap: 8px;
}

.preview-field span {
    color: var(--text-muted);
    font-size: 14px;
}

.preview-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;

    color: var(--text);
    background: var(--input);
    border: 1px solid var(--line-soft);
    border-radius: 11px;
    outline: none;
}

.preview-field input:focus-visible,
button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.preview-field input::placeholder {
    color: var(--text-soft);
}

.preview-status-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
}

.preview-status-row.muted {
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-soft);
}

.status-dot-online {
    background: var(--online);
    box-shadow: 0 0 14px var(--online);
}

@media (max-width: 760px) {
    .theme-preview {
        width: min(100% - 20px, 1180px);
        padding-top: 14px;
    }

    .preview-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-switcher {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

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

    .preview-hero {
        min-height: 260px;
        padding: 28px 22px;
    }
}

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