/* ======================================
   BIROD Portfolio — styles.css
   Toolkit: gstack (D:\gstack-main)
   Dark theme futuriste premium
   ====================================== */

/* ── CSS Custom Properties ── */
:root {
  --color-primary: #0066FF;
  --color-accent: #00FFFF;
  --color-bg-dark: #0A0E1A;
  --color-bg-card: #111827;
  --color-text: #F0F4FF;
  --color-text-muted: #8892A4;
  --color-gradient: linear-gradient(135deg, #0066FF, #00FFFF);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-glow-primary: rgba(0, 102, 255, 0.4);
  --color-glow-accent: rgba(0, 255, 255, 0.3);

  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

  --container: 1140px;
  --nav-height: 120px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg-dark);
  overflow-x: hidden;
}

/* Grain texture overlay (gstack convention) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

.font-mono { font-family: var(--font-mono); }

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.text-accent { color: var(--color-accent); }
.text-gradient {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 1px 0 var(--color-border);
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo-img {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(0, 102, 255, 0.3));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 48px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover { color: var(--color-text); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 8px 20px !important;
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: var(--radius-full);
  color: var(--color-accent) !important;
  transition: all 0.3s var(--ease-out) !important;
}

.nav-cta:hover {
  background: rgba(0, 255, 255, 0.08);
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.15);
}

.nav-cta::after { display: none !important; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 1100px;
  padding: 0 24px;
}

.hero-banner {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 32px;
  padding-top: 80px;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(0, 102, 255, 0.25)) drop-shadow(0 0 60px rgba(0, 255, 255, 0.1));
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin-bottom: 8px;
}

.hero-logo-wrapper {
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--color-text);
}

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

.hero-title-amp {
  display: block;
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.6em;
  margin: 8px 0;
}

.hero-subtitle {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 102, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 102, 255, 0.45);
}

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(0, 255, 255, 0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn:hover .btn-glow {
  transform: translateX(100%);
}

.btn-outline {
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(0, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* Hero badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: rgba(0, 255, 255, 0.04);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse-dot 2s infinite;
}

.badge-text {
  font-size: 12px;
  color: var(--color-text-muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* Hero scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  animation: scroll-hint 2s infinite;
}

@keyframes scroll-hint {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  30% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
}

/* ── Sections ── */
.section {
  padding: 120px 0;
  position: relative;
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
}

.section-title-sm {
  font-size: clamp(14px, 2vw, 21px);
}

/* ── About ── */
/* ══════ BLOC 1 — Accroche hybride ══════ */
.about-hybride {
  max-width: 820px;
  margin: 0 auto 80px;
  text-align: center;
}

.about-hybride-text {
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 2;
  color: var(--color-text);
  margin-bottom: 32px;
}

.about-hybride-text strong {
  background: linear-gradient(90deg, #0066FF, #00FFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.about-conventions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.convention-pill {
  display: inline-block;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: var(--radius-full);
  background: rgba(0, 255, 255, 0.04);
  transition: all 0.3s;
}

.convention-pill:hover {
  border-color: rgba(0, 255, 255, 0.5);
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.1);
}

.about-hybride-closing {
  font-size: 15px;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.7;
}

/* ══════ BLOC 2 — LEXPAY (two-column) ══════ */
.about-lexpay {
  max-width: 760px;
  margin: 0 auto 80px;
  display: flex;
  gap: 32px;
}

.lexpay-accent-line {
  width: 3px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #00FFFF, #0066FF, transparent);
  border-radius: 3px;
}

.lexpay-content {
  flex: 1;
}

.lexpay-content p {
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.9;
  margin-bottom: 20px;
}

/* LEXPAY badge */
.about-highlight-lexpay {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #0A0E1A;
  background: linear-gradient(135deg, #0066FF, #00FFFF);
  padding: 2px 12px;
  border-radius: var(--radius-full);
}

.lexpay-quote {
  position: relative;
  font-size: clamp(14px, 1.6vw, 16px);
  font-style: italic;
  font-weight: 600;
  line-height: 1.7;
  color: var(--color-accent);
  padding: 24px 0 24px 4px;
  margin: 0 0 16px;
  border: none;
  text-align: center;
}

.lexpay-quote-mark {
  position: absolute;
  top: -10px;
  left: -16px;
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, rgba(0, 255, 255, 0.06), transparent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  pointer-events: none;
  user-select: none;
}

.lexpay-proof {
  font-size: 15px !important;
  color: var(--color-text-muted) !important;
  opacity: 0.85;
}

/* ══════ BLOC 3 — Rupture narrative ══════ */
.about-rupture {
  max-width: 960px;
  margin: 0 auto 80px;
}

.rupture-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.rupture-line {
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.3));
}

