:root {
  --bg: #ffffff;
  --text: #16150f;
  --muted: #74706a;
  --line: #e7e4de;
  --field: #fafaf8;
  --accent: #15803d;
  --accent-text: #ffffff;
  --success-text: #15803d;
  --error-text: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --text: #f4f2ec;
    --muted: #97928a;
    --line: #2b2a26;
    --field: #1a1a17;
    --accent: #4ade80;
    --accent-text: #10120f;
    --success-text: #4ade80;
    --error-text: #fca5a5;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew",
               "Arial Hebrew", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 1.5rem 3rem;
}

/* Hero */
.brand {
  margin: 0 0 2.5rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 5.5vw, 2.6rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.subhead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  text-wrap: pretty;
}

/* Signup */
.signup { margin-top: 2.75rem; }

.form__row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 30rem) {
  .form__row { grid-template-columns: 1fr 1fr; }
}

.form__field { display: block; }

.form__label {
  display: block;
  margin-bottom: .45rem;
  font-size: .88rem;
  font-weight: 600;
}

.form input[type="text"],
.form input[type="email"] {
  width: 100%;
  padding: .75rem .9rem;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form input::placeholder { color: var(--muted); opacity: .7; }

.form input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.form input[aria-invalid="true"] { border-color: var(--error-text); }

.button {
  display: block;
  inline-size: 100%;
  margin-top: 1.25rem;
  padding: .85rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity .15s ease, transform .05s ease;
}

.button:hover { opacity: .9; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .55; cursor: progress; }

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form__note {
  margin: .85rem 0 0;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

.form__honeypot {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Status messages */
.status {
  margin-bottom: 1.25rem;
  padding-inline-start: .9rem;
  border-inline-start: 3px solid currentColor;
  font-size: .95rem;
  font-weight: 500;
}

.status--success { color: var(--success-text); }
.status--error { color: var(--error-text); }
.is-hidden { display: none; }

/* Latest issue (hidden unless SHOW_LATEST_ISSUE=true) */
.issue { margin-top: 4.5rem; }

.issue__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.issue h2 { margin: 0; font-size: 1.15rem; }

.issue__meta { margin: 0; font-size: .85rem; color: var(--muted); }

.posts { list-style: none; margin: 0; padding: 0; }

.post {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.post:last-child { border-bottom: 0; }

.post__title { margin: 0 0 .35rem; font-size: 1.05rem; line-height: 1.4; }

.post__summary { margin: 0 0 .6rem; color: var(--muted); font-size: .95rem; }

.post__link {
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.post__link:hover { text-decoration: underline; }

/* Footer */
.footer {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: .85rem;
  color: var(--muted);
}

.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
