/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg:             #0A0A0A;
  --bg-card:        #141414;
  --text-primary:   #E8E8E8;
  --text-secondary: #888888;
  --accent:         #00FF88;
  --border:         rgba(255, 255, 255, 0.08);
  --border-accent:  rgba(0, 255, 136, 0.3);
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --font-body:      'Inter', system-ui, sans-serif;

  --nav-height:       64px;
  --container-max:    1200px;
  --section-padding:  clamp(5rem, 10vw, 8rem);
  --gap-card:         1.5rem;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

img, video {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

/* ============================================================
   NOISE TEXTURE  (SVG feTurbulence — no extra HTTP request)
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* All content must stack above the noise layer */
nav, main, footer, .cursor {
  position: relative;
  z-index: 1;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.accent {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  z-index: 10000;
  transition: top 0.15s;
}

.skip-link:focus {
  top: 1rem;
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 18px;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate(
    calc(var(--cursor-x, -100) * 1px - 50%),
    calc(var(--cursor-y, -100) * 1px - 50%)
  );
  transition: opacity 0.3s, width 0.12s, height 0.12s;
  mix-blend-mode: difference;
}

.cursor--visible { opacity: 1; }

.cursor--hover {
  width: 20px;
  height: 26px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(10, 10, 10, 0.88);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__logo {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  letter-spacing: -0.02em;
}

.nav__logo:hover { color: var(--accent); }

/* Hamburger toggle */
.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.2s, opacity 0.2s;
  transform-origin: center;
}

.nav--open .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav--open .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav links — mobile default: hidden */
.nav__links {
  display: none;
  gap: 0;
}

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.875rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0.875rem;
  right: 0.875rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}

.nav__link:hover,
.nav__link.active {
  color: var(--accent);
}

.nav__link:hover::after,
.nav__link.active::after {
  transform: scaleX(1);
}

.nav__cta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 0.5rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
}

.nav__cta:hover {
  background: var(--accent);
  color: #000;
}

/* Mobile nav open */
@media (max-width: 767px) {
  .nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 0;
  }

  .nav--open .nav__links {
    display: flex;
  }

  .nav__link {
    padding: 0.875rem 1.5rem;
    width: 100%;
    min-height: 48px;
  }

  .nav__link::after { display: none; }

  .nav__cta {
    margin: 0.5rem 1.5rem;
    justify-content: center;
  }
}

/* Desktop nav */
@media (min-width: 768px) {
  .nav__toggle { display: none; }

  .nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
}

/* ============================================================
   SECTION LABEL  // about
   ============================================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  margin-bottom: 2.5rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  overflow: hidden;
}

/* Faint grid — terminal paper feel */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero__content {
  max-width: 820px;
}

.hero__prompt {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--accent);
  margin-bottom: 0.75rem;
  user-select: none;
}

.hero__name {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5.5vw, 4.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  min-height: 1.2em;
}

/* Blinking cursor — CSS only, no JS needed */
.cursor-blink {
  display: inline-block;
  color: var(--accent);
  font-weight: 400;
  animation: blink 1s step-end infinite;
  margin-left: 3px;
  line-height: 1;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(0.9375rem, 2.5vw, 1.375rem);
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero__tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 1.8vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2.75rem;
  max-width: 480px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  align-items: center;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: #000;
  border: 1px solid var(--accent);
}

.btn--primary:hover {
  background: transparent;
  color: var(--accent);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: var(--section-padding) 0;
}

.about__text {
  max-width: 680px;
}

.about__text p {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.about__text p:last-child { margin-bottom: 0; }

.about__text strong {
  color: var(--accent);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects {
  padding: var(--section-padding) 0;
}

.projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-card);
}

@media (min-width: 768px) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* Project card */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Screenshot / placeholder */
.project-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 1.5rem;
  position: relative;
  letter-spacing: 0.04em;
}

.project-card__placeholder::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid var(--border-accent);
  pointer-events: none;
}

.project-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__number {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.project-card__title {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.project-card__tags {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.875rem;
  opacity: 0.85;
}

.project-card__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
  flex: 1;
}

.project-card__stack {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
  line-height: 1.7;
  opacity: 0.7;
}

.project-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: auto;
}

.project-card__link {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.04em;
  transition: color 0.2s, border-color 0.2s;
}

.project-card__link:hover {
  color: var(--accent);
  border-color: var(--border-accent);
}

/* ============================================================
   STACK
   ============================================================ */
.stack-section {
  padding: var(--section-padding) 0;
}

.stack__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  font-family: var(--font-mono);
}

@media (min-width: 640px) {
  .stack__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stack__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stack__category-title {
  font-size: 0.75rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  margin-bottom: 0.625rem;
}

.stack__divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 1rem;
}

.stack__items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stack__item {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Concepts row — spans full width */
.stack__concepts {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.stack__concepts-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 2rem;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: var(--section-padding) 0;
}

.contact__intro {
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.contact__intro p {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.contact__intro p + p { margin-top: 0.5rem; }

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.contact__link {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  transition: color 0.2s;
}

.contact__link::before { content: '['; color: var(--accent); margin-right: 0.25rem; }
.contact__link::after  { content: ']'; color: var(--accent); margin-left: 0.25rem; }

.contact__link:hover { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer__text {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.footer__link {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer__link:hover { color: var(--accent); }

/* ============================================================
   SCROLL REVEAL  (JS adds .visible)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FOCUS RING
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   RESPONSIVE — 1280px
   ============================================================ */
@media (min-width: 1280px) {
  .container {
    padding: 0 2rem;
  }
}

/* ============================================================
   PREFERS-REDUCED-MOTION  — disable all animations
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .cursor-blink {
    animation: none;
    opacity: 1;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .project-card {
    transition: none;
  }

  .cursor { display: none; }

  .nav__toggle-bar { transition: none; }

  .nav__link::after,
  .btn,
  .nav__logo,
  .nav__cta,
  .project-card__link,
  .contact__link,
  .footer__link {
    transition: none;
  }
}
