:root {
  --bg: #f3ebdf;
  --bg-strong: #dfccb0;
  --surface: rgba(255, 248, 240, 0.86);
  --surface-strong: #fff8f0;
  --ink: #1e1712;
  --muted: #675345;
  --line: rgba(86, 55, 35, 0.18);
  --accent: #a04426;
  --accent-deep: #712713;
  --shadow: 0 20px 60px rgba(59, 31, 16, 0.12);
  --headline: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Baskerville, Georgia, serif;
  --body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.64), transparent 24%),
    radial-gradient(circle at right 20%, rgba(160, 68, 38, 0.12), transparent 20%),
    linear-gradient(180deg, #efe3d1 0%, var(--bg) 48%, #f7f0e8 100%);
}

.site-body {
  position: relative;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-shell {
  width: min(1140px, calc(100vw - 2rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  position: relative;
  z-index: 2;
}

.brand-block {
  display: grid;
  gap: 0.2rem;
}

.brand-mark {
  font-family: var(--headline);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.main-nav a {
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  border-color: currentColor;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hero-section,
.section-block,
.page-space {
  padding: 2rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
  align-items: stretch;
}

.hero-copy,
.hero-portrait-card,
.value-card,
.project-card,
.journal-card,
.journal-row,
.entry-shell {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy,
.hero-portrait-card {
  border-radius: 32px;
  overflow: hidden;
}

.hero-copy {
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--headline);
  line-height: 0.96;
}

.hero-copy h1 {
  font-size: clamp(3rem, 8vw, 6.2rem);
  max-width: 10ch;
}

.lead {
  margin: 1.1rem 0 0;
  max-width: 40rem;
  font-size: 1.2rem;
  line-height: 1.65;
}

.supporting-copy,
.value-card p,
.project-card p,
.journal-card p,
.journal-row p,
.entry-content p,
.story-copy p {
  color: var(--muted);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
}

.button-primary {
  background: var(--accent);
  color: #fff8f2;
}

.button-primary:hover {
  background: var(--accent-deep);
}

.button-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.hero-portrait-card {
  display: grid;
  grid-template-rows: minmax(350px, 1fr) auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(233, 212, 185, 0.9));
}

.hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card-copy {
  padding: 1.5rem;
}

.hero-card-copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.85rem;
}

.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2,
.page-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  max-width: 15ch;
}

.page-intro {
  max-width: 48rem;
}

.split-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
}

.value-grid,
.project-grid,
.journal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.value-card,
.project-card,
.journal-card {
  border-radius: 24px;
  padding: 1.4rem;
}

.value-card h3,
.project-card h3,
.journal-card h3,
.journal-row h2 {
  margin-bottom: 0.8rem;
  font-size: 1.6rem;
}

.story-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  align-items: center;
}

.manifesto-band {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
  align-items: start;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.2rem 0;
}

.manifesto-mark {
  font-family: var(--headline);
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.9;
  color: rgba(113, 39, 19, 0.65);
}

.manifesto-copy h2,
.footer-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  max-width: 18ch;
}

.story-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.story-images img {
  border-radius: 28px;
  min-height: 440px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.inline-link {
  display: inline-flex;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--accent-deep);
  font-weight: 700;
}

.journal-meta,
.journal-row-meta {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.journal-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.journal-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.journal-list {
  display: grid;
  gap: 1rem;
}

.empty-state,
.flash,
.login-card,
.admin-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.empty-state,
.login-card,
.admin-panel {
  border-radius: 28px;
  padding: 1.4rem;
}

.flash {
  margin-bottom: 1rem;
  border-radius: 18px;
  padding: 0.95rem 1rem;
}

.flash-success {
  background: rgba(64, 132, 91, 0.12);
  color: #18492b;
}

.flash-error {
  background: rgba(160, 68, 38, 0.12);
  color: #5f1f10;
}

.journal-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 1.25rem;
  align-items: start;
  padding: 1.4rem;
  border-radius: 24px;
}

.entry-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  border-radius: 32px;
  padding: 2rem;
}

.entry-date {
  margin: 1rem 0 0;
  color: var(--muted);
}

.entry-content {
  display: grid;
  gap: 1.15rem;
  margin-top: 2rem;
}

.entry-image {
  width: 100%;
  margin-top: 1.5rem;
  border-radius: 24px;
  max-height: 480px;
  object-fit: cover;
}

.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.35), rgba(225, 205, 177, 0.6));
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
}

.footer-links {
  display: grid;
  gap: 0.6rem;
  justify-items: end;
  font-weight: 700;
}

.reveal-on-load {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal-on-load.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.login-card {
  width: min(640px, 100%);
  margin: 0 auto;
}

.login-card-wide {
  width: min(760px, 100%);
}

.admin-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-form label {
  display: grid;
  gap: 0.45rem;
}

.admin-form span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font: inherit;
  padding: 0.85rem 0.95rem;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form-wide {
  max-width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: #862d17;
  color: #fff7f0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.checkbox-row input {
  width: auto;
}

.image-preview-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.image-preview-card img {
  width: 100%;
  max-width: 320px;
  border-radius: 16px;
}

.danger-form {
  margin-top: 1.2rem;
}

.admin-body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.64), transparent 24%),
    linear-gradient(180deg, #eee0cc 0%, #f8f1e8 100%);
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  background: rgba(244, 231, 211, 0.8);
}

.admin-nav {
  display: grid;
  gap: 0.65rem;
  margin-top: 2rem;
}

.admin-nav a {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.44);
}

.admin-nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff8f2;
}

.admin-sidebar-footer {
  margin-top: 2rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.admin-main {
  padding: 1.5rem;
}

.admin-topbar {
  margin-bottom: 1rem;
}

.admin-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.admin-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-subtext {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-draft {
  background: rgba(120, 96, 72, 0.14);
  color: #5a4534;
}

.status-published {
  background: rgba(64, 132, 91, 0.14);
  color: #1e5c35;
}

@media (max-width: 960px) {
  .hero-grid,
  .value-grid,
  .project-grid,
  .journal-grid,
  .story-band,
  .journal-row,
  .admin-shell,
  .form-grid,
  .manifesto-band {
    grid-template-columns: 1fr;
  }

  .split-heading,
  .site-header,
  .admin-section-heading,
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .story-images img {
    min-height: 320px;
  }

  .admin-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .footer-links {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(1140px, calc(100vw - 1.25rem));
  }

  .hero-copy,
  .hero-portrait-card,
  .value-card,
  .project-card,
  .journal-card,
  .journal-row,
  .entry-shell {
    border-radius: 22px;
  }

  .hero-copy,
  .hero-card-copy,
  .value-card,
  .project-card,
  .journal-card,
  .journal-row,
  .entry-shell {
    padding: 1.2rem;
  }

  .story-images {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    display: none;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 248, 240, 0.96);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: grid;
  }
}
