/* Portfolio styles. No external requests; fonts are self-hosted. */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #050505;
  --bg-raised: #0a0a0a;
  --fg: #ededed;
  --muted: #a1a1a1;
  --dim: #8b8b8b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #52e3a0;
  --accent-soft: rgba(82, 227, 160, 0.14);
  --radius: 16px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 100%;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html { overflow-x: clip; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

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

p,
h1,
h2,
h3,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--fg);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  transform: translateY(-160%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

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

/* ---------- Cursor glow (desktop, fine pointers only) ---------- */

.cursor-glow {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor-glow {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(82, 227, 160, 0.07) 0%, rgba(82, 227, 160, 0.025) 35%, transparent 65%);
    pointer-events: none;
    opacity: 0;
    transform: translate3d(var(--x, -1000px), var(--y, -1000px), 0);
    transition: opacity 0.5s ease;
    will-change: transform;
  }

  .cursor-glow.is-on {
    opacity: 1;
  }
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(5, 5, 5, 0.72);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  flex: none;
  transition: transform 0.3s var(--ease);
}

.brand {
  padding: 4px;
  margin-left: -4px;
  border-radius: 10px;
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vw, 12px);
}

.nav-links a {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--fg);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

/* ---------- Layout layers ---------- */

main,
.footer {
  position: relative;
  z-index: 1;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  padding-block: 72px 112px;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 20%, transparent 78%);
}

.hero-grid-lines {
  position: absolute;
  inset: -64px 0 0 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  animation: grid-drift 14s linear infinite;
}

@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, 64px, 0); }
}

.glow {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

.glow-a {
  top: -28%;
  left: 50%;
  width: min(900px, 130vw);
  aspect-ratio: 1;
  margin-left: calc(min(900px, 130vw) / -2);
  background: radial-gradient(circle, rgba(82, 227, 160, 0.16) 0%, rgba(82, 227, 160, 0.05) 38%, transparent 66%);
  animation: glow-a 16s ease-in-out infinite alternate;
}

.glow-b {
  bottom: -40%;
  right: -12%;
  width: min(700px, 110vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(237, 237, 237, 0.07) 0%, transparent 62%);
  animation: glow-b 20s ease-in-out infinite alternate;
}

@keyframes glow-a {
  0% { transform: translate3d(-6%, 0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate3d(6%, 6%, 0) scale(1.12); opacity: 1; }
}

@keyframes glow-b {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.6; }
  100% { transform: translate3d(-10%, -8%, 0) scale(1.1); opacity: 1; }
}

.hero-inner {
  position: relative;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.7);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.flag {
  width: 20px;
  height: 15px;
  flex: none;
}

.pill .flag {
  margin-left: 4px;
}

.hero-name {
  margin-top: 28px;
  font-size: clamp(2.85rem, 9.4vw, 6.75rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero-name-line {
  display: block;
}

.hero-name-line--dim {
  color: #7a7a7a;
}

.hero-role {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.6em;
  min-height: 1.6em;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--fg);
  white-space: nowrap;
}

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

.typed {
  display: inline-block;
}

.caret {
  display: inline-block;
  width: 0.58em;
  height: 1.15em;
  margin-left: -0.45em;
  background: var(--accent);
  animation: blink 1.1s steps(1, end) infinite;
}

.is-typing .caret {
  animation: none;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 550;
  transition: transform 0.25s var(--ease);
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--fg);
  color: #000;
}

.btn-lg {
  height: 52px;
  padding: 0 26px 0 28px;
  font-size: 1rem;
  gap: 10px;
}

.btn-lg svg {
  transition: transform 0.3s var(--ease);
}

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

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 10, 0.6);
  color: var(--fg);
}

.btn:focus-visible {
  border-radius: 999px;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 32px;
  display: block;
  padding: 8px;
  margin-left: -19px;
  border-radius: 999px;
}

.scroll-hint-track {
  position: relative;
  display: block;
  width: 22px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.scroll-hint-dot {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 7px;
  margin-left: -2px;
  border-radius: 4px;
  background: var(--muted);
  animation: scroll-dot 2.2s var(--ease) infinite;
}

@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 0; }
  25% { opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 11vw, 140px);
}

.section + .section {
  padding-top: 0;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-index {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.section-head h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line-strong), transparent);
}

/* ---------- About ---------- */

.about-text {
  max-width: 30ch;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  font-weight: 560;
  line-height: 1.22;
  letter-spacing: -0.03em;
}

/* ---------- Skills ---------- */

.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

.terminal {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0d0d0d, #080808);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #2a2a2a;
}

.terminal-title {
  flex: 1;
  margin-right: 46px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
}

.terminal-body {
  padding: 22px 22px 26px;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.75;
}

.t-line {
  color: var(--fg);
}

.t-line + .t-line,
.t-out + .t-line {
  margin-top: 10px;
}

.t-prompt {
  color: var(--accent);
  margin-right: 4px;
}

