@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/PlusJakartaSans-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/PlusJakartaSans-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/PlusJakartaSans-Bold.ttf') format('truetype');
}

:root {
    --background: #000000;
    /* Text colors keep at least 7:1 (WCAG AAA) on the card, even over the brightest light. */
    --text-primary: #fafafa;
    --text-secondary: #c8c8cc;
    --text-body: #e4e4e7;
    --glass-bg: rgba(10, 10, 12, 0.74);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent: #e4e4e7;
    --accent-hover: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    min-height: 100%;
    overflow-x: hidden;
    /* Safari tints its status bar, toolbar and overscroll from the page background. */
    background-color: var(--background);
}

body {
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

/* The Picker tab's lights, drawn by glow.js. Strongest at the top, fading like the app's. */
.glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0.3) 100%);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.4) 45%, rgba(0, 0, 0, 0.3) 100%);
}

/* The first page of a visit fades the light in; later pages show it at once, already matching. */
canvas.glow {
    opacity: 0;
}

canvas.glow.is-ready {
    opacity: 1;
    transition: opacity 0.9s ease;
}

canvas.glow.is-continuing,
canvas.glow.fallback {
    opacity: 1;
}

/* Moving between the home page and the policies crossfades instead of cutting. */
@view-transition {
    navigation: auto;
}

::view-transition-group(root) {
    animation-duration: 0.35s;
}

/* Without WebGL, a still glow in the same colors. */
.glow.fallback {
    background:
        radial-gradient(40% 22% at 25% 18%, rgba(255, 92, 138, 0.75), transparent),
        radial-gradient(40% 22% at 55% 24%, rgba(255, 196, 80, 0.6), transparent),
        radial-gradient(40% 22% at 80% 16%, rgba(20, 200, 170, 0.7), transparent);
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.icon-container {
    margin-bottom: 1.5rem;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    object-fit: cover;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

p.author {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: -0.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

p.coming-soon {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-size: 0.95rem;
}

footer {
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

footer a {
    color: white;
    text-decoration: underline;
    margin: 0 10px;
}

footer a:hover {
    opacity: 0.85;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.document-container {
    max-width: 800px;
    text-align: left;
    padding: 3rem 4rem;
}

/* Policy pages start at the top, so the card only grows downward as the text arrives. */
body.document-page {
    justify-content: flex-start;
}

.document-header {
    margin-bottom: 1.5rem;
}

.container.is-growing {
    transition: height 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

.document {
    transition: opacity 0.5s ease 0.1s, transform 0.6s cubic-bezier(0.32, 0.72, 0, 1) 0.1s;
}

.document.is-arriving {
    opacity: 0;
    transform: translateY(8px);
    transition: none;
}

.document {
    color: var(--text-body);
    line-height: 1.7;
    font-size: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.document h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.document h2,
.document h3 {
    color: var(--text-primary);
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.document h3 {
    font-size: 1.05rem;
}

.document p,
.document ul {
    margin-bottom: 1rem;
}

.document ul {
    padding-left: 1.5rem;
}

.document li {
    margin-bottom: 0.5rem;
}

.document strong {
    color: var(--text-primary);
}

.document a {
    color: var(--accent);
    text-decoration: underline;
}

.document a:hover {
    opacity: 0.8;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--accent-hover);
    background: rgba(255, 255, 255, 0.1);
}

.back-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    @view-transition {
        navigation: none;
    }

    canvas.glow.is-ready {
        transition: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 2rem;
    }

    .document-container {
        padding: 1.5rem;
    }

    .document h1 {
        font-size: 1.6rem;
    }
}
