/* Beatpax: the Pack Folder world.
   Shared tokens and components lifted from templates/landing.html so every page
   outside the app speaks the same language (see DESIGN.md).

   Contents
   1. Tokens + ground
   2. Type
   3. Folder-tab button (the one button shape)
   4. Paper sheet / chips
   5. Public nav + footer
   6. Legal pages (Terms, Privacy)
*/

/* ---------- 1. Tokens + ground ---------- */
:root {
    --pack-red: #d21a23;        /* folder body, from the logo */
    --pack-tab: #ee4b45;        /* folder tab / back edge */
    --pack-red-deep: #a8131b;
    --pack-ink: #0a0a0a;
    --pack-ground: #242424;     /* plain grey ground behind the dots */
    --pack-ink-2: #141414;
    --pack-paper: #ffffff;
    --pack-paper-2: #f3f1ee;
    --pack-muted: #9a9a9a;
    --pack-line: #3a3a3a;
    --pack-gold: #ffcf3a;
    --pack-display: "Archivo", "Arial Black", Helvetica, sans-serif;
    --pack-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --pack-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --pack-spring: cubic-bezier(0.2, 1.35, 0.35, 1);
    --pack-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --pack-gutter: max(20px, env(safe-area-inset-left, 0px));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }

body.pack-page {
    font-family: var(--pack-body);
    color: var(--pack-paper);
    background:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.085) 1px, transparent 1.5px) 0 0 / 22px 22px,
        var(--pack-ground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body.pack-page ::selection { background: var(--pack-red); color: #fff; }
body.pack-page a { color: inherit; }
body.pack-page :focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

/* ---------- 2. Type ---------- */
.pack-display {
    font-family: var(--pack-display);
    font-stretch: 125%;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 0.92;
    text-transform: uppercase;
}
.pack-mono { font-family: var(--pack-mono); }
.pack-eyebrow {
    font: 500 11px/1 var(--pack-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pack-muted);
}
.pack-lede { font-size: 18px; line-height: 1.55; color: #bdbdbd; }

/* ---------- 3. Folder-tab button ---------- */
.folder-btn {
    --fc: var(--pack-paper);
    --ft: var(--pack-ink);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 22px 0 20px;
    margin-top: 10px;
    background: var(--fc);
    color: var(--ft);
    border: none;
    border-radius: 0 12px 12px 12px;
    font: 600 15px var(--pack-body);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--pack-spring), background 0.15s;
}
.folder-btn::before {           /* the tab */
    content: "";
    position: absolute;
    left: 0;
    top: -10px;
    width: 46%;
    height: 12px;
    background: inherit;
    border-radius: 8px 8px 0 0;
    clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%);
}
.folder-btn:hover { transform: translateY(-2px) rotate(-1.5deg); }
.folder-btn:active { transform: translateY(1px) scale(0.98); }
.folder-btn .lucide-icon,
.folder-btn svg { width: 17px; height: 17px; }
.folder-btn.red { --fc: var(--pack-red); --ft: #fff; }
.folder-btn.red:hover { background: var(--pack-red-deep); }
.folder-btn.small { height: 38px; font-size: 14px; padding: 0 16px; }

/* Plain text link that sits beside a folder button */
.pack-quiet-link {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}
.pack-quiet-link:hover { border-color: #fff; }

/* ---------- 4. Paper sheet / chips ---------- */
.pack-sheet {
    position: relative;
    background: var(--pack-paper);
    color: var(--pack-ink);
    border-radius: 14px 34px 18px 18px;
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.9);
}
.pack-sheet::after {            /* folded corner */
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(225deg, var(--pack-ink) 50%, var(--pack-paper-2) 50%);
    border-radius: 0 34px 0 8px;
    opacity: 0.12;
    pointer-events: none;
}
.pack-chip {
    display: inline-block;
    font: 500 10px/1 var(--pack-mono);
    padding: 5px 7px;
    border-radius: 4px;
    background: var(--pack-paper-2);
    color: #3a3a3a;
    white-space: nowrap;
}
.pack-chip.red { background: var(--pack-red); color: #fff; }

/* ---------- 5. Public nav + footer ---------- */
.pack-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px var(--pack-gutter);
    background: rgba(36, 36, 36, 0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pack-nav-logo { display: flex; align-items: center; }
/* Wordmark: the hero face, set as one white block of type */
.pack-nav-logo .logo-word {
    display: block;
    font-family: var(--pack-display);
    font-stretch: 125%;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
}
.pack-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    font-weight: 500;
}
.pack-nav-links a { text-decoration: none; color: #fff; }
.pack-nav-links a:hover { color: #fff; }

.pack-footer {
    padding: 28px var(--pack-gutter) max(28px, env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--pack-muted);
    border-top: 1px solid var(--pack-line);
}
.pack-footer nav { display: flex; gap: 22px; }
.pack-footer a { text-decoration: none; }
.pack-footer a:hover { color: #fff; }

/* ---------- 6. Legal pages ---------- */
.legal-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 52px) max(16px, env(safe-area-inset-left, 0px)) clamp(56px, 8vw, 96px);
}

.legal-folder {
    position: relative;
    background: var(--pack-red);
    border-radius: 0 34px 0 0;
    padding: clamp(40px, 6vw, 64px) clamp(22px, 5vw, 48px) clamp(46px, 6vw, 60px);
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.8);
}
.legal-folder::before {         /* the folder tab, as on the logo */
    content: "";
    position: absolute;
    left: 0;
    top: -14px;
    width: 34%;
    height: 16px;
    background: var(--pack-red);
    border-radius: 12px 12px 0 0;
    clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}
.legal-folder .pack-eyebrow { color: rgba(255, 255, 255, 0.72); }
.legal-title {
    margin-top: 14px;
    font-size: clamp(34px, 6.4vw, 62px);
    color: #fff;
}
.legal-meta {
    margin-top: 14px;
    font: 400 12px/1.5 var(--pack-mono);
    color: rgba(255, 255, 255, 0.78);
}

.legal-sheet {
    position: relative;
    z-index: 1;
    margin: -18px clamp(4px, 2vw, 22px) 0;
    padding: clamp(26px, 4vw, 48px);
}

.legal-note {
    display: flex;
    gap: 12px;
    background: var(--pack-paper-2);
    border-left: 4px solid var(--pack-red);
    border-radius: 0 10px 10px 0;
    padding: 16px 18px;
    margin-bottom: 34px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}
.legal-note i,
.legal-note .lucide-icon { width: 18px; height: 18px; color: var(--pack-red); flex-shrink: 0; margin-top: 2px; }

.legal-prose { color: #2c2c2c; }
.legal-prose h2 {
    font-family: var(--pack-display);
    font-stretch: 125%;
    font-weight: 800;
    font-size: clamp(19px, 2.4vw, 24px);
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--pack-ink);
    margin: 40px 0 10px;
    padding-top: 18px;
    border-top: 1px solid #e8e4de;
}
.legal-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-prose p,
.legal-prose li { font-size: 15.5px; line-height: 1.7; margin-bottom: 12px; color: #383838; }
.legal-prose ul { padding-left: 22px; }
.legal-prose li::marker { color: var(--pack-red); }
.legal-prose a { color: var(--pack-red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.legal-prose strong { color: var(--pack-ink); font-weight: 700; }

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    margin-top: 34px;
}

@media (max-width: 640px) {
    .pack-nav-logo .logo-word { font-size: 17px; }
    .pack-nav-links { gap: 16px; font-size: 13px; }
    .legal-sheet { margin-inline: 0; border-radius: 12px 26px 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    body.pack-page *, body.pack-page *::before, body.pack-page *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.001ms !important;
    }
    html { scroll-behavior: auto; }
}
