/* public/site.css
 * Shared look for the public site (landing page, help and legal pages):
 * design tokens, header, buttons, footer and long-form text.
 * App pages (login, dashboard, signing) use style.css instead.
 */

:root {
    --paper: #f3efe6;
    --paper-deep: #ebe5d8;
    --sheet: #fffdf9;
    --ink: #16181d;
    --ink-soft: #464953;
    --muted: #7b776c;
    --rule: #d8d0c0;
    --rule-strong: #b9b09d;
    --pen: #2338c4;
    --pen-deep: #19289a;
    --pen-wash: #e3e6f7;

    --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    /* Faint paper grain */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
    background-image: var(--grain);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.label {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* --- Header --- */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--paper) var(--grain);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

header.scrolled {
    border-bottom-color: var(--rule);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.logo em {
    font-style: italic;
    font-weight: 400;
    color: var(--pen);
}

.logo-icon {
    width: 28px;
    height: 28px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--ink-soft);
    transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
    color: var(--ink);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1010;
}

.hamburger-line {
    width: 1.6rem;
    height: 1.5px;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.4rem;
    border: 1px solid var(--ink);
    border-radius: 3px;
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: var(--ink);
    color: var(--paper);
}

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

.btn-secondary {
    background: transparent;
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.text-link {
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 1px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.text-link:hover {
    color: var(--pen);
    border-color: var(--pen);
}

/* --- Footer --- */

footer {
    background: var(--ink);
    color: #b8b5ad;
    padding-bottom: 2.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 2rem;
    padding: 3rem 0;
    border-top: 1px solid #34373f;
}

/* A footer that doesn't follow a dark section gets its own top spacing instead of a rule */
footer.standalone .footer-content {
    border-top: none;
    padding-top: 4rem;
}

footer .logo {
    color: var(--paper);
}

footer .logo em {
    color: #9aa8ff;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #7d7a72;
}

.footer-section a {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-section a:hover {
    color: var(--paper);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #34373f;
    font-size: 0.85rem;
    color: #7d7a72;
}

/* --- Long-form pages (help, legal) --- */

.page-body {
    padding: 4rem 0 6rem;
}

.page-body .container {
    max-width: 760px;
}

.page-head {
    padding-bottom: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--ink);
}

.page-head h1 {
    margin-top: 1rem;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.025em;
}

.page-head p {
    margin-top: 1rem;
    color: var(--muted);
}

.prose h2 {
    margin: 3rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.75rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.prose > h2:first-child {
    margin-top: 2.5rem;
    padding-top: 0;
    border-top: none;
}

.prose h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.prose p,
.prose li {
    color: var(--ink-soft);
}

.prose p {
    margin-bottom: 1rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.prose li::marker {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85em;
}

.prose strong {
    color: var(--ink);
    font-weight: 600;
}

.prose a {
    color: var(--pen);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: var(--pen-deep);
}

/* --- Responsive --- */

@media (max-width: 960px) {
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .footer-content > :first-child {
        grid-column: 1 / -1;
    }
}

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

    .hamburger-menu {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        inset: 0;
        padding: 6rem 1.5rem 2rem;
        background: var(--paper);
        z-index: 1005;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        gap: 1.25rem;
    }

    .nav-links a {
        font-family: var(--serif);
        font-size: 2rem;
        color: var(--ink);
    }

    .auth-buttons {
        width: 100%;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0.75rem;
        padding-top: 2rem;
        border-top: 1px solid var(--rule);
    }

    .auth-buttons .btn {
        padding: 0.9rem;
    }

    .auth-buttons .text-link {
        align-self: center;
    }

    .page-body {
        padding: 2.5rem 0 4rem;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.prose .highlight-box {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--pen);
    border-radius: 2px;
}

.prose .highlight-box p:last-child {
    margin-bottom: 0;
}
