:root {
    --bg: #f6f1e8;
    --bg-strong: #f0e7d8;
    --surface: rgba(255, 251, 245, 0.88);
    --surface-strong: #fffaf2;
    --ink: #1f2430;
    --muted: #5f6675;
    --line: rgba(38, 45, 60, 0.12);
    --accent: #d95d39;
    --accent-soft: rgba(217, 93, 57, 0.16);
    --accent-2: #0f7a6c;
    --danger: #bc3b2a;
    --warning: #cb7e20;
    --shadow: 0 28px 80px rgba(54, 38, 21, 0.12);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --content-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Aptos", "Trebuchet MS", "Segoe UI Variable", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(217, 93, 57, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 122, 108, 0.14), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, #fbf7f0 48%, var(--bg-strong) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
    pointer-events: none;
}

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

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

.page-shell {
    width: min(calc(100% - 32px), var(--content-width));
    margin: 0 auto;
    padding: 24px 0 56px;
    position: relative;
    z-index: 1;
}

.hero,
.reveal {
    opacity: 0;
    transform: translateY(24px);
    animation: rise-in 0.8s ease forwards;
}

.reveal:nth-of-type(2) {
    animation-delay: 0.08s;
}

.reveal:nth-of-type(3) {
    animation-delay: 0.16s;
}

.reveal:nth-of-type(4) {
    animation-delay: 0.24s;
}

.reveal:nth-of-type(5) {
    animation-delay: 0.32s;
}

.reveal:nth-of-type(6) {
    animation-delay: 0.4s;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-xl) + 6px);
    background: rgba(255, 250, 242, 0.66);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fffaf5;
    background:
        linear-gradient(135deg, #1e2532, #304f6d 60%, #d95d39 100%);
    box-shadow: 0 18px 30px rgba(31, 36, 48, 0.2);
}

.brand p,
.brand span,
.eyebrow,
.ticket-id,
.status-pill,
.insight-card span {
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand p {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
}

.brand span {
    color: var(--muted);
    font-size: 0.7rem;
}

.topbar-actions,
.hero-actions,
.filter-group,
.severity-options {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.primary-link,
.ghost-link,
.filter,
.severity {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.primary-link {
    color: #fff7f0;
    background: linear-gradient(135deg, var(--accent), #c44734);
    box-shadow: 0 16px 30px rgba(217, 93, 57, 0.25);
}

.ghost-link,
.filter,
.severity {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.48);
    border: 1px solid rgba(31, 36, 48, 0.08);
}

.primary-link:hover,
.ghost-link:hover,
.filter:hover,
.severity:hover {
    transform: translateY(-2px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    margin-top: 22px;
}

.hero-copy,
.hero-card,
.insight-card,
.ticket-card,
.flow-card,
.capacity-card,
.form-card,
.timeline-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 34px;
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -70px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 122, 108, 0.18), transparent 70%);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Iowan Old Style", "Georgia", serif;
    line-height: 0.98;
}

h1 {
    max-width: 11ch;
    font-size: clamp(3rem, 5vw, 5.5rem);
}

h2 {
    font-size: clamp(2rem, 3vw, 3.2rem);
}

h3 {
    font-size: 1.4rem;
    line-height: 1.15;
}

.hero-text,
.ticket-card p,
.flow-card p,
.timeline-list p,
.insight-card strong,
.incident-form label,
.capacity-label span {
    color: var(--muted);
}

.hero-text {
    max-width: 55ch;
    margin: 20px 0 26px;
    font-size: 1.08rem;
    line-height: 1.7;
}

.trust-strip {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    list-style: none;
    padding: 22px 0 0;
    margin: 30px 0 0;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
    color: var(--muted);
}

.hero-card,
.glow-card {
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(255, 248, 238, 0.78)),
        radial-gradient(circle at top right, rgba(217, 93, 57, 0.12), transparent 34%);
}

.card-header,
.pulse-header,
.ticket-meta,
.ticket-footer,
.section-heading,
.capacity-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-header p,
.pulse-header p {
    margin: 0;
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
}

.stable {
    color: var(--accent-2);
    background: rgba(15, 122, 108, 0.12);
}

.warning {
    color: var(--warning);
    background: rgba(203, 126, 32, 0.14);
}

.danger {
    color: var(--danger);
    background: rgba(188, 59, 42, 0.14);
}

.scoreboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 24px 0 28px;
}

.scoreboard article,
.flow-card,
.insight-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(31, 36, 48, 0.06);
}

.scoreboard span,
.ticket-id,
.insight-card span {
    font-size: 0.72rem;
    font-weight: 700;
}

.scoreboard strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 2.1rem;
    line-height: 1;
}

.scoreboard small {
    color: var(--muted);
}

.pulse-track,
.capacity-bar {
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(31, 36, 48, 0.08);
}

.pulse-track {
    height: 14px;
    margin-top: 16px;
}

.pulse-fill {
    width: 78%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-2), #1f9d82, #f3b24a);
    animation: pulse-fill 1.3s ease forwards;
    transform-origin: left center;
}

.mini-legend {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 10px;
    color: var(--muted);
}

.mini-legend li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-legend span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.insight-band,
.queue-grid,
.flow-grid,
.operations-grid {
    display: grid;
    gap: 20px;
}

.insight-band {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 26px;
}

