:root {
  --color-bg: #fbfaf8;
  --color-surface: #ffffff;
  --color-surface-alt: #f4f0ea;
  --color-text: #171614;
  --color-muted: #68615b;
  --color-border: rgba(23, 22, 20, 0.12);
  --color-border-strong: rgba(23, 22, 20, 0.2);
  --color-accent: #171614;
  --color-accent-soft: #26221f;
  --color-inverse: #f8f5f0;
  --color-dark-surface: #161411;
  --shadow-soft: 0 20px 50px rgba(23, 22, 20, 0.08);
  --shadow-card: 0 20px 45px rgba(23, 22, 20, 0.06);
  --max-width: 1180px;
  --max-width-narrow: 760px;
  --header-height: 5rem;
  --transition: 180ms ease;
}

:root[data-theme="dark"] {
  --color-bg: #11100e;
  --color-surface: #1a1815;
  --color-surface-alt: #201d19;
  --color-text: #f4efe7;
  --color-muted: #b8aea1;
  --color-border: rgba(244, 239, 231, 0.12);
  --color-border-strong: rgba(244, 239, 231, 0.2);
  --color-accent: #f4efe7;
  --color-accent-soft: #e6ddd0;
  --color-inverse: #171411;
  --color-dark-surface: #0d0c0a;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.24);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
textarea,
select {
  width: 100%;
}

svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
}

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

.screen-reader-text:focus {
  clip: auto;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  margin: 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  z-index: 9999;
}

.site-shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.narrow-shell {
  width: min(calc(100% - 2rem), var(--max-width-narrow));
}

.site-main {
  min-height: 60vh;
}

.eyebrow {
  margin: 0 0 1rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-muted);
}

h1,
h2,
h3,
h4,
blockquote,
.text-logo,
.footer-logo {
  font-family: "Playfair Display", serif;
  letter-spacing: -0.02em;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
blockquote {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.95rem 1.5rem;
  border: 1px solid transparent;
  transition: transform var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
}

.button:hover {
  transform: translateY(-1px);
}

.button-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
}

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

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

.button-secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.button-secondary:hover {
  border-color: var(--color-text);
}

.button-light {
  background: var(--color-surface);
  color: #11100e;
}

.button-light:hover {
  background: #ece7df;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 999;
  background: color-mix(in srgb, var(--color-surface) 78%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.header-shell {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.text-logo,
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  font-size: clamp(1.7rem, 2vw, 2rem);
  font-weight: 700;
}

.custom-logo-link img {
  max-height: 56px;
  width: auto;
}

.primary-navigation {
  margin-left: auto;
}

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

.primary-menu,
.mobile-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.primary-menu a,
.mobile-menu a,
.footer-menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: 0.96rem;
}

.primary-menu a::after,
.mobile-menu a::after,
.footer-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.55rem;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--transition);
}

.primary-menu a:hover::after,
.primary-menu .current-menu-item a::after,
.mobile-menu a:hover::after,
.mobile-menu .current-menu-item a::after,
.footer-menu a:hover::after,
.footer-menu .current-menu-item a::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.theme-toggle,
.menu-toggle {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.theme-toggle:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
  background: var(--color-surface-alt);
}

.theme-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.theme-toggle-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-icon-moon {
  display: block;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-toggle span {
  width: 1rem;
  height: 1px;
  background: currentColor;
}

.mobile-navigation {
  display: none;
}

.hero-section {
  position: relative;
  min-height: min(94vh, 58rem);
  padding-top: calc(var(--header-height) + 2rem);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(251, 250, 248, 0.94) 12%, rgba(251, 250, 248, 0.72) 36%, rgba(251, 250, 248, 0.18) 64%, rgba(251, 250, 248, 0) 100%),
    var(--hero-image);
  background-size: cover;
  background-position: center;
}

:root[data-theme="dark"] .hero-media {
  background-image:
    linear-gradient(90deg, rgba(17, 16, 14, 0.96) 12%, rgba(17, 16, 14, 0.84) 42%, rgba(17, 16, 14, 0.42) 68%, rgba(17, 16, 14, 0.16) 100%),
    var(--hero-image);
}

.hero-shell {
  position: relative;
  min-height: calc(94vh - var(--header-height));
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 38rem;
}

.hero-content h1 {
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.3;
  font-style: italic;
  margin-bottom: 2rem;
}

.hero-divider,
.section-divider {
  width: 3rem;
  height: 1px;
  background: var(--color-border-strong);
}

