/* ============================================================
   Digital Twin — consolidated stylesheet
   Single "Dark Premium" theme. This file replaces the layered
   history (base v3 → additions → mobile-fix → founder-style →
   realistic-redesign → dark-premium) with one clean pass: every
   selector appears once, holding its final effective value.

   Palette ratio target: ~80% dark neutral, ~15% blue accent,
   ~5% purple, cyan reserved for rare tiny highlights.
   ============================================================ */

:root {
  --bg: #09090b;
  --panel: #18181b;
  --panel-alt: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --ink: #fafafa;
  --text-dim: #a1a1aa;

  --accent: #3b82f6;         /* blue — dominant accent, ~15% */
  --accent-dark: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-purple: #8b5cf6;  /* used sparingly, ~5% */
  --accent-cyan: #06b6d4;    /* rare tiny highlights only */
  --glow: rgba(59, 130, 246, 0.25);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);

  --radius: 10px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden; /* belt-and-suspenders against residual horizontal scroll */
}

::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

/* ---------- Scroll progress bar ---------- */

#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }

.brand-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
}

.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); }

.nav-links {
  display: none;
  gap: 1.6rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.nav-links a { text-decoration: none; position: relative; padding-bottom: 2px; }
.nav-links a:hover { color: var(--ink); }

.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:not(.nav-cta):hover::after { width: 100%; }

.nav-cta {
  background: var(--accent) !important;
  color: white !important;
  padding: 0.45rem 1rem;
  border-radius: 10px !important;
  font-weight: 500;
}
.nav-cta:hover { background: var(--accent-dark) !important; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (min-width: 760px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}

@media (max-width: 759px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1.5rem 1.25rem;
    gap: 0.9rem;
  }
  .nav-links.open { display: flex; }
  .nav-cta { align-self: flex-start; }
}

/* ---------- Scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

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

.hero { position: relative; overflow: hidden; padding: 3.5rem 1.5rem 4rem; }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  min-width: 0;
}

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
}

.hero-text { min-width: 0; }

/* ---- Gradient mesh + floating glow orbs ---- */

.hero-mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.16), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.10), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.08), transparent 45%);
  animation: meshDrift 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes meshDrift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(3%, -3%) scale(1.05); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.orb-1 { width: 260px; height: 260px; background: var(--accent); top: -60px; right: 15%; animation: orbFloat 9s ease-in-out infinite; }
.orb-2 { width: 180px; height: 180px; background: var(--accent-purple); bottom: -40px; left: 8%; animation: orbFloat 11s ease-in-out infinite reverse; opacity: 0.35; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -25px); }
}

/* Mouse-follow spotlight (dark-premium.js sets --mx/--my) */
.hero-spotlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(59, 130, 246, 0.08), transparent 70%);
}

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

.hero-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 3px solid var(--border);
  position: relative;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-avatar-fallback {
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

.tag-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.14;
  margin: 0 0 1.1rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero h1 .type-cursor {
  display: inline-block;
  width: 3px;
  background: var(--accent);
  margin-left: 4px;
  animation: cursorBlink 0.9s step-end infinite;
}
@keyframes cursorBlink { 50% { opacity: 0; } }

.hero-sub { color: var(--text-dim); font-size: 1.05rem; max-width: 440px; margin: 0 0 1.1rem; overflow-wrap: break-word; word-break: break-word; }
.hero-meta { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1.6rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; min-width: 0; }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.3rem;
  border-radius: 10px !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.25s ease;
}
.btn-primary svg, .btn-secondary svg { flex-shrink: 0; }

.btn-primary { background: var(--accent); color: white; box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 0 24px var(--glow); }

.btn-secondary { background: var(--panel-alt); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 0 18px var(--glow); }

/* ---------- Hero art / floating skill chips ---------- */

.hero-art { position: relative; height: 280px; display: none; }
@media (min-width: 860px) { .hero-art { display: block; } }

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.chip { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; animation: chipFloat 4s ease-in-out infinite; }
.chip-2 { animation-delay: 0.6s; }
.chip-3 { animation-delay: 1.2s; }
.chip-4 { animation-delay: 1.8s; }
.chip-1 { top: 0; left: 10%; }
.chip-2 { top: 12%; left: 45%; }
.chip-3 { top: 55%; left: 5%; }
.chip-4 { top: 60%; left: 62%; }

.chip-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.chip:hover .chip-icon {
  box-shadow: 0 0 24px var(--glow);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.chip span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Quick stats bar ---------- */

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 480px) {
  .quick-stats { gap: 1.5rem; padding: 1.25rem 1rem; }
  .stat-num { font-size: 1.3rem; }
}

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

main { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 5rem; overflow: hidden; /* contains the alt-section negative margins below */ }
.section { padding: 3.25rem 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: none; }

