:root {
  --bg: #f5f1ea;
  --surface: #fbf8f3;
  --surface-strong: #fffdf8;
  --text: #151412;
  --text-soft: #4b4742;
  --line: #d9d0c2;
  --accent: #9a6a2f;
  --accent-soft: #e8dcc9;
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(154, 106, 47, 0.08), transparent 38%),
    radial-gradient(circle at 85% 88%, rgba(21, 20, 18, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Noto Serif", Georgia, serif;
  line-height: 1.75;
}

body.modal-open {
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(0, 0, 0, 0.03) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  opacity: 0.22;
  z-index: 0;
}

.frame-line {
  position: fixed;
  left: 2.4rem;
  right: 2.4rem;
  height: 1px;
  background: var(--line);
  pointer-events: none;
  z-index: 1;
}

.frame-line.top {
  top: 1.6rem;
}

.frame-line.bottom {
  bottom: 1.6rem;
}

.site-header,
main,
.site-footer {
  width: min(1180px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.8rem 0 1.2rem;
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-family: "Bodoni Moda", "Times New Roman", serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.03em;
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  text-decoration: none;
  color: var(--text-soft);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
}

nav a.active,
nav a:hover {
  color: var(--text);
  border-bottom-color: var(--line);
}

main {
  min-height: calc(100vh - 210px);
}

.hero {
  padding: 5.6rem 0 4.8rem;
  max-width: 780px;
}

.page-intro {
  padding: 3rem 0 2rem;
  max-width: 780px;
}

.home-main .single-screen {
  min-height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2rem;
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif", Georgia, serif;
  line-height: 1.24;
  font-weight: 500;
}

h1 {
  margin-top: 1rem;
  font-size: clamp(2.1rem, 6vw, 4.7rem);
}

h2 {
  margin-top: 0.7rem;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
}

.lead {
  margin-top: 1.5rem;
  color: var(--text-soft);
  max-width: 640px;
  font-size: clamp(1rem, 2vw, 1.14rem);
}

.actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.btn {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
  background: transparent;
  color: var(--text);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.block {
  padding: 4rem 0 5.2rem;
  border-top: 1px solid var(--line);
}

.page-intro + .block {
  padding-top: 2.2rem;
}

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

.essay-grid.single {
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.essay-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.4rem;
}

.meta,
.text-link,
.philosopher,
.mini-note,
.source,
.modal-close {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

.meta {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.essay-card p {
  color: var(--text-soft);
}

.text-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.essay-article {
  max-width: 860px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.article-nav {
  margin-top: 0.9rem;
}

.article-nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.essay-article h2 {
  margin-top: 2.2rem;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.essay-article h3 {
  margin-top: 1.7rem;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
}

.essay-article p {
  color: var(--text-soft);
  margin: 0.9rem 0 0;
}

.essay-article .split-quote {
  margin: 1.1rem 0 0;
}

.essay-article .split-quote p {
  margin: 0.25rem 0;
  color: var(--text);
}

.essay-article ol,
.essay-article ul {
  margin: 0.8rem 0 0;
  padding-left: 1.4rem;
  color: var(--text-soft);
}

.essay-article li {
  margin-top: 0.35rem;
}

.reading-links {
  list-style: none;
  padding-left: 0;
}

.reading-links li {
  margin-top: 0.6rem;
}

.reading-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.inspiration-layout {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 1rem;
}

.input-panel,
.insight-card {
  border: 1px solid var(--line);
  background: var(--surface);
}

.input-panel {
  padding: 1.5rem;
}

.input-panel label {
  display: block;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

textarea {
  width: 100%;
  margin-top: 0.75rem;
  min-height: 170px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 0.82rem;
  resize: vertical;
  font: inherit;
  color: var(--text);
}

.input-panel .btn {
  margin-top: 0.9rem;
}

.input-panel .helper-text {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--text-soft);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.card-grid {
  display: grid;
  gap: 0.9rem;
}

.status-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.3rem;
  color: var(--text-soft);
}

.status-card.error {
  border-color: rgba(160, 43, 43, 0.38);
  background: rgba(160, 43, 43, 0.06);
  color: #6f2b2b;
}

.insight-card {
  text-align: left;
  padding: 1.3rem;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.insight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(154, 106, 47, 0.55);
}

.philosopher {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--text-soft);
}

blockquote {
  margin: 0.7rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--accent);
  font-family: "Bodoni Moda", "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.55;
}

.mini-note {
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.insight-excerpt {
  margin-top: 0.8rem;
  color: var(--text-soft);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.modal-panel {
  position: relative;
  width: min(720px, 92vw);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  padding: 1.8rem;
  box-shadow: 0 24px 50px rgba(21, 20, 18, 0.15);
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-body {
  color: var(--text-soft);
  margin-top: 1rem;
}

.modal-label {
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--text-soft);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source {
  margin-bottom: 0;
  margin-top: 0.9rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.site-footer {
  padding: 2.2rem 0 3.8rem;
  color: var(--text-soft);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 1100px) {
  .essay-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .frame-line {
    left: 1rem;
    right: 1rem;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding-top: 2rem;
  }

  .hero {
    padding: 3.8rem 0 3.8rem;
  }

  .page-intro {
    padding: 2.6rem 0 1.8rem;
  }

  .essay-grid,
  .inspiration-layout {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .essay-grid {
    grid-template-columns: 1fr;
  }
}
