/* =========================================================================
   Relay Daily — light "paper" editorial, monochrome ink brand
   Ink #111 on warm paper, » chevron motif, Space Grotesk display.
   No purple, no external font requests (Space Grotesk self-hosted).
   ========================================================================= */

@font-face {
    font-family: "Space Grotesk";
    src: url("/fonts/SpaceGrotesk.ttf") format("truetype");
    font-weight: 300 700;
    font-display: swap;
    font-style: normal;
}

:root {
    /* Color — monochrome ink on paper */
    --paper:    #f7f5f0;   /* page background */
    --paper-2:  #fffefb;   /* cards / raised surfaces */
    --paper-3:  #efece4;   /* subtle fills */
    --ink:      #111111;   /* primary text + brand */
    --ink-soft: #2a2926;
    --muted:    #5b574e;   /* secondary text */
    --faint:    #8c887d;   /* tertiary text */
    --border:        rgba(17,17,17,0.12);
    --border-strong: rgba(17,17,17,0.24);

    /* Type */
    --display: "Space Grotesk", "Futura", "Century Gothic", system-ui, sans-serif;
    --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --radius:    14px;
    --radius-sm: 9px;
    --shadow:    0 18px 44px -22px rgba(17,17,17,0.30);
    --maxw:      720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* --- Accessibility helpers --------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -48px;
    background: var(--ink); color: var(--paper);
    padding: 10px 16px; border-radius: 8px; z-index: 100;
    text-decoration: none; font-weight: 600; transition: top .18s ease;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

/* --- Ambient background (very subtle paper grid) ------------------------ */
.background-container { position: fixed; inset: 0; z-index: -1; background: var(--paper); overflow: hidden; }
.gradient-bg {
    position: absolute; inset: 0;
    background: radial-gradient(70% 50% at 50% -10%, rgba(17,17,17,0.04), transparent 70%);
}
.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(17,17,17,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17,17,17,0.035) 1px, transparent 1px);
    background-size: 52px 52px;
    mask-image: radial-gradient(120% 70% at 50% 0%, #000 35%, transparent 85%);
    -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 35%, transparent 85%);
}

/* --- Layout ------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* --- Header ------------------------------------------------------------- */
.site-header {
    max-width: 1040px; margin: 0 auto; padding: 22px;
    display: flex; align-items: center; justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-logo { height: 24px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
    color: var(--muted); text-decoration: none; font-weight: 500;
    padding: 8px 12px; border-radius: 8px; font-size: 0.95rem;
    transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--ink); background: rgba(17,17,17,0.05); }
.nav-cta {
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    padding: 8px 16px; border-radius: 9px;
    color: var(--paper); background: var(--ink);
    transition: background .15s ease, transform .12s ease;
}
.nav-cta:hover { background: var(--ink-soft); }

/* --- Hero --------------------------------------------------------------- */
.hero { padding: 60px 0 26px; text-align: center; }
.kicker {
    margin: 0 0 18px; text-transform: uppercase; letter-spacing: 0.16em;
    font-size: 0.76rem; font-weight: 700; color: var(--faint);
    font-family: var(--display);
}
.hero-title {
    font-family: var(--display); font-weight: 600;
    font-size: clamp(2.1rem, 5.6vw, 3.4rem);
    line-height: 1.1; letter-spacing: -0.02em;
    margin: 0 auto 20px; max-width: 16ch; color: var(--ink);
}
/* monochrome "highlighter" emphasis instead of a colored accent */
.hero-title .accent {
    color: var(--ink);
    background: linear-gradient(transparent 62%, rgba(17,17,17,0.12) 0);
    padding: 0 2px;
}
.hero-sub {
    margin: 0 auto 30px; max-width: 50ch;
    color: var(--muted); font-size: clamp(1.02rem, 2.3vw, 1.16rem);
}

/* --- Signup form -------------------------------------------------------- */
.signup { max-width: 520px; margin: 0 auto; }
.field-row {
    display: flex; gap: 8px;
    background: var(--paper-2);
    border: 1px solid var(--border-strong);
    border-radius: 13px; padding: 7px; box-shadow: var(--shadow);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,17,17,0.10), var(--shadow); }
.email-input {
    flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: none;
    color: var(--ink); font-size: 1.02rem; padding: 12px 14px; font-family: inherit;
}
.email-input::placeholder { color: var(--faint); }
.field-row:has(.email-input.error) { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,0.14); }

.signup-btn {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; min-width: 140px; border: 0; border-radius: 9px; cursor: pointer;
    font-family: var(--display); font-size: 1rem; font-weight: 600;
    color: var(--paper); padding: 12px 22px; background: var(--ink);
    transition: background .15s ease, transform .12s ease;
}
.signup-btn:hover { background: var(--ink-soft); }
.signup-btn:active { transform: translateY(1px); }
.signup-btn:disabled { opacity: 0.7; cursor: progress; }
.btn-loader { display: inline-flex; }
.spinner { color: var(--paper); }

