/* ====================================================================
   ALVI CHOWDHURY — PORTFOLIO STYLES
   Theme: "Cinema" (dark, default) / "Day" (light) — toggled via JS
   ==================================================================== */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Cinema (dark) theme — default */
  --bg: #0b0d10;
  --bg-elevated: #14171c;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f4f1ea;
  --text-muted: #9a958d;

  --accent: #ff6b47;     /* coral/terracotta — advertising & film */
  --accent-2: #4adede;   /* cyan — AI & data */

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --container: 1140px;
  --section-pad: clamp(64px, 10vw, 120px);

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

/* AI Lab theme overrides */
:root[data-theme="ai-lab"] {
  --bg: #05070a;
  --bg-elevated: #0d1318;
  --surface: rgba(74, 222, 222, 0.05);
  --surface-strong: rgba(74, 222, 222, 0.1);
  --border: rgba(74, 222, 222, 0.18);
  --text: #e8fcfa;
  --text-muted: #6f8e8d;

  --accent: #4adede;
  --accent-2: #ff6b47;

  --grid-line: rgba(74, 222, 222, 0.06);
}

/* ---------- 2. RESET & BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

ul {
  list-style: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- 3. FILM GRAIN OVERLAY (signature element) ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 1.2s steps(4) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 2%); }
  50%  { transform: translate(2%, -2%); }
  75%  { transform: translate(-1%, 1%); }
  100% { transform: translate(0, 0); }
}

/* Scanline overlay (signature element for AI Lab theme) */
.scan {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  opacity: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(74, 222, 222, 0.05) 0px,
    rgba(74, 222, 222, 0.05) 1px,
    transparent 1px,
    transparent 3px
  );
  transition: opacity 0.4s ease;
}

[data-theme="ai-lab"] .scan {
  opacity: 1;
}

[data-theme="ai-lab"] .grain {
  opacity: 0.015;
}

/* ---------- 4. LAYOUT HELPERS ---------- */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad) 24px;
}

.section-head {
  position: relative;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  margin: 12px 0 8px;
  position: relative;
}

