/* ==========================================================================
   Lingesh A — Portfolio
   Design tokens, layout, components. Light + dark themes.
   ========================================================================== */

:root {
  --bg: #f8f7fe;
  --bg-2: #f1eefd;
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --ink: #0d0a1f;
  --ink-2: #2a2640;
  --muted: #5d5a75;
  --line: #ebe7f8;
  --line-2: #ddd7f5;
  --primary: #5b2bf0;
  --primary-2: #7c4dff;
  --primary-3: #a78bfa;
  --soft: #f0ebff;
  --soft-2: #e6defe;
  --on-primary: #ffffff;
  --success: #12b76a;
  --shadow-sm: 0 1px 2px rgba(30, 16, 80, .05), 0 2px 8px rgba(60, 30, 160, .05);
  --shadow: 0 10px 30px -12px rgba(70, 40, 180, .18), 0 2px 6px rgba(40, 20, 120, .05);
  --shadow-lg: 0 30px 70px -25px rgba(70, 40, 180, .35);
  --glow: 0 12px 30px -8px rgba(91, 43, 240, .55);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --container: 1240px;
  --header-h: 74px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --font-script: "Dancing Script", cursive;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0913;
  --bg-2: #0f0d1c;
  --surface: #13111f;
  --surface-2: #171428;
  --ink: #f4f2ff;
  --ink-2: #dcd8f5;
  --muted: #a39fc2;
  --line: #242036;
  --line-2: #312b4a;
  --primary: #7c5cff;
  --primary-2: #9b7bff;
  --primary-3: #c4b5fd;
  --soft: #1d1833;
  --soft-2: #262043;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -25px rgba(0, 0, 0, .8);
  --glow: 0 12px 34px -8px rgba(124, 92, 255, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.025em; font-weight: 800; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background-color .35s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { font-weight: 800; font-size: 1.45rem; letter-spacing: -.04em; display: inline-flex; align-items: baseline; gap: 6px; }
.brand span { color: var(--primary); }
.brand .brand-cursor { width: 9px; height: 3px; background: var(--primary); border-radius: 2px; animation: blink 1.1s steps(1) infinite; align-self: flex-end; margin-bottom: 7px; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 6px; margin-inline: auto; }
.nav-links a {
  position: relative; padding: 8px 14px; font-size: .92rem; font-weight: 500; color: var(--ink-2);
  border-radius: 10px; transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--primary); background: var(--soft); }
.nav-links a.active { color: var(--primary); font-weight: 700; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -16px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, color .2s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 24px; border-radius: 14px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); box-shadow: var(--glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(91, 43, 240, .65); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-sm { --h: 44px; padding: 0 18px; font-size: .9rem; border-radius: 12px; }
.btn-xs { --h: 40px; padding: 0 16px; font-size: .86rem; border-radius: 11px; }

/* ---------- Common bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  color: var(--primary); text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.grad {
  background: linear-gradient(100deg, var(--primary) 10%, var(--primary-2) 55%, #b06cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s, background-color .35s;
}
.card.lift:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.ibub {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(145deg, var(--soft), var(--soft-2)); color: var(--primary);
}
.ibub svg { width: 24px; height: 24px; }
.ibub.sm { width: 42px; height: 42px; border-radius: 13px; }
.ibub.sm svg { width: 20px; height: 20px; }
.ibub.lg { width: 60px; height: 60px; border-radius: 50%; }
.dot-title { display: flex; align-items: center; gap: 14px; font-size: 1.45rem; }
.dot-title::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent);
}
.sub { color: var(--muted); font-size: .93rem; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 9px;
  font-size: .82rem; font-weight: 500; color: var(--primary); background: var(--soft);
  border: 1px solid color-mix(in srgb, var(--primary) 10%, transparent);
  transition: background-color .2s, transform .2s;
}
.chip.lg { padding: 9px 16px; font-size: .9rem; border-radius: 11px; }
.chip:hover { background: var(--soft-2); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; color: var(--primary); background: var(--soft); white-space: nowrap;
}
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: .9rem; }
.link-arrow:hover svg { transform: translateX(3px); }
.link-arrow svg { transition: transform .2s; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 40px 0 46px;
  background:
    radial-gradient(900px 500px at 8% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%),
    radial-gradient(700px 500px at 100% 100%, color-mix(in srgb, var(--primary-2) 12%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  border-bottom: 1px solid var(--line);
}
.hero-field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 100%); }
.hero-grid {
  display: grid; align-items: center; gap: 28px;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .92fr) minmax(0, .74fr);
}
.hero-copy h1 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); margin: 16px 0 18px; letter-spacing: -.045em; line-height: 1.02; }
.hero-copy h1.name { font-size: clamp(3.2rem, 7vw, 5.6rem); margin-bottom: 8px; }
.hero-role { font-size: clamp(1.35rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -.02em; margin-bottom: 16px; }
.hero-role .typed { font-weight: 800; }
.hero-role .caret { display: inline-block; width: 3px; height: .95em; vertical-align: -0.1em; margin-left: 3px; background: var(--primary); animation: blink 1s steps(1) infinite; }
.hero-copy .lead { color: var(--muted); font-size: 1.06rem; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; font-size: .88rem; color: var(--muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { color: var(--primary); }

/* Portrait stage: dark "terminal" card that renders the portrait as ASCII */
.stage { position: relative; aspect-ratio: 4 / 4.7; max-width: 430px; width: 100%; margin-inline: auto; }
.stage .brush {
  position: absolute; inset: 6% -8% -4% -14%; z-index: 0; color: var(--primary-2); opacity: .9;
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate(8px, -6px) rotate(1.5deg); } }
.stage .script {
  position: absolute; left: -26%; top: 10%; z-index: 3;
  font-family: var(--font-script); font-weight: 700; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: .95;
  color: var(--primary); transform: rotate(-14deg); opacity: .85; pointer-events: none;
}
.stage .script span { display: block; }
.stage .script span:nth-child(2) { padding-left: .6em; }
.stage .script span:nth-child(3) { padding-left: 1.2em; }
.term {
  position: absolute; inset: 0; z-index: 2; overflow: hidden;
  border-radius: 28px; background: #07060d;
  border: 1px solid rgba(167, 139, 250, .22);
  box-shadow: var(--shadow-lg), 0 0 0 8px color-mix(in srgb, var(--surface) 55%, transparent);
  transform: rotate(1.5deg);
  transition: transform .5s var(--ease);
}
.stage:hover .term { transform: rotate(0deg) scale(1.01); }
.term-bar {
  position: absolute; z-index: 4; top: 0; left: 0; right: 0; height: 38px;
  display: flex; align-items: center; gap: 7px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(7, 6, 13, .95), rgba(7, 6, 13, 0));
  font-family: var(--font-mono); font-size: .7rem; color: rgba(220, 210, 255, .55);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3550; }
