:root {
  --bg: #040714;
  --bg-deep: #02040b;
  --panel: rgba(10, 15, 34, 0.62);
  --panel-strong: rgba(10, 15, 34, 0.8);
  --line: rgba(133, 151, 196, 0.22);
  --text: #edf4ff;
  --muted: #95a6c8;
  --soft: #66789b;
  --cyan: #60f4ff;
  --pink: #ff5fe1;
  --violet: #9f78ff;
  --max-width: 1180px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 28px;
}

body.light-mode {
  --bg: #f0f3fa;
  --bg-deep: #e4e9f5;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(0, 0, 0, 0.1);
  --text: #0d1420;
  --muted: #4a5a7a;
  --soft: #7a8aaa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.1);
  --cyan: #0077cc;
  --pink: #cc00b8;
  --violet: #6a4aff;
  color-scheme: light;
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 119, 204, 0.08), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(204, 0, 184, 0.08), transparent 26%),
    linear-gradient(135deg, #f0f3fa 0%, #e8edf5 48%, #e4e9f5 100%);
}

body.light-mode::before {
  opacity: 0.06;
}

body.light-mode .ambient-backdrop-layer::before {
  opacity: 0;
}

body.light-mode .home-canvas {
  filter: invert(1);
  mix-blend-mode: normal;
  opacity: 1;
}

body.light-mode .page-hero p,
body.light-mode .card p,
body.light-mode .stack p,
body.light-mode .contact-list a,
body.light-mode .contact-list span {
  color: #44536f;
}

body.light-mode .article h2 {
  color: #18263b;
}

body.light-mode .article h3 {
  color: #3a4d6d;
}

body.light-mode .article p,
body.light-mode .article li,
body.light-mode .article ol,
body.light-mode .article ul {
  color: #2d3b53;
}

body.light-mode .footer-note {
  color: #5f6f8d;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 22%, rgba(96, 244, 255, 0.12), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(255, 95, 225, 0.12), transparent 26%),
    linear-gradient(135deg, var(--bg) 0%, #09102a 48%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 130px 130px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
  opacity: 0.16;
}

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

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

.site-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.ambient-backdrop-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-backdrop-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(106, 122, 255, 0.12), transparent 46%),
    radial-gradient(circle at 22% 24%, rgba(96, 244, 255, 0.12), transparent 38%),
    radial-gradient(circle at 78% 24%, rgba(255, 95, 225, 0.1), transparent 34%),
    radial-gradient(circle at 50% 68%, rgba(88, 120, 255, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(2, 5, 12, 0.18), rgba(3, 6, 16, 0.38)),
    linear-gradient(120deg, rgba(4, 7, 20, 0.94), rgba(8, 12, 28, 0.78) 40%, rgba(10, 14, 34, 0.78) 60%, rgba(4, 7, 20, 0.94));
  z-index: 1;
}

.site-shell::after {
  content: "";
  position: fixed;
  inset: 24px;
  border: 1px solid rgba(141, 157, 199, 0.14);
  border-radius: 32px;
  pointer-events: none;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-text {
  position: relative;
  display: inline-block;
  min-width: 8.8ch;
}

.brand-text::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 0.22em;
  vertical-align: -0.16em;
  background: currentColor;
  opacity: 1;
}

.brand-text.is-blinking::after {
  animation: brand-caret-blink 1s step-end 2;
}

.audio-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  opacity: 0.98;
  flex: 0 0 auto;
  filter:
    drop-shadow(0 0 5px rgba(96, 244, 255, 0.52))
    drop-shadow(0 0 11px rgba(255, 95, 225, 0.34));
}

.audio-toggle svg {
  width: 78%;
  height: 78%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audio-toggle::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1.5px;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  transform: scaleX(0) rotate(-10deg);
  transform-origin: center;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.audio-toggle.is-off::after {
  transform: scaleX(1) rotate(-10deg);
  opacity: 1;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
  opacity: 1;
  color: #b3fbff;
  filter:
    drop-shadow(0 0 6px rgba(96, 244, 255, 0.55))
    drop-shadow(0 0 12px rgba(255, 95, 225, 0.34));
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  opacity: 0.98;
  flex: 0 0 auto;
}

.theme-toggle svg {
  width: 78%;
  height: 78%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 1;
  color: #b3fbff;
}

@keyframes brand-caret-blink {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
  border: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--text);
  border-color: rgba(123, 143, 190, 0.36);
  background: rgba(255, 255, 255, 0.03);
}