.rupture-line:last-child {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.3), transparent);
}

.rupture-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.2);
  flex-shrink: 0;
}

.rupture-text {
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.9;
}

.rupture-dropcap {
  float: left;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 64px;
  line-height: 0.8;
  margin: 4px 12px 0 0;
  background: linear-gradient(180deg, #0066FF, #00FFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Anecdote italic accent */
.about-anecdote {
  font-style: italic;
  color: var(--color-accent);
}

/* ══════ BLOC 4 — Formation continue (typewriter) ══════ */
.about-formation-block {
  max-width: 600px;
  margin: 0 auto 80px;
  text-align: center;
}

.formation-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-cyan {
  background: #00FFFF;
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.dot-mid {
  background: #0099FF;
  box-shadow: 0 0 8px rgba(0, 153, 255, 0.4);
}

.dot-blue {
  background: #0066FF;
  box-shadow: 0 0 8px rgba(0, 102, 255, 0.5);
}

.formation-typewriter {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.9;
  border-right: 2px solid var(--color-accent);
  display: inline-block;
  text-align: left;
  overflow: hidden;
  white-space: normal;
}

.formation-typewriter.typing {
  animation: blink-caret 0.6s step-end infinite;
}

.formation-typewriter.done {
  border-right-color: transparent;
}

@keyframes blink-caret {
  0%, 100% { border-right-color: var(--color-accent); }
  50% { border-right-color: transparent; }
}

/* about-block fallback for remaining blocks */
.about-block {
  max-width: 800px;
  margin: 0 auto 56px;
}

.about-block p {
  color: var(--color-text-muted);
  line-height: 1.9;
  margin-bottom: 20px;
  font-size: 16px;
}

.about-block strong {
  color: var(--color-text);
}

/* Tools grid */
.about-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.about-tool {
  padding: 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.3s;
}

.about-tool:hover {
  border-color: rgba(0, 255, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.12), 0 0 60px rgba(0, 102, 255, 0.06);
  transform: translateY(-2px);
}

.tool-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #0066FF, #00FFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tool-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* Signature */
.about-signature {
  text-align: center;
  font-size: 22px !important;
  font-weight: 600;
  color: var(--color-text) !important;
  margin-top: 40px;
  line-height: 1.6 !important;
}

.about-signature em {
  font-style: normal;
  color: var(--color-accent);
}

.about-signature-closing {
  text-align: center;
  font-size: 17px !important;
  color: var(--color-text-muted) !important;
  margin-top: 8px;
  line-height: 1.8 !important;
}

.about-signature-glow {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #0066FF, #00FFFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.4));
}

/* Staggered fade-in animations */
.about-block-1 { transition-delay: 0s; }
.about-block-2 { transition-delay: 0.15s; }
.about-block-3 { transition-delay: 0.3s; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
}

.about-lead {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 16px;
  color: var(--color-text);
}

.about-badge-row {
  margin-top: 32px;
}

.about-formation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.formation-icon { font-size: 24px; }

.formation-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}

.formation-status {
  font-size: 12px;
  color: var(--color-accent);
}

/* Domain pills */
.domain-group {
  margin-bottom: 24px;
}

.domain-title {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.domain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-block;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 102, 255, 0.08);
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: var(--radius-full);
  color: var(--color-primary);
  transition: all 0.2s;
}

.pill:hover {
  background: rgba(0, 102, 255, 0.15);
  border-color: var(--color-primary);
}

.pill-accent {
  background: rgba(0, 255, 255, 0.06);
  border-color: rgba(0, 255, 255, 0.2);
  color: var(--color-accent);
}

.pill-accent:hover {
  background: rgba(0, 255, 255, 0.12);
  border-color: var(--color-accent);
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s var(--ease-out);
  overflow: hidden;
}

/* Gradient border glow on hover */
.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--color-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}