.insight-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.08rem;
    line-height: 1.5;
}

.queue-section,
.flow-section,
.timeline-section {
    margin-top: 26px;
    padding: 28px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading.compact h2 {
    font-size: 2rem;
}

.queue-grid {
    grid-template-columns: repeat(2, 1fr);
}

.ticket-card {
    padding: 24px;
    transition: transform 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.ticket-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 93, 57, 0.18);
}

.ticket-card h3 {
    margin: 18px 0 12px;
}

.ticket-card p {
    margin: 0 0 22px;
    line-height: 1.65;
}

.ticket-footer {
    color: var(--muted);
    font-size: 0.95rem;
}

.filter.active,
.severity.active {
    color: #fff7f0;
    background: linear-gradient(135deg, #203246, #395e81);
    box-shadow: 0 14px 28px rgba(32, 50, 70, 0.18);
}

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

.flow-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-soft);
}

.flow-card p {
    margin: 14px 0 0;
    line-height: 1.65;
}

.operations-grid {
    grid-template-columns: 1fr 1fr;
    margin-top: 26px;
}

.capacity-card,
.form-card {
    padding: 28px;
}

.capacity-list {
    display: grid;
    gap: 20px;
}

.capacity-label {
    margin-bottom: 10px;
}

.capacity-bar {
    height: 14px;
}

.capacity-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #203246, var(--accent-2), #f0b24d);
}

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

.incident-form label {
    display: grid;
    gap: 10px;
    font-size: 0.96rem;
}

.incident-form input,
.incident-form select,
.incident-form textarea {
    width: 100%;
    border: 1px solid rgba(31, 36, 48, 0.12);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.64);
    resize: vertical;
}

.incident-form input:focus,
.incident-form select:focus,
.incident-form textarea:focus {
    outline: 2px solid rgba(217, 93, 57, 0.18);
    border-color: rgba(217, 93, 57, 0.28);
}

.form-submit {
    width: fit-content;
}

.timeline-list {
    display: grid;
    gap: 14px;
}

.timeline-list article {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid rgba(31, 36, 48, 0.08);
}

.timeline-list article:first-child {
    border-top: 0;
    padding-top: 0;
}

.timeline-list span {
    font-weight: 800;
    color: var(--accent);
}

.timeline-list p {
    margin: 0;
    font-size: 1.04rem;
    line-height: 1.6;
}

.hidden-ticket {
    opacity: 0.18;
    transform: scale(0.98);
    pointer-events: none;
}

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

@keyframes pulse-fill {
    from {
        transform: scaleX(0.2);
    }
    to {
        transform: scaleX(1);
    }
}

@media (max-width: 980px) {
    .hero-grid,
    .insight-band,
    .queue-grid,
    .flow-grid,
    .operations-grid {
        grid-template-columns: 1fr;
    }

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

    h1 {
        max-width: 14ch;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(calc(100% - 20px), var(--content-width));
        padding-top: 16px;
    }

    .topbar,
    .section-heading,
    .card-header,
    .pulse-header,
    .ticket-meta,
    .ticket-footer,
    .capacity-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-copy,
    .hero-card,
    .queue-section,
    .flow-section,
    .capacity-card,
    .form-card,
    .timeline-section {
        padding: 22px;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.1rem;
    }

    .timeline-list article {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.portal-body {
    position: relative;
    display: grid;
    place-items: center;
    padding: 24px;
}

.portal-body .page-shell {
    display: none;
}

.portal-shell {
    position: relative;
    z-index: 2;
    width: min(100%, 920px);
}

.portal-card {
    padding: 68px 58px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 36px;
    background:
        linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(255, 248, 239, 0.82)),
        radial-gradient(circle at top right, rgba(217, 93, 57, 0.14), transparent 34%);
    box-shadow: 0 32px 80px rgba(54, 38, 21, 0.14);
    backdrop-filter: blur(12px);
}

.portal-kicker {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-title {
    margin: 0;
    font-size: clamp(3.6rem, 8vw, 7.2rem);
    line-height: 0.94;
    letter-spacing: -0.04em;
}

.portal-copy {
    margin: 22px 0 0;
    max-width: 34ch;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.portal-status {
    margin: 18px 0 0;
    color: var(--accent);
    font-size: 0.96rem;
    font-weight: 600;
}

.portal-controls {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.discreet-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 252, 246, 0.72);
    box-shadow: 0 14px 32px rgba(42, 31, 19, 0.08);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.discreet-run {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid rgba(31, 36, 48, 0.1);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 252, 246, 0.88);
    box-shadow: 0 14px 32px rgba(42, 31, 19, 0.08);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.discreet-download::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #c44734);
}

.discreet-download:hover {
    transform: translateY(-1px);
    color: var(--ink);
    border-color: rgba(217, 93, 57, 0.22);
}

.discreet-run:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(217, 93, 57, 0.22);
}

.discreet-run:disabled {
    cursor: wait;
    opacity: 0.72;
}

@media (max-width: 720px) {
    .portal-body {
        align-items: start;
        padding: 88px 16px 16px;
    }

    .portal-card {
        padding: 40px 26px;
        border-radius: 28px;
    }

    .portal-controls {
        top: 14px;
        left: 14px;
        right: 14px;
    }

    .portal-copy {
        font-size: 1rem;
    }

    .discreet-download,
    .discreet-run {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
}
