* {
  box-sizing: border-box;
}

:root {
  /* Styx Helix — Re:Zero palette */
  --rezero-navy: #0f1428;
  --rezero-purple: #1a1633;
  --rezero-silver: #e8eaf0;
  --rezero-lavender: #b8a4ff;
  --rezero-ice: #a8d8ff;
  --rezero-rose: #d9a3b4;

  --color-bg: var(--rezero-navy);
  --color-surface: var(--rezero-purple);
  --color-surface-raised: #252042;
  --color-text: var(--rezero-silver);
  --color-muted: color-mix(in srgb, var(--rezero-silver) 58%, var(--rezero-ice));
  --color-accent: var(--rezero-lavender);
  --color-accent-hover: var(--rezero-ice);
  --color-accent-rose: var(--rezero-rose);
  --color-border: color-mix(in srgb, var(--rezero-lavender) 22%, var(--rezero-purple));
  --max-content: 72rem;
  --max-wide: 96rem;
  --sidebar-width: 17rem;
  --main-pad-x: clamp(1.25rem, 3.5vw, 2.5rem);
  --header-pad-x: var(--main-pad-x);
  --content-pad-y: 2.5rem;
  --radius-sm: 6px;
  --radius-md: 12px;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--rezero-navy);
  min-height: 100vh;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--rezero-ice);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.skip-link:focus-visible {
  left: calc(var(--sidebar-width) + 1rem);
  top: 0.5rem;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--color-accent-rose);
  background: color-mix(in srgb, var(--rezero-purple) 88%, var(--rezero-rose) 12%);
  color: var(--color-muted);
}

code {
  font-size: 0.9em;
  background: var(--color-surface-raised);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

pre code {
  padding: 0;
  background: none;
}

/* Left sidebar: brand + vertical nav */
.page-shell {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 55% at 80% 0%, color-mix(in srgb, var(--rezero-lavender) 14%, transparent), transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 40%, color-mix(in srgb, var(--rezero-ice) 8%, transparent), transparent 45%),
    linear-gradient(160deg, var(--rezero-navy) 0%, color-mix(in srgb, var(--rezero-purple) 40%, var(--rezero-navy)) 100%);
}

.site-sidebar {
  flex-shrink: 0;
  width: var(--sidebar-width);
  padding: 1.75rem 1.125rem;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--rezero-purple) 88%, var(--rezero-lavender) 12%) 0%,
    var(--rezero-navy) 100%
  );
  border-right: 1px solid color-mix(in srgb, var(--rezero-lavender) 30%, var(--rezero-purple));
  box-shadow: inset -1px 0 0 color-mix(in srgb, var(--rezero-ice) 8%, transparent);
}

.site-sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  position: sticky;
  top: 0;
  padding-bottom: 1.5rem;
}

.site-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--rezero-lavender) 18%, var(--rezero-purple));
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--rezero-silver);
  text-decoration: none;
  line-height: 1.3;
}

.site-brand-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-brand-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rezero-lavender) 35%, transparent);
}

.site-brand:hover {
  color: var(--rezero-ice);
  text-decoration: none;
}

.site-brand:hover .site-brand-icon {
  box-shadow: 0 0 12px color-mix(in srgb, var(--rezero-lavender) 45%, transparent);
}

.site-tagline {
  margin: 0;
  padding-left: 0.15rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.site-nav-label {
  margin: 0 0 0.5rem;
  padding: 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rezero-rose);
}

.site-nav {
  min-width: 0;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--rezero-lavender) 85%, var(--rezero-silver));
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-nav a:hover {
  color: var(--rezero-ice);
  border-color: color-mix(in srgb, var(--rezero-lavender) 25%, transparent);
  background: color-mix(in srgb, var(--rezero-lavender) 12%, var(--rezero-navy));
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--rezero-silver);
  border-color: color-mix(in srgb, var(--rezero-lavender) 40%, transparent);
  background: color-mix(in srgb, var(--rezero-lavender) 18%, var(--rezero-purple));
  box-shadow:
    inset 3px 0 0 var(--rezero-rose),
    0 4px 16px color-mix(in srgb, var(--rezero-lavender) 10%, transparent);
  padding-left: 0.75rem;
  text-decoration: none;
}

/* Main content widths */
.content {
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: var(--content-pad-y) var(--main-pad-x);
}

.hero-band + .content {
  padding-top: 1.75rem;
}

.content--standard {
  max-width: var(--max-content);
}

.content--wide {
  max-width: var(--max-wide);
}

.content--minimal {
  max-width: var(--max-content);
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.page-title {
  margin: 0 0 1.25rem;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--rezero-silver);
}

.content--standard > p {
  color: color-mix(in srgb, var(--rezero-silver) 92%, var(--rezero-ice));
}

.content a {
  color: var(--rezero-lavender);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rezero-lavender) 45%, transparent);
  text-underline-offset: 0.15em;
}

