:root {
  --bg: #050b12;
  --bg-soft: #07131f;
  --panel: rgba(7, 19, 31, 0.78);
  --panel-strong: rgba(8, 17, 29, 0.94);
  --border: rgba(126, 240, 219, 0.18);
  --border-strong: rgba(126, 240, 219, 0.36);
  --text: #e8fbff;
  --muted: #9bb5bf;
  --accent: #00e5c3;
  --accent-2: #6c8cff;
  --accent-3: #bf6dff;
  --danger: #ff6b8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(0, 229, 195, 0.18), transparent 32rem),
    radial-gradient(circle at 80% 0%, rgba(108, 140, 255, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(5, 11, 18, 0.88), rgba(5, 11, 18, 0.96)),
    image-set(url('/assets/img/bg.webp') type('image/webp'), url('/assets/img/bg.jpg') type('image/jpeg')) center / cover fixed no-repeat;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 75%);
  z-index: -1;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #00110f;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }
.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;
}

.site-shell {
  width: min(100% - 32px, var(--max));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 16px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 11, 18, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.26);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #00110f;
  font-family: "Ubuntu Mono", monospace;
  font-weight: 700;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 32px rgba(0, 229, 195, 0.28);
}
.brand strong,
.brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 0.98rem; }
.brand small { color: var(--muted); font-size: 0.75rem; margin-top: 0.2rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a {
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  transition: 180ms ease;
}
.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
  background: rgba(126, 240, 219, 0.11);
}
.nav-toggle { display: none; }

.site-main {
  flex: 1;
  padding: 74px 0 60px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 2rem;
  min-height: calc(100vh - 190px);
}
.hero-copy h1,
.page-hero h1,
.split-section h2 {
  margin: 0;
  letter-spacing: -0.055em;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.92;
}
.hero-copy h1 span,
.page-hero h1 span,
.split-section h2 span {
  color: transparent;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-copy p,
.page-hero p {
  max-width: 720px;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
}
.terminal-label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: "Ubuntu Mono", monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.terminal-label span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.9rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #00110f;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 50px rgba(0, 229, 195, 0.22);
}
.btn-ghost { background: rgba(255,255,255,0.035); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.07); }

.badge-row,
.mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.6rem;
  align-items: center;
}
.badge-row img,
.mini-badges img { height: 28px; width: auto; border-radius: 7px; }

.hero-card,
.glass-panel,
.legal-panel,
.project-card,
.skill-card,
.link-card,
.split-section,
.stats-strip {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hero-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform: rotate(1.4deg);
}
.window-bar {
  display: flex;
  gap: 0.45rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}
.window-bar span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}
.window-bar span:nth-child(2) { background: #ffd166; }
.window-bar span:nth-child(3) { background: var(--danger); }
pre {
  margin: 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  white-space: pre-wrap;
  color: #dffcff;
  font-family: "Ubuntu Mono", monospace;
  line-height: 1.7;
  font-size: clamp(0.94rem, 1.4vw, 1.08rem);
}
.muted { color: var(--accent); }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 0 74px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(126, 240, 219, 0.14);
}
.stats-strip div {
  padding: 1.4rem;
  background: rgba(5, 11, 18, 0.82);
}
.stats-strip strong {
  display: block;
  font-size: 1.6rem;
  color: var(--text);
}
.stats-strip span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
}

