/* Mobile-first: base styles are the iPhone layout; wider screens are the
   enhancement. Primary device: iPhone 17 Air. */

:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --ink: #26221c;
  --muted: #6d6558;
  --accent: #b4552d;
  --nav-bg: rgba(250, 247, 242, 0.88);
  --hairline: rgba(38, 34, 28, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --ink: #ece7de;
    --muted: #a39a8b;
    --accent: #e08a5c;
    --nav-bg: rgba(23, 21, 18, 0.88);
    --hairline: rgba(236, 231, 222, 0.16);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-serif, "Iowan Old Style", Georgia, serif;
  font-size: 1.0625rem;          /* ≥17px body — legible without zoom */
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/* One centered column with safe-area-aware gutters */
header, main {
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: max(1.375rem, env(safe-area-inset-left))
                  max(1.375rem, env(safe-area-inset-right));
}

header {
  padding-top: max(1.25rem, env(safe-area-inset-top));
}

.wordmark {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

main {
  /* clear the fixed thumb nav + home-indicator inset */
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.hero {
  padding-block: 18svh 3rem;
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(2.4rem, 11vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  font-weight: 650;
}

.lede {
  margin: 0;
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 30ch;
}

section {
  padding-block: 1.6rem;
  scroll-margin-top: 1rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

p { margin: 0.4rem 0 0; max-width: 60ch; }

footer {
  padding-block: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

/* Thumb nav: fixed to the bottom on phones, every target ≥48px tall */
nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}

nav a {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 550;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

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

a:focus-visible, nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 2;
}

.skip:focus { left: 0; }

/* Wider screens: nav joins the header row, column breathes */
@media (min-width: 700px) {
  body { font-size: 1.125rem; }

  nav {
    position: static;
    max-width: 40rem;
    margin: -2.4rem auto 0;   /* sits beside the wordmark visually */
    padding: 0 1.375rem;
    background: none;
    border-top: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    justify-content: flex-end;
    gap: 0.25rem;
  }

  nav a {
    flex: 0 0 auto;
    padding: 0.35rem 0.8rem;
  }

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

  main { padding-bottom: 3rem; }

  .hero { padding-block: 22svh 4rem; }
}