.content a:hover {
  color: var(--rezero-ice);
  text-decoration-color: var(--rezero-ice);
}

/* Prose inside content areas */
.content ul,
.content ol,
.blog-post-body ul,
.blog-post-body ol,
.blog-index-intro ul,
.blog-index-intro ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.content li + li,
.blog-post-body li + li,
.blog-index-intro li + li {
  margin-top: 0.35rem;
}

.content hr,
.blog-post-body hr,
.blog-index-intro hr {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

.content table,
.blog-post-body table,
.blog-index-intro table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.content th,
.content td,
.blog-post-body th,
.blog-post-body td,
.blog-index-intro th,
.blog-index-intro td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  text-align: left;
}

.content th,
.blog-post-body th,
.blog-index-intro th {
  background: var(--color-surface-raised);
  font-weight: 600;
}

/* Footer — slim floating bar */
.site-footer {
  margin-top: auto;
  padding: 1.5rem var(--main-pad-x) 1.75rem;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.site-footer-float {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0.55rem 0.85rem 0.55rem 1.1rem;
  background: color-mix(in srgb, var(--rezero-purple) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--rezero-lavender) 22%, var(--rezero-purple));
  border-radius: 999px;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--rezero-ice) 8%, transparent) inset,
    0 8px 28px color-mix(in srgb, var(--rezero-navy) 50%, transparent);
  backdrop-filter: blur(10px);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  min-width: 0;
}

.site-footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  margin: 0;
  min-width: 0;
  line-height: 1.4;
}

.site-footer-copy,
.site-footer-tagline {
  margin: 0;
}

.site-footer-copy {
  color: color-mix(in srgb, var(--rezero-silver) 80%, var(--rezero-ice));
  white-space: nowrap;
}

.site-footer-tagline {
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer-tagline::before {
  content: "·";
  margin-right: 0.65rem;
  color: color-mix(in srgb, var(--rezero-lavender) 40%, var(--rezero-purple));
}

.site-footer .site-social {
  margin: 0;
  flex-shrink: 0;
}

.site-footer .site-social ul {
  justify-content: flex-end;
  gap: 0.35rem;
}

.site-social--footer a {
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  border-radius: 50%;
  background: transparent;
}

.site-social--footer a:hover {
  background: color-mix(in srgb, var(--rezero-lavender) 14%, transparent);
}

.site-social--footer .site-social-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.site-footer .site-social a {
  color: color-mix(in srgb, var(--rezero-lavender) 65%, var(--rezero-silver));
}

.site-footer .site-social a:hover {
  color: var(--rezero-ice);
}

.site-social ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.site-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.site-social a:hover {
  color: var(--rezero-ice);
}

.site-social-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.site-social--hero {
  margin: 1.25rem 0 0;
}

.site-social--hero ul {
  justify-content: flex-start;
  gap: 0.65rem;
}

.site-social--hero a {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface-raised);
}

.site-social--hero .site-social-icon {
  width: 1.125rem;
  height: 1.125rem;
}

.site-social--hero a:hover {
  border-color: var(--rezero-lavender);
  color: var(--rezero-ice);
  background: color-mix(in srgb, var(--rezero-lavender) 18%, var(--rezero-purple));
}

/* Blog post — open layout on page background (~80% of footer bar width) */
.blog-post-page .content--blog {
  max-width: calc(var(--max-content) * 0.8);
}

.blog-post {
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.blog-post-back {
  margin: 0 0 1.75rem;
  font-size: 0.8125rem;
}

.blog-post-back a {
  color: color-mix(in srgb, var(--rezero-lavender) 75%, var(--rezero-silver));
  text-decoration: none;
  transition: color 0.15s ease;
}

.blog-post-back a:hover {
  color: var(--rezero-ice);
  text-decoration: none;
}

.blog-post-header {
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--rezero-lavender) 18%, var(--rezero-purple));
}

.blog-post-date {
  display: block;
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rezero-rose);
}

.blog-post-title {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  line-height: 1.15;
  font-weight: 700;
  color: var(--rezero-silver);
  text-wrap: balance;
}

.blog-post-deck {
  margin: 0.85rem 0 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--rezero-silver) 72%, var(--rezero-ice));
}

.blog-post-featured {
  margin: 0 0 2rem;
  padding: 0;
}

.blog-post-featured-frame {
  position: relative;
  margin: 0 -0.5rem;
  padding: 3px;
  border-radius: calc(var(--radius-md) + 3px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--rezero-lavender) 70%, transparent),
    color-mix(in srgb, var(--rezero-rose) 55%, transparent),
    color-mix(in srgb, var(--rezero-ice) 50%, transparent)
  );
  box-shadow:
    0 20px 50px color-mix(in srgb, var(--rezero-navy) 55%, transparent),
    0 0 40px color-mix(in srgb, var(--rezero-lavender) 12%, transparent);
}

