:root {
  color-scheme: dark;
  --bg: #09090c;
  --fg: #f2f2f0;
  --muted: #919198;
  --dim: #5e5e66;
  --line: rgba(242, 242, 240, 0.18);
  --line-strong: rgba(242, 242, 240, 0.48);
  --panel: rgba(9, 9, 12, 0.72);
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

a { color: inherit; }

.bg-screen-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.bg-screen-wrap::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 9, 12, 0.2), var(--bg) 88%),
    radial-gradient(circle at 75% 10%, transparent, rgba(9, 9, 12, 0.5) 70%);
  content: "";
}

#bg-screen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  filter: grayscale(1) contrast(1.15);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 34px 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-link,
.view-switch a,
.project-action {
  text-decoration: none;
}

.back-link {
  color: var(--muted);
  transition: color 160ms ease;
}

.back-link::before { content: "← "; }
.back-link:hover,
.back-link:focus-visible { color: var(--fg); }

.view-switch {
  display: flex;
  gap: 18px;
  color: var(--dim);
}

.view-switch a { transition: color 160ms ease; }
.view-switch a:hover,
.view-switch a:focus-visible,
.view-switch .current { color: var(--fg); }
.view-switch .current::before { content: "["; }
.view-switch .current::after { content: "]"; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.35fr);
  gap: 40px;
  align-items: end;
  min-height: 36vh;
  padding: 54px 0 38px;
}

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

.eyebrow::before { content: "// "; }

.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 8.6rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.78;
  text-transform: uppercase;
}

.hero h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-strong);
}

.hero-summary {
  max-width: 370px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.index-heading {
  display: grid;
  grid-template-columns: 70px minmax(180px, 0.7fr) minmax(280px, 1.5fr) minmax(190px, 0.8fr) 100px;
  gap: 22px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.project-group { border-bottom: 1px solid var(--line-strong); }

.group-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 27px 14px 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.group-title::before { content: ">"; color: var(--fg); }
.group-title span { color: var(--dim); }

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(180px, 0.7fr) minmax(280px, 1.5fr) minmax(190px, 0.8fr) 100px;
  gap: 22px;
  align-items: start;
  padding: 26px 14px 28px;
  border-top: 1px solid var(--line);
  transition: background 180ms ease, padding 180ms ease;
}

.project-row::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(242, 242, 240, 0.055);
  content: "";
  opacity: 0;
  transform: scaleY(0.8);
  transition: opacity 180ms ease, transform 180ms ease;
}

.project-row:hover::before,
.project-row:focus-within::before {
  opacity: 1;
  transform: scaleY(1);
}

.project-number {
  color: var(--dim);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.project-name {
  margin: -0.15em 0 0;
  color: var(--fg);
  font-size: clamp(1.08rem, 1.7vw, 1.55rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.project-status {
  display: block;
  width: max-content;
  margin-top: 12px;
  color: var(--dim);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-status.active { color: var(--fg); }
.project-status::before { content: "○ "; }
.project-status.active::before { content: "● "; }

.project-description {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
  list-style: none;
}

.project-tech li::before { content: "+ "; color: var(--dim); }

.project-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.project-action {
  position: relative;
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.project-action::after { content: " ↗"; }
.project-action.internal::after { content: " →"; }
.project-action:hover,
.project-action:focus-visible { color: var(--fg); }

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 18px;
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 24px; min-height: 34vh; }
  .hero-summary { max-width: 600px; }
  .index-heading { display: none; }
  .project-row {
    grid-template-columns: 48px minmax(170px, 0.65fr) minmax(260px, 1.35fr) 90px;
  }
  .project-tech { grid-column: 3; }
  .project-actions { grid-column: 4; grid-row: 1 / span 2; }
}

@media (max-width: 680px) {
  .page-shell { padding: 18px 18px 36px; }
  .topbar { align-items: flex-start; gap: 20px; }
  .view-switch { flex-direction: column; align-items: flex-end; gap: 7px; }
  .hero { min-height: 31vh; padding: 44px 0 30px; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5.8rem); line-height: 0.82; }
  .project-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 22px 8px 24px;
  }
  .project-name,
  .project-description,
  .project-tech,
  .project-actions { grid-column: 2; }
  .project-description { margin-top: 4px; }
  .project-tech { margin-top: 4px; }
  .project-actions {
    grid-row: auto;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
  }
  .group-title { padding-inline: 8px; }
  .page-footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #bg-screen { display: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
