/* Portfolio — dark theme, typography-first */

:root {
  --bg: #0c0e10;
  --bg-mid: #12151a;
  --bg-warm: #141218;
  --surface: rgba(255, 255, 255, 0.1);
  --surface-hover: rgba(255, 255, 255, 0.14);
  --fg: #f2f1ee;
  --muted: #a8aeb4;
  --faint: #6b7178;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #6ec4c1;
  --accent-bright: #8fe8e4;
  --accent-dim: rgba(110, 196, 193, 0.2);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.45);
  /* Full desktop-width shell; text blocks use --measure for readability */
  --max: 72rem;
  --measure: 44rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 3.25rem;
  /* Site-wide background tech pattern */
  --bg-tech-line: rgba(255, 255, 255, 0.035);
  --bg-tech-accent-line: rgba(110, 196, 193, 0.055);
  --bg-tech-grid: 4rem;
  /* Cursor-follow spotlight (px or %), updated by script.js on fine pointers */
  --bg-cursor-x: 50vw;
  --bg-cursor-y: 42vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    /* Fine node grid */
    radial-gradient(
      circle at 1px 1px,
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1.5px
    ),
    /* Major vertical + horizontal blueprint grid */
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(var(--bg-tech-grid) - 1px),
      var(--bg-tech-line) calc(var(--bg-tech-grid) - 1px),
      var(--bg-tech-line) var(--bg-tech-grid)
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent calc(var(--bg-tech-grid) - 1px),
      var(--bg-tech-line) calc(var(--bg-tech-grid) - 1px),
      var(--bg-tech-line) var(--bg-tech-grid)
    ),
    /* Accent “circuit” diagonals */
    repeating-linear-gradient(
      125deg,
      transparent 0,
      transparent 5.5rem,
      var(--bg-tech-accent-line) 5.5rem,
      var(--bg-tech-accent-line) calc(5.5rem + 1px)
    ),
    repeating-linear-gradient(
      -35deg,
      transparent 0,
      transparent 7rem,
      rgba(110, 196, 193, 0.035) 7rem,
      rgba(110, 196, 193, 0.035) calc(7rem + 1px)
    ),
    /* Accent spotlight — follows cursor (see --bg-cursor-x / --bg-cursor-y) */
    radial-gradient(
      ellipse 26vmin 22vmin at var(--bg-cursor-x) var(--bg-cursor-y),
      rgba(110, 196, 193, 0.11) 0%,
      rgba(110, 196, 193, 0.04) 32%,
      transparent 52%
    ),
    radial-gradient(
      120% 85% at 50% -25%,
      var(--bg-mid) 0%,
      var(--bg-warm) 42%,
      var(--bg) 72%
    );
  background-size:
    2rem 2rem,
    auto,
    auto,
    auto,
    auto,
    auto,
    auto;
  background-position:
    0 0,
    0 0,
    0 0,
    0 0,
    2rem 1.25rem,
    0 0,
    0 0;
}

@media (min-width: 768px) {
  body {
    background-attachment: fixed;
  }
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 100;
  padding: 0.4rem 0.65rem;
  background: #fff;
  color: #0c0e10;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 14, 16, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.site-header.is-open {
  border-bottom-color: var(--line);
}

.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.75rem);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--fg);
  line-height: 1;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.logo:hover {
  color: var(--accent-bright);
  text-shadow: 0 0 24px rgba(110, 196, 193, 0.35);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--accent-bright);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.nav-toggle {
  display: none;
  padding: 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  border-radius: 6px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-toggle:hover {
  border-color: rgba(110, 196, 193, 0.35);
  background: rgba(110, 196, 193, 0.08);
  color: var(--accent-bright);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
    background: rgba(12, 14, 16, 0.97);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
  }

  .site-header.is-open .site-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
    letter-spacing: 0.04em;
  }

  .site-nav a:last-child {
    border-bottom: none;
  }
}

@keyframes main-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem clamp(1.25rem, 4vw, 2.75rem) 4rem;
  animation: main-fade 0.55s ease;
}

/* Home — centered column (index only) */
#main.main--centered {
  max-width: min(62rem, calc(100vw - 2.5rem));
  text-align: center;
}