.hero-divider {
  margin-bottom: 2rem;
}

.hero-description {
  max-width: 31rem;
  font-size: 1.05rem;
  color: var(--color-muted);
  margin-bottom: 2.4rem;
}

.ideas-section,
.latest-writing-section,
.quote-section,
.content-section {
  padding: clamp(4.5rem, 9vw, 7rem) 0;
}

.section-heading,
.section-header {
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading {
  text-align: center;
}

.section-heading h2,
.split-header h2,
.newsletter-copy h2,
.deeper-reads-copy h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}

.section-divider {
  margin: 0 auto;
}

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

.idea-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.idea-card:hover {
  transform: translateY(-4px);
  transition: transform var(--transition);
}

.idea-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  padding: 0.95rem;
  border-radius: 999px;
  background: var(--color-surface-alt);
}

.idea-card h3 {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.idea-card p,
.latest-writing-body p,
.page-hero p,
.empty-state p,
.post-card-excerpt,
.editorial-content,
.newsletter-copy p {
  color: var(--color-muted);
}

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

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.latest-writing-list {
  border-top: 1px solid var(--color-border);
}

.latest-writing-item {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.latest-writing-thumb {
  overflow: hidden;
  background: var(--color-surface-alt);
  aspect-ratio: 16 / 10;
}

.latest-writing-thumb img,
.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.latest-writing-item:hover .latest-writing-thumb img,
.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.latest-writing-body h3,
.post-card-title,
.single-article-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.14;
}

.latest-writing-body h3,
.post-card-title {
  margin-bottom: 0.75rem;
}

.latest-writing-meta,
.post-card-meta,
.single-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  color: var(--color-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.deeper-reads-section {
  display: grid;
  background: var(--color-dark-surface);
  color: #f4efe7;
}

.deeper-reads-copy {
  padding: clamp(3rem, 8vw, 6rem) min(7vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.deeper-reads-copy p:not(.eyebrow) {
  max-width: 33rem;
  color: rgba(244, 239, 231, 0.74);
  margin-bottom: 2rem;
}

.deeper-reads-media img {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  object-fit: cover;
  filter: grayscale(1);
  opacity: 0.86;
}

.quote-section {
  background: var(--color-surface-alt);
  text-align: center;
}

.quote-mark {
  font-size: 3rem;
  opacity: 0.6;
  margin-bottom: 1rem;
}

.quote-section blockquote {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.35;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.quote-section cite {
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

.newsletter-section {
  position: relative;
  padding: clamp(4.5rem, 9vw, 6.5rem) 0;
  background-image:
    linear-gradient(rgba(12, 11, 10, 0.72), rgba(12, 11, 10, 0.72)),
    var(--newsletter-image);
  background-position: center;
  background-size: cover;
  color: #f4efe7;
}

.newsletter-shell {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.newsletter-copy p {
  max-width: 34rem;
  color: rgba(244, 239, 231, 0.82);
}

.newsletter-placeholder-form,
.newsletter-shortcode-output form,
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.newsletter-placeholder-form input,
.newsletter-shortcode-output input,
.newsletter-shortcode-output textarea,
.newsletter-shortcode-output select,
.search-field {
  min-height: 3.4rem;
  padding: 0.95rem 1rem;
  border: 1px solid transparent;
  background: var(--color-surface);
  color: #11100e;
}

.newsletter-placeholder-form button,
.newsletter-shortcode-output button,
.newsletter-shortcode-output input[type="submit"],
.search-form .button {
  border: 0;
  background: var(--color-surface);
  color: #11100e;
  padding-inline: 1.5rem;
  min-width: 10rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.newsletter-placeholder-note {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: rgba(244, 239, 231, 0.82);
}

.site-footer {
  background: var(--color-dark-surface);
  color: #f4efe7;
  padding: clamp(4rem, 7vw, 6rem) 0;
}

.footer-shell {
  display: grid;
  gap: 2.5rem;
}

.footer-brand,
.footer-column {
  min-width: 0;
}

.footer-column h2 {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: rgba(244, 239, 231, 0.62);
  margin-bottom: 1rem;
}

.footer-logo {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.footer-tagline,
.footer-copyright,
.footer-closing {
  color: rgba(244, 239, 231, 0.72);
}

.footer-copyright {
  margin-top: 2rem;
  font-size: 0.88rem;
}

.footer-column-accent {
  position: relative;
}

.footer-closing {
  margin-top: 2rem;
  font-style: italic;
}

.footer-mark {
  width: 3rem;
  height: 1.8rem;
  margin-top: 1rem;
}

.page-hero {
  padding: calc(var(--header-height) + 4rem) 0 2.5rem;
}

.page-hero-compact {
  padding-bottom: 0.5rem;
}

.page-hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.posts-grid {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.post-card-image {
  display: block;
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.post-card-body {
  padding: 1.5rem;
}

.post-card-category {
  margin-bottom: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-muted);
}

.empty-state,
.error-shell {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.empty-state h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.12;
  margin-bottom: 1rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}

.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.page-numbers,
.post-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.page-numbers.current {
  background: var(--color-accent);
  color: var(--color-inverse);
  border-color: var(--color-accent);
}

.single-article-header {
  padding: calc(var(--header-height) + 4rem) 0 2rem;
}

.single-article-meta {
  margin-top: 1.5rem;
}

.single-article-media {
  margin-bottom: 2.5rem;
}

.single-article-image {
  width: 100%;
  max-height: 38rem;
  object-fit: cover;
  border-radius: 1.25rem;
}

.editorial-content {
  font-size: 1.08rem;
}

.editorial-content > * + * {
  margin-top: 1.3rem;
}

.editorial-content h2,
.editorial-content h3,
.editorial-content h4 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.2;
  margin-top: 2.2rem;
}

.editorial-content img {
  border-radius: 1rem;
}

.editorial-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-alt);
  font-size: 1.35rem;
  line-height: 1.45;
}

.editorial-content ul,
.editorial-content ol {
  padding-left: 1.4rem;
}

.editorial-content a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.post-navigation {
  padding: 0 0 2rem;
}

.post-navigation .nav-links {
  width: min(calc(100% - 2rem), var(--max-width-narrow));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-navigation a {
  min-height: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.post-nav-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--color-muted);
}

.post-nav-title {
  font-family: "Playfair Display", serif;
  font-size: 1.15rem;
}

.comments-area {
  width: min(calc(100% - 2rem), var(--max-width-narrow));
  margin: 0 auto 5rem;
  padding-top: 1rem;
}

.comments-title,
.comment-reply-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.comment-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
}

.comment-list li + li {
  margin-top: 1rem;
}

.comment-form {
  display: grid;
  gap: 1rem;
}

.comment-form input,
.comment-form textarea {
  min-height: 3.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.comment-form textarea {
  min-height: 10rem;
}

.search-form {
  margin-top: 1.5rem;
}

.search-form label {
  flex: 1 1 18rem;
}

.search-field {
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.search-form .button {
  flex: 0 0 auto;
}

@media (min-width: 700px) {
  .newsletter-shell,
  .latest-writing-item,
  .footer-shell {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .newsletter-copy,
  .latest-writing-body,
  .footer-brand {
    grid-column: span 6;
  }

  .newsletter-form-wrap,
  .latest-writing-meta {
    grid-column: span 6;
  }

  .latest-writing-item {
    grid-template-columns: 16rem minmax(0, 1fr) 8rem;
  }

  .latest-writing-thumb {
    aspect-ratio: auto;
    height: 10rem;
  }

  .latest-writing-meta {
    align-items: flex-end;
    justify-content: flex-start;
    flex-direction: column;
    text-align: right;
  }

  .newsletter-shell {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  }

  .footer-shell {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }

  .ideas-grid,
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .ideas-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deeper-reads-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 38rem;
  }
}

@media (max-width: 899px) {
  .desktop-navigation {
    display: none;
  }

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

  .mobile-navigation {
    display: block;
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 96%, transparent);
  }

  .mobile-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1rem 1rem;
  }

  .mobile-menu a {
    min-height: 3.25rem;
  }

  .site-header.is-open .menu-toggle span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
  }

  .site-header.is-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.is-open .menu-toggle span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
  }

  .menu-toggle span {
    transition: transform var(--transition), opacity var(--transition);
  }
}

@media (max-width: 699px) {
  .site-shell,
  .narrow-shell {
    width: min(calc(100% - 1.25rem), var(--max-width));
  }

  .split-header,
  .newsletter-placeholder-form,
  .newsletter-shortcode-output form,
  .search-form,
  .post-navigation .nav-links {
    display: grid;
  }

  .post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .newsletter-placeholder-form button,
  .newsletter-shortcode-output button,
  .newsletter-shortcode-output input[type="submit"],
  .search-form .button {
    width: 100%;
  }

  .single-article-image {
    border-radius: 0.9rem;
  }
}