.hero {
  min-height: calc(100vh - 150px);
  display: grid;
  align-items: end;
  padding-bottom: 56px;
}

.hero-inner {
  max-width: 540px;
}

.hero-inner-minimal {
  max-width: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

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

.minimal-copy {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.8;
  color: #d6e2f4;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.home-carousel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 8px;
  border: 1px solid rgba(120, 141, 188, 0.24);
  border-radius: 999px;
  background: rgba(8, 13, 28, 0.36);
  backdrop-filter: blur(14px);
}

.home-carousel-minimal {
  width: min(1120px, calc(100vw - 120px));
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.carousel-arrow {
  padding: 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(120, 141, 188, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(96, 244, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fbff;
}

.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;
}

.carousel-pill {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.carousel-pill:hover,
.carousel-pill:focus-visible,
.carousel-pill.is-active {
  color: var(--text);
  border-color: rgba(120, 141, 188, 0.36);
  background: rgba(255, 255, 255, 0.05);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 148px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid rgba(120, 141, 188, 0.34);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(96, 244, 255, 0.48);
  background: rgba(255, 255, 255, 0.05);
}

.button-primary {
  background: linear-gradient(135deg, rgba(96, 244, 255, 0.16), rgba(255, 95, 225, 0.16));
}

.home-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.route-home .home-canvas {
  opacity: 1;
}

.surface {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.page-hero {
  padding: 48px;
  margin-bottom: 30px;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.page-hero p {
  margin: 0;
  max-width: 700px;
  color: #d0dcee;
  line-height: 1.8;
  font-size: 1.02rem;
}

.grid {
  display: grid;
  gap: 24px;
}

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

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.6fr);
  gap: 24px;
  align-items: start;
}

.about-card {
  padding: 34px;
}

.about-image {
  width: min(220px, 38vw);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.about-copy {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 0;
}

.about-card h1 {
  margin: 0 0 12px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.about-bio {
  max-width: 560px;
}

.about-bio p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.about-bio p + p {
  margin-top: 16px;
}

.about-links {
  padding: 28px;
  display: grid;
  gap: 16px;
}

.about-links a {
  display: block;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(129, 148, 194, 0.16);
  color: var(--text);
  letter-spacing: 0.04em;
}

.about-links a:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.card {
  padding: 28px;
}

.card h2,
.card h3 {
  margin: 0 0 10px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.card h2 {
  font-size: 2rem;
}

.card h3 {
  font-size: 1.7rem;
}

.meta {
  margin: 0 0 14px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.card p,
.stack p,
.contact-list a,
.contact-list span {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.article-link {
  display: inline-flex;
  margin-top: 20px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.stack {
  padding: 28px;
}

.stack h2 {
  margin: 0 0 18px;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "Space Grotesk", sans-serif;
}

.stack ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.stack li {
  padding: 14px 0;
  border-top: 1px solid rgba(129, 148, 194, 0.16);
}

.stack li:first-child {
  border-top: 0;
  padding-top: 0;
}

.stack strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
  color: var(--text);
}

.contact-list {
  display: grid;
  gap: 18px;
}

.contact-list a,
.contact-list span {
  display: block;
  padding-top: 12px;
  border-top: 1px solid rgba(129, 148, 194, 0.16);
}

.contact-list a:first-child,
.contact-list span:first-child {
  border-top: 0;
  padding-top: 0;
}

.article-shell {
  width: 100%;
}

.article {
  padding: 42px;
}

.article h1 {
  margin: 0 0 14px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.96;
}

.article h2 {
  margin: 36px 0 10px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: #e8f0fc;
  letter-spacing: -0.02em;
}

.article h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #c4d4ee;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.article ol,
.article ul {
  margin: 0 0 18px;
  padding-left: 24px;
  color: #d6e2f4;
}

.article li {
  margin-bottom: 10px;
  line-height: 1.72;
}

.article li ul,
.article li ol {
  margin-top: 8px;
  margin-bottom: 0;
}

.article blockquote {
  margin: 4px 0 22px;
  padding: 18px 22px;
  border-left: 2px solid var(--cyan);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 0 18px 18px 0;
}

.article p {
  margin: 0 0 18px;
  color: #d6e2f4;
  line-height: 1.9;
  font-size: 1.02rem;
}

.article-figure {
  margin: 28px 0 30px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.article-figure img {
  width: 100%;
  border-radius: 12px;
}

body.light-mode .article blockquote {
  background: rgba(0, 0, 0, 0.035);
}

body.light-mode .article-figure {
  background: rgba(255, 255, 255, 0.62);
}

.article p:last-child {
  margin-bottom: 0;
}

.footer-note {
  margin-top: 32px;
  color: var(--soft);
  font-size: 0.9rem;
}

.footer-note .article-link {
  margin-top: 0;
}

.comments-block {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid rgba(129, 148, 194, 0.18);
}

.comments-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 22px;
}

.comments-note,
.comments-empty,
.comments-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.comments-list {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.comment-item {
  padding: 18px 20px;
  border: 1px solid rgba(129, 148, 194, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comment-meta time {
  color: var(--muted);
  white-space: nowrap;
}

.comment-item p {
  margin: 0;
  color: #d6e2f4;
  font-size: 0.96rem;
  line-height: 1.75;
}

.comments-form {
  display: grid;
  gap: 16px;
}

.comments-form label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.comments-form input,
.comments-form textarea {
  width: 100%;
  border: 1px solid rgba(129, 148, 194, 0.24);
  border-radius: 16px;
  background: rgba(3, 8, 22, 0.42);
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  line-height: 1.55;
  outline: 0;
  padding: 13px 15px;
  text-transform: none;
}

.comments-form textarea {
  resize: vertical;
}

.comments-form input:focus,
.comments-form textarea:focus {
  border-color: rgba(93, 243, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(93, 243, 255, 0.08);
}

.comments-submit {
  justify-self: start;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.comments-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.comments-status[data-status="success"] {
  color: var(--cyan);
}

.comments-status[data-status="error"] {
  color: #ff9ab9;
}

body.light-mode .comment-item {
  background: rgba(255, 255, 255, 0.68);
}

body.light-mode .comment-item p {
  color: #2d3b53;
}

body.light-mode .comments-form input,
body.light-mode .comments-form textarea {
  background: rgba(255, 255, 255, 0.78);
  color: #1f2d44;
}

.moderation-shell {
  padding: 42px;
}

.moderation-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.moderation-header h1 {
  margin: 0 0 14px;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 0.98;
}

.moderation-header p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.moderation-token {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin-bottom: 18px;
}

.moderation-token label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.moderation-token input {
  width: 100%;
  border: 1px solid rgba(129, 148, 194, 0.24);
  border-radius: 16px;
  background: rgba(3, 8, 22, 0.42);
  color: var(--text);
  font: inherit;
  padding: 13px 15px;
}

.moderation-actions,
.moderation-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.moderation-actions {
  margin-bottom: 16px;
}

.moderation-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.moderation-item {
  padding: 18px 20px;
  border: 1px solid rgba(129, 148, 194, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.moderation-item p {
  margin: 0 0 16px;
  color: #d6e2f4;
  line-height: 1.75;
}

body.light-mode .moderation-token input,
body.light-mode .moderation-item {
  background: rgba(255, 255, 255, 0.72);
}

body.light-mode .moderation-item p {
  color: #2d3b53;
}

@media (max-width: 900px) {
  .page {
    width: min(var(--max-width), calc(100% - 28px));
    padding-top: 18px;
  }

  .site-shell::after {
    inset: 14px;
  }

  .site-header,
  .two-column,
  .posts-grid,
  .about-page {
    grid-template-columns: 1fr;
    display: grid;
  }

  .site-header {
    justify-content: unset;
    gap: 18px;
  }

  .page-hero,
  .card,
  .stack,
  .article,
  .about-card,
  .about-links,
  .moderation-shell {
    padding: 24px;
  }

  .about-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: calc(100vh - 120px);
    padding-bottom: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .site-nav a {
    transition: none;
  }
}