/* Hero: copy left, portrait right */
#main.main--centered .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.75rem 2.25rem;
  align-items: center;
  text-align: left;
}

#main.main--centered .hero__content {
  min-width: 0;
  text-align: left;
}

#main.main--centered .hero h1,
#main.main--centered .hero__tagline,
#main.main--centered .hero__lead {
  margin-left: 0;
  margin-right: 0;
}

#main.main--centered .hero__tagline,
#main.main--centered .hero__lead {
  max-width: min(40rem, 100%);
}

#main.main--centered .hero__actions {
  justify-content: flex-start;
}

#main.main--centered .hero__portrait {
  width: min(14rem, 28vw);
  margin: 0;
  justify-self: end;
}

@media (max-width: 720px) {
  #main.main--centered .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  #main.main--centered .hero__content {
    text-align: center;
  }

  #main.main--centered .hero h1,
  #main.main--centered .hero__tagline,
  #main.main--centered .hero__lead {
    margin-left: auto;
    margin-right: auto;
  }

  #main.main--centered .hero__actions {
    justify-content: center;
  }

  #main.main--centered .hero__portrait {
    width: min(11.5rem, 52vw);
    margin: 1.5rem auto 0;
    justify-self: center;
  }
}

#main.main--centered .section > h2 {
  text-align: center;
  border-left: none;
  padding-left: 0;
}

#main.main--centered .section > h2::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin: 0.55rem auto 0;
  background: var(--accent);
  border-radius: 2px;
  opacity: 0.9;
}

#main.main--centered .card {
  text-align: left;
}

#main.main--centered .section__intro {
  margin-left: auto;
  margin-right: auto;
}

#main.main--centered .inline-links {
  align-items: center;
}

@media (min-width: 560px) {
  #main.main--centered .inline-links {
    flex-direction: row;
    justify-content: center;
  }
}

body.page-home .site-footer {
  text-align: center;
}

/* Home */
.hero {
  position: relative;
  padding: 0 0 2.5rem;
  border-bottom: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(110, 196, 193, 0.15) 20%,
    rgba(110, 196, 193, 0.45) 50%,
    rgba(110, 196, 193, 0.15) 80%,
    transparent 100%
  );
}

.hero__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero__portrait {
  --portrait-rotate-x: 0deg;
  --portrait-rotate-y: 0deg;
  --portrait-shift-x: 0px;
  --portrait-shift-y: 0px;
  display: block;
  width: min(12rem, 38vw);
  max-width: 100%;
  height: auto;
  aspect-ratio: 549 / 1024;
  object-fit: cover;
  object-position: center 18%;
  margin: 0;
  border-radius: 1.1rem;
  border: 1px solid rgba(110, 196, 193, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: perspective(900px)
    translate3d(var(--portrait-shift-x), var(--portrait-shift-y), 0)
    rotateX(var(--portrait-rotate-x)) rotateY(var(--portrait-rotate-y));
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-shadow: 0 0 48px rgba(110, 196, 193, 0.18);
}

.hero__tagline {
  margin: 0 0 0.75rem;
  max-width: min(var(--measure), 100%);
  font-size: clamp(0.98rem, 1.15vw, 1.125rem);
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.hero__tagline__sep {
  margin: 0 0.45em;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(110, 196, 193, 0.4);
}

.hero__lead {
  margin: 0 0 1.75rem;
  max-width: min(var(--measure), 100%);
  font-size: clamp(0.9375rem, 1.05vw, 1rem);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
}

/* Actions — primary uses accent */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  color: #0c0e10;
  background: linear-gradient(165deg, var(--accent-bright) 0%, var(--accent) 100%);
  box-shadow: 0 4px 20px rgba(110, 196, 193, 0.35);
}

.btn--primary:hover {
  color: #0c0e10;
  background: linear-gradient(165deg, #a5f0ec 0%, #8ad4d1 100%);
  box-shadow: 0 8px 28px rgba(110, 196, 193, 0.45);
}

.btn--ghost {
  font-weight: 600;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn--ghost:hover {
  color: var(--accent-bright);
  border-color: rgba(110, 196, 193, 0.5);
  background: var(--surface-hover);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3);
}

.btn--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sections */
.section {
  margin-top: 2.5rem;
}

.section--tight {
  margin-top: 2rem;
}

.section > h2 {
  margin: 0 0 1rem;
  padding-left: 0.65rem;
  border-left: 3px solid var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.88;
}

/* Single education block (not in a card grid) */
.section > .card {
  margin-top: 0.25rem;
}

.section__intro {
  margin: 0 0 0.75rem;
  max-width: min(var(--measure), 100%);
  font-size: 0.9375rem;
  color: var(--muted);
}

.section__intro--spaced {
  margin-top: 1.5rem;
}

.section__intro strong {
  color: var(--fg);
  font-weight: 600;
}

.section__cta {
  margin-top: 2.5rem;
  text-align: left;
}

/* Card grids — use horizontal space on wider viewports */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-grid--two {
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .card-grid:not(.card-grid--two) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .card-grid:not(.card-grid--two) {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
  }
}

@media (min-width: 560px) {
  .card-grid--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 900px) {
  .card-grid--two {
    gap: 1.1rem;
  }
}

.card {
  padding: 1.15rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-soft);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease,
    background 0.22s ease;
}

@media (hover: hover) {
  .card:hover,
  .cert-card:hover {
    transform: translateY(-3px);
    border-color: rgba(110, 196, 193, 0.28);
    background: var(--surface-hover);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, var(--shadow-lift),
      0 0 0 1px rgba(110, 196, 193, 0.12);
  }
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: none;
}

.page-header {
  padding-bottom: 1.5rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(110, 196, 193, 0.08);
}

.page-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-shadow: 0 0 36px rgba(110, 196, 193, 0.12);
}

