:root {
  --bg: #f5f3ee;
  --bg-alt: #eee9df;
  --bg-accent-1: rgba(201, 118, 76, 0.24);
  --bg-accent-2: rgba(57, 127, 134, 0.22);
  --bg-accent-3: rgba(221, 171, 91, 0.18);
  --text: #1b1b1b;
  --muted: #5c5c5c;
  --accent: #1f4e5f;
  --accent-strong: #12323c;
  --link: color-mix(in srgb, var(--text) 30%, var(--accent) 30%);
  --link-hover: var(--accent-strong);
  --line: #d3cec5;
  --card: #faf7f295;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 0px;
  --botton-radius: 999px;
  --grid-gap: 28px;
  --max-width: 1080px;
}

[data-theme="dark"] {
  --bg: #0f1214;
  --bg-alt: #14181b;
  --bg-accent-1: rgba(118, 201, 214, 0.34);
  --bg-accent-2: rgba(92, 147, 224, 0.3);
  --bg-accent-3: rgba(209, 153, 94, 0.28);
  --text: #f1f1f1;
  --muted: #b5b9bd;
  --accent: #89c2c7;
  --accent-strong: #b9e1e6;
  --link: color-mix(in srgb, var(--text) 30%, var(--accent-strong) 30%);
  --link-hover: var(--accent-strong);
  --line: hsla(203, 13%, 19%, 0.779);
  --card: #161b1f91;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--bg-alt), transparent 60%),
    radial-gradient(140% 120% at 100% 100%, color-mix(in srgb, var(--bg-alt) 65%, var(--bg) 35%), transparent 62%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(44vw 44vw at 12% 18%, var(--bg-accent-1), transparent 68%),
    radial-gradient(40vw 40vw at 88% 12%, var(--bg-accent-2), transparent 70%),
    radial-gradient(38vw 38vw at 50% 90%, var(--bg-accent-3), transparent 72%);
  filter: blur(8px);
  opacity: 0.85;
  pointer-events: none;
  animation: auroraDrift 7s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--line) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--line) 1.5px, transparent 1.5px);
  background-size: 120px 120px;
  opacity: 0.3;
  pointer-events: none;
  animation: gridFloat 7s linear infinite;
}

[data-theme="dark"] body::before {
  opacity: 1;
  filter: blur(6px) saturate(1.2);
  mix-blend-mode: screen;
}

[data-theme="dark"] body::after {
  opacity: 0.2;
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

@keyframes auroraDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.8%, -1.2%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-2%, 1.6%, 0) scale(1.02);
  }
}

@keyframes gridFloat {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 0 120px, 120px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after {
    animation: none;
  }
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

.container {
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  padding: 15px 0 15px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(245, 243, 238, 0.92), rgba(245, 243, 238, 0.76));
  backdrop-filter: blur(10px);
  z-index: 10;
}

[data-theme="dark"] .site-header {
  background: linear-gradient(to bottom, rgba(15, 18, 20, 0.92), rgba(15, 18, 20, 0.76));
}

.header-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.brand {
  justify-self: start;
}

.brand-socials {
  display: flex;
}

.social-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.social-link,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 84%, transparent);
  color: var(--text);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease;
}

.social-link:hover,
.theme-toggle:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  background: color-mix(in srgb, var(--card) 70%, var(--accent) 14%);
  transform: translateY(-1px);
}

.social-link:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.social-link i,
.theme-toggle i {
  font-size: 1.7rem;
  line-height: 1;
}

.social-link .ai {
  display: inline-block;
  width: 1em;
  text-align: center;
}

.social-link svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-links--footer {
  margin-top: 12px;
}

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 42px);
  flex-wrap: wrap;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  justify-self: center;
}

.theme-toggle {
  cursor: pointer;
  padding: 0;
}

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

main {
  padding: 15px 0 15px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--grid-gap);
  align-items: start;
  margin-bottom: 60px;
}

.hero > * {
  min-width: 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 2.2rem + 1.5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hero p {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0 0 18px;
}

.hero .meta {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.section {
  margin-bottom: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  margin-bottom: 15px;
}

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

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

.list li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.list li:last-child {
  border-bottom: none;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-row a {
  overflow-wrap: anywhere;
}

.meta-row .meta-icon {
  margin-right: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: var(--botton-radius);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.highlight {
  border-left: 4px solid var(--accent);
  padding-left: 18px;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
}

.post-list {
  display: grid;
  gap: 15px;
}

.post-card {
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card.has-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px);
  gap: 20px;
  align-items: center;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.post-title {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-meta {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-content {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

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

.post-media {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.post-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.post-hero {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  height: auto;
  margin-bottom: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--botton-radius);
  border: 1px solid var(--line);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: inherit;
}

.button-icon {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
}

.button-icon i {
  font-size: 1.7rem;
  line-height: 1;
}

.button:hover {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.publication-list {
  display: grid;
  gap: 15px;
}

.publication-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px);
  gap: 15px;
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.publication-media {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.publication-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Backward-compatible override for older publication pages using this class. */
.publication-hero {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  height: auto;
  aspect-ratio: auto;
  object-fit: initial;
  margin-bottom: 18px;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.publication-authors {
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin: 6px 0 12px;
}

.highlight-link {
  display: block;
  color: inherit;
}

.highlight-link .post-title,
.highlight-link .highlight {
  overflow-wrap: anywhere;
}

.highlight-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

footer {
  padding: 15px 0 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

@media (max-width: 900px) {
  .header-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "nav nav";
    align-items: center;
    gap: 12px;
  }

  .brand {
    grid-area: brand;
    justify-self: start;
  }

  .theme-toggle {
    grid-area: toggle;
    justify-self: end;
  }

  .nav-links {
    grid-area: nav;
    justify-content: flex-start;
    gap: 12px 18px;
  }

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

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

  .post-card.has-media {
    grid-template-columns: 1fr;
  }

  .publication-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .container {
    width: min(100% - 32px, var(--max-width));
  }

  .site-header {
    padding: 15px 0 15px;
  }

  .brand {
    min-height: 44px;
  }

  .nav-links {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    line-height: 1.35;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }

  .social-link {
    width: 40px;
    height: 40px;
  }

  .social-link i,
  .theme-toggle i {
    font-size: 1.45rem;
  }

  .social-link svg {
    width: 31px;
    height: 31px;
  }

  .hero {
    gap: 15px;
    margin-bottom: 15px;
  }

  .hero .card {
    padding: 15px;
  }

  .meta-row {
    gap: 10px;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
  }
}