.term-bar i:nth-child(1) { background: #ff5f57; } .term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar b { margin-left: 8px; font-weight: 500; }
.term canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.term .photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: radial-gradient(75% 70% at 50% 42%, #000 45%, transparent 78%);
  mask-image: radial-gradient(75% 70% at 50% 42%, #000 45%, transparent 78%);
  transition: opacity .8s var(--ease), filter .8s var(--ease);
}
.stage.ascii-mode .photo { opacity: 0; filter: blur(6px); }
.ascii-toggle {
  position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; color: #ece6ff; cursor: pointer;
  background: rgba(20, 16, 36, .7); border: 1px solid rgba(167, 139, 250, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background-color .2s, border-color .2s;
}
.ascii-toggle:hover { background: rgba(91, 43, 240, .55); border-color: rgba(196, 181, 253, .7); }
.ascii-toggle .sw { width: 26px; height: 14px; border-radius: 999px; background: #3b3458; position: relative; transition: background-color .25s; }
.ascii-toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.stage.ascii-mode .ascii-toggle .sw { background: var(--primary-2); }
.stage.ascii-mode .ascii-toggle .sw::after { transform: translateX(12px); }
.float-chip {
  position: absolute; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px;
  border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: .8rem; line-height: 1.25; animation: bob 5s ease-in-out infinite;
}
.float-chip strong { display: block; font-size: .88rem; }
.float-chip small { color: var(--muted); }
.float-chip.a { left: -12%; bottom: 16%; }
.float-chip.b { right: -8%; top: 18%; animation-delay: -2.5s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Right column info cards */
.hero-side { display: grid; gap: 14px; }
.stack-card { padding: 8px; display: grid; }
.stack-card .side-row + .side-row { border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.side-row {
  display: flex; align-items: center; gap: 14px; padding: 16px 16px;
  border-radius: 16px; transition: background-color .2s;
}
a.side-row:hover, .side-row.hoverable:hover { background: var(--surface-2); }
.side-row strong { display: block; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.25; }
.side-row strong.big { font-size: 1.55rem; letter-spacing: -.03em; }
.side-row small { color: var(--muted); font-size: .84rem; line-height: 1.35; display: block; }
.side-row .chev { margin-left: auto; color: var(--primary); width: 30px; height: 30px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; }
.side-row .chev svg { width: 15px; height: 15px; }
.side-card { padding: 4px; }
.quote-card { padding: 28px 26px; position: relative; overflow: hidden; }
.quote-card .qmark { font-family: Georgia, serif; font-size: 3.8rem; line-height: .6; color: var(--primary); font-weight: 700; display: block; height: 30px; }
.quote-card p { font-size: 1.15rem; font-weight: 500; line-height: 1.45; color: var(--ink-2); margin: 14px 0 16px; }
.quote-card .bar { width: 28px; height: 4px; border-radius: 4px; background: var(--primary); }
.quote-card .deco { position: absolute; right: -14px; bottom: -14px; width: 120px; opacity: .95; }
.mini-bars { display: flex; align-items: flex-end; gap: 3px; margin-left: auto; height: 26px; color: var(--primary); }
.mini-bars i { width: 6px; border-radius: 2px; background: currentColor; opacity: .55; }
.mini-bars i:nth-child(1) { height: 40%; } .mini-bars i:nth-child(2) { height: 70%; opacity: .75; } .mini-bars i:nth-child(3) { height: 100%; opacity: 1; }

/* ---------- Sections ---------- */
.section { padding: 34px 0; }
.section.tight { padding-top: 22px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pad { padding: 26px; }
.pad-lg { padding: 32px; }

/* About-me card on home */
.about-card p.body { color: var(--muted); margin: 14px 0 22px; }
.fact-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fact-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.fact-tile .ib { color: var(--primary); width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.fact-tile .ib svg { width: 26px; height: 26px; }
.fact-tile strong { display: block; font-size: .9rem; line-height: 1.25; }
.fact-tile small { color: var(--muted); font-size: .8rem; }

/* Tech logo tiles */
.tech-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tech {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface); font-size: .9rem; font-weight: 500; line-height: 1.2;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.tech:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.tech img, .logo { width: 28px; height: 28px; object-fit: contain; flex: none; }
[data-theme="dark"] .logo.invert-dark { filter: invert(1) brightness(1.4); }

/* Dark band (featured projects on home) */
.band {
  position: relative; overflow: hidden; isolation: isolate; padding: 44px 0 50px; margin-top: 30px;
  background: radial-gradient(800px 400px at 15% 0%, rgba(124, 92, 255, .22), transparent 70%), #0b0918; color: #f1eeff;
  --ink: #f4f2ff; --ink-2: #dcd8f5; --muted: #a8a3c8; --line: #262140; --line-2: #3a3360; --surface: #13101f; --surface-2: #181429; --soft: #221c3e; --soft-2: #2c2450; --primary: #8b6cff; --primary-2: #a78bfa;
}
.band canvas.band-field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: .55; }
.band .section-head h2 { color: #fff; }

/* Projects */
.proj-feature { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; padding: 16px; align-items: stretch; }
.proj-feature .body { display: flex; flex-direction: column; gap: 12px; padding: 10px 8px 6px 0; }
.proj-feature h3 { font-size: 1.45rem; }
.proj-feature p { color: var(--muted); font-size: .94rem; }
.proj-feature .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.proj-compact { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; padding: 14px; }
.proj-compact h3 { font-size: 1.15rem; margin-bottom: 8px; padding-right: 30px; }
.proj-compact p { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.proj-compact .ext { position: absolute; top: 18px; right: 18px; color: var(--muted); }
.proj-compact .ext:hover { color: var(--primary); }
.media {
  position: relative; overflow: hidden; border-radius: 14px; min-height: 220px; background: #0d0b1a; isolation: isolate;
}
.media > img.real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; transition: transform .6s var(--ease); }
.card:hover .media > img.real { transform: scale(1.04); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.thumbs .media { min-height: 0; aspect-ratio: 16 / 10; border-radius: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.filter {
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 500; font-size: .9rem; cursor: pointer; transition: all .2s var(--ease);
}
.filter:hover { border-color: var(--primary); color: var(--primary); }
.filter.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: var(--glow); }
[data-cat].is-hidden { display: none !important; }
.mini-proj { display: flex; gap: 18px; padding: 22px; }
.mini-proj .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mini-proj h3 { font-size: 1.08rem; }
.mini-proj p { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.ibub.square { width: 64px; height: 64px; border-radius: 18px; }
.ibub.square svg { width: 30px; height: 30px; }

/* Fallback illustrations (shown when a generated image is missing) */
.art { position: absolute; inset: 0; z-index: 1; }
.art-chat { background: radial-gradient(400px 260px at 20% 40%, rgba(124, 92, 255, .45), transparent 70%), linear-gradient(135deg, #0e0a22, #1a1040 60%, #2a1663); }
.art-chat .nav-mini { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; font-size: .62rem; color: #d9d0ff; }
.art-chat .nav-mini b { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; }
.art-chat .nav-mini b::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.art-chat .nav-mini span { margin-left: auto; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.1); }
.art-chat .headline { position: absolute; left: 7%; top: 34%; color: #fff; font-weight: 800; font-size: clamp(1rem, 2vw, 1.45rem); line-height: 1.15; letter-spacing: -.02em; }
.art-chat .headline em { font-style: normal; color: #b9a5ff; }
.art-chat .headline small { display: block; margin-top: 10px; font-size: .55rem; font-weight: 400; color: #b6add8; max-width: 170px; line-height: 1.5; letter-spacing: 0; }
.art-chat .phone {
  position: absolute; right: 7%; top: 16%; bottom: 8%; width: 36%; min-width: 120px; border-radius: 16px; background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.45); padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: .55rem; color: #2a2640;
  transform: rotate(3deg);
}
.art-chat .phone .ph-top { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #6d28d9, #8b5cf6); color: #fff; border-radius: 9px; padding: 6px 8px; font-weight: 700; }
.art-chat .msg { padding: 6px 8px; border-radius: 8px; background: #f2eefe; max-width: 85%; line-height: 1.35; }
.art-chat .msg.me { align-self: flex-end; background: #6d28d9; color: #fff; }
.art-chat .typing { display: flex; gap: 3px; padding: 7px 9px; background: #f2eefe; border-radius: 8px; width: max-content; }
.art-chat .typing i { width: 4px; height: 4px; border-radius: 50%; background: #8b5cf6; animation: typing 1.2s infinite; }
.art-chat .typing i:nth-child(2) { animation-delay: .15s; } .art-chat .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { transform: translateY(-3px); opacity: .4; } }
.art-chat .ph-in { margin-top: auto; border: 1px solid #e6e1f6; border-radius: 8px; padding: 6px 8px; color: #9a95b5; display: flex; justify-content: space-between; }
.art-city { background: linear-gradient(180deg, #1d1b45 0%, #6b3a7a 42%, #f08a4b 70%, #ffc27a 82%, #2a2235 83%); }
.art-city svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-city .tag { position: absolute; left: 14px; top: 12px; font-size: .6rem; font-weight: 800; color: #fff; background: #c8102e; padding: 2px 6px; border-radius: 3px; letter-spacing: .05em; }
.art-studio { background: linear-gradient(135deg, #0f0c1f, #1d1442); }
.art-studio .win { position: absolute; inset: 14% 10% 0; border-radius: 12px 12px 0 0; background: #fff; overflow: hidden; box-shadow: 0 -10px 40px rgba(124,92,255,.35); }
.art-studio .win::before { content: ""; display: block; height: 16px; background: #f1eef9; }
.art-studio .win .l1 { position: absolute; left: 10%; top: 26%; width: 50%; height: 12px; border-radius: 4px; background: #1a1430; }
.art-studio .win .l2 { position: absolute; left: 10%; top: 38%; width: 36%; height: 12px; border-radius: 4px; background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.art-studio .win .l3 { position: absolute; left: 10%; top: 52%; width: 55%; height: 6px; border-radius: 3px; background: #e5e1f2; box-shadow: 0 10px 0 #e5e1f2; }
.art-studio .win .l4 { position: absolute; left: 10%; top: 72%; width: 22%; height: 16px; border-radius: 5px; background: #6d28d9; }
.art-studio .win .l5 { position: absolute; right: 8%; top: 24%; width: 26%; height: 56%; border-radius: 10px; background: linear-gradient(160deg, #ede9fe, #c4b5fd); }
.art-studio .logo-txt { position: absolute; left: 12px; top: 10px; font-weight: 800; color: #fff; font-size: .8rem; letter-spacing: -.01em; }
.art-studio .logo-txt span { color: #a78bfa; }
.art-office { background: linear-gradient(180deg, #8ec5ff 0%, #cfe6ff 55%, #b9d68c 56%, #8fb562 100%); }
.art-office svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Skills page ---------- */
.skill-card { padding: 22px 22px 24px; }
.skill-card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.skill-card h3 { font-size: 1.12rem; letter-spacing: -.015em; }
.skill-card .head small { color: var(--muted); font-size: .82rem; display: block; margin-top: 3px; }
.meter { display: grid; grid-template-columns: 30px 112px 1fr; align-items: center; gap: 4px 12px; padding: 9px 0; }
.meter .nm { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.meter .track { position: relative; height: 7px; border-radius: 99px; background: var(--soft); overflow: visible; }
.meter .fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 1.4s var(--ease); }
.meter .fill::after { content: ""; position: absolute; right: -2px; top: 50%; width: 11px; height: 11px; transform: translate(0, -50%); border-radius: 50%; background: var(--surface); border: 2.5px solid var(--primary-2); }
.meter .pct { position: absolute; right: 0; top: -20px; font-size: .74rem; font-weight: 600; color: var(--muted); font-family: var(--font-mono); }
.learn-list { display: grid; gap: 8px; }
.learn-list a, .learn-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-radius: 10px; background: var(--soft); color: var(--primary); font-size: .88rem; font-weight: 500; }
.learn-list li span.pip { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-2); animation: pulse 2s infinite; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-2) 25%, transparent); }

/* ---------- About page ---------- */
.stat { display: flex; align-items: center; gap: 18px; padding: 24px; }
.stat strong { display: block; font-size: 1.6rem; letter-spacing: -.03em; line-height: 1.1; }
.stat span { display: block; font-size: .92rem; color: var(--ink-2); }
.stat small { color: var(--muted); font-size: .84rem; }
.timeline { position: relative; display: grid; gap: 6px; }
.tl-item { position: relative; display: grid; grid-template-columns: 64px 130px minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 0; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--line-2), var(--line-2)); }
.tl-item::after { content: ""; position: absolute; left: -27px; top: 30px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 20%, transparent); }
.timeline.with-rail { padding-left: 24px; }
.tl-item .when { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding-top: 6px; }
.tl-item h4 { font-size: 1.04rem; letter-spacing: -.01em; margin-bottom: 4px; }
.tl-item .org { font-size: .88rem; color: var(--muted); }
.tl-item p { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.drive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.drive { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.drive strong { display: block; font-size: .95rem; }
.drive small { color: var(--muted); font-size: .84rem; line-height: 1.4; display: block; margin-top: 2px; }
.hobbies { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.hobby { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: .88rem; font-weight: 500; background: var(--surface-2); transition: transform .25s var(--ease), border-color .2s; }
.hobby:hover { transform: translateY(-3px); border-color: var(--primary-3); }
.hobby svg { color: var(--primary); width: 22px; height: 22px; }

/* ---------- Experience page ---------- */
.xp-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.xp-list { position: relative; display: grid; gap: 18px; }
.xp { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; position: relative; }
.xp .rail { position: relative; padding: 24px 0 0 34px; }
.xp .rail::before { content: ""; position: absolute; left: 6px; top: 0; bottom: -18px; width: 2px; background: var(--line-2); }
.xp:last-child .rail::before { bottom: 0; }
.xp .rail::after { content: ""; position: absolute; left: 0; top: 28px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent); }
.xp .rail .date { font-weight: 600; font-size: .9rem; }
.xp .rail .badge { margin-top: 10px; }
.xp .card { padding: 22px 24px; }
.xp .xp-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.xp .co-logo { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 1.1rem; color: #fff; box-shadow: var(--shadow-sm); }
.xp h3 { font-size: 1.18rem; letter-spacing: -.015em; }
.xp .org { color: var(--muted); font-size: .92rem; margin-top: 3px; }
.xp .xp-head .badge { margin-left: auto; }
.bullets { display: grid; gap: 7px; }
.bullets li { position: relative; padding-left: 20px; font-size: .92rem; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ov { display: flex; align-items: center; gap: 14px; padding: 16px; }
.ov strong { display: block; font-size: 1rem; line-height: 1.25; }
.ov small { color: var(--muted); font-size: .82rem; line-height: 1.35; display: block; }
.env { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; }
.env .media { min-height: 200px; }
.check-list { display: grid; gap: 7px; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; font-size: .86rem; color: var(--ink-2); line-height: 1.4; }
.check-list li svg { color: var(--primary); margin-top: 2px; width: 15px; height: 15px; }

/* ---------- Contact page ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 22px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; margin-top: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-size: .9rem; font-weight: 600; }
.field label b { color: #ef4444; font-weight: 600; }
.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 15px; top: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-wrap input, .input-wrap select, .input-wrap textarea {
  width: 100%; height: 52px; padding: 0 16px 0 46px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--surface-2); outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s; appearance: none; -webkit-appearance: none;
}
.input-wrap textarea { height: auto; min-height: 140px; padding-top: 14px; resize: vertical; line-height: 1.5; }
.input-wrap select { cursor: pointer; }
.input-wrap .caret-down { left: auto; right: 15px; }
.input-wrap input:focus, .input-wrap select:focus, .input-wrap textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); background: var(--surface); }
.field.span-2 { grid-column: span 2; }
.form-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-status { font-size: .88rem; color: var(--success); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.info { display: flex; align-items: center; gap: 14px; padding: 16px; min-width: 0; }
.info strong { display: block; font-size: .95rem; }
.info .v { display: block; font-size: .92rem; color: var(--ink-2); overflow-wrap: anywhere; }
.info small { color: var(--muted); font-size: .8rem; }
.map-card { position: relative; margin-top: 14px; border-radius: 16px; overflow: hidden; min-height: 150px; background: linear-gradient(120deg, var(--soft), var(--soft-2)); display: flex; align-items: center; gap: 16px; padding: 18px; }
.map-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; }
.map-card .pin-card { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: .82rem; line-height: 1.35; }
.map-card .pin-card strong { display: block; font-size: .92rem; }
.map-card .pin-card small { color: var(--muted); }
.map-card .script { position: relative; margin-left: auto; font-family: var(--font-script); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--primary); transform: rotate(-10deg); text-align: center; }
.resp { display: flex; align-items: center; gap: 12px; padding: 14px; }
.resp strong { display: block; font-size: .92rem; }
.resp small { color: var(--muted); font-size: .82rem; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px; }

/* ---------- Footer ---------- */
.footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0; flex-wrap: wrap; }
.footer p { color: var(--muted); font-size: .88rem; }
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-2); transition: all .2s; }
.socials a:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
.footer .ascii-sig { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }

.back-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: var(--glow); opacity: 0; transform: translateY(14px); pointer-events: none; transition: all .3s var(--ease); display: grid; place-items: center; }
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* Cursor spotlight on cards */
.card.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--primary) 9%, transparent), transparent 60%);
}
.card.spot:hover::before { opacity: 1; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 20, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal .card { width: min(640px, 100%); max-height: 88vh; overflow: auto; padding: 28px; transform: translateY(16px) scale(.98); transition: transform .35s var(--ease); }
.modal.open .card { transform: none; }
.modal h3 { font-size: 1.45rem; margin: 10px 0 12px; }
.modal p { color: var(--muted); margin-bottom: 14px; }
.modal .close { position: absolute; top: 16px; right: 16px; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Page-load intro (ASCII boot) */
.boot { position: fixed; inset: 0; z-index: 200; background: #07060d; display: grid; place-items: center; transition: opacity .6s var(--ease), visibility .6s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot pre { margin: 0; font-family: var(--font-mono); font-size: clamp(.7rem, 1.6vw, .95rem); color: #c4b5fd; line-height: 1.5; min-width: 280px; }
.boot pre b { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .hero-side { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-side.single { grid-template-columns: 1fr; }
  .stack-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack-card .side-row + .side-row { border-top: 0; }
  .stage .script { left: -14%; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proj-feature { grid-template-columns: 1fr; }
  .proj-feature .media.main { min-height: 260px; }
  .xp-layout, .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .nav-links {
    position: fixed; top: var(--header-h); left: 12px; right: 12px; flex-direction: column; gap: 2px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(-8px); pointer-events: none; transition: all .25s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; }
  .nav-links a.active { background: var(--soft); }
  .nav-links a.active::after { display: none; }
  .menu-toggle { display: grid; }
  .nav-actions { margin-left: auto; }
  .nav-actions .btn .lbl { display: none; }
  .nav-actions .btn { padding: 0 13px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .hobbies { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proj-compact { grid-template-columns: 1fr; }
  .proj-compact .media { min-height: 190px; }
}
@media (max-width: 760px) {
  :root { --header-h: 66px; }
  .hero { padding-top: 26px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side, .stack-card { grid-template-columns: 1fr; }
  .stage { max-width: 340px; }
  .stage .script { left: -6%; top: -2%; font-size: 1.6rem; }
  .float-chip.a { left: -4%; } .float-chip.b { right: -4%; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .g-4, .fact-tiles, .info-grid, .ov-grid, .drive-grid, .form-grid, .env { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-item { grid-template-columns: 52px minmax(0, 1fr); }
  .tl-item .when { grid-column: 2; padding-top: 0; }
  .tl-item .what { grid-column: 2; }
  .tl-item .ibub { grid-row: span 2; }
  .xp { grid-template-columns: 1fr; gap: 6px; }
  .xp .rail { padding: 0 0 0 30px; display: flex; align-items: center; gap: 12px; }
  .xp .rail::after { top: 4px; }
  .xp .rail::before { display: none; }
  .xp .rail .badge { margin-top: 0; }
  .xp .xp-head { flex-wrap: wrap; }
  .xp .xp-head .badge { margin-left: 0; }
  .cta { flex-direction: column; align-items: flex-start; }
  .map-card { flex-wrap: wrap; }
  .map-card .script { margin-left: 0; }
  .pad, .pad-lg { padding: 20px; }
  .proj-feature { padding: 12px; }
  .hobbies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Additions: 3D deco tile, meter icons ---------- */
.quote-card { min-height: 240px; }
.quote-card p { max-width: 78%; }
.deco3d { position: absolute; right: -6px; bottom: -10px; width: 118px; height: 118px; pointer-events: none; }
.deco3d .glass {
  position: absolute; inset: 8px; border-radius: 28px; transform: rotate(-12deg); display: grid; place-items: center; color: var(--primary);
  background: linear-gradient(145deg, rgba(255, 255, 255, .95), rgba(225, 216, 255, .7));
  box-shadow: 0 24px 40px -14px rgba(91, 43, 240, .45), inset 0 1px 0 #fff, inset 0 -6px 14px rgba(124, 77, 255, .15);
  animation: bob 6s ease-in-out infinite;
}
[data-theme="dark"] .deco3d .glass { background: linear-gradient(145deg, #2d2550, #16132a); box-shadow: 0 24px 40px -14px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .12); }
.deco3d .glass svg { width: 52px; height: 52px; stroke-width: 2.6; }
.deco3d img.real { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: contain; z-index: 2; animation: bob 6s ease-in-out infinite; }
.meter .mi { width: 30px; height: 30px; display: grid; place-items: center; color: var(--primary); }
.meter .mi svg { width: 22px; height: 22px; }
.chip-cloud .chip { font-size: .86rem; padding: 8px 14px; }
.art-chat .headline { max-width: 54%; font-size: clamp(.95rem, 1.6vw, 1.3rem); }
.art-chat .phone { top: 50%; bottom: auto; height: min(80%, 290px); transform: translateY(-46%) rotate(3deg); }
.field { align-content: start; }
.info-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.info .ibub { width: 46px; height: 46px; border-radius: 14px; }
.info .ibub svg { width: 21px; height: 21px; }
.info .v { overflow-wrap: normal; word-break: normal; font-size: .9rem; }
@media (max-width: 760px) {
  .stage .script { left: 4%; top: -7%; }
  .hero-field { opacity: .45; }
}

/* ---------- Light theme portrait: transparent cut-out on the brush stroke ---------- */
.photo-cut { display: none; }
[data-theme="light"] .photo-dark { display: none; }
[data-theme="light"] .photo-cut {
  display: block;
  -webkit-mask-image: radial-gradient(90% 78% at 50% 36%, #000 62%, transparent 100%);
  mask-image: radial-gradient(90% 78% at 50% 36%, #000 62%, transparent 100%);
  filter: drop-shadow(0 18px 28px rgba(60, 30, 160, .2));
}
[data-theme="light"] .term { background: transparent; border-color: transparent; box-shadow: none; transform: none; overflow: visible; }
[data-theme="light"] .stage:hover .term { transform: none; }
[data-theme="light"] .term-bar { display: none; }
[data-theme="light"] .stage .brush { inset: 0 -14% -2% -16%; opacity: 1; }
[data-theme="light"] .term canvas {
  -webkit-mask-image: radial-gradient(90% 80% at 50% 38%, #000 58%, transparent 96%);
  mask-image: radial-gradient(90% 80% at 50% 38%, #000 58%, transparent 96%);
}
.stat strong span { display: inline; font-size: inherit; color: inherit; }

/* ---------- Real images: brand logo, theme-swapped screenshots ---------- */
.brand-logo { width: 70%; height: 70%; object-fit: contain; }
img.brand-logo[width] { width: 34px; height: 34px; }
.co-logo .brand-logo { width: 80%; height: 80%; }
[data-theme="light"] .only-dark, [data-theme="dark"] .only-light { display: none; }
.proj-brand { display: block; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }

/* Painted brush stroke (light theme) behind the portrait */
.brush-img { display: none; }
[data-theme="light"] .stage .brush { display: none; }
[data-theme="light"] .brush-img {
  display: block; position: absolute; z-index: 0; inset: -6% -40% -8% -38%;
  background: url("../assets/images/brush-stroke.webp") no-repeat 78% 70% / cover;
  mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 60% at 62% 58%, #000 55%, transparent 100%);
  mask-image: radial-gradient(60% 60% at 62% 58%, #000 55%, transparent 100%);
}

/* FiveM memories button */
.memories-btn {
  width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; cursor: pointer;
  border-radius: 14px; border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--ink);
  transition: border-color .2s, background-color .2s, transform .25s var(--ease);
}
.memories-btn:hover { border-color: var(--primary); border-style: solid; background: var(--soft); transform: translateY(-2px); }
.memories-btn strong { display: block; font-size: .9rem; }
.memories-btn small { color: var(--muted); font-size: .78rem; }
.memories-btn .go { margin-left: auto; color: var(--primary); transition: transform .2s; }
.memories-btn:hover .go { transform: translateX(3px); }

/* Work environment photo grid */
.work-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; grid-template-rows: 150px 150px; gap: 10px; margin-bottom: 14px; }
.work-tile { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--soft); }
.work-tile:first-child { grid-row: span 2; }
.work-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.work-tile:hover img { transform: scale(1.06); }
.work-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); background: linear-gradient(180deg, transparent 60%, rgba(10, 6, 30, .35)); }
.env.one { grid-template-columns: 1fr; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto 1fr auto; background: rgba(6, 4, 16, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s; color: #ece8ff; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-size: .9rem; }
.lb-top b { font-family: var(--font-mono); font-weight: 500; color: #b9a8ff; font-size: .8rem; }
.lb-cap { color: #b6add8; font-size: .85rem; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 64px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); transition: opacity .25s; }
.lb-stage img.loading { opacity: 0; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(124, 92, 255, .5); color: #fff; }
.lb-thumbs { display: flex; gap: 8px; justify-content: center; padding: 14px; overflow-x: auto; }
.lb-thumbs button { flex: none; width: 64px; height: 42px; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; opacity: .55; cursor: pointer; background: #222; transition: opacity .2s, border-color .2s; }
.lb-thumbs button.portrait { width: 30px; }
.lb-thumbs button.on { opacity: 1; border-color: #a78bfa; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .lb-stage { padding: 0 8px 56px; }
  .lb-nav { top: auto; bottom: 4px; transform: none; }
  .work-grid { grid-template-rows: 120px 120px; }
}

/* Featured projects: one wide card per row so screenshots read at a good size */
.feature-list { grid-template-columns: 1fr; }
.feature-list .proj-feature { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; padding: 18px; }
.feature-list .proj-feature:nth-child(even) > :first-child { order: 2; }
.feature-list .media.main { min-height: 0; aspect-ratio: 16 / 10; }
.feature-list .proj-feature .body { padding: 14px 10px 8px 0; }
.feature-list .proj-feature h3 { font-size: 1.7rem; }
@media (max-width: 920px) {
  .feature-list .proj-feature { grid-template-columns: 1fr; }
  .feature-list .proj-feature:nth-child(even) > :first-child { order: 0; }
}
.media > img.real.left { object-position: 8% 50%; }

/* Lightbox layout fix: the photo always fits between the header and the thumbnail strip */
.lightbox { display: flex; flex-direction: column; }
.lb-top, .lb-thumbs { flex: none; }
.lb-stage { flex: 1 1 auto; min-height: 0; display: block; padding: 0; }
.lb-stage img {
  position: absolute; inset: 0; margin: auto;
  width: auto; height: auto; max-width: calc(100% - 152px); max-height: calc(100% - 8px);
}
.lb-thumbs { justify-content: safe center; padding: 12px 16px 16px; scrollbar-width: thin; }
@media (max-width: 760px) {
  .lb-stage img { max-width: calc(100% - 16px); max-height: calc(100% - 64px); inset: 0 0 56px; }
  .lb-nav { bottom: 6px; }
  .lb-nav.prev { left: calc(50% - 52px); } .lb-nav.next { right: calc(50% - 52px); }
}

/* ---------- Company logos ---------- */
.logo-tile { background: #fff; border: 1px solid var(--line); padding: 7px; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.ibub.lg.logo-tile { padding: 9px; }
.co-logo { background: #fff; border: 1px solid var(--line); padding: 7px; }
.co-logo img { width: 100%; height: 100%; object-fit: contain; }
.fact-tile .ib img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; }
.btn-logo { width: 22px; height: 22px; object-fit: contain; }

/* Stat cards: only the text spans are block-level, not the icon bubble */
.stat span { display: grid; }
.stat > div > span { display: block; }

/* Hobbies wrap instead of overflowing */
.hobbies { display: flex; flex-wrap: wrap; gap: 10px; }
.hobby { flex: 1 1 128px; justify-content: flex-start; padding: 12px 14px; }

/* Journey timeline: room for the "Upcoming" badge under the date */
.tl-item .when .badge { margin-top: 6px; font-size: .7rem; padding: 3px 9px; }

/* ---------- Portrait: same open cut-out look in both themes (no dark box) ---------- */
.photo-dark { display: none !important; }
.photo-cut {
  display: block;
  -webkit-mask-image: radial-gradient(90% 78% at 50% 36%, #000 62%, transparent 100%);
  mask-image: radial-gradient(90% 78% at 50% 36%, #000 62%, transparent 100%);
  filter: drop-shadow(0 18px 28px rgba(60, 30, 160, .2));
}
[data-theme="dark"] .photo-cut { filter: drop-shadow(0 18px 40px rgba(124, 92, 255, .35)); }
.term { background: transparent; border-color: transparent; box-shadow: none; transform: none; overflow: visible; }
.stage:hover .term { transform: none; }
.term-bar { display: none; }
.term canvas {
  -webkit-mask-image: radial-gradient(90% 80% at 50% 38%, #000 58%, transparent 96%);
  mask-image: radial-gradient(90% 80% at 50% 38%, #000 58%, transparent 96%);
}
.stage .script { left: -10%; top: 3%; }
.ascii-toggle { background: rgba(20, 16, 36, .78); }

/* ---------- Footer ---------- */
.footer { margin-top: 48px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.3fr) auto auto; align-items: center; gap: 32px; padding: 34px 0 26px; }
.f-brand p { margin-top: 8px; max-width: 380px; font-size: .9rem; }
.f-links { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.f-links a { padding: 6px 10px; border-radius: 9px; font-size: .9rem; color: var(--ink-2); transition: color .2s, background-color .2s; }
.f-links a:hover { color: var(--primary); background: var(--soft); }
.socials img { width: 20px; height: 20px; object-fit: contain; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 70px 22px 0; border-top: 1px solid var(--line); }
.footer-bottom p { font-size: .85rem; }
.made-by { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; color: var(--muted); padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .2s, color .2s; }
.made-by img { width: 20px; height: 20px; object-fit: contain; }
.made-by b { color: var(--ink); }
.made-by:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 920px) {
  .footer-top { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 760px) {
  .footer-top, .footer-bottom { text-align: left; }
  .footer-bottom { padding-right: 0; padding-bottom: 80px; flex-direction: column; align-items: flex-start; }
  .stage .script { left: 2%; top: -4%; }
}
.feature-list .media.main { width: 100%; height: auto; align-self: center; }