.page-header__lead {
  margin: 0;
  max-width: min(var(--measure), 100%);
  font-size: 0.9375rem;
  color: var(--muted);
}

.prose p {
  margin: 0 0 1rem;
  max-width: min(var(--measure), 100%);
  font-size: 0.9375rem;
  color: var(--muted);
}

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

.prose h2 {
  margin: 2rem 0 0.75rem;
  padding-left: 0.65rem;
  border-left: 3px solid rgba(110, 196, 193, 0.55);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.85;
}

.prose h2:first-child {
  margin-top: 0;
}

.inline-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (min-width: 560px) {
  .inline-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
  }
}

.inline-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(110, 196, 193, 0.35);
  padding-bottom: 0.1rem;
  width: fit-content;
  color: var(--accent);
  transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

.inline-links a:hover {
  border-bottom-color: var(--accent-bright);
  color: var(--accent-bright);
  text-shadow: 0 0 20px rgba(110, 196, 193, 0.35);
}

/* Experience / education entries */
.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-card {
  display: block;
  padding: 1.15rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, var(--shadow-soft);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease,
    background 0.22s ease;
}

.cert-list .cert-card:first-child {
  margin-top: 0;
}

.cert-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cert-card__issuer {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.cert-card__meta {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cert-card__dot {
  margin: 0 0.25rem;
}

.resume-bullets {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.resume-bullets li {
  margin-bottom: 0.35rem;
}

.resume-bullets li:last-child {
  margin-bottom: 0;
}

/* Tags — light outline, no fill */
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.tag-list li {
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg);
  background: var(--accent-dim);
  border: 1px solid rgba(110, 196, 193, 0.22);
  border-radius: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .tag-list li:hover {
    background: rgba(110, 196, 193, 0.28);
    border-color: rgba(110, 196, 193, 0.45);
    transform: translateY(-1px);
  }
}

.section--note {
  margin-top: 2rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
  background: none;
  border-radius: 0;
}

.section--note h2 {
  margin: 0 0 0.5rem;
}

.section--note p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: min(var(--measure), 100%);
}

.inline-code {
  padding: 0.05rem 0.3rem;
  font-size: 0.8em;
  font-family: ui-monospace, monospace;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--fg);
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 2.75rem) 2.5rem;
  border-top: 1px solid var(--line);
  box-shadow: 0 -1px 0 rgba(110, 196, 193, 0.06);
}

.site-footer p {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  #main {
    animation: none;
  }

  .hero__portrait {
    transform: none;
    transition: none;
  }

  .btn:hover,
  .card:hover,
  .cert-card:hover,
  .tag-list li:hover {
    transform: none;
  }
}