.t-out {
  color: var(--muted);
}

.t-out--list {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.4em;
  row-gap: 0;
}

.t-dim {
  color: var(--dim);
}

.t-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: -0.18em;
  background: var(--fg);
  animation: blink 1.1s steps(1, end) infinite;
}

.skills-label {
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tiles-more {
  grid-column: 1 / -1;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.3s var(--ease);
}

.tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(82, 227, 160, 0.35);
  border-radius: inherit;
  box-shadow: 0 10px 30px -12px rgba(82, 227, 160, 0.25), inset 0 0 24px rgba(82, 227, 160, 0.05);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.tile:hover {
  transform: translateY(-3px);
}

.tile:hover::after {
  opacity: 1;
}

.tile-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0c0c0c;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

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

.tile-name {
  font-weight: 550;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.tile--more {
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}

.tile--more .tile-name {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Certifications ---------- */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 16px;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  color: var(--fg);
  transition: transform 0.35s var(--ease);
}

.cert-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(82, 227, 160, 0.4);
  border-radius: inherit;
  box-shadow: 0 16px 40px -18px rgba(82, 227, 160, 0.3), inset 0 0 30px rgba(82, 227, 160, 0.04);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}

.cert-card:hover,
.cert-link:focus-visible {
  transform: translateY(-4px);
}

.cert-card:hover::after,
.cert-link:focus-visible::after {
  opacity: 1;
}

.cert-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
}

.cert-issuer {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

.cert-name {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.cert-year {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.cert-verify {
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--muted);
}

.cert-link:hover .cert-verify,
.cert-link:focus-visible .cert-verify {
  color: var(--accent);
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--dim);
  font-size: 0.95rem;
}

.empty-state-icon {
  flex: none;
  color: var(--dim);
}

.cert-grid:not(:empty) + .empty-state {
  margin-top: 16px;
}

/* ---------- Projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-feature {
  grid-column: 1 / -1;
}

/* A single secondary card spans the full width; two or more sit side by side. */
.project-secondary:nth-child(2):last-child {
  grid-column: 1 / -1;
}

.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(24px, 4.5vw, 52px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(82, 227, 160, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease);
}

.project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(70% 80% at 80% 20%, rgba(82, 227, 160, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.project::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(82, 227, 160, 0.4);
  border-radius: inherit;
  box-shadow: 0 0 60px -10px rgba(82, 227, 160, 0.18), inset 0 0 40px rgba(82, 227, 160, 0.04);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.project:hover {
  transform: translateY(-6px);
}

.project:hover::before,
.project:hover::after,
.project:focus-within::after {
  opacity: 1;
}

.project-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.tag--accent {
  border-color: rgba(82, 227, 160, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.project-title {
  margin-top: 24px;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.project-lede {
  max-width: 34ch;
  margin-top: 18px;
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.45;
  color: var(--fg);
}

.project-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 28px;
}

.part {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 5, 5, 0.6);
}

.part-name {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.part-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin-top: 32px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--fg);
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
}

.project-cta svg {
  transition: transform 0.3s var(--ease);
}

.project:hover .project-cta svg {
  transform: translate(2px, -2px);
}

/* Whole card is clickable via the one real link (keyboard: Tab to "View project"). */
.project-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 22px;
}

.project-cta:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}

.project-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.radar {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 1;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.radar-ring--2 {
  inset: 16%;
  border-color: var(--line);
}

.radar-ring--3 {
  inset: 32%;
  border-color: rgba(82, 227, 160, 0.18);
}

.radar-pulse {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(82, 227, 160, 0.45);
  border-radius: 50%;
  opacity: 0;
  animation: pulse 4s var(--ease) infinite;
}

@keyframes pulse {
  0% { transform: scale(0.35); opacity: 0; }
  20% { opacity: 0.9; }
  100% { transform: scale(1.05); opacity: 0; }
}

.radar-scan {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(82, 227, 160, 0.16), transparent 22%);
  -webkit-mask-image: radial-gradient(circle, #000 0 69%, transparent 70%);
  mask-image: radial-gradient(circle, #000 0 69%, transparent 70%);
  animation: spin 7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.shield {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 34%;
  height: auto;
  transform: translate(-50%, -50%);
}

.shield-outline {
  fill: rgba(5, 5, 5, 0.85);
  stroke: var(--fg);
  stroke-width: 3;
  stroke-linejoin: round;
}

.shield-half {
  fill: rgba(82, 227, 160, 0.14);
}

.shield-check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Secondary project card (ModSentinel and later projects) */

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  height: 100%;
  padding: clamp(24px, 3.6vw, 40px);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.4s var(--ease);
}

/* Two or more secondary cards: stack each card's content, button last. */
.project-secondary:not(:nth-child(2):last-child) .project-card {
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0;
}

.project-secondary:not(:nth-child(2):last-child) .project-card-main {
  display: contents;
}

.project-secondary:not(:nth-child(2):last-child) .feature-list {
  order: 1;
  align-content: start;
}

.project-secondary:not(:nth-child(2):last-child) .project-card-cta {
  order: 2;
  justify-self: start;
  margin-top: 24px;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 90% at 0% 0%, rgba(82, 227, 160, 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(82, 227, 160, 0.4);
  border-radius: inherit;
  box-shadow: 0 0 50px -12px rgba(82, 227, 160, 0.16), inset 0 0 36px rgba(82, 227, 160, 0.035);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card:hover::before,
.project-card:hover::after,
.project-card:focus-within::after {
  opacity: 1;
}

.project-card-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.project-card-title {
  margin-top: 22px;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  font-weight: 680;
  line-height: 1;
  letter-spacing: -0.04em;
}

.project-card-lede {
  max-width: 44ch;
  margin-top: 14px;
  margin-bottom: 28px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--muted);
}

.project-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin-top: auto;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.6);
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
}


.project-card-cta svg {
  transition: transform 0.3s var(--ease);
}

.project-card:hover .project-card-cta svg {
  transform: translate(2px, -2px);
}

.project-card-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 20px;
}

.project-card-cta:focus-visible {
  outline-offset: 4px;
  border-radius: 999px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: center;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 5, 5, 0.6);
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--fg);
}

