/* Shared styles for content + error pages (privacy, terms, 404, 500).
   Self-contained: mirrors the tokens and chrome from index.css. */

:root {
    --cream-50: #F7F3ED;
    --cream-100: #EFE9E1;
    --cream-200: #E9E2D6;
    --cream-300: #D4C6AE;
    --coffee-300: #C87941;
    --coffee-500: #8B5E3C;
    --coffee-700: #6F3F1E;
    --coffee-900: #2B1F17;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--cream-50);
    color: var(--coffee-900);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 160px;
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* ── Header ─────────────────────────────── */
.site-header {
    padding: 2rem 2rem 0;
    display: flex;
    justify-content: center;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.7;
}

.logo-svg {
    height: 50px;
    width: auto;
    display: block;
}

/* ── Footer ─────────────────────────────── */
.site-footer {
    padding: 1.25rem 2rem;
    text-align: center;
    border-top: 1px solid var(--cream-200);
}

.footer-text {
    font-size: 0.73rem;
    color: var(--cream-300);
    letter-spacing: 0.04em;
}

.footer-nav {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin-bottom: 0.6rem;
}

.footer-nav a,
.footer-text a {
    color: var(--coffee-500);
    text-decoration: none;
    font-size: 0.73rem;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.footer-nav a:hover,
.footer-text a:hover {
    color: var(--coffee-700);
}

/* ── Decorative drops ───────────────────── */
.deco {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
}

.deco-1 {
    top: -80px;
    right: -60px;
    width: 300px;
}

.deco-2 {
    bottom: -60px;
    left: -70px;
    width: 240px;
    transform: rotate(18deg);
}

/* ── Error pages (404 / 500) ────────────── */
.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
}

.error-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--coffee-500);
    margin-bottom: 1.25rem;
    animation: fadeUp 0.7s var(--ease-out) 0.1s both;
}

.error-code {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(5rem, 18vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--coffee-700);
    font-variant-numeric: tabular-nums;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.7s var(--ease-out) 0.15s both;
}

.error-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--coffee-900);
    max-width: 16ch;
    margin-bottom: 1.25rem;
    animation: fadeUp 0.7s var(--ease-out) 0.2s both;
}

.error-headline em {
    font-style: italic;
    color: var(--coffee-700);
}

.error-sub {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--coffee-500);
    max-width: 40ch;
    margin-bottom: 2.5rem;
    animation: fadeUp 0.7s var(--ease-out) 0.3s both;
}

.btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: var(--coffee-700);
    color: var(--cream-50);
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    animation: fadeUp 0.7s var(--ease-out) 0.4s both;
}

.btn:hover {
    background: var(--coffee-900);
}

/* ── Form pages (unsubscribe) ───────────── */
.form-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
}

.form-page .error-headline {
    margin-bottom: 1.25rem;
}

.subscribe-form {
    width: 100%;
    max-width: 420px;
    animation: fadeUp 0.7s var(--ease-out) 0.4s both;
}

.form-message {
    display: none;
    margin-bottom: 0.875rem;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: left;
}

.form-message.success {
    display: block;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.form-row {
    display: flex;
    border: 1.5px solid var(--cream-300);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row:focus-within {
    border-color: var(--coffee-700);
    box-shadow: 0 0 0 3px rgba(111, 63, 30, 0.09);
}

.form-input {
    flex: 1;
    min-width: 0;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--coffee-900);
    outline: none;
}

.form-input::placeholder {
    color: var(--cream-300);
}

.form-btn {
    padding: 0.875rem 1.3rem;
    background: var(--coffee-700);
    color: var(--cream-50);
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.form-btn:hover:not(:disabled) {
    background: var(--coffee-900);
}

.form-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-note {
    margin-top: 0.85rem;
    font-size: 0.76rem;
    color: var(--coffee-500);
    opacity: 0.75;
    letter-spacing: 0.01em;
}

/* ── Content pages (privacy / terms) ────── */
.content {
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4rem;
    animation: fadeUp 0.7s var(--ease-out) 0.1s both;
}

.content-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--coffee-500);
    margin-bottom: 1rem;
}

.content-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--coffee-900);
    margin-bottom: 0.75rem;
}

.content-updated {
    font-size: 0.82rem;
    color: var(--coffee-500);
    opacity: 0.8;
    margin-bottom: 2.5rem;
}

.content h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
    color: var(--coffee-900);
    margin: 2.5rem 0 0.85rem;
}

.content p {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--coffee-900);
    margin-bottom: 1rem;
}

.content ul {
    margin: 0 0 1rem 1.25rem;
}

.content li {
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--coffee-900);
    margin-bottom: 0.5rem;
}

.content a {
    color: var(--coffee-700);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.content a:hover {
    color: var(--coffee-900);
}

.content strong {
    font-weight: 600;
    color: var(--coffee-900);
}

/* ── Animations ─────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile ─────────────────────────────── */
@media (max-width: 480px) {
    .site-header {
        padding: 1.5rem 1.5rem 0;
    }

    .content {
        padding: 2.5rem 1.25rem 3rem;
    }

    .footer-nav {
        gap: 1rem;
    }

    .form-row {
        flex-direction: column;
        border-radius: 10px;
    }

    .form-input {
        border-bottom: 1px solid var(--cream-200);
        padding: 0.9rem 1rem;
        text-align: center;
    }

    .form-btn {
        padding: 0.9rem 1rem;
        text-align: center;
        font-size: 0.9rem;
    }
}
