/* =======================================================
 * LMXAI — AI Engineering & Consultancy
 * Custom theme (replaces Ninestars template styling)
 * ======================================================= */

:root {
  --bg: #08090c;
  --bg-soft: #0d0f14;
  --surface: rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e7eaee;
  --text-dim: #9aa3ad;
  --text-faint: #6b727c;
  --accent: #34d399;
  --accent-2: #22d3ee;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --radius: 16px;
  --maxw: 1180px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 80% -5%, rgba(52, 211, 153, 0.10), transparent 60%),
    radial-gradient(700px 500px at 0% 10%, rgba(34, 211, 238, 0.07), transparent 55%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
}

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

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

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; }
.brand img { width: 30px; height: 30px; }
.brand .brand-name { font-size: 1.15rem; letter-spacing: -.01em; }
.brand .brand-name b { color: var(--accent); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: var(--text-dim); font-size: .92rem; font-weight: 500; transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav .btn-nav {
  color: var(--bg);
  background: var(--accent);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
}
.nav .btn-nav:hover { color: var(--bg); background: #43e0a6; box-shadow: 0 0 24px rgba(52,211,153,.35); }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.6rem; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: #43e0a6; box-shadow: 0 0 30px rgba(52,211,153,.35); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Section primitives ---------- */
section { padding: 110px 0; position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: "//"; opacity: .6; }
.section-head { max-width: 720px; margin-bottom: 54px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 16px 0 14px;
  font-weight: 600;
}
.section-head p { color: var(--text-dim); font-size: 1.05rem; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: 150px 0 100px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  margin: 20px 0 22px;
  font-weight: 600;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead { font-size: 1.12rem; color: var(--text-dim); max-width: 560px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 26px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta .item { }
.hero-meta .k { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--text); }
.hero-meta .v { font-size: .82rem; color: var(--text-faint); }

/* Hero code card */
.code-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  position: relative;
}
.code-card .bar {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.code-card .bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #34373e; }
.code-card .bar .dot:nth-child(1) { background: #ff5f57; opacity: .85; }
.code-card .bar .dot:nth-child(2) { background: #febc2e; opacity: .85; }
.code-card .bar .dot:nth-child(3) { background: #28c840; opacity: .85; }
.code-card .bar .file { margin-left: 10px; font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); }
.code-card pre {
  margin: 0;
  padding: 22px;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.75;
  color: var(--text-dim);
  overflow-x: auto;
}
.code-card .c { color: var(--text-faint); }
.code-card .kw { color: #c792ea; }
.code-card .fn { color: var(--accent-2); }
.code-card .str { color: var(--accent); }
.code-card .num { color: #f78c6c; }


.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.chip {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 12px;
  border-radius: 999px;
}
.chip.accent { color: var(--accent); border-color: rgba(52,211,153,.3); }

/* ---------- About / positioning ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-grid .lead-text { font-size: 1.35rem; font-family: var(--font-display); line-height: 1.4; letter-spacing: -.01em; }
.about-grid .lead-text b { color: var(--accent); font-weight: 600; }
.about-list { display: grid; gap: 14px; }
.about-list .row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.about-list .row i { color: var(--accent); font-size: 1.2rem; margin-top: 2px; }
.about-list .row span { color: var(--text-dim); font-size: .95rem; }
.about-list .row b { color: var(--text); }

/* ---------- Cards grid (capabilities) ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
  transition: border-color .25s, transform .25s, background .25s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-2); }
.card .ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.35rem;
  margin-bottom: 18px;
}
.card h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 0 0 10px; font-weight: 600; letter-spacing: -.01em; }
.card p { color: var(--text-dim); font-size: .94rem; margin: 0 0 16px; }
.card .tags { display: flex; flex-wrap: wrap; gap: 7px; }
.card .tags span {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 6px;
}

/* ---------- Work / projects ---------- */
.work-list { display: grid; gap: 18px; }
.project {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .25s, background .25s;
}
.project:hover { border-color: var(--border-strong); background: var(--surface-2); }
.project .meta-col { }
.project .tag-kind {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
}
.project h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 6px 0 0; font-weight: 600; letter-spacing: -.01em; }
.project .client { font-size: .85rem; color: var(--text-faint); margin-top: 4px; }
.project .desc { color: var(--text-dim); font-size: .96rem; margin: 0; }
.project .stack { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.project .stack span { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.project .result {
  text-align: right;
  font-family: var(--font-display);
  min-width: 120px;
}
.project .result .big { font-size: 1.5rem; font-weight: 600; color: var(--accent); display: block; }
.project .result .small { font-size: .78rem; color: var(--text-faint); }

.video-wrap {
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Industries ---------- */
.industries-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.industry {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  transition: border-color .25s, transform .25s;
}
.industry:hover { border-color: rgba(52,211,153,.35); transform: translateY(-2px); }
.industry i { font-size: 1.6rem; color: var(--accent); }
.industry h4 { font-family: var(--font-display); font-size: 1.02rem; margin: 14px 0 6px; font-weight: 600; }
.industry p { font-size: .86rem; color: var(--text-dim); margin: 0; }

/* ---------- Tech stack ---------- */
.stack-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-strip span {
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 15px;
  border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.stack-strip span:hover { color: var(--accent); border-color: rgba(52,211,153,.3); }

/* ---------- Personal about ---------- */
.bio-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; }
.bio p { color: var(--text-dim); font-size: 1.02rem; }
.bio p b { color: var(--text); }
.facts { display: grid; gap: 14px; align-content: start; }
.fact {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.fact .label { font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.fact .val { color: var(--text); font-size: .92rem; text-align: right; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; }
.contact-info .row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.contact-info .row i {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
}
.contact-info .row h4 { margin: 0 0 3px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 600; }
.contact-info .row p { margin: 0; color: var(--text); }
.contact-info .socials { display: flex; gap: 12px; margin-top: 8px; }
.contact-info .socials a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text-dim);
  font-size: 1.15rem;
  transition: all .2s;
}
.contact-info .socials a:hover { color: var(--accent); border-color: rgba(52,211,153,.4); }

.contact-form {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px;
}
.contact-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.contact-form input, .contact-form textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: .95rem;
  margin-bottom: 18px;
  transition: border-color .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form button { width: 100%; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner .brand { font-size: 1rem; }
.footer-inner p { margin: 0; color: var(--text-faint); font-size: .88rem; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-dim); font-size: .88rem; }
.footer-links a:hover { color: var(--accent); }

/* Project card as link */
a.project { color: inherit; position: relative; }
.project .go {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .76rem; color: var(--accent);
  margin-top: 14px; opacity: .85; transition: gap .2s, opacity .2s;
}
a.project:hover .go { gap: 11px; opacity: 1; }

/* =======================================================
 * Detail / case-study pages
 * ======================================================= */
.detail-hero { padding: 130px 0 50px; }
.breadcrumb {
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  transition: color .2s;
}
.breadcrumb:hover { color: var(--accent); }
.detail-hero .tag-kind {
  font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
}
.detail-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.06; letter-spacing: -.025em; font-weight: 600;
  margin: 12px 0 16px; max-width: 880px;
}
.detail-hero .sub { color: var(--text-dim); font-size: 1.12rem; max-width: 720px; margin: 0; }

.detail-meta {
  display: flex; flex-wrap: wrap; gap: 0; margin-top: 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.detail-meta .cell { padding: 18px 24px; flex: 1; min-width: 160px; border-right: 1px solid var(--border); }
.detail-meta .cell:last-child { border-right: 0; }
.detail-meta .label { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.detail-meta .val { color: var(--text); font-size: .95rem; margin-top: 5px; font-weight: 500; }

.prose { max-width: 760px; }
.prose h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; margin: 38px 0 12px; }
.prose h3:first-child { margin-top: 0; }
.prose p { color: var(--text-dim); font-size: 1.02rem; margin: 0 0 16px; }
.prose ul { color: var(--text-dim); font-size: 1.02rem; padding-left: 0; list-style: none; margin: 0 0 16px; }
.prose ul li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.prose ul li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.prose b { color: var(--text); }

.results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.result-card {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 12px; padding: 24px;
}
.result-card .big { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--accent); display: block; line-height: 1; }
.result-card .small { color: var(--text-dim); font-size: .88rem; margin-top: 8px; display: block; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery figure { margin: 0; }
.gallery .shot {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  cursor: zoom-in; background: var(--bg-soft); transition: border-color .25s, transform .25s;
}
.gallery .shot:hover { border-color: var(--accent); transform: translateY(-2px); }
.gallery .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { font-size: .82rem; color: var(--text-faint); margin-top: 8px; font-family: var(--font-mono); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 5, 7, 0.92);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; border: 1px solid var(--border-strong); }
.lightbox .close {
  position: absolute; top: 24px; right: 28px; background: none; border: 0;
  color: var(--text); font-size: 2rem; cursor: pointer; line-height: 1;
}

/* Detail bottom nav */
.detail-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .about-grid, .bio-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 130px; }
  .code-card { order: -1; }
  .cards { grid-template-columns: 1fr; }
  .industries-grid { grid-template-columns: repeat(2, 1fr); }
  .project { grid-template-columns: 1fr; gap: 16px; }
  .project .result { text-align: left; }
}

@media (max-width: 720px) {
  section { padding: 80px 0; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: rgba(10,12,16,.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 22px 24px;
    gap: 18px;
    align-items: flex-start;
  }
  .nav-toggle { display: block; }
  .contact-form .row2 { grid-template-columns: 1fr; }
  .industries-grid { grid-template-columns: 1fr; }
}

/* =======================================================
 * Section background (alternating rows)
 * ======================================================= */
.section-bg { background: var(--bg-soft); }

/* =======================================================
 * Theme toggle button
 * ======================================================= */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-strong); }

/* =======================================================
 * Light mode
 * ======================================================= */
html[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-soft: #eef0f4;
  --surface: rgba(0,0,0,0.032);
  --surface-2: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.16);
  --text: #111318;
  --text-dim: #4a5568;
  --text-faint: #8892a0;
  --accent: #059669;
  --accent-2: #0284c7;
  --accent-soft: rgba(5,150,105,0.1);
}

/* Ambient glows — lighter */
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 600px at 80% -5%, rgba(5,150,105,0.07), transparent 60%),
    radial-gradient(700px 500px at 0% 10%, rgba(2,132,199,0.05), transparent 55%),
    var(--bg);
}
/* Grid overlay — dark lines on light bg */
html[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(0,0,0,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.045) 1px, transparent 1px);
}

/* Scrolled header */
html[data-theme="light"] .site-header.scrolled {
  background: rgba(247,248,250,0.88);
}

/* Mobile nav overlay */
html[data-theme="light"] .nav.open {
  background: rgba(247,248,250,0.97);
}

/* Chip accent hardcoded border */
html[data-theme="light"] .chip.accent {
  border-color: rgba(5,150,105,0.3);
}

/* Button hover colours */
html[data-theme="light"] .nav .btn-nav:hover  { background: #047857; }
html[data-theme="light"] .btn-primary:hover   { background: #047857; box-shadow: 0 0 30px rgba(5,150,105,.2); }

/* Industry card hover border */
html[data-theme="light"] .industry:hover { border-color: rgba(5,150,105,.35); }

/* Stack strip hover border */
html[data-theme="light"] .stack-strip span:hover { border-color: rgba(5,150,105,.3); }

/* Socials hover border */
html[data-theme="light"] .contact-info .socials a:hover { border-color: rgba(5,150,105,.4); }

/* Code card — stays dark regardless of theme */
html[data-theme="light"] .code-card {
  background: linear-gradient(180deg, #161b22, #0d1117);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
html[data-theme="light"] .code-card .bar {
  background: rgba(255,255,255,0.03);
  border-bottom-color: rgba(255,255,255,0.08);
}
html[data-theme="light"] .code-card .bar .file { color: rgba(255,255,255,0.3); }
html[data-theme="light"] .code-card pre { color: rgba(255,255,255,0.6); }
html[data-theme="light"] .code-card .c   { color: rgba(255,255,255,0.28); }
html[data-theme="light"] .code-card .kw  { color: #c792ea; }
html[data-theme="light"] .code-card .fn  { color: #67e8f9; }
html[data-theme="light"] .code-card .str { color: #6ee7b7; }
html[data-theme="light"] .code-card .num { color: #f78c6c; }

/* ── Chat widget ─────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 1.3rem; color: #fff;
  box-shadow: 0 4px 20px rgba(52,211,153,.35);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(52,211,153,.5); }
.chat-fab .bi-x-lg { display: none; }
.chat-fab.open .bi-chat-dots { display: none; }
.chat-fab.open .bi-x-lg { display: block; }

.chat-panel {
  position: fixed; bottom: 92px; right: 28px; z-index: 899;
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 18px; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
  overflow: hidden; opacity: 0; pointer-events: none;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s, transform .22s;
}
.chat-panel.open { opacity: 1; pointer-events: all; transform: none; }

.chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.chat-header .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid rgba(52,211,153,.3);
  display: grid; place-items: center; font-size: .9rem; color: var(--accent); flex-shrink: 0;
}
.chat-header .info { flex: 1; }
.chat-header .name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.chat-header .status { font-size: .75rem; color: var(--accent); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 340px; min-height: 120px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 82%; padding: 10px 13px; border-radius: 14px;
  font-size: .87rem; line-height: 1.5;
}
.chat-msg.bot {
  background: var(--surface-2); color: var(--text);
  border-bottom-left-radius: 4px; align-self: flex-start;
}
.chat-msg.user {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}
.chat-msg.typing { color: var(--text-faint); font-style: italic; }

.chat-input-row {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px; font-size: .87rem;
  color: var(--text); outline: none; font-family: var(--font-body);
  transition: border-color .2s;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row input::placeholder { color: var(--text-faint); }
.chat-send {
  background: var(--accent); border: none; border-radius: 10px;
  width: 38px; height: 38px; display: grid; place-items: center;
  color: #fff; cursor: pointer; font-size: .95rem; flex-shrink: 0;
  transition: background .2s;
}
.chat-send:hover { background: #059669; }
.chat-send:disabled { opacity: .5; cursor: default; }

html[data-theme="light"] .chat-panel { box-shadow: 0 16px 48px rgba(0,0,0,.15); }
html[data-theme="light"] .chat-msg.bot { background: rgba(0,0,0,.05); }

/* ── Chat widget ─────────────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 1.3rem; color: #fff;
  box-shadow: 0 4px 20px rgba(52,211,153,.35);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(52,211,153,.5); }
.chat-fab .bi-x-lg { display: none; }
.chat-fab.open .bi-chat-dots { display: none; }
.chat-fab.open .bi-x-lg { display: block; }

.chat-panel {
  position: fixed; bottom: 92px; right: 28px; z-index: 899;
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 18px; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.4); overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s, transform .22s;
}
.chat-panel.open { opacity: 1; pointer-events: all; transform: none; }

.chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.chat-header .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid rgba(52,211,153,.3);
  display: grid; place-items: center; font-size: .9rem; color: var(--accent); flex-shrink: 0;
}
.chat-header .name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.chat-header .status { font-size: .75rem; color: var(--accent); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 340px; min-height: 120px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 82%; padding: 10px 13px; border-radius: 14px;
  font-size: .87rem; line-height: 1.5;
}
.chat-msg.bot { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-msg.typing { color: var(--text-faint); font-style: italic; }
.chat-msg.bot p { margin: 0 0 .4em; }
.chat-msg.bot p:last-child { margin-bottom: 0; }
.chat-msg.bot ul, .chat-msg.bot ol { margin: .25em 0 .4em 1.2em; padding: 0; }
.chat-msg.bot li { margin-bottom: .15em; }
.chat-msg.bot code { background: rgba(255,255,255,.12); padding: .1em .35em; border-radius: 3px; font-size: .85em; }
.chat-msg.bot strong { font-weight: 600; }

.chat-input-row {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 13px; font-size: .87rem;
  color: var(--text); outline: none; font-family: var(--font-body);
  transition: border-color .2s;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row input::placeholder { color: var(--text-faint); }
.chat-send {
  background: var(--accent); border: none; border-radius: 10px;
  width: 38px; height: 38px; display: grid; place-items: center;
  color: #fff; cursor: pointer; font-size: .95rem; flex-shrink: 0;
  transition: background .2s;
}
.chat-send:hover { background: #059669; }
.chat-send:disabled { opacity: .5; cursor: default; }

html[data-theme="light"] .chat-panel { box-shadow: 0 16px 48px rgba(0,0,0,.15); }
html[data-theme="light"] .chat-msg.bot { background: rgba(0,0,0,.05); }