/* Alternate section backgrounds for visual rhythm instead of one flat page */
.section:nth-of-type(even) {
  background: var(--panel-alt);
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 1.4rem;
  text-transform: uppercase;
}

.about-text { font-size: 1.05rem; max-width: 680px; }

/* ---------- Skill / general cards ---------- */

.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .grid-tight { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

.card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { border-color: var(--accent); box-shadow: 0 0 28px var(--glow); }
.card .label { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 0.6rem; }
.card h3 { font-family: var(--font-display); font-size: 1.08rem; margin: 0 0 0.7rem; font-weight: 700; }
.card p { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--text-dim); }
.card p:last-child { margin-bottom: 0; }
.card p strong { color: var(--ink); font-weight: 600; }

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

.skill-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.skill-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 28px var(--glow);
  transform: translateY(-3px);
}
.skill-card:hover::before { opacity: 1; }

.skill-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.skill-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
}

.skill-card-head .label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.skill-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Experience ---------- */

.exp-item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }
.exp-item h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 0.3rem; font-weight: 700; }
.exp-item .period { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); display: block; margin-bottom: 0.6rem; }
.exp-item p { color: var(--text-dim); font-size: 0.92rem; margin: 0; }

/* ---------- Project cards ---------- */

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.project-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  animation: cardIn 0.5s ease both;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 0 28px var(--glow); }

.project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }

.project-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.project-links { display: flex; gap: 0.6rem; }
.project-links a {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.project-links a:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.08); }

.project-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; margin: 0 0 0.5rem; color: var(--ink); }
.project-tagline { font-size: 0.9rem; color: var(--text-dim); margin: 0 0 1rem; line-height: 1.5; }
.stack-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.pill { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0.22rem 0.6rem; }

.project-details summary {
  cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--accent);
  list-style: none; display: flex; align-items: center; gap: 0.3rem;
}
.project-details summary::-webkit-details-marker { display: none; }
.project-details summary::before { content: "→"; transition: transform 0.2s ease; }
.project-details[open] summary::before { transform: rotate(90deg); }
.details-body { padding-top: 0.8rem; animation: cardIn 0.25s ease both; }
.details-body p { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 0.6rem; }
.details-body p:last-child { margin-bottom: 0; }
.details-body p strong { color: var(--ink); font-weight: 600; }

/* ---------- Featured project ---------- */

.featured-section { border-top: 1px solid var(--border); }

#featured-project {
  background: var(--panel-alt);
  color: white;
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

#featured-project::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 70%);
  pointer-events: none;
}

.featured-inner { position: relative; display: grid; gap: 1.5rem; }

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #a9b7f5;
  text-transform: uppercase;
}

.featured-inner h3 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0.6rem 0 0.9rem; font-weight: 700; }
.featured-inner p.tagline { color: #c7cede; font-size: 1rem; max-width: 620px; margin: 0 0 1.4rem; }
.featured-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.featured-stat { font-family: var(--font-mono); }
.featured-stat .n { font-size: 1.3rem; font-weight: 700; color: white; display: block; }
.featured-stat .l { font-size: 0.72rem; color: #9aa4c4; }

.featured-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.featured-actions a {
  padding: 0.7rem 1.3rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600; text-decoration: none;
}
.featured-actions a.primary { background: white; color: var(--bg); }
.featured-actions a.primary:hover { background: var(--accent-soft); }
.featured-actions a.secondary { border: 1px solid rgba(255, 255, 255, 0.3); color: white; }
.featured-actions a.secondary:hover { border-color: white; }

/* ---------- FAQs ---------- */

.faq-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color 0.15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--accent); }

.faq-item p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0.8rem 0 0;
  line-height: 1.6;
  animation: cardIn 0.25s ease both;
}

/* ---------- Contact (founder-style) ---------- */

.contact-founder {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 0 1rem;
  min-width: 0;
}

