:root {
  --theme-font-heading: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --theme-font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  --background: #0b0b0c;
  --foreground: #ededed;
  --muted: #b5b5b5;
  --muted-foreground: #7f7f7f;
  --card: #141414;
  --card-soft: #1e1e1e;
  --card-hover: #262626;
  --border: #313131;
  --border-strong: #4d4d4d;
  --green: #90b8a2;
  --blue: #a8b6c8;
  --rose: #c2a5ad;
  --amber: #c7b28a;
  --wash-cool: rgba(168, 182, 200, 0.14);
  --wash-warm: rgba(199, 178, 138, 0.10);
  --topbar: rgba(20, 20, 20, 0.78);
  --panel: rgba(20, 20, 20, 0.88);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.36);
  --gh-font-heading: var(--theme-font-heading);
  --gh-font-body: var(--theme-font-body);
  font-family: var(--theme-font-body);
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-wght.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

[data-theme="light"] {
  color-scheme: light;
  --background: #ededeb;
  --foreground: #1e1e1e;
  --muted: #626262;
  --muted-foreground: #7f7f7f;
  --card: #f7f7f5;
  --card-soft: #e7e7e4;
  --card-hover: #dadad6;
  --border: #c2c2bd;
  --border-strong: #a3a39d;
  --green: #4f7562;
  --blue: #5b6f86;
  --rose: #815d67;
  --amber: #7c6642;
  --wash-cool: rgba(91, 111, 134, 0.12);
  --wash-warm: rgba(124, 102, 66, 0.10);
  --topbar: rgba(247, 247, 245, 0.82);
  --panel: rgba(247, 247, 245, 0.88);
  --shadow: 0 18px 45px rgba(30, 30, 30, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, var(--wash-cool), transparent 30rem),
    radial-gradient(circle at 84% 8%, var(--wash-warm), transparent 26rem),
    linear-gradient(180deg, var(--background), var(--background)),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--foreground) 4%, transparent) 0, color-mix(in srgb, var(--foreground) 4%, transparent) 1px, transparent 1px, transparent 80px);
  color: var(--foreground);
  font-family: var(--theme-font-body);
  transition: background-color 180ms ease, color 180ms ease;
}

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

img {
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 72px;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 8px;
  background: var(--topbar);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0 10px;
  font-weight: 650;
  font-family: var(--theme-font-body);
}

.brand-menu {
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  cursor: pointer;
}

.nav-links {
  justify-self: start;
}

.nav-links ul {
  display: flex;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover,
.nav-current a {
  background: var(--card-hover);
  color: var(--foreground);
}

.nav-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.icon {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.theme-icon {
  display: none;
}

[data-theme="dark"] .theme-icon-light,
[data-theme="light"] .theme-icon-dark {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 24px;
}

.intro-panel,
.profile-card,
.info-block,
.feature-link,
.feed-shell,
.article-shell,
.archive-header {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.intro-panel {
  min-height: 430px;
  padding: clamp(26px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.eyebrow,
.section-kicker,
.period,
.article-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent);
}

.intro-panel h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
  font-family: var(--theme-font-heading);
  font-weight: 760;
}

.intro-panel p {
  max-width: 660px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 620;
}

.primary-action {
  gap: 8px;
  background: var(--foreground);
  color: var(--background);
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--card);
}

.profile-card {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  overflow: hidden;
}

.photo-frame {
  position: relative;
  width: 100%;
  min-height: 238px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-soft);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  min-height: 238px;
  display: block;
  object-fit: cover;
  object-position: 66% 52%;
  filter: contrast(1.05) brightness(0.92);
}

[data-theme="light"] .photo-frame img {
  filter: contrast(1.03) brightness(1.02);
}

.photo-caption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, white 16%, transparent);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.profile-card h2 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.profile-card p,
.info-block p,
.post-body p,
.archive-header p {
  color: var(--muted);
  line-height: 1.65;
}

.profile-links {
  display: grid;
  gap: 8px;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-soft);
  font-size: 14px;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.home-dsl-intro {
  margin-top: 18px;
  padding-left: 22px;
  border-left: 1px solid var(--border);
}

.home-dsl-intro h2 {
  max-width: 780px;
  margin: 3px 0 0;
  font-family: var(--theme-font-heading);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

.home-dsl-intro p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.info-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 210px;
  padding: 22px;
}

.block-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.block-icon {
  display: inline-flex;
  color: var(--green);
}

