:root {
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --line: #e2e8f0;
    --primary: #6366f1;
    --primary-soft: #e0e7ff;
    --secondary: #22d3ee;
    --accent: #8b5cf6;
    --accent-soft: #ede9fe;
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --error: #ef4444;
    --error-soft: #fee2e2;
    --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-soft: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.1), 0 10px 25px -5px rgba(99, 102, 241, 0.2), 0 4px 6px -4px rgba(99, 102, 241, 0.1);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shell: min(1120px, calc(100vw - 48px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

code {
    font-family: "Space Grotesk", "JetBrains Mono", monospace;
}

.page-bg {
    display: none;
}

.shell {
    width: var(--shell);
    margin: 0 auto;
}

.clay-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.clay-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 20px 0 0;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(248, 250, 252, 0.8));
    backdrop-filter: blur(20px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
}

.brand__text {
    display: grid;
    gap: 2px;
}

.brand__text strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand__text small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -5px rgba(99, 102, 241, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn--primary:hover {
    box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.5);
}

.btn--ghost {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--line);
}

.btn--ghost:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

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

.hero {
    padding: 24px 0 20px;
    position: relative;
    z-index: 1;
}

.console-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
}

.console-card__nav {
    margin-bottom: 16px;
}

.page-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.page-switcher__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-switcher__link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.page-switcher__link.is-active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
}

.console-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.console-card__head--wide {
    margin-bottom: 16px;
}

.console-card__eyebrow,
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.section-tag--alt {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(139, 92, 246, 0.2);
}

.console-card__title,
.section-heading h2,
.notice-card h3,
.status-card strong,
.console-side-card strong,
.result-panel strong,
.footer strong {
    margin: 16px 0 0;
    font-family: "Noto Sans SC", sans-serif;
    font-weight: 700;
}

.console-card__intro,
.section-heading p,
.notice-card p,
.status-card span,
.field-hint,
.console-side-card p,
.result-panel p,
.footer p {
    color: var(--text-muted);
    line-height: 1.7;
}

.mode-chip {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.85rem;
}

.mode-chip--demo {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.mode-chip--live {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.relay-form {
    display: grid;
    gap: 16px;
}

.relay-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.relay-form__main,
.relay-form__side {
    display: grid;
    gap: 16px;
}

.relay-form__section {
    display: grid;
    gap: 10px;
}

.section-label,
.field-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

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

.idc-pill {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.idc-pill strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.idc-pill span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: "Space Grotesk", sans-serif;
}

.idc-pill:hover,
.idc-pill.is-active {
    background: var(--idc-surface);
    border-color: var(--idc-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--idc-accent) 15%, transparent);
}

.idc-pill.is-active {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--idc-accent) 20%, transparent), var(--shadow-soft);
}

textarea,
input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.field-hint,
.console-side-card p {
    margin: 0;
    font-size: 0.82rem;
}

.console-side-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: all 0.25s ease;
}

.console-side-card:hover {
    box-shadow: var(--shadow-soft);
}

.console-side-card--muted {
    background: var(--surface-muted);
}

.console-side-card__label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.console-side-card strong {
    font-size: 1.05rem;
}

.console-side-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.console-side-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.side-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    transition: all 0.2s ease;
}

.side-link-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.side-link-btn--alt {
    background: var(--surface-muted);
}

.side-link-btn--alt:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

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

.result-panel {
    margin-top: 16px;
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.result-panel--success {
    background: var(--success-soft);
    border-color: rgba(16, 185, 129, 0.3);
}

.result-panel--error {
    background: var(--error-soft);
    border-color: rgba(239, 68, 68, 0.3);
}

.result-panel--placeholder {
    background: var(--surface-muted);
}

.result-panel__meta,
.console-side-card__chips {
    display: flex;
    flex-wrap: wrap;
}

.result-panel__meta {
    gap: 10px;
}

.result-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.78rem;
    font-weight: 600;
}

.result-panel code {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--line);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.status-board {
    padding: 20px;
    border-radius: var(--radius-xl);
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.status-board__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.status-board__title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 700;
}

.status-board__title strong {
    font-size: 1.05rem;
    font-family: "Noto Sans SC", sans-serif;
}

.status-board__accent {
    width: 4px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.status-board__current {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-code-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.status-code-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: all 0.25s ease;
}

.status-code-card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.status-code-card__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
    color: var(--primary);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
}

.status-code-card__desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.lookup-results {
    display: grid;
    gap: 16px;
}

.lookup-results--placeholder {
    min-height: 120px;
}

.lookup-empty {
    display: grid;
    gap: 8px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
}

.lookup-empty strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.05rem;
}

.lookup-empty p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

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

.lookup-summary-card {
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: all 0.25s ease;
}

.lookup-summary-card:hover {
    box-shadow: var(--shadow-soft);
}

.lookup-summary-card__value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lookup-summary-card__label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.lookup-records {
    display: grid;
    gap: 14px;
}

.lookup-record {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
}

.lookup-record__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

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

.lookup-column,
.lookup-detail {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.lookup-column__label,
.lookup-detail__label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.lookup-column__value,
.lookup-detail__value {
    font-size: 0.9rem;
    line-height: 1.6;
}

.lookup-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.section {
    padding: 28px 0 32px;
    position: relative;
    z-index: 1;
}

.section--cream,
.section--soft {
    background: transparent;
}

.section-heading {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.1;
}

.section-heading p {
    margin: 0;
    max-width: 60ch;
}

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

.notice-card,
.status-card {
    padding: 18px;
}

.notice-card {
    display: grid;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    transition: all 0.25s ease;
}

.notice-card:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.notice-card__tag {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 600;
}

.notice-card h3 {
    font-size: 1.1rem;
    line-height: 1.25;
}

.notice-card p {
    margin: 0;
}

.status-grid {
    display: grid;
    gap: 14px;
}

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

.status-card {
    display: grid;
    gap: 8px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.status-card strong {
    font-size: 1.25rem;
}

.status-card span {
    margin: 0;
}

.js-enabled [data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.brand-header {
    text-align: center;
    padding: 20px 0 8px;
}

.brand-header h1 {
    margin: 0;
    font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-header p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer {
    padding: 24px 0 32px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 1080px) {
    .relay-grid,
    .notice-grid,
    .status-grid--full {
        grid-template-columns: 1fr;
    }

    .status-code-grid,
    .lookup-summary-grid,
    .lookup-columns,
    .lookup-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .topbar {
        position: static;
        padding-top: 24px;
    }

    .topbar__inner,
    .console-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .hero {
        padding-top: 24px;
    }

    .idc-switcher {
        grid-template-columns: 1fr;
    }

    .mode-chip {
        width: fit-content;
    }

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

    .status-code-grid,
    .lookup-summary-grid,
    .lookup-columns,
    .lookup-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    :root {
        --shell: min(100vw - 32px, 100%);
    }

    .shell {
        width: var(--shell);
    }

    .clay-card {
        border-width: 1px;
        box-shadow: var(--shadow-soft);
    }

    .console-card,
    .notice-card,
    .status-card,
    .status-board {
        padding: 16px;
    }

    .status-code-grid,
    .lookup-summary-grid,
    .lookup-columns,
    .lookup-details {
        grid-template-columns: 1fr;
    }
}
