/* ============================================================
   Terminal/sci-fi portfolio theme
   Palette: deep space bg, cyan accent, amber secondary
   ============================================================ */

:root {
  --bg: #05080f;
  --bg-panel: #0a1120;
  --bg-raised: #0e1628;
  --line: #1c2a45;
  --text: #c9d6e8;
  --text-dim: #6d7f99;
  --accent: #7fa3ff;
  --accent-dim: rgba(127, 163, 255, 0.15);
  --amber: #fbbf24;
  --danger: #f87171;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
  --max-w: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle CRT scanline overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 3px,
    rgba(0, 0, 0, 0.12) 3px 4px
  );
  opacity: 0.32;
}

/* Faint grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(94, 234, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 234, 212, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 75%);
}

::selection { background: var(--accent-dim); color: var(--accent); }

/* Twinkling starfield canvas — drawn by js/script.js */
#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  display: block;
}

/* ================= NAV ================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav__links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}

.nav__links a:hover { color: var(--amber); }

.nav__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  background: var(--bg-panel);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: 0 0 8px #ff5f57;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ================= SHARED ================= */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }

.section__kicker {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.section__title {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

/* Dashed "photo goes here" boxes — swap for real <img> later */
.photo-frame__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 180px;
  border: 1.5px dashed var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ================= HERO ================= */

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 4rem);
  min-height: 80vh;
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.hero__title {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero__tagline {
  color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero__tagline strong { color: var(--accent); font-weight: 500; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  transition: all 0.15s;
}

.btn:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--bg);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
}

.btn--ghost:hover {
  background: var(--amber);
  color: var(--bg);
}

/* Photo frame with corner brackets */
.photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 380px;
  justify-self: center;
  width: 100%;
}

.photo-frame::before,
.photo-frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  z-index: 1;
}

.photo-frame::before {
  top: -8px;
  left: -8px;
  border-right: none;
  border-bottom: none;
}

.photo-frame::after {
  bottom: -8px;
  right: -8px;
  border-left: none;
  border-top: none;
}

.photo-frame__label {
  position: absolute;
  bottom: -2rem;
  left: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.hero__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}

.hero__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 64% at 50% 44%, rgba(127, 163, 255, 0.1) 0%, rgba(127, 163, 255, 0.04) 55%, transparent 80%);
}

.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px);
  -webkit-mask-image: radial-gradient(ellipse 60% 64% at 50% 44%, #000 55%, transparent 80%);
  mask-image: radial-gradient(ellipse 60% 64% at 50% 44%, #000 55%, transparent 80%);
  pointer-events: none;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: brightness(0.96) saturate(0.98);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 78%);
  animation: hero-float 6s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.accent-text { color: var(--accent); }

/* ================= EXPERIENCE ================= */

.exp__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.exp-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}

.exp-card:hover {
  transform: translateY(-4px);
  border-color: var(--amber);
}

.exp-card__header {
  aspect-ratio: 21 / 9;
}

.exp-card__header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exp-card__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
}

.exp-card__brandrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.exp-card__logo {
  height: 26px;
  width: auto;
  object-fit: contain;
}

.exp-card__logo--chip {
  background: #fff;
  padding: 3px 7px;
  border-radius: 5px;
}

.exp-card__logo--sq {
  width: 26px;
  object-fit: cover;
  object-position: left;
  background: #fff;
  border-radius: 5px;
}

.exp-card__logo--sm { height: 20px; }

.exp-card__brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.exp-card__snippet {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

.exp-card__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.exp-card__badges span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  white-space: nowrap;
}

.exp-card__badges img {
  width: 24px;
  height: 24px;
}

.exp-card__body { padding: 1.2rem 1.1rem 1.35rem; }

.exp-card__title { font-size: 1.15rem; }

.exp-card__company {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.exp-card__timeline {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--amber);
  margin: 0.6rem 0 0.9rem;
}

.exp-card__stack {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.exp-card__stack span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--accent);
  white-space: nowrap;
}

.exp-card__stack img {
  width: 18px;
  height: 18px;
}

.exp-card__impact-label {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
}

.exp-card__impact {
  list-style: none;
}

.exp-card__impact li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.exp-card__impact li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
}

.exp-card__impact .metric {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* ================= TERMINAL ================= */

.terminal {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
}

.terminal__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal__dot--red { background: var(--danger); }
.terminal__dot--yellow { background: var(--amber); }
.terminal__dot--green { background: var(--accent); }

.terminal__path {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.terminal__lines {
  list-style: none;
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: clamp(0.78rem, 2vw, 0.9rem);
  line-height: 2;
}

.t-key { color: var(--accent); }
.t-ok { color: var(--amber); }
.t-icon {
  height: 1.05em;
  width: 1.05em;
  vertical-align: -0.2em;
  margin-right: 2px;
}

.about__bio {
  color: var(--text-dim);
  max-width: 72ch;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

/* ================= LAB ================= */

.lab__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem;
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--amber);
}

.card__thumb {
  aspect-ratio: 16 / 10;
  margin-bottom: 1rem;
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.card__title { font-size: 1.15rem; margin-bottom: 0.4rem; }

.card__desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}

.card__link {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
}

.card__link:hover { text-decoration: underline; color: var(--amber); }

/* ================= LINK CARDS ================= */

.lab__links,
.comms__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.link-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
}

.link-card__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
}

.link-card__icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.link-card__body h3 {
  font-size: 1.02rem;
  margin-bottom: 0.2rem;
}

.link-card__sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--amber);
  margin-top: 0.2rem;
  white-space: nowrap;
}

.link-card__body p {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ================= FOOTER ================= */

.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 1rem 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer__meta {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  opacity: 1;
  color: var(--text);
}

/* ================= ANIMATIONS / RESPONSIVE ================= */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot, .cursor, .hero__img { animation: none; }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    text-align: center;
  }
  .hero__tagline { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .photo-frame { margin-bottom: 2rem; }
}