.form-microcopy { margin: 14px 0 0; color: var(--faint); font-size: 0.88rem; }
.input-validation, .error-message { margin: 12px auto 0; color: #c0392b; font-size: 0.9rem; font-weight: 500; }
.success-message { margin: 12px auto 0; color: #1d7a46; font-size: 0.95rem; font-weight: 600; }
[hidden] { display: none !important; }

/* --- Sections ----------------------------------------------------------- */
section { scroll-margin-top: 80px; }
.section-title {
    font-family: var(--display); font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.015em;
    text-align: center; margin: 0 0 10px; color: var(--ink);
}
.section-lead { text-align: center; color: var(--muted); max-width: 46ch; margin: 0 auto 28px; }
.sample, .topics, .values { padding: 56px 0; }

/* --- Latest-issue preview card ----------------------------------------- */
.preview-card {
    background: var(--paper-2); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: left;
}
.preview-head {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px; border-bottom: 1px solid var(--border); background: var(--paper-3);
}
.preview-logo {
    width: 40px; height: 40px; border-radius: 10px; background: var(--ink);
    display: grid; place-items: center;
}
.preview-logo img { width: 22px; height: auto; }
.preview-meta { display: flex; flex-direction: column; line-height: 1.3; }
.preview-name { font-weight: 700; font-family: var(--display); }
.preview-date { color: var(--faint); font-size: 0.85rem; }
.preview-content { padding: 6px 22px 14px; }
.preview-content h4 {
    font-family: var(--display); margin: 20px 0 6px; font-size: 1.06rem;
    letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px;
}
.preview-content h4 [role="img"] { font-size: 1rem; }
.preview-content h4 + p { margin-top: 0; }
.preview-content p {
    margin: 0 0 4px; color: var(--muted); font-size: 0.98rem;
    padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.preview-content > *:last-child { border-bottom: 0; padding-bottom: 0; }
.preview-footer { padding: 16px 22px; border-top: 1px solid var(--border); text-align: center; }
.link-cta {
    background: none; border: 0; cursor: pointer; font-family: var(--display);
    color: var(--ink); font-size: 0.98rem; font-weight: 600;
    padding: 6px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px;
    text-decoration-thickness: 1px; transition: color .15s ease;
}
.link-cta:hover { color: var(--muted); }

/* --- Topics ------------------------------------------------------------- */
.topics-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.topic {
    background: var(--paper-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 22px; transition: border-color .18s ease, transform .18s ease;
}
.topic:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.topic-name { font-family: var(--display); margin: 0 0 6px; font-size: 1.06rem; }
.topic-desc { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* --- Values ------------------------------------------------------------- */
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.value { text-align: center; padding: 26px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--paper-2); }
.value-num { display: block; font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: var(--ink); margin-bottom: 8px; letter-spacing: -0.01em; }
.value p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* --- Closing CTA -------------------------------------------------------- */
.closing { text-align: center; padding: 64px 0 40px; }
.closing-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 4.5vw, 2.2rem); letter-spacing: -0.02em; margin: 0 auto 10px; max-width: 18ch; }
.closing-sub { color: var(--muted); margin: 0 auto 26px; max-width: 42ch; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--display); font-weight: 600; font-size: 1rem;
    padding: 13px 24px; border-radius: 11px; cursor: pointer; text-decoration: none;
    border: 1px solid transparent; margin: 4px; transition: background .15s ease, transform .12s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { color: var(--paper); background: var(--ink); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { color: var(--ink); border-color: var(--border-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); background: rgba(17,17,17,0.04); }

/* --- Footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-content {
    max-width: 1040px; margin: 0 auto; padding: 30px 22px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between;
}
.footer-logo { height: 20px; width: auto; }
.footer-links { display: flex; gap: 4px; }
.footer-link { color: var(--muted); text-decoration: none; font-size: 0.92rem; padding: 6px 10px; border-radius: 7px; transition: color .15s ease, background .15s ease; }
.footer-link:hover { color: var(--ink); background: rgba(17,17,17,0.05); }
.footer-text { color: var(--faint); font-size: 0.85rem; margin: 0; width: 100%; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 560px) {
    body { font-size: 16px; }
    .hero { padding: 38px 0 16px; }
    .field-row { flex-direction: column; padding: 10px; }
    .signup-btn { width: 100%; padding: 14px 20px; }
    .topics-grid { grid-template-columns: 1fr; }
    .values-grid { grid-template-columns: 1fr; }
    .footer-content { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
