:root {
  color-scheme: light;
  --ink: #171714;
  --muted: #605f57;
  --paper: #f5f0e6;
  --panel: #fffaf0;
  --line: #25231e;
  --green: #315f48;
  --amber: #a06122;
  --steel: #62727c;
  --shadow: 0 18px 40px rgba(23, 23, 20, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23,23,20,.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(23,23,20,.025) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 2px solid var(--line);
  background: rgba(245, 240, 230, .94);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--amber);
}

nav { display: flex; flex-wrap: wrap; gap: 14px 20px; font-size: .92rem; }
nav a { text-decoration: none; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--amber); }

main { min-height: 72vh; }

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 84px));
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--line);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.04);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(245,240,230,.96), rgba(245,240,230,.76) 43%, rgba(245,240,230,.12) 72%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: clamp(36px, 8vw, 96px) clamp(18px, 4vw, 56px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 { font-size: clamp(2.2rem, 7vw, 5.8rem); max-width: 11ch; }
h2 { font-size: clamp(1.55rem, 3vw, 2.8rem); }
h3 { font-size: 1.22rem; }

.hero-copy > p:not(.eyebrow), .page-heading > p, .detail-head > p {
  max-width: 68ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.22rem);
}

.hero-actions, .detail-head .button { margin-top: 22px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 800;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease;
}

.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.button.primary { background: var(--green); color: #fffaf0; }

.section-grid, .journal-strip, .page-heading, .project-grid.wide, .post-list, .detail {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(48px, 8vw, 96px) 0;
}

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

.project-grid.wide { padding: 0 0 72px; }

.project-card, .post-card {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.project-card {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--steel);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-card p, .post-card p { margin: 0; color: var(--muted); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  border: 1px solid var(--line);
  background: rgba(160, 97, 34, .11);
  padding: 3px 7px;
  font-size: .76rem;
}

.journal-strip {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(42px, 7vw, 82px) 0;
  border-top: 2px solid var(--line);
}

.post-list {
  display: grid;
  gap: 16px;
  padding-bottom: 72px;
}

.post-card { margin-bottom: 16px; }
.post-card time { color: var(--amber); font-weight: 800; font-size: .82rem; }

.page-heading {
  padding: clamp(52px, 9vw, 112px) 0 clamp(30px, 5vw, 58px);
}

.page-heading h1 { max-width: 14ch; }
.page-heading.about h1 { max-width: 18ch; }

.detail {
  padding: 46px 0 86px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--green);
  font-weight: 800;
}

.detail-head {
  border-bottom: 2px solid var(--line);
  padding-bottom: 28px;
  margin-bottom: 34px;
}

.detail-head h1 { max-width: 13ch; }

.prose {
  max-width: 780px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.16rem;
}

.prose h2 {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.45rem;
  margin-top: 2rem;
}

.prose code, .prose pre {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.prose pre {
  overflow: auto;
  padding: 14px;
  border: 2px solid var(--line);
  background: #efe7d7;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

@media (max-width: 840px) {
  .site-header, .site-footer, .journal-strip { display: block; }
  nav { margin-top: 14px; }
  .hero { min-height: 680px; }
  .hero::after { background: rgba(245,240,230,.88); }
  h1 { max-width: 100%; font-size: 2.55rem; }
  .section-grid, .journal-strip { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .site-footer span { display: block; margin-bottom: 8px; }
}

/* Cyberpunk console theme */
:root {
  color-scheme: dark;
  --ink: #e9fff7;
  --muted: #96a8b5;
  --paper: #070a12;
  --panel: rgba(13, 20, 33, .88);
  --line: #28f0ff;
  --green: #41ff9f;
  --amber: #ffb84d;
  --steel: #b45cff;
  --pink: #ff3df2;
  --shadow: 0 0 0 1px rgba(40,240,255,.22), 0 20px 60px rgba(0,0,0,.38), 0 0 34px rgba(255,61,242,.08);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255,61,242,.14), transparent 26rem),
    radial-gradient(circle at 88% 20%, rgba(40,240,255,.12), transparent 28rem),
    linear-gradient(90deg, rgba(40,240,255,.08) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(180,92,255,.07) 1px, transparent 1px) 0 0 / 42px 42px,
    var(--paper);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025), rgba(255,255,255,.025) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: screen;
  opacity: .35;
  z-index: 20;
}

.site-header {
  background: rgba(7, 10, 18, .88);
  border-bottom: 1px solid rgba(40,240,255,.5);
  box-shadow: 0 0 28px rgba(40,240,255,.12);
  backdrop-filter: blur(14px);
}

.brand-mark {
  background: linear-gradient(135deg, var(--pink), var(--line));
  border-color: var(--line);
  color: #05070d;
  box-shadow: 0 0 18px rgba(40,240,255,.55);
}

nav a { color: var(--muted); }
nav a:hover { color: var(--ink); border-bottom-color: var(--pink); }

.hero {
  border-bottom: 1px solid rgba(40,240,255,.42);
  min-height: min(790px, calc(100vh - 74px));
}

.hero img {
  filter: saturate(1.25) contrast(1.14) brightness(.48) hue-rotate(170deg);
}

.hero::after {
  background:
    linear-gradient(90deg, rgba(7,10,18,.96), rgba(7,10,18,.78) 45%, rgba(7,10,18,.26) 78%),
    linear-gradient(180deg, rgba(255,61,242,.16), transparent 36%, rgba(40,240,255,.12));
}

.hero-copy {
  border-left: 3px solid var(--line);
  margin-left: clamp(18px, 4vw, 56px);
  padding-left: clamp(18px, 4vw, 44px);
}

.eyebrow {
  color: var(--green);
  text-shadow: 0 0 14px rgba(65,255,159,.35);
}

h1 { text-shadow: 0 0 24px rgba(40,240,255,.16); }
h2, h3 { color: var(--ink); }

.hero-copy > p:not(.eyebrow), .page-heading > p, .detail-head > p {
  color: var(--muted);
}

.button {
  background: rgba(13, 20, 33, .96);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(40,240,255,.25), 0 0 22px rgba(40,240,255,.14);
}

.button.primary {
  background: linear-gradient(135deg, rgba(40,240,255,.98), rgba(255,61,242,.9));
  color: #05070d;
  border-color: transparent;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(255,61,242,.34);
}

.project-card, .post-card, .result-card, .archive-tools, .search-console {
  position: relative;
  background: linear-gradient(180deg, rgba(17,27,44,.92), rgba(8,12,22,.94));
  border: 1px solid rgba(40,240,255,.36);
  box-shadow: var(--shadow);
}

.project-card::before, .post-card::before, .result-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(255,61,242,.64);
  pointer-events: none;
}