.block-heading .block-icon .icon {
  width: 18px;
  height: 18px;
}

.block-heading > div {
  display: grid;
  gap: 6px;
}

.block-heading > div > span {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.block-heading h2 {
  margin: 0;
  font-size: 20px;
  font-family: var(--theme-font-heading);
}

.info-block p {
  margin: 18px 0 0;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.feature-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 18px;
}

.feature-link strong {
  display: block;
  margin-bottom: 4px;
}

.feature-link span {
  color: var(--muted);
  font-size: 14px;
}

.feature-link > .icon {
  color: var(--muted);
}

.feed-shell {
  margin-top: 18px;
  padding: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 28px;
}

.section-heading a,
.post-meta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.post-list {
  display: grid;
}

.post-item {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.post-date {
  color: var(--muted);
  font-size: 14px;
}

.post-body {
  position: relative;
  padding-left: 18px;
}

.post-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 6px;
  width: 3px;
  border-radius: 10px;
  background: var(--green);
}

.post-body h3 {
  margin: 6px 0 8px;
  font-size: 23px;
  line-height: 1.18;
  font-family: var(--theme-font-heading);
}

.post-body p {
  max-width: 780px;
  margin: 0;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.post-meta span {
  color: var(--muted);
  font-size: 13px;
}

.article-shell,
.archive-header {
  width: min(900px, 100%);
  margin: 24px auto 0;
  padding: clamp(24px, 5vw, 56px);
}

.article-header {
  margin-bottom: 34px;
}

.article-header.compact {
  margin-bottom: 18px;
}

.article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.article-header h1,
.archive-header h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  font-family: var(--theme-font-heading);
  font-weight: 760;
}

.article-header p {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.65;
}

.article-image {
  margin: 32px 0 0;
}

.article-image img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.article-image figcaption {
  margin-top: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.content-body {
  color: var(--foreground);
  font-size: 18px;
  line-height: 1.8;
  font-family: var(--theme-font-body);
}

.content-body > * {
  margin: 0 0 1.4em;
}

.content-body h2,
.content-body h3 {
  margin-top: 1.8em;
  line-height: 1.15;
  font-family: var(--theme-font-heading);
  color: var(--foreground);
}

.content-body h2 {
  font-size: 32px;
}

.content-body h3 {
  font-size: 24px;
}

.content-body p,
.content-body li {
  color: var(--muted);
}

.content-body p br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

.content-body a {
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.content-body blockquote {
  margin-left: 0;
  padding-left: 18px;
  border-left: 3px solid var(--green);
  color: var(--foreground);
}

.content-body pre,
.content-body code {
  border-radius: 7px;
  background: var(--card-soft);
}

.content-body code {
  padding: 2px 5px;
}

.content-body pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
}

.content-body pre code {
  padding: 0;
  background: transparent;
}

.content-body .kg-card {
  margin: 2em 0;
}

.content-body .kg-width-wide {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.content-body .kg-width-full {
  width: calc(100vw - 32px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.content-body .kg-image {
  border-radius: 8px;
}

.content-body .kg-bookmark-card,
.content-body .kg-callout-card,
.content-body .kg-toggle-card {
  border-radius: 8px;
}

.archive-feed {
  width: min(900px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 42px;
  padding: 22px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted);
}

.footer-nav a:hover {
  background: var(--card-hover);
  color: var(--foreground);
}

.footer-copy {
  text-align: right;
}

@media (max-width: 860px) {
  .site-shell {
    width: min(100% - 24px, 720px);
    padding-top: 12px;
  }

  .hero-grid,
  .block-grid,
  .feature-row {
    grid-template-columns: 1fr;
  }

  .intro-panel,
  .profile-card {
    min-height: auto;
  }

  .intro-panel {
    padding: 30px 22px;
  }

  .profile-card {
    gap: 22px;
  }

  .photo-frame,
  .photo-frame img {
    min-height: 320px;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-menu {
    display: grid;
  }

  .brand span {
    max-width: 128px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-links {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 4px;
  }

  .topbar.is-open .nav-links {
    display: block;
  }

  .nav-links ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .nav-links a {
    padding: 10px 11px;
    border: 1px solid var(--border);
    background: var(--card-soft);
  }

  .intro-panel h1 {
    font-size: 38px;
  }

  .photo-frame,
  .photo-frame img {
    min-height: 260px;
  }

  .section-heading,
  .post-meta,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-copy {
    text-align: left;
  }
}
