/* ── Fonts ───────────────────────────────────── */

:root {
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Lato', 'Helvetica Neue', Arial, sans-serif;

  --text:    #1a1a0e;
  --muted:   rgba(26, 26, 14, 0.5);
  --bg:      #f5f0a8;
  --ink:     #2c2c1e;

  --side-pad: max(1.5rem, calc((100vw - 960px) / 2));
  --hero-font-size: clamp(2.5rem, 4.5vw, 3.5rem);
}

/* ── Reset ───────────────────────────────────── */

/* Suppress transitions during window resize (applied via script.js) */
.no-transition * { transition: none !important; }

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

/* Force consistent font rendering on form elements */
input, textarea, button, select {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: inherit;
}

/* ── Base ────────────────────────────────────── */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;  /* 14px — one size for all body/UI text */
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* First content section absorbs extra space so .signup stays flush above footer */
main > *:first-child {
  flex: 1;
}

/* ── Nav ─────────────────────────────────────── */

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.75rem var(--side-pad) 0.75rem;
}

/* Nav brand uses the display serif — same size as body so it reads as a wordmark */
.nav-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
}

.nav-toggle { display: none; }
.nav-toggle-label { display: none; }
.nav-scrim { display: none; }
.nav-links { display: flex; }

/* Nav link uses body font — identical to all other small text */
.nav-link {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
}

@media (hover: hover) {
  .nav-link:hover { text-decoration: underline; }
}

.nav-link-active::before {
  content: "›";
  margin-right: 0.3em;
}

/* ── Button ──────────────────────────────────── */

.btn {
  display: inline-block;
  background-color: var(--ink);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.85;
}

/* ── Footer ──────────────────────────────────── */

footer {
  padding: 1.5rem var(--side-pad);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ════════════════════════════════════════════════
   HOME PAGE
   ════════════════════════════════════════════════ */

.hero {
  padding: 5rem var(--side-pad) 2rem;
}

.hero-label {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: var(--hero-font-size);
  font-weight: 400;
  line-height: 1.17;
  margin-bottom: 1.75rem;
  max-width: 16em;
  text-wrap: balance;
}

.hero h1 strong {
  font-weight: 700;
}

.hero-subtext {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.8;
  max-width: calc(16 * var(--hero-font-size));
}

/* ── Email Signup ────────────────────────────── */

.signup {
  padding: 3rem var(--side-pad) 2.5rem;
}

.signup h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1.75rem;
}

.signup-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.signup-row input[type="email"] {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.65rem 0.9rem;
  background: #fff;
  border: 1px solid rgba(44, 44, 30, 0.3);
  border-radius: 4px;
  outline: none;
  color: var(--text);
  width: 240px;
}

.signup-row input[type="email"]::placeholder {
  color: var(--muted);
}

.signup-row input[type="email"]:focus {
  border-color: var(--ink);
}

[data-members-subscribe] .cf-turnstile {
  margin-bottom: 0.75rem;
}

.signup-feedback {
  display: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

[data-members-subscribe].success .signup-feedback--success { display: block; }
[data-members-subscribe].error  .signup-feedback--error   { display: block; }
[data-members-subscribe].loading .signup-row .btn          { opacity: 0.6; pointer-events: none; }

.signup-disclaimer {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ════════════════════════════════════════════════
   CONTACT PAGE
   ════════════════════════════════════════════════ */

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 5rem var(--side-pad) 2rem;
  align-items: start;
}

.contact-intro h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.contact-intro p {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
}

/* ── Contact Form ────────────────────────────── */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group-label {
  font-family: var(--sans);
  font-size: 0.875rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-family: var(--sans);
  font-size: 0.875rem;
}

.form-field label .req {
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 400;
  background: #fff;
  border: 1px solid rgba(44, 44, 30, 0.25);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  outline: none;
  width: 100%;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--ink);
}

.form-field textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 700px) {

  /* ── Nav ── */

  nav {
    align-items: center;
  }

  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    position: relative;
    z-index: 200;
  }

  .nav-toggle-label span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
    position: relative;
  }

  /* Hamburger → X */
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Scrim — nearly-invisible dismiss layer; non-zero bg required for iOS Safari hit detection */
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 14, 0.08);
    z-index: 50;
    visibility: hidden;
    transition: visibility 0s linear 0.2s;
    cursor: default;
  }
  .nav-toggle:checked ~ .nav-scrim {
    visibility: visible;
    transition: visibility 0s linear 0s;
  }

  /* Popover */
  .nav-links {
    position: fixed;
    top: 4rem;
    right: 1rem;
    width: min(200px, calc(100vw - 2rem));
    background: var(--bg);
    border: 1px solid rgba(26, 26, 14, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(26, 26, 14, 0.14), 0 2px 8px rgba(26, 26, 14, 0.08);
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    gap: 0;
    z-index: 100;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .nav-toggle:checked ~ .nav-links {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0s;
  }

  /* Larger tap targets in popover */
  .nav-links .nav-link {
    font-size: 1.1rem;
    padding: 0.6rem 0;
  }
  .nav-links .nav-link + .nav-link {
    border-top: 1px solid rgba(26, 26, 14, 0.07);
  }

  /* ── Home Page ── */

  .hero {
    padding: 4rem 1.5rem 3rem;
  }

  /* ── Shared: Email Signup ── */

  .signup {
    padding: 3.5rem 1.5rem;
  }

  .signup-row {
    flex-wrap: wrap;
  }

  .signup-row input[type="email"] {
    width: 100%;
  }

  /* ── Contact Page ── */

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 4rem 1.5rem;
  }
}