.card-topline { color: var(--line); }
.project-card p, .post-card p, .result-card p { color: var(--muted); }

.tag-row span {
  border-color: rgba(65,255,159,.44);
  background: rgba(65,255,159,.08);
  color: #c9ffdf;
}

.journal-strip, .detail-head {
  border-top-color: rgba(40,240,255,.28);
  border-bottom-color: rgba(40,240,255,.38);
}

.prose {
  color: #dce9ee;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.prose h2 { color: var(--line); }

.prose pre {
  background: rgba(0,0,0,.35);
  border-color: rgba(40,240,255,.42);
}

.archive-tools {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 28px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.archive-tools div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.archive-tools strong {
  color: var(--line);
  font-size: 2rem;
  line-height: 1;
}

.archive-tools span { color: var(--muted); }

.pager {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 76px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pager a {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid rgba(40,240,255,.45);
  text-decoration: none;
}

.pager a[aria-current="page"] {
  background: var(--line);
  color: #05070d;
  font-weight: 800;
}

.search-console {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 76px;
  padding: 18px;
}

.search-console label {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .78rem;
}

.search-console input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(40,240,255,.5);
  color: var(--ink);
  font: inherit;
}

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

.result-card {
  padding: 18px;
}

.empty-state {
  color: var(--muted);
  margin: 0;
}

.site-footer {
  border-top-color: rgba(40,240,255,.38);
  background: rgba(7,10,18,.76);
}

@media (max-width: 840px) {
  .hero-copy { margin-left: 18px; }
  .archive-tools { display: block; }
  .archive-tools .button { margin-top: 12px; margin-right: 8px; }
  .result-grid { grid-template-columns: 1fr; }
}
