:root {
    --bg-top: #eff5ff;
    --bg-bottom: #a9c5fa;
    --surface: rgba(255, 255, 255, 0.3);
    --surface-strong: rgba(255, 255, 255, 0.88);
    --surface-soft: rgba(236, 244, 255, 0.88);
    --primary: #7a8ef1;
    --primary-strong: #6d82ef;
    --primary-soft: rgba(122, 142, 241, 0.14);
    --ink: #18212c;
    --muted: #5d6774;
    --line: rgba(73, 108, 179, 0.2);
    --shadow-lg: 0 24px 60px rgba(72, 103, 168, 0.18);
    --shadow-md: 0 16px 34px rgba(72, 103, 168, 0.12);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 22%),
        linear-gradient(180deg, var(--bg-top) 0%, #dce9ff 40%, var(--bg-bottom) 100%);
}

body.sheet-open {
    overflow: hidden;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    position: relative;
    width: min(100%, 460px);
    min-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
}

.app-screen {
    min-height: 100vh;
    padding:
        calc(env(safe-area-inset-top, 0px) + 24px)
        20px
        calc(env(safe-area-inset-bottom, 0px) + 24px);
    display: flex;
    flex-direction: column;
}

.brand-hero {
    display: grid;
    justify-items: center;
    gap: 18px;
    text-align: center;
    margin-top: 8px;
}