.content-section { margin-top: 74px; }
.content-section.compact-top { margin-top: 24px; }
.section-header {
  display: grid;
  gap: 0.5rem;
  max-width: 780px;
  margin-bottom: 1.4rem;
}
.section-header h2 {
  margin: 0;
  letter-spacing: -0.04em;
  font-size: clamp(2rem, 4vw, 3.4rem);
}
.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.project-grid,
.skill-grid,
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.project-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card,
.skill-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.project-card::before,
.link-card::before,
.glass-panel::before,
.legal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(0,229,195,0.11), transparent 36%, rgba(108,140,255,0.08));
  opacity: 0.8;
}
.project-card > *,
.link-card > *,
.glass-panel > *,
.legal-panel > * { position: relative; }
.project-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.project-accent,
.status-dot,
.link-tag,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--border);
  background: rgba(126, 240, 219, 0.08);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.36rem 0.62rem;
}
.project-accent { color: var(--accent); }
.status-dot { color: var(--muted); }
.project-card h3,
.project-card h2,
.skill-card strong,
.link-card strong {
  margin: 0;
  letter-spacing: -0.025em;
}
.project-card h3 { font-size: 1.35rem; }
.project-card h2 { font-size: 1.7rem; }
.project-card p {
  color: var(--muted);
  line-height: 1.65;
  min-height: 5.4rem;
}
.project-card-large p { min-height: auto; }
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}
.pill-row.large { margin-top: 1.4rem; }
.card-link {
  display: inline-flex;
  margin-top: 1.2rem;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}
.card-link:hover { text-decoration: underline; }

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  margin-top: 84px;
  border-radius: var(--radius-xl);
  padding: clamp(1.2rem, 4vw, 2rem);
}
.split-section h2 {
  font-size: clamp(2.1rem, 4.6vw, 4.6rem);
}
.service-list {
  display: grid;
  gap: 0.8rem;
}
.service-list div {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.035);
}
.service-list strong,
.service-list span { display: block; }
.service-list span { color: var(--muted); margin-top: 0.35rem; line-height: 1.55; }

.page-hero {
  max-width: 900px;
  padding: clamp(1rem, 5vw, 2rem) 0 1rem;
}
.page-hero h1 { font-size: clamp(3rem, 7vw, 6rem); }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.52fr);
  gap: 1rem;
  align-items: stretch;
  margin-top: 2rem;
}
.glass-panel,
.legal-panel {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(1.2rem, 4vw, 2rem);
}
.glass-panel h2,
.legal-panel h2 { margin-top: 0; }
.glass-panel p,
.legal-panel p {
  color: var(--muted);
  line-height: 1.8;
}
.legal-panel a { color: var(--accent); }
.image-stack {
  display: grid;
  gap: 1rem;
}
.image-stack picture {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.image-stack img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}
.skill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.skill-card {
  display: grid;
  gap: 0.5rem;
}
.skill-card span { color: var(--muted); line-height: 1.55; }

.links-section { margin-top: 46px; }
.link-hero { max-width: 760px; }
.links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.link-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  min-height: 104px;
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: rgba(7, 19, 31, 0.92);
}
.link-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(126, 240, 219, 0.11);
  font-size: 1.55rem;
}
.link-content { display: grid; gap: 0.25rem; }
.link-content small { color: var(--muted); line-height: 1.4; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 2rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.site-footer strong,
.site-footer span { display: block; }
.site-footer strong { color: var(--text); margin-bottom: 0.25rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 650ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .site-header { border-radius: 26px; align-items: flex-start; }
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    margin: 0.15rem 0.15rem 0 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
    color: var(--text);
  }
  .nav-toggle span:not(.sr-only) {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }
  .site-nav {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    top: calc(100% + 0.5rem);
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(5, 11, 18, 0.96);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; }
  .hero-grid,
  .about-layout,
  .split-section { grid-template-columns: 1fr; }
  .hero-grid { min-height: auto; }
  .hero-card { transform: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .project-grid,
  .project-grid-wide,
  .links-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-shell { width: min(100% - 20px, var(--max)); }
  .site-main { padding-top: 52px; }
  .brand small { display: none; }
  .brand strong { font-size: 0.9rem; }
  .hero-copy h1,
  .page-hero h1 { letter-spacing: -0.045em; }
  .stats-strip,
  .skill-grid { grid-template-columns: 1fr; }
  .link-card { grid-template-columns: auto 1fr; }
  .link-tag { grid-column: 2; }
  .site-footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