.blog-post-featured-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--radius-md);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rezero-silver) 12%, transparent);
}

.blog-post-featured img {
  display: block;
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.blog-post-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: color-mix(in srgb, var(--rezero-silver) 94%, var(--rezero-ice));
}

.blog-post-body > :first-child {
  margin-top: 0;
}

.blog-post-body a {
  color: var(--rezero-lavender);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--rezero-lavender) 40%, transparent);
  text-underline-offset: 0.15em;
}

.blog-post-body a:hover {
  color: var(--rezero-ice);
  text-decoration-color: var(--rezero-ice);
}

.blog-post-body h2,
.blog-post-body h3 {
  color: var(--rezero-silver);
}

.blog-post-body blockquote {
  border-left-color: var(--rezero-rose);
}

/* Blog index template */
.blog-index-page .content--blog {
  max-width: var(--max-wide);
}

.blog-index-header {
  margin-bottom: 2rem;
  max-width: var(--max-content);
}

.blog-index-title {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--rezero-silver);
}

.blog-index-intro > :first-child {
  margin-top: 0;
}

.blog-index-intro > :last-child {
  margin-bottom: 0;
}

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.blog-list-item {
  margin: 0;
  min-width: 0;
}

.blog-list-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: color-mix(in srgb, var(--rezero-purple) 88%, var(--rezero-navy));
  border: 1px solid color-mix(in srgb, var(--rezero-lavender) 22%, var(--rezero-purple));
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.blog-list-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--rezero-lavender) 45%, transparent);
  box-shadow:
    0 8px 28px color-mix(in srgb, var(--rezero-navy) 65%, transparent),
    0 0 0 1px color-mix(in srgb, var(--rezero-rose) 18%, transparent);
  transform: translateY(-2px);
}

.blog-list-card:hover .blog-list-title {
  color: var(--rezero-ice);
}

.blog-list-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-surface-raised);
  border-bottom: 1px solid color-mix(in srgb, var(--rezero-lavender) 15%, var(--rezero-purple));
}

.blog-list-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-list-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: 1rem 1.15rem 1.15rem;
  min-width: 0;
}

.blog-list-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--rezero-silver);
  transition: color 0.15s ease;
}

.blog-list-excerpt {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.blog-list-date {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--rezero-rose);
}

.blog-list-empty {
  margin: 0;
  color: var(--color-muted);
  grid-column: 1 / -1;
}

/* Hero template */
.hero-band {
  width: 100%;
  margin: 0;
  padding: var(--content-pad-y) var(--main-pad-x) 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  background: color-mix(in srgb, var(--rezero-purple) 82%, var(--rezero-navy));
  border: 1px solid color-mix(in srgb, var(--rezero-lavender) 28%, var(--rezero-purple));
  border-top: 2px solid color-mix(in srgb, var(--rezero-lavender) 55%, var(--rezero-ice));
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--rezero-ice) 12%, transparent) inset,
    0 16px 48px color-mix(in srgb, var(--rezero-navy) 70%, transparent),
    0 0 0 1px color-mix(in srgb, var(--rezero-rose) 12%, transparent);
}

.hero-portrait-wrap {
  margin: 0;
  flex-shrink: 0;
}

.hero-portrait {
  display: block;
  width: clamp(7.5rem, 18vw, 12rem);
  height: clamp(7.5rem, 18vw, 12rem);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid color-mix(in srgb, var(--rezero-lavender) 55%, var(--rezero-ice));
  box-shadow:
    0 8px 24px color-mix(in srgb, var(--rezero-navy) 65%, transparent),
    0 0 0 1px color-mix(in srgb, var(--rezero-rose) 25%, transparent);
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--rezero-silver);
  text-wrap: balance;
}

.hero-lead {
  margin: 0.85rem 0 0;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--rezero-silver) 75%, var(--rezero-ice));
  max-width: 40rem;
}

.hero-page .content--standard {
  padding-top: var(--content-pad-y);
}

.hero-page .content--standard > :first-child {
  margin-top: 0;
}

@media (max-width: 720px) {
  .page-shell {
    flex-direction: column;
  }

  .site-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
    padding: 1rem var(--header-pad-x);
  }

  .site-sidebar-inner {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
  }

  .site-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
  }

  .site-nav a[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--rezero-rose);
    padding-left: 0.75rem;
  }

  .site-nav-label {
    display: none;
  }

  .site-tagline {
    display: none;
  }

  .skip-link:focus-visible {
    left: var(--header-pad-x);
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-lead {
    margin-left: auto;
    margin-right: auto;
  }

  .site-social--hero ul {
    justify-content: center;
  }

  .site-footer-float {
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
  }

  .site-footer-inner {
    flex-wrap: wrap;
  }

  .site-footer-meta {
    flex: 1 1 12rem;
  }

  .site-footer .site-social ul {
    justify-content: flex-start;
  }
}
