:root {
  --ink: #0b2e36;
  --ink-soft: #184955;
  --teal: #147a86;
  --teal-deep: #0d5a64;
  --foam: #e8f4f5;
  --paper: #f7f3ec;
  --sand: #efe6d6;
  --amber: #c97816;
  --amber-deep: #9a5a0d;
  --line: rgba(11, 46, 54, 0.12);
  --white: #fffdf9;
  --shadow: 0 18px 40px rgba(11, 46, 54, 0.12);
  --radius: 18px;
  --font-ui: "Manrope", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(20, 122, 134, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(201, 120, 22, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f7f5 0%, var(--paper) 42%, #f1ebe1 100%);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
}

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

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--amber-deep);
}

.screen-reader-text,
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1rem;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(247, 243, 236, 0.9);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.brand-portal {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a9395;
  line-height: 1;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 auto;
  width: clamp(280px, 34vw, 560px);
  max-width: 560px;
  min-width: 260px;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1px solid rgba(11, 46, 54, 0.16);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.header-search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 122, 134, 0.12);
}

.header-search-icon {
  display: inline-flex;
  color: #7b8588;
  flex-shrink: 0;
}

.header-search-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.header-search-field::placeholder {
  color: #8a9395;
  font-weight: 600;
}

.site-nav {
  flex: 0 1 auto;
  max-width: 46%;
}

.nav-list,
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.95rem;
}

.nav-list a,
.footer-list a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 100%;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}

.nav-list a:hover::after,
.nav-list .current-menu-item > a::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  position: relative;
  transition: 0.2s ease;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before {
  top: -6px;
}

.nav-toggle-bar::after {
  top: 6px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(78vh, 640px);
  display: grid;
  align-items: center;
  color: var(--white);
  isolation: isolate;
}

.hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(11, 46, 54, 0.92) 0%, rgba(20, 122, 134, 0.78) 48%, rgba(154, 90, 13, 0.55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M0 40h160M0 80h160M0 120h160M40 0v160M80 0v160M120 0v160'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 20% 20%, #1a8a97 0%, transparent 40%),
    #0b2e36;
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

.hero-inner {
  padding: 5.5rem 0 4.5rem;
  max-width: 760px;
}

.hero-brand {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.hero-title {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 3.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.25;
  max-width: 16ch;
}

.hero-lead {
  margin: 0 0 1.75rem;
  font-size: 1.08rem;
  max-width: 38ch;
  color: rgba(255, 253, 249, 0.9);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary {
  background: var(--amber);
  color: #1d1205;
}

.btn-primary:hover {
  background: #e39a2d;
  color: #1d1205;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

/* Sections */
.page-intro {
  padding: 3rem 0 1rem;
}

.page-intro h1,
.section-head h2,
.related-wrap h2,
.empty-state h1,
.empty-state h2 {
  font-family: var(--font-serif);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.page-intro-lead,
.section-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 52ch;
}

.posts-section {
  padding: 2.5rem 0 4rem;
}

.section-head {
  margin-bottom: 1.75rem;
}

.post-stream {
  display: grid;
  gap: 1rem;
}

.post-item {
  border-top: 1px solid var(--line);
}

.post-item:first-child {
  border-top: 0;
}

.post-item-link {
  display: block;
  padding: 1.25rem 0.2rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, padding-left 0.25s ease;
}

.post-item-link:hover {
  background: rgba(20, 122, 134, 0.05);
  padding-left: 0.55rem;
}

.post-item-meta {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.post-item-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post-item-excerpt {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
  max-width: 70ch;
}

.post-item-cta {
  font-weight: 700;
  color: var(--amber-deep);
}

.post-stream.compact .post-item-excerpt {
  display: none;
}

/* Article */
.article-hero {
  padding: 3.5rem 0 1.5rem;
  background:
    linear-gradient(180deg, rgba(20, 122, 134, 0.1), transparent 70%);
}

.article-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.article-title {
  margin: 0 0 0.8rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.article-meta {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 2.5rem;
  padding: 1rem 0 3.5rem;
}

.article-body {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.75;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body h2,
.article-body h3 {
  font-family: var(--font-ui);
  letter-spacing: -0.02em;
  margin-top: 2rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 0.75rem 0.9rem;
  text-align: left;
}

.article-body th {
  background: var(--foam);
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
}

.article-aside {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.aside-panel {
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.7);
}

.aside-label {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.aside-panel a {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  text-decoration: none;
  font-weight: 600;
}

.related-wrap,
.comments-wrap {
  padding-bottom: 3rem;
}

/* Forms */
.search-form {
  display: flex;
  gap: 0.45rem;
}

.search-field,
.search-submit,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--white);
  color: var(--ink);
}

.search-field {
  flex: 1;
  min-width: 0;
}

.search-submit {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 46, 54, 0.04), rgba(11, 46, 54, 0.1));
  padding: 2.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 1.5rem;
  align-items: start;
}

.footer-name {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.footer-copy,
.footer-meta {
  margin: 0;
  color: var(--ink-soft);
}

.empty-state {
  padding: 5rem 0;
  text-align: left;
}

.empty-state p {
  max-width: 42ch;
  color: var(--ink-soft);
}

.empty-search {
  margin-top: 1.5rem;
  max-width: 420px;
}

.navigation.pagination {
  margin-top: 2rem;
}

.navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.navigation.pagination a,
.navigation.pagination span {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  background: var(--white);
  text-decoration: none;
  font-weight: 700;
}

/* Motion */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-animate].is-inview {
  opacity: 1;
  transform: none;
}

[data-animate="hero"].is-inview .hero-brand {
  animation: riseIn 0.8s ease both;
}

[data-animate="hero"].is-inview .hero-title {
  animation: riseIn 0.8s ease 0.1s both;
}

[data-animate="hero"].is-inview .hero-lead,
[data-animate="hero"].is-inview .hero-actions {
  animation: riseIn 0.8s ease 0.2s both;
}

[data-animate="stagger"].is-inview .post-item {
  animation: riseIn 0.55s ease both;
}

[data-animate="stagger"].is-inview .post-item:nth-child(2) { animation-delay: 0.06s; }
[data-animate="stagger"].is-inview .post-item:nth-child(3) { animation-delay: 0.12s; }
[data-animate="stagger"].is-inview .post-item:nth-child(4) { animation-delay: 0.18s; }
[data-animate="stagger"].is-inview .post-item:nth-child(5) { animation-delay: 0.24s; }
[data-animate="stagger"].is-inview .post-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

@media (max-width: 900px) {
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding: 0.85rem 0;
  }

  .header-left {
    order: 1;
    width: calc(100% - 56px);
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav-toggle {
    order: 2;
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    position: static;
    width: 100%;
    max-width: none;
    background: rgba(247, 243, 236, 0.97);
    border-top: 1px solid var(--line);
    padding: 0.85rem 0 0.25rem;
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .header-search {
    flex-basis: 100%;
    max-width: none;
  }

  .nav-list {
    flex-direction: column;
    gap: 0.85rem;
  }

  .hero {
    min-height: 72vh;
  }

  .hero-inner {
    padding-top: 4.2rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