.section-note {
  color: var(--text-muted);
  margin-top: 8px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- 4b. THEME-SPECIFIC CONTENT ---------- */
/* Cinema content shows by default; AI Lab content is hidden until toggled */
.theme-ai {
  display: none;
}

[data-theme="ai-lab"] .theme-ai {
  display: revert;
}

[data-theme="ai-lab"] .theme-cinema {
  display: none;
}

/* Grid containers need their display restored explicitly */
[data-theme="ai-lab"] .theme-ai.bento {
  display: grid;
}

:root:not([data-theme="ai-lab"]) .theme-cinema.bento {
  display: grid;
}

/* ---------- 4c. AI NETWORK BACKGROUND ---------- */
.ai-network {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

[data-theme="ai-lab"] .ai-network {
  opacity: 0.6;
}

/* ---------- 5. NAVBAR ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  text-decoration: none;
}

.logo-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.theme-toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  transition: background 0.3s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s ease, background 0.3s ease;
}

[data-theme="ai-lab"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* Mobile menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- 6. HERO ---------- */
.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--container);
  margin: 0 auto;
  padding: 80px 24px 40px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-inner {
  max-width: 620px;
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 24px;
  color: var(--text-muted);
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 107, 71, 0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(255, 107, 71, 0); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.15;
  margin: 8px 0 24px;
}

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

.hero-title .line-2 {
  color: var(--text-muted);
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

.hero-sub strong {
  color: var(--text);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- 6b. AI CORE — interactive hero visual ---------- */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-core {
  position: relative;
  width: 78%;
  aspect-ratio: 1 / 1;
}

.core-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.core-ring.ring-2 {
  inset: 13%;
  border-style: dashed;
}

.core-ring.ring-3 {
  inset: 27%;
}

.ring-1 { animation: spin 50s linear infinite; }
.ring-2 { animation: spin 34s linear infinite reverse; }
.ring-3 { animation: spin 22s linear infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mouse-reactive glow — JS sets --mx / --my */
.core-glow {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 70%);
  filter: blur(28px);
  opacity: 0.45;
  transition: opacity 0.4s ease;
}

.core-object {
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* Cinema: a lens with a moving specular highlight */
.core-lens {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 60% 65%, color-mix(in srgb, var(--accent) 55%, transparent), #05070a 75%);
  border: 1px solid var(--border);
}

.lens-highlight {
  position: absolute;
  width: 36%;
  height: 36%;
  border-radius: 50%;
  top: var(--my, 30%);
  left: var(--mx, 30%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 70%);
  filter: blur(3px);
  mix-blend-mode: overlay;
  transition: top 0.18s ease, left 0.18s ease;
}

/* AI Lab: a small robot face, eyes track the cursor */
.robot-face {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  gap: 16%;
}

[data-theme="ai-lab"] .robot-face.theme-ai {
  display: flex;
}

.robot-eye {
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #050708;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.robot-pupil {
  width: 46%;
  height: 46%;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: transform 0.08s ease-out;
}

.core-readout {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* AI Lab mode: faster rings, brighter glow, scrambled readout */
[data-theme="ai-lab"] .ring-1 { animation-duration: 26s; }
[data-theme="ai-lab"] .ring-2 { animation-duration: 18s; }
[data-theme="ai-lab"] .ring-3 { animation-duration: 10s; }
[data-theme="ai-lab"] .core-glow { opacity: 0.7; }
[data-theme="ai-lab"] .core-readout { color: var(--accent); }

/* ---------- 6d. HOVER EFFECTS: Cinema flicker / AI Lab scramble ---------- */
/* hover-fx: only fire when the cursor is directly over the element itself */
.hover-fx {
  cursor: default;
  display: inline-block; /* ensures the hover area is exactly the element bounds */
}

a.hover-fx,
a .hover-fx {
  cursor: pointer;
}

/* Cinema: camera-flash / film-flicker on hover
   Change the animation duration (0.5s) here to adjust speed */
:root:not([data-theme="ai-lab"]) .hover-fx:hover {
  animation: film-flicker 0.5s steps(6) 1;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 65%, transparent);
}

@keyframes film-flicker {
  0%   { opacity: 1;    filter: brightness(1)   contrast(1); }
  15%  { opacity: 0.35; filter: brightness(2.4) contrast(1.5); }
  30%  { opacity: 1;    filter: brightness(0.7) contrast(1.2); }
  45%  { opacity: 0.5;  filter: brightness(2)   contrast(1.3); }
  60%  { opacity: 1;    filter: brightness(0.85) contrast(1); }
  100% { opacity: 1;    filter: brightness(1)   contrast(1); }
}

/* AI Lab: scrambled text (JS-driven) + glow.
   Speed controlled in script.js: change totalFrames = length * 5 and setInterval ms = 50 */
[data-theme="ai-lab"] .hover-fx:hover {
  color: var(--accent);
  text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: color 0.1s ease, text-shadow 0.1s ease;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-cue span {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  animation: scroll-cue 1.8s ease infinite;
}

@keyframes scroll-cue {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- 7. BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #0b0d10;
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 85%, white 15%);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: var(--surface-strong);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* ---------- 8. ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin: 40px 0;
}

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

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

/* ---------- 9. BENTO GRID ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.bento-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.bento-cell:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.bento-cell--wide {
  grid-column: span 2;
}

/* Stat bento */
.stat-bento .bento-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  color: var(--accent-2);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- 10. FEATURED WORK ---------- */
.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 32px;
  backdrop-filter: blur(14px);
}

.featured-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
}

.featured-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 999px;
}

.featured-info h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 8px 0 12px;
}

.featured-info p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ---------- 10b. COMPANY / MODEL SHOWCASE (AI Lab) ---------- */
.company-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.company-card {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  overflow: hidden;
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.company-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.company-card span {
  position: relative;
  z-index: 1;
}

/* Diagonal light-sweep on hover */
.company-card::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 35%, color-mix(in srgb, var(--accent) 35%, transparent) 50%, transparent 65%);
  transform: translateX(-60%);
  transition: transform 0.7s ease;
}

.company-card:hover::after {
  transform: translateX(60%);
}

