/* The Unfinished Mind — one colour, three sage shades.
   Ammar's feedback (Nov 25, 2026): the multi-colour dress-up felt
   like a children's website — too many colours. So: one hue only,
   sage green, in three light-to-medium shades. No dark shades, no
   peach, butter, mist blue or pine. Body text stays a dark charcoal
   for readability (that is text, not a palette colour).
   Palette (research, Nov 2026 — monochromatic "Misty Sage" scale):
   page #F2F6F1 (very light sage), surface #DBE7D7 (soft light sage),
   accent #4F6B52 (medium sage, links + buttons).
   Contrast on the page background: body text 10.9:1, muted text
   5.5:1, links 5.4:1, white on buttons 5.9:1 — all pass WCAG AA. */
:root {
  /* Light-only site: without this, phones and browsers in dark mode
     auto-darken the page (dark background, light text). This line
     tells them the site is light only, so the sage palette below
     always shows as designed, on every device. */
  color-scheme: light;
  --page: #f2f6f1;
  --surface: #dbe7d7;
  --accent: #4f6b52;
  --text: #2e3a32;
  --muted: #55665a;
  --rule: rgba(79, 107, 82, 0.35);
  --shadow: rgba(46, 58, 50, 0.14);
  --backdrop: rgba(46, 58, 50, 0.3);
}

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

body {
  background: var(--page);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header,
main,
footer {
  max-width: 40rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.site-header nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.site-header a {
  color: var(--text);
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

.site-title {
  font-weight: 700;
  color: var(--text);
}

.nav-links a {
  margin-left: 1rem;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  overflow-wrap: break-word;
}

h1 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.6rem;
  line-height: 1.3;
  margin: 0 0 1rem;
  color: var(--text);
}

h2 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

.post-date {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.25rem;
}

.post-list-date {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.post-list-desc {
  margin: 0.25rem 0 0;
}

.about-photo {
  display: block;
  width: 150px;
  height: 150px;
  max-width: 100%;
  margin: 0 0 1rem;
}

footer {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Email signup box (end of posts, homepage) */
.signup-box {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}

.signup-box h2 {
  margin-top: 0;
}

.signup-box label {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.signup-box input[type="email"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--accent);
  margin-bottom: 0.75rem;
  background: var(--page);
  color: var(--text);
}

.signup-box button {
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.signup-box button:hover {
  filter: brightness(0.92);
}

.signup-small {
  color: var(--muted);
  font-size: 0.9rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Email signup pop-up: bottom slide-in, never a centre modal.
   Mobile: full-width bar at the bottom, at most half the screen tall. */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 90;
}

.popup-backdrop.visible {
  opacity: 1;
}

.popup {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  max-height: 50vh;
  overflow-y: auto;
  background: var(--surface);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 20px var(--shadow);
  transform: translateY(100%);
  transition: transform 0.3s;
}

.popup.visible {
  transform: translateY(0);
}

.popup .signup-box {
  border: none;
  margin: 0;
}

/* Inviting line at the top of the pop-up only (not in the
   signup boxes). Simple words, in Ammar's voice. */
.popup-intro {
  margin: 0;
  padding: 1.25rem 3rem 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem 0.5rem;
}

@media (min-width: 640px) {
  .popup {
    left: auto;
    right: 1rem;
    bottom: 1rem;
    width: 26rem;
    max-width: calc(100vw - 2rem);
    border: 1px solid var(--rule);
  }
}

/* Homepage hero + post cards (redesign Nov 25, 2026): the first
   live version showed posts as a plain list of titles, which read
   like a bare HTML page. The preview Ammar approved shows posts as
   cards in a grid, so the real site now matches that — same three
   sage shades, no new colours. */
.hero {
  padding: 1rem 0 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.hero-kicker {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.hero-intro {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

@media (min-width: 700px) {
  .post-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
}

.post-card:hover {
  border-color: var(--accent);
}

.post-card h3 {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.post-card-desc {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.55;
}

.post-card-date {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}