.brand-hero__logo {
    width: min(42vw, 172px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
}

.brand-hero__copy {
    display: grid;
    gap: 10px;
}

.brand-hero__eyebrow,
.sheet-header__eyebrow,
.card-tag {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4570cb;
}

.brand-hero h1,
.sheet-header h2,
.list-card h3,
.section-card__title,
.tab-button {
    margin: 0;
    font-family: "Archivo", sans-serif;
}

.brand-hero h1 {
    font-size: clamp(3.2rem, 13vw, 5.4rem);
    line-height: 0.92;
    letter-spacing: 0.04em;
    color: rgba(71, 160, 230, 0.88);
    text-shadow:
        -2px -2px 0 rgba(255, 255, 255, 0.72),
        2px 2px 0 rgba(103, 160, 224, 0.25);
}

.home-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.home-action {
    min-height: 74px;
    border: 0;
    border-radius: 22px;
    padding: 0 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #879bf5 100%);
    color: white;
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.home-action:active {
    transform: scale(0.98);
}

.home-action--about {
    grid-column: 1 / -1;
    min-height: 60px;
    width: min(180px, 100%);
    justify-self: center;
}

.app-footer {
    margin-top: auto;
    padding-top: 28px;
}

.app-footer p {
    margin: 0;
    text-align: center;
    color: rgba(24, 33, 44, 0.64);
    font-size: 0.9rem;
    line-height: 1.45;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 33, 61, 0.28);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.app-sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    width: min(100%, 460px);
    max-height: min(78vh, 720px);
    transform: translate(-50%, calc(100% + 20px));
    padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
    background: var(--surface-strong);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -20px 50px rgba(56, 83, 130, 0.18);
    z-index: 11;
    transition: transform 220ms ease;
    overflow: hidden;
}

.app-sheet.is-open {
    transform: translate(-50%, 0);
}

.sheet-handle {
    width: 52px;
    height: 6px;
    margin: 2px auto 14px;
    border-radius: 999px;
    background: rgba(120, 136, 161, 0.36);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.sheet-header h2 {
    font-size: 1.9rem;
    line-height: 1.02;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.sheet-tabs {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-button {
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    background: var(--surface-soft);
    color: #4e5d70;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.tab-button.is-active {
    background: var(--primary);
    color: white;
}

.sheet-content {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    max-height: calc(min(78vh, 720px) - 138px);
    overflow-y: auto;
    padding-right: 2px;
}

.list-card,
.section-card {
    padding: 18px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

.list-card h3,
.section-card__title {
    font-size: 1.04rem;
    line-height: 1.18;
}

.list-card h3 {
    white-space: normal;
}

.list-card p,
.section-card p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.card-badge {
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #5570d8;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.list-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.list-card--link:hover {
    transform: translateY(-1px);
    background: rgba(222, 234, 252, 0.98);
}

.list-card--link:active,
.home-action:active,
.tab-button:active,
.icon-button:active {
    transform: scale(0.98);
}

.placeholder-card {
    background: rgba(255, 255, 255, 0.92);
    border-style: dashed;
}

.section-card {
    display: grid;
    gap: 8px;
}

.section-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .app-shell {
        min-height: 100vh;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.4),
            0 24px 70px rgba(65, 90, 150, 0.18);
    }

    .home-action:hover,
    .icon-button:hover,
    .tab-button:hover {
        transform: translateY(-1px);
    }
}

@media (min-width: 900px) {
    body {
        padding: 20px;
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 22%),
            linear-gradient(180deg, var(--bg-top) 0%, #dce9ff 40%, var(--bg-bottom) 100%);
    }

    .app-shell {
        width: min(100%, 1180px);
        min-height: calc(100vh - 40px);
        border-radius: 0;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
            linear-gradient(180deg, var(--bg-top) 0%, #dce9ff 40%, var(--bg-bottom) 100%);
        border: 1px solid rgba(255, 255, 255, 0.56);
    }

    .app-screen {
        min-height: calc(100vh - 40px);
        padding: 48px 64px 38px;
    }

    .brand-hero {
        grid-template-columns: auto auto;
        justify-content: center;
        align-items: center;
        gap: 26px;
        margin-top: 0;
    }

    .brand-hero__logo {
        width: 180px;
        border-radius: 40px;
    }

    .brand-hero__copy {
        text-align: left;
        max-width: 420px;
    }

    .brand-hero h1 {
        font-size: 6rem;
    }

    .brand-hero__eyebrow {
        max-width: 18ch;
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }

    .home-actions {
        width: min(100%, 760px);
        margin: 54px auto 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }

    .home-action {
        min-height: 56px;
        border-radius: 18px;
        font-size: 1rem;
    }

    .home-action--about {
        margin-top: 72px;
        grid-column: 1 / -1;
        width: 128px;
    }

    .app-footer {
        padding-top: 18px;
    }

    .app-footer p {
        font-size: 0.82rem;
        opacity: 0.72;
    }

    .sheet-backdrop {
        background: rgba(17, 33, 61, 0.12);
        backdrop-filter: blur(2px);
        pointer-events: auto;
    }

    .app-sheet {
        position: fixed;
        left: 50%;
        top: clamp(300px, 42vh, 380px);
        bottom: auto;
        width: min(100% - 120px, 860px);
        max-height: min(54vh, 460px);
        transform: translate(-50%, 24px) scale(0.98);
        padding: 18px 22px 22px;
        border-radius: 28px;
        border: 1px solid rgba(122, 142, 241, 0.18);
        box-shadow: 0 26px 60px rgba(67, 93, 145, 0.16);
        background: rgba(255, 255, 255, 0.96);
        opacity: 0;
        pointer-events: none;
    }

    .app-sheet.is-open {
        transform: translate(-50%, 0) scale(1);
        opacity: 1;
        pointer-events: auto;
    }

    .sheet-handle {
        display: none;
    }

    .sheet-header h2 {
        font-size: 1.7rem;
    }

    .sheet-tabs {
        gap: 12px;
        margin-top: 14px;
    }

    .sheet-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 140px;
        align-items: start;
        grid-auto-rows: min-content;
    }

    .list-card,
    .section-card {
        min-height: 0;
        display: block;
        padding: 10px 16px;
        height: auto;
        align-self: start;
    }

    .list-card h3,
    .section-card__title {
        font-size: 0.78rem;
        line-height: 1.22;
    }

    .list-card {
        min-height: auto;
    }

    .list-card p,
    .section-card p {
        font-size: 0.92rem;
    }
}
