:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --surface: #fbfcf8;
  --surface-strong: #ffffff;
  --ink: #151816;
  --muted: #647068;
  --line: rgba(25, 24, 22, 0.14);
  --accent: #0f8b6f;
  --accent-2: #b64b2c;
  --gold: #bf8a18;
  --shadow: 0 18px 50px rgba(27, 24, 19, 0.14);
  --max: 1120px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111412;
  --surface: #191f1b;
  --surface-strong: #202821;
  --ink: #edf5ee;
  --muted: #a8b8ad;
  --line: rgba(244, 238, 227, 0.14);
  --accent: #68d3b4;
  --accent-2: #ff936f;
  --gold: #f1c15f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.site-header.is-elevated {
  border-color: var(--line);
}

.brand,
.nav,
.hero-actions,
.site-footer,
.intro-band {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
}

.nav {
  gap: 6px;
}

.nav a,
.theme-toggle {
  min-height: 38px;
  border-radius: 8px;
}

.nav a {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.theme-toggle {
  width: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  display: grid;
  align-items: end;
  overflow: hidden;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(7, 13, 10, 0.9), rgba(7, 13, 10, 0.58) 48%, rgba(7, 13, 10, 0.12)),
    linear-gradient(0deg, rgba(7, 13, 10, 0.78), rgba(7, 13, 10, 0) 52%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 7px);
}

.hero-content {
  position: relative;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 145px 0 84px;
  color: #fff8ed;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f5cc66;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(3rem, 8vw, 6.7rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

h3 {
  font-size: 1.25rem;
}

.hero-copy {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255, 248, 237, 0.84);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.terminal-strip {
  width: min(560px, 100%);
  margin: 34px 0 0;
  padding: 16px 18px;
  border: 1px solid rgba(104, 211, 180, 0.36);
  border-radius: 8px;
  background: rgba(5, 12, 9, 0.68);
  color: #a9f5dc;
  font: 0.9rem/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.button.primary {
  border-color: transparent;
  background: var(--accent);
  color: #fffaf2;
}

.button.ghost {
  border-color: rgba(255, 248, 237, 0.35);
  color: #fff8ed;
}

.intro-band {
  width: min(var(--max), calc(100% - 40px));
  margin: -38px auto 0;
  position: relative;
  z-index: 2;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.intro-band div {
  flex: 1;
  padding: 20px;
}

.intro-band div + div {
  border-left: 1px solid var(--line);
}

.intro-band strong,
.intro-band span {
  display: block;
}

.intro-band span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.94rem;
}

.section,
.feature-row,
.about-section {
  width: min(var(--max), calc(100% - 40px));
  margin: 92px auto 0;
}

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

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

.post-card,
.writeup-card,
.note-card,
.reading-list,
.contact-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 22px;
}

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

.writeup-card {
  min-height: 280px;
  padding: 22px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 82%, transparent), transparent),
    var(--surface);
}

.writeup-topline,
.writeup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-weight: 800;
}

.writeup-card h3 {
  margin-top: 24px;
  font-size: 1.45rem;
}

.writeup-card p {
  color: var(--muted);
}

.writeup-status {
  justify-content: flex-start;
  margin-top: 22px;
  color: var(--accent-2);
}

.post-meta,
.note-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.post-card h3 {
  margin-top: 24px;
  font-size: 1.55rem;
}

.post-card p {
  color: var(--muted);
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 22px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
}

.feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 28px;
  align-items: start;
  padding: 54px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-copy p {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.06rem;
}

.text-link {
  color: var(--accent);
  font-weight: 800;
}

.reading-list {
  padding: 24px;
}

.reading-list ul {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.reading-list li + li {
  margin-top: 12px;
}

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

.note-card {
  padding: 20px;
}

.note-card p {
  margin-bottom: 0;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 28px;
  align-items: start;
  margin-bottom: 76px;
}

.about-copy p,
.contact-panel p {
  color: var(--muted);
}

.contact-panel {
  padding: 24px;
}

.contact-panel .button {
  margin-top: 6px;
}

.site-footer {
  justify-content: space-between;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .hero {
    min-height: 760px;
  }

  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(13, 12, 10, 0.86), rgba(13, 12, 10, 0.18)),
      linear-gradient(90deg, rgba(13, 12, 10, 0.72), rgba(13, 12, 10, 0.18));
  }

  .intro-band,
  .feature-row,
  .about-section {
    display: block;
  }

  .intro-band div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .post-grid,
  .writeup-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .reading-list,
  .contact-panel {
    margin-top: 22px;
  }

  .site-footer {
    display: block;
  }

  .site-footer span {
    display: block;
  }
}

@media (max-width: 480px) {
  .hero-content {
    width: min(100% - 28px, var(--max));
    padding-bottom: 60px;
  }

  .section,
  .feature-row,
  .about-section,
  .intro-band,
  .site-footer {
    width: calc(100% - 28px);
  }

  .button {
    width: 100%;
  }
}
