/* ============================================================
   Portfolio — dark, engineering-flavored, single accent.
   No gradients-on-everything, no glassmorphism, no blobs.
   ============================================================ */

:root {
  --bg:        #0a0b0d;
  --bg-soft:   #0e1013;
  --panel:     #101317;
  --line:      rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --text:  #e7e9ec;
  --mut:   #949aa3;
  --faint: #5c636d;

  /* Single restrained accent — a soft phosphor green. */
  --accent:      #9ece6a;
  --accent-dim:  #7fa653;
  --accent-glow: rgba(158, 206, 106, 0.14);

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --wrap: 940px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Barely-there dotted texture — reads as "engineering", not decoration. */
  background-image: radial-gradient(rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 34px 34px;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.08em 0.36em;
  border-radius: 4px;
}

::selection { background: var(--accent); color: #0a0b0d; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); background: rgba(10, 11, 13, 0.9); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-weight: 600; }
.brand__mark { color: var(--accent); font-size: 1.05rem; }
.brand__name { color: var(--text); letter-spacing: 0.02em; }

.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a { font-family: var(--mono); font-size: 0.8rem; color: var(--mut); letter-spacing: 0.02em; transition: color 0.2s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  color: var(--accent) !important;
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 6px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease) !important;
}
.nav__cta:hover { border-color: var(--accent-dim); background: var(--accent-glow); }

/* ---------------- Hero ---------------- */
.hero { padding: clamp(64px, 13vw, 128px) 0 clamp(48px, 8vw, 96px); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--mut);
  letter-spacing: 0.04em;
  margin-bottom: 26px;
}
.eyebrow__idx { color: var(--accent); }

.hero__title {
  font-size: clamp(3rem, 11vw, 6.2rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: flex-end;
}
.cursor {
  display: inline-block;
  width: 0.5ch;
  height: 0.86em;
  margin-left: 0.14em;
  background: var(--accent);
  transform: translateY(-0.04em);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.hero__role {
  font-family: var(--mono);
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  color: var(--accent);
  margin-top: 22px;
  letter-spacing: -0.01em;
}
.hero__bio {
  max-width: 60ch;
  color: var(--mut);
  font-size: 1.12rem;
  margin-top: 22px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }
.btn {
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  padding: 12px 22px;
  border-radius: 7px;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn--primary { background: var(--accent); color: #0a0b0d; font-weight: 600; }
.btn--primary:hover { transform: translateY(-2px); background: #aadb78; }
.btn--ghost { color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent-dim); color: var(--accent); }

/* ---------------- Section scaffolding ---------------- */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section__head { display: flex; align-items: center; gap: 16px; margin-bottom: 52px; }
.section__idx { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.section__title { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.section__rule { flex: 1; height: 1px; background: var(--line); }

/* ---------------- Projects ---------------- */
.projects { list-style: none; display: flex; flex-direction: column; gap: 22px; counter-reset: none; }

.project {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 30px 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.28s var(--ease), transform 0.28s var(--ease), background 0.28s var(--ease);
}
.project::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.project:hover {
  border-color: var(--line);
  transform: translateY(-3px);
  background: var(--panel);
}
.project:hover::before { transform: scaleY(1); }

.project__no {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--faint);
  padding-top: 4px;
}
.project__topline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.project__title { font-size: 1.32rem; font-weight: 600; letter-spacing: -0.02em; }
.project__kind { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.03em; text-transform: uppercase; }

.project__lead { color: var(--text); max-width: 66ch; }
.project__lead strong { color: var(--accent); font-weight: 600; }
.project__lead em { color: var(--text); font-style: italic; }
.project__note { color: var(--mut); font-size: 0.98rem; max-width: 68ch; margin-top: 12px; }
.project__note strong { color: var(--text); font-weight: 600; }

/* faux-terminal block — clean, not cartoonish */
.terminal {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #08090b;
  font-family: var(--mono);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.015);
}
.terminal__bar span { width: 9px; height: 9px; border-radius: 50%; background: #2b2f36; }
.terminal__bar em { margin-left: 8px; font-style: normal; font-size: 0.72rem; color: var(--faint); }
.terminal__body { padding: 15px 16px; font-size: 0.8rem; line-height: 1.75; color: var(--text); white-space: pre-wrap; }
.c-accent { color: var(--accent); }
.c-mut { color: var(--mut); }
.c-dim { color: var(--faint); }
.c-b { color: var(--text); font-weight: 600; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--mut);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

.project__links { margin-top: 20px; }
.link {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  transition: opacity 0.2s var(--ease), letter-spacing 0.2s var(--ease);
}
.link:hover { letter-spacing: 0.02em; }
.link[data-disabled] { color: var(--faint); pointer-events: none; }

/* ---------------- About ---------------- */
.about__lead { font-size: 1.16rem; max-width: 64ch; color: var(--text); }
.about__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 44px; margin-top: 44px; }
.about__h { font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 14px; }
.about__col + .about__col .about__h:not(:first-child) { margin-top: 26px; }
.about__meta { color: var(--mut); font-family: var(--mono); font-size: 0.9rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.chips li {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 7px;
}

/* ---------------- Contact ---------------- */
.contact__line { font-size: 1.3rem; max-width: 40ch; color: var(--text); margin-bottom: 34px; letter-spacing: -0.01em; }
.contact__links { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.contact__link {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  transition: padding-left 0.24s var(--ease), color 0.24s var(--ease);
}
.contact__link:hover { padding-left: 16px; color: var(--accent); }
.contact__link[data-disabled] { color: var(--faint); pointer-events: none; }
.contact__k { width: 92px; flex-shrink: 0; font-size: 0.78rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.contact__link:hover .contact__k { color: inherit; }
.contact__v { font-size: 1.02rem; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 40px; }
.footer__inner { display: flex; align-items: center; gap: 12px; }
.footer__mark { font-family: var(--mono); color: var(--accent); }
.footer__text { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }

/* ---------------- Reveal-on-scroll ---------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav__links { gap: 16px; }
  .nav__links a:not(.nav__cta) { display: none; }
  .project { grid-template-columns: 1fr; padding: 24px 22px; }
  .project__no { display: none; }
  .about__grid { grid-template-columns: 1fr; gap: 30px; }
  .contact__k { width: 74px; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