/* ---------- 11. MEDIA PLACEHOLDERS ---------- */
.media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    135deg,
    var(--surface) 0px,
    var(--surface) 12px,
    transparent 12px,
    transparent 24px
  );
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- 11b. VIDEO EMBED (Now Showing) ---------- */
.video-embed {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- 12. SCENES / EXPERIENCE TIMELINE ---------- */
.scene-list {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
}

.scene {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  transition: padding-left 0.25s ease;
}

.scene:last-child {
  border-bottom: 1px solid var(--border);
}

.scene:hover {
  padding-left: 12px;
}

.scene-number {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: color 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.scene-now {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
}

.scene:hover .scene-number {
  color: var(--accent);
}

.scene-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 4px 0 8px;
}

.scene-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.scene-body p:last-child {
  color: var(--text-muted);
  max-width: 640px;
}

/* ---------- 13. SKILLS ---------- */
.skills-bento h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 14px;
}

/* Cinema: creative/software highlighted, AI cards slightly muted */
:root:not([data-theme="ai-lab"]) .skill-ai {
  opacity: 0.5;
  filter: saturate(0.4);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

:root:not([data-theme="ai-lab"]) .skill-ai:hover {
  opacity: 0.75;
  filter: saturate(0.8);
}

/* AI Lab: AI/code highlighted, creative/software cards slightly muted */
[data-theme="ai-lab"] .skill-creative,
[data-theme="ai-lab"] .skill-software {
  opacity: 0.45;
  filter: saturate(0.3);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

[data-theme="ai-lab"] .skill-creative:hover,
[data-theme="ai-lab"] .skill-software:hover {
  opacity: 0.7;
  filter: saturate(0.7);
}

/* Leadership always slightly muted in both — it's shared context */
.skill-leadership {
  opacity: 0.7;
}

.skill-leadership:hover {
  opacity: 1;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- 13b. PROMPT LAB (AI Lab mode) ---------- */
.prompt-lab-wrap {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-lab-wrap label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-lab-wrap textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.25s ease;
}

.prompt-lab-wrap textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.prompt-lab-wrap .btn {
  align-self: flex-start;
  border: none;
}

.prompt-output {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(14px);
  min-height: 80px;
  font-size: 0.9rem;
  line-height: 1.65;
}

.prompt-output-placeholder {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

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

.skill-bar span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.skill-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animate fill once the skill bar enters the viewport (JS adds .in-view) */
.skill-bar.in-view .skill-fill {
  width: var(--level);
}

/* ---------- 14. PHOTOGRAPHY ---------- */
.gallery-bento {
  margin-top: 32px;
}

.gallery-bento .bento-cell {
  aspect-ratio: 1 / 1;
  padding: 0;
}

.gallery-bento .bento-cell--wide {
  aspect-ratio: 2 / 1;
}

/* When a real photo is added (replace media-placeholder with gallery-img) */
.gallery-img {
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
  transition: transform 0.35s ease;
}

.gallery-img:hover {
  transform: scale(1.02);
}

/* Path-reveal effect: image "wipes" into view as it enters the viewport */
.reveal-img {
  clip-path: polygon(0 100%, 0 100%, 100% 100%, 100% 100%);
  transition: clip-path 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-img.revealed {
  clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
}

/* ---------- 15. CONTACT ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  margin-top: 40px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  backdrop-filter: blur(14px);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.contact-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.contact-form .btn {
  align-self: flex-start;
  border: none;
}

/* ---------- 16. FOOTER ---------- */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- 17. SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 17b. AI LAB MINI-GAME ---------- */
.game-wrap {
  position: relative;
  margin-top: 28px;
  aspect-ratio: 16 / 6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(6px);
  text-align: center;
  padding: 24px;
  transition: opacity 0.3s ease;
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 320px;
}

.game-score {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ---------- 18. RESPONSIVE ---------- */
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 280px;
    margin: 32px auto 0;
  }

  .company-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 14px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .about-grid,
  .featured-card,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .bento,
  .skills-bento,
  .stat-bento,
  .gallery-bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-cell--wide {
    grid-column: span 2;
  }

  .scene {
    grid-template-columns: 56px 1fr;
  }
}

@media (max-width: 540px) {
  .bento,
  .skills-bento,
  .stat-bento,
  .gallery-bento {
    grid-template-columns: 1fr;
  }

  .bento-cell--wide {
    grid-column: span 1;
  }

  .company-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 19. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .grain,
  .scan,
  .ai-network {
    display: none;
  }

  .reveal-img {
    clip-path: none;
  }

  .game-wrap {
    display: none;
  }
}