.project-card:hover::before { opacity: 1; }

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 102, 255, 0.12), 0 0 32px rgba(0, 255, 255, 0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-icon {
  width: 40px;
  height: 40px;
  color: var(--color-accent);
}

.card-tag {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--color-text);
}

.card-desc {
  font-size: 14px;
  color: var(--color-accent);
  margin-bottom: 12px;
  font-weight: 500;
}

.card-body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.card-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.stack-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.card-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-live { background: #22C55E; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.status-deployed { background: var(--color-primary); box-shadow: 0 0 8px var(--color-glow-primary); }
.status-wip { background: #F59E0B; box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }

.card-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-accent);
  padding: 6px 14px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.card-btn:hover {
  background: rgba(0, 255, 255, 0.08);
  border-color: var(--color-accent);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.4s var(--ease-out);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
}

.modal-content h3 {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 8px;
}

.modal-content .modal-subtitle {
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 20px;
}

.modal-content p {
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.modal-content .modal-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 24px;
}

.modal-content .modal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.modal-content .modal-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 13px;
}

/* ── Skills Section ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.skill-group {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.skill-group-title {
  font-size: 13px;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--color-text);
}

.skill-bar-label .font-mono {
  color: var(--color-text-muted);
  font-size: 12px;
}

.skill-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  width: 0;
  background: var(--color-gradient);
  border-radius: var(--radius-sm);
  transition: width 1s var(--ease-out);
  box-shadow: 0 0 12px var(--color-glow-accent);
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: start;
}

.contact-lead {
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.contact-item strong { color: var(--color-text); }

.contact-icon {
  color: var(--color-accent);
  font-size: 14px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}

.form-input::placeholder { color: rgba(255, 255, 255, 0.2); }

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238892A4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select option {
  background: var(--color-bg-card);
  color: var(--color-text);
}

.form-textarea { resize: vertical; min-height: 120px; }

.btn-submit {
  width: 100%;
  padding: 16px;
}

.btn-submit .btn-success {
  display: none;
}

.btn-submit.sent .btn-text { display: none; }
.btn-submit.sent .btn-success {
  display: inline;
  color: #22C55E;
}
.btn-submit.sent {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.15);
}

/* ── Footer ── */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--color-border);
}

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

.footer-logo-img {
  height: 48px;
  width: auto;
  opacity: 0.6;
  filter: drop-shadow(0 0 8px rgba(0, 102, 255, 0.3));
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 12px;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.footer-link:hover { color: var(--color-text); }

/* ── Animations ── */
.anim-fade {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.anim-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */

/* Tablet */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { gap: 40px; }
  .contact-grid { gap: 40px; }
}

/* Mobile */
@media (max-width: 768px) {
  :root { --nav-height: 64px; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    padding: 32px 24px;
    gap: 24px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-out);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .section { padding: 80px 0; }
  .section-header { margin-bottom: 40px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-tools-grid { grid-template-columns: 1fr; }

  /* LEXPAY bloc — single column on mobile */
  .about-lexpay {
    flex-direction: column;
    gap: 0;
  }
  .lexpay-accent-line {
    width: 100%;
    height: 3px;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #00FFFF, #0066FF, transparent);
  }
  .lexpay-quote { font-size: 18px; }
  .lexpay-quote-mark { font-size: 80px; top: -8px; left: -8px; }

  /* Dropcap smaller on mobile */
  .rupture-dropcap { font-size: 48px; }

  /* Convention pills wrap */
  .convention-pill { margin-left: 0 !important; }
  .about-signature { font-size: 18px !important; }
  .about-signature-glow { font-size: 22px; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .hero-row {
    flex-direction: column;
    gap: 24px;
  }
  .hero-title { font-size: clamp(28px, 8vw, 48px); }
  .hero-subtitle { font-size: 16px; }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .btn { width: 100%; max-width: 280px; }

  .modal { padding: 28px; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Small mobile */
@media (max-width: 375px) {
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
}

/* ── Print ── */
@media print {
  .navbar, .hero-canvas, .hero-scroll-hint, .nav-toggle,
  .hero-ctas, .contact-form, .footer-links, .btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .section { padding: 20px 0 !important; }
  .hero { min-height: auto !important; padding: 40px 0 !important; }
  .hero-banner-img, .footer-logo-img { filter: none !important; }
  a { color: #0066FF !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .anim-fade {
    opacity: 1;
    transform: none;
  }
}