.contact-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.75rem;
  border: 3px solid var(--border);
  position: relative;
}
.contact-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-avatar-fallback {
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.contact-founder h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.25;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

.contact-lede {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.contact-email:hover { color: var(--accent-dark); border-color: var(--accent-dark); }

.contact-social {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}
.contact-social a { color: var(--text-dim); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.contact-social a:hover { color: var(--ink); }
.contact-social a svg { flex-shrink: 0; }

.contact-form-minimal {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  min-width: 0;
}
.form-row { display: flex; gap: 0.75rem; min-width: 0; }
.form-row input { flex: 1; min-width: 0; }

.contact-form-minimal input,
.contact-form-minimal textarea {
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-alt);
  color: var(--ink);
  resize: vertical;
  width: 100%;
}
.contact-form-minimal input:focus,
.contact-form-minimal textarea:focus { border-color: var(--accent); outline: none; }

.contact-form-minimal button {
  align-self: center;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px !important;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.25s ease;
}
.contact-form-minimal button:hover { background: var(--accent-dark); box-shadow: 0 0 24px var(--glow); }

.contact-status { font-size: 0.85rem; margin: 0; min-height: 1.2em; }
.contact-status.ok { color: var(--success); }
.contact-status.err { color: #f87171; }

@media (max-width: 480px) {
  .form-row { flex-direction: column; }
  .contact-founder { padding: 1.5rem 0.5rem 0.5rem; }
  .hero-avatar { width: 90px; height: 90px; }
  .contact-avatar { width: 110px; height: 110px; }
}

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

.footer { text-align: center; padding: 2.5rem 1.5rem; color: var(--text-dim); font-size: 0.82rem; border-top: 1px solid var(--border); }

/* ============================================================
   Chat widget
   ============================================================ */

#twin-widget { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 999; font-family: var(--font-body); display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
#twin-tooltip { background: var(--panel-alt); color: var(--ink); font-size: 0.78rem; padding: 0.55rem 0.85rem; border-radius: 10px; max-width: 200px; text-align: right; box-shadow: var(--shadow-md); border: 1px solid var(--border); }

#twin-toggle {
  background: var(--accent); color: white; border: none; padding: 0.8rem 1.2rem; border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; gap: 0.55rem; box-shadow: var(--shadow-md), 0 0 0 rgba(59, 130, 246, 0); font-size: 0.88rem; font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.25s ease;
}
#twin-toggle:hover { background: var(--accent-dark); box-shadow: var(--shadow-md), 0 0 24px var(--glow); }
#twin-toggle .dot { width: 7px; height: 7px; background: #6ee7b7; border-radius: 50%; display: inline-block; }

#twin-toggle.idle-pulse { animation: idlePulse 2.6s ease-in-out infinite; }
@keyframes idlePulse {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: var(--shadow-md), 0 0 20px var(--glow); }
}

#twin-panel {
  position: absolute; bottom: 3.9rem; right: 0; width: min(360px, calc(100vw - 2rem)); max-height: min(520px, calc(100vh - 8rem));
  background: var(--panel-alt); border: 1px solid var(--border); color: var(--ink); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
#twin-panel.hidden { display: none; }

.twin-header { background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.85rem 1rem; font-size: 0.75rem; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.twin-header button { background: none; border: none; color: var(--text-dim); font-size: 1.2rem; cursor: pointer; line-height: 1; flex-shrink: 0; }
.twin-header button:hover { color: var(--ink); }

#twin-suggestions { padding: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; border-bottom: 1px solid var(--border); }
.suggestion { background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; border-radius: 999px; padding: 0.4rem 0.75rem; font-size: 0.74rem; cursor: pointer; font-weight: 500; }
.suggestion:hover { border-color: var(--accent); }

#twin-messages { flex: 1; overflow-y: auto; padding: 1rem; font-size: 0.88rem; display: flex; flex-direction: column; gap: 0.75rem; min-height: 120px; }
.msg { max-width: 88%; }
.msg.user { align-self: flex-end; background: var(--accent); color: white; padding: 0.55rem 0.8rem; border-radius: 10px 10px 2px 10px; font-weight: 500; }
.msg.bot { align-self: flex-start; background: var(--bg); border: 1px solid var(--border); padding: 0.55rem 0.8rem; border-radius: 10px 10px 10px 2px; }
.msg .source-tag { display: block; margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.66rem; color: var(--accent); opacity: 0.9; }

.hiring-banner { align-self: center; background: var(--success-soft); border: 1px solid rgba(52, 211, 153, 0.35); color: var(--success); font-size: 0.74rem; padding: 0.45rem 0.65rem; border-radius: 8px; text-align: center; }

#twin-form { display: flex; border-top: 1px solid var(--border); }
#twin-input { flex: 1; background: none; border: none; color: var(--ink); padding: 0.85rem; font-size: 0.85rem; font-family: var(--font-body); min-width: 0; }
#twin-input::placeholder { color: var(--text-dim); }
#twin-input:focus { outline: none; }
#twin-form button { background: var(--accent); color: white; border: none; width: 3rem; cursor: pointer; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
#twin-form button:hover { background: var(--accent-dark); }

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1.25rem 2.5rem; }
  main { padding: 0 1.25rem 3.5rem; }
  .nav-inner { padding: 0.75rem 1.25rem; }
  #featured-project { padding: 1.75rem 1.25rem; border-radius: 16px; }
  .featured-stats { gap: 1rem; }
  #twin-widget { bottom: 1rem; right: 1rem; left: 1rem; align-items: stretch; }
  #twin-tooltip { align-self: flex-end; max-width: 60%; }
  #twin-panel { width: 100%; right: 0; left: 0; }
  #twin-toggle { width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .stat-num, #scroll-progress,
  .hero-mesh, .orb, #twin-toggle.idle-pulse, .hero h1 .type-cursor,
  .chip, .chip-2, .chip-3, .chip-4 {
    animation: none !important;
    transition: none !important;
  }
}