.feature-index {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.tag--live {
  gap: 8px;
  border-color: rgba(82, 227, 160, 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: live-ping 2s var(--ease) infinite;
}

@keyframes live-ping {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(2.6); opacity: 0; }
}

.ms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #0a0a0a;
}

.ms-icon svg {
  width: 40px;
  height: 40px;
  overflow: visible;
}

.ms-ring {
  fill: none;
  stroke: rgba(82, 227, 160, 0.5);
  stroke-width: 1.2;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ms-ring 3.6s var(--ease) infinite;
}

.ms-shield {
  fill: rgba(82, 227, 160, 0.08);
  stroke: var(--fg);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.ms-eye {
  fill: #050505;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.ms-pupil {
  fill: var(--accent);
  animation: ms-look 6s ease-in-out infinite;
}

@keyframes ms-ring {
  0% { transform: scale(0.6); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: scale(1.12); opacity: 0; }
}

@keyframes ms-look {
  0%, 18% { transform: translateX(0); }
  28%, 44% { transform: translateX(-2.2px); }
  54%, 70% { transform: translateX(2.2px); }
  80%, 100% { transform: translateX(0); }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  color: var(--dim);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-made {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ---------- 404 ---------- */

.hero--404 .hero-name {
  font-size: clamp(2.4rem, 7vw, 4.75rem);
}

.code-404 {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.terminal--inline {
  max-width: 560px;
  margin-top: 32px;
}

/* ---------- Scroll reveal (only when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 0.8s var(--ease) var(--d, 0ms),
    transform 0.8s var(--ease) var(--d, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .terminal-body .reveal {
  transform: translate3d(0, 8px, 0);
}

.js .terminal-body .reveal.is-in {
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .skills-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .skills-side {
    order: -1;
  }

  .project {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  /* Stacked: tags, title, text, features, then the button last. */
  .project-card-main {
    display: contents;
  }

  .feature-list {
    order: 1;
  }

  .project-card-cta {
    order: 2;
    justify-self: start;
    margin-top: 24px;
  }

  .project-visual {
    order: -1;
    min-height: 0;
    justify-content: flex-start;
  }

  .radar {
    width: 132px;
  }
}

@media (max-width: 560px) {
  .nav-inner {
    gap: 8px;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 8px 7px;
    font-size: 0.84rem;
  }

  .nav-links a::after {
    left: 7px;
    right: 7px;
  }

  .hero {
    padding-block: 40px 112px;
  }

  .project-parts,
  .feature-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .projects {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature {
    flex-direction: row;
    gap: 12px;
    padding: 14px 16px;
  }

  .feature-index {
    padding-top: 2px;
  }

  .terminal-body {
    padding: 18px 16px 22px;
    font-size: 0.84rem;
  }

  .tile {
    gap: 12px;
    padding: 0 12px;
  }

  .tile-name {
    font-size: 0.95rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 370px) {
  .nav-links a {
    padding: 8px 5px;
    font-size: 0.8rem;
  }

  .nav-links a::after {
    left: 5px;
    right: 5px;
  }
}

/* ---------- Reduced motion: no animation, everything visible ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .terminal-body .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-glow,
  .radar-pulse,
  .scroll-hint-dot,
  .live-dot::after,
  .ms-ring {
    display: none;
  }

  .glow {
    opacity: 0.9;
  }

  .tile:hover,
  .project:hover,
  .project-card:hover,
  .cert-card:hover,
  .cert-link:focus-visible,
  .btn:hover,
  .btn-lg:hover svg,
  .brand:hover .brand-mark {
    transform: none;
  }
}
