:root {
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --text: #c0c0c0;
  --muted: #7a7a7a;
  --crimson: #cc0000;
  --cyan: #00ffff;
  --line: #2a2a2a;
  --font-mono: "Share Tech Mono", ui-monospace, monospace;
  --font-display: "Press Start 2P", var(--font-mono);
  --header-h: 3.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(204, 0, 0, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(0, 255, 255, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--crimson);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--cyan);
}

.muted {
  color: var(--muted);
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  opacity: 0.35;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid transparent;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(10, 10, 10, 0.92);
}

.brand {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--crimson);
}

.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  scroll-margin-top: 0;
  align-items: start;
  justify-items: center;
  padding: 1rem 1.25rem 3rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.65)),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(204, 0, 0, 0.03) 48px,
      rgba(204, 0, 0, 0.03) 49px
    );
}

.hero-inner {
  width: min(720px, 100%);
  text-align: left;
}

.hero-portrait {
  display: block;
  width: min(220px, 55vw);
  height: min(220px, 55vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  filter: contrast(1.05) saturate(0.9);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  line-height: 1.25;
  color: #f2f2f2;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text);
}

.lede-end {
  color: var(--crimson);
  letter-spacing: 0.04em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 1px solid var(--crimson);
  font-family: inherit;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--crimson);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: transparent;
  color: var(--cyan);
  border-color: var(--cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0.75;
}

.glitch::before {
  color: var(--cyan);
  transform: translate(1px, 0);
  animation: glitch-a 3.5s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--crimson);
  transform: translate(-1px, 0);
  animation: glitch-b 2.8s infinite linear alternate-reverse;
}

@keyframes glitch-a {
  0%,
  90%,
  100% {
    clip-path: inset(0 0 100% 0);
  }
  92% {
    clip-path: inset(10% 0 60% 0);
  }
  94% {
    clip-path: inset(40% 0 20% 0);
  }
}

@keyframes glitch-b {
  0%,
  88%,
  100% {
    clip-path: inset(0 0 100% 0);
  }
  91% {
    clip-path: inset(55% 0 10% 0);
  }
  93% {
    clip-path: inset(5% 0 70% 0);
  }
}

.section {
  padding: 4rem 1.25rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 0.5rem);
}

.section-inner {
  width: min(960px, 100%);
  margin: 0 auto;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  color: #f0f0f0;
  letter-spacing: 0.04em;
}

.section-lead {
  margin: 0 0 2rem;
  color: var(--muted);
}

.updates-list {
  display: grid;
  gap: 1.25rem;
}

.update-item {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.update-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.update-item time {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--cyan);
  font-size: 0.85rem;
}

.update-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #e8e8e8;
}

.update-item p {
  margin: 0;
}

.project-list {
  display: grid;
  gap: 2rem;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Fixed 16:9 frame — matches Project A placeholder; images cannot expand this box */
.project-media {
  position: relative;
  display: block;
  width: 100%;
  max-width: 280px;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 = 280 × 157.5 */
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--bg-elevated);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.project-media:hover {
  border-color: var(--crimson);
  transform: translateY(-2px);
}

.project-thumb {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit: cover;
  object-position: center top;
  background-color: transparent;
}

.project-thumb--soon {
  background-image:
    linear-gradient(135deg, rgba(122, 122, 122, 0.2), rgba(0, 0, 0, 0.8)),
    repeating-linear-gradient(
      -45deg,
      #141414,
      #141414 8px,
      #0f0f0f 8px,
      #0f0f0f 16px
    );
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-meta h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #f0f0f0;
}

.project-body p {
  margin: 0;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: auto;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.status[data-state="online"] {
  color: #6dff6d;
}

.status[data-state="online"]::before {
  background: #6dff6d;
}

.status[data-state="offline"] {
  color: var(--crimson);
}

.status[data-state="offline"]::before {
  background: var(--crimson);
}

.status[data-state="checking"]::before {
  background: var(--cyan);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.about-grid h3 {
  margin: 0 0 0.6rem;
  color: var(--cyan);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-grid p {
  margin: 0;
}

.skills,
.contact {
  margin: 0;
  padding-left: 1.1rem;
}

.skills li,
.contact li {
  margin-bottom: 0.35rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 760px) {
  .project {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: calc(100svh - var(--header-h));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .glitch::before,
  .glitch::after {
    animation: none;
    content: none;
  }

  .project-media:hover {
    transform: none;
  }
}
