/* ═══════════════════════════════════════════════════════════
   style.css — zurai02.is-a.dev (enhanced & refactored)
   ═══════════════════════════════════════════════════════════ */

/* ── 1. RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #07090e;
  --bg-card:     #0d1219;
  --bg-card2:    #111820;
  --border:      #1a2130;
  --border-hi:   #263040;
  --text:        #eaf1fa;
  --muted:       #6e7e94;
  --accent:      #ff6b35;
  --accent-hi:   #ff9560;
  --accent2:     #4493f8;
  --luau:        #a78bfa;
  --success:     #3fb950;
  --warn:        #e3b341;
  --radius:      14px;
  --radius-sm:   8px;
  --nav-h:       60px;
  --max-w:       960px;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

::selection {
  background: rgba(255, 107, 53, 0.3);
  color: var(--text);
}

/* ── 2. SCROLL PROGRESS BAR ── */
#scroll-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--luau));
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* ── 3. CANVAS & GLOW ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.055) 0%, transparent 65%);
  opacity: 0;
  will-change: transform;
  transition: opacity 0.4s ease;
}

/* ── 4. PAGE LAYOUT ── */
.page {
  position: relative;
  z-index: 2;
  padding-top: var(--nav-h);
}

/* ── 5. NAVIGATION ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

nav.scrolled {
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-color: var(--border);
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: -0.01em;
}

.nav-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink-c 1.1s step-end infinite;
}

@keyframes blink-c {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.15s ease;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transition: width 0.22s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile Hamburger Toggle */
#nav-hamburger,
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 201;
}

#nav-hamburger span,
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.2s ease;
}

#nav-hamburger.open span:nth-child(1),
.nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: var(--accent);
}

#nav-hamburger.open span:nth-child(2),
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

#nav-hamburger.open span:nth-child(3),
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--accent);
}

/* ── 6. HERO SECTION ── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem clamp(1.25rem, 5vw, 2rem) 7rem;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: -10rem;
  left: -16rem;
  width: 750px;
  height: 750px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.055) 0%, transparent 65%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

.hero-glow2 {
  position: absolute;
  top: -6rem;
  right: -12rem;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68, 147, 248, 0.04) 0%, transparent 65%);
  pointer-events: none;
  animation: glow-pulse 8s ease-in-out infinite reverse;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(63, 185, 80, 0.07);
  border: 1px solid rgba(63, 185, 80, 0.17);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: fu 0.5s 0.05s forwards;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 7px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.5; }
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fu 0.5s 0.15s forwards;
}

.tag-lang {
  background: rgba(167, 139, 250, 0.09);
  border: 1px solid rgba(167, 139, 250, 0.22);
  color: var(--luau);
  padding: 0.12rem 0.52rem;
  border-radius: 5px;
  font-size: 0.67rem;
}

.hero h1 {
  font-size: clamp(3.2rem, 8.5vw, 5.8rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.048em;
  margin-bottom: 0.35rem;
  opacity: 0;
  animation: fu 0.6s 0.25s forwards;
}

.hero h1 .handle {
  position: relative;
  display: inline-block;
  color: var(--accent);
}

.hero h1 .handle::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi), transparent);
  border-radius: 2px;
  animation: ul-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

@keyframes ul-in {
  from { transform: scaleX(0); transform-origin: left; opacity: 0; }
  to { transform: scaleX(1); transform-origin: left; opacity: 1; }
}

.hero-sub {
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  color: var(--muted);
  max-width: 580px;
  margin: 1.65rem 0 2.5rem;
  line-height: 1.95;
  min-height: 4em;
  opacity: 0;
  animation: fu 0.6s 0.35s forwards;
}

.tw-cur {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink-c 0.85s step-end infinite;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  opacity: 0;
  animation: fu 0.6s 0.45s forwards;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--border-hi);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: fu 0.5s 1.1s both;
}

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

@keyframes sh-drop {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  55%  { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ── 7. BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.btn:hover::before {
  opacity: 1;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(255, 107, 53, 0.5);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--border-hi);
}

.btn-ghost:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.btn-discord {
  background: rgba(88, 101, 242, 0.1);
  color: #9baee8;
  border-color: rgba(88, 101, 242, 0.22);
}

.btn-discord:hover {
  background: rgba(88, 101, 242, 0.18);
  color: #c4d0ff;
  border-color: rgba(88, 101, 242, 0.45);
  transform: translateY(-1px);
}

#discord-btn.copied,
.btn.copied {
  color: var(--success) !important;
  border-color: rgba(63, 185, 80, 0.4) !important;
  background: rgba(63, 185, 80, 0.09) !important;
}

/* ── 8. SECTIONS & GENERAL CONTENT ── */
.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--border);
}

section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem clamp(1.25rem, 5vw, 2rem);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.rd1 { transition-delay: 0.06s; }
.rd2 { transition-delay: 0.12s; }
.rd3 { transition-delay: 0.18s; }
.rd4 { transition-delay: 0.24s; }

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  max-width: 100px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.section-sub {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 520px;
  margin-bottom: 2.25rem;
  line-height: 1.9;
}

/* ── 9. SKILL CARDS & STATS ── */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.skill-card {
  background: rgba(13, 18, 25, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 1.65rem 1.8rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transform-style: preserve-3d;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transition: left 0.5s ease;
}

.skill-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 107, 53, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  border-color: rgba(255, 107, 53, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 107, 53, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.skill-card:hover::before { left: 100%; }
.skill-card:hover::after  { opacity: 1; }

.skill-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent);
  opacity: 0.5;
  margin-bottom: 0.65rem;
  display: block;
  letter-spacing: 0.1em;
}

.skill-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.skill-card p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.75;
}

.skill-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  margin-bottom: 0.8rem;
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.22s ease, color 0.2s ease;
}

.skill-card:hover .skill-icon {
  opacity: 1;
  transform: scale(1.15) rotate(-5deg);
  color: var(--accent-hi);
}

.stat-row {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── 10. TECH STACK BADGES ── */
.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.33rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.18s ease;
  cursor: default;
  letter-spacing: 0.01em;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.badge-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.b-luau  { background: rgba(167, 139, 250, 0.07); border-color: rgba(167, 139, 250, 0.2);  color: var(--luau); }
.b-rblx  { background: rgba(255, 107, 53, 0.07);  border-color: rgba(255, 107, 53, 0.2);   color: var(--accent-hi); }
.b-blue  { background: rgba(68, 147, 248, 0.07);  border-color: rgba(68, 147, 248, 0.2);   color: var(--accent2); }
.b-green { background: rgba(63, 185, 80, 0.07);   border-color: rgba(63, 185, 80, 0.2);    color: var(--success); }

.b-luau:hover  { border-color: rgba(167, 139, 250, 0.5); box-shadow: 0 4px 16px rgba(167, 139, 250, 0.15); }
.b-rblx:hover  { border-color: rgba(255, 107, 53, 0.5);  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.15); }
.b-blue:hover  { border-color: rgba(68, 147, 248, 0.5);  box-shadow: 0 4px 16px rgba(68, 147, 248, 0.15); }
.b-green:hover { border-color: rgba(63, 185, 80, 0.5);   box-shadow: 0 4px 16px rgba(63, 185, 80, 0.15); }

/* ── 11. VERIFICATION BLOCK ── */
.verify-block {
  background: rgba(68, 147, 248, 0.05);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(68, 147, 248, 0.16);
  border-left: 3px solid var(--accent2);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.verify-block p {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.8;
}

.verify-block strong {
  color: var(--text);
  font-weight: 600;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.79rem;
  color: var(--accent2);
}

/* ── 12. LINK CARDS ── */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 1.15rem 1.35rem;
  background: rgba(13, 18, 25, 0.6);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.link-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.06), transparent);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.link-card::after {
  content: '↗';
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform: translate(-4px, 4px);
}

.link-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.link-card:hover::before { opacity: 1; }
.link-card:hover::after  { opacity: 1; transform: translate(0, 0); }

.link-name  { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.link-label { font-size: 0.69rem;  color: var(--muted); }
.link-icon  {
  width: 18px;
  height: 18px;
  color: var(--muted);
  margin-bottom: 0.45rem;
  display: block;
  transition: color 0.18s ease, transform 0.2s ease;
}

.link-card:hover .link-icon {
  color: var(--accent);
  transform: scale(1.15) rotate(-5deg);
}

/* ── 13. TERMINAL WIDGET ── */
.tw-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4.5rem clamp(1.25rem, 5vw, 2rem) 6rem;
}

.tw-terminal {
  background: rgba(5, 8, 12, 0.85);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 107, 53, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.tw-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: rgba(8, 11, 16, 0.92);
  border-bottom: 1px solid var(--border);
}

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

.tw-bar-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.67rem;
  color: var(--muted);
  margin-left: 0.4rem;
  letter-spacing: 0.05em;
}

.tw-body {
  padding: 1.25rem 1.5rem 1.75rem;
  min-height: 220px;
  overflow: hidden;
}

.tw-line {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.79rem;
  line-height: 1.8;
  margin-bottom: 0.2rem;
  animation: tw-line-in 0.22s ease both;
}

@keyframes tw-line-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.tw-prompt   { color: var(--accent); user-select: none; flex-shrink: 0; }
.tw-code     { white-space: pre-wrap; word-break: break-all; flex: 1; }
.tw-code.dim { color: var(--muted); }
.tw-active .tw-code { color: var(--text); }

.tw-block-cur {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink-c 1s step-end infinite;
}

/* Syntax Highlighting */
.kw { color: #ff7b72; }
.fn { color: #d2a8ff; }
.str { color: #a5d6ff; }
.num { color: #79c0ff; }
.cm { color: var(--muted); font-style: italic; }
.op { color: #ffa657; }

/* ── 14. BACK TO TOP & TOAST ── */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 500;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.25);
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#back-to-top:hover {
  background: rgba(255, 107, 53, 0.22);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

#copy-toast {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: rgba(12, 18, 26, 0.97);
  color: var(--success);
  border: 1px solid rgba(63, 185, 80, 0.25);
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 999;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 15. FOOTER ── */
footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.72rem;
  border-top: 1px solid var(--border);
  letter-spacing: 0.025em;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--accent-hi);
}

/* ── 16. RESPONSIVE BREAKPOINTS ── */
@media (max-width: 640px) {
  #nav-hamburger,
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(7, 9, 14, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    z-index: 199;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
  }

  #cursor-glow {
    display: none;
  }

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

  .hero h1 {
    letter-spacing: -0.035em;
  }

  #back-to-top {
    bottom: 1rem;
    right: 1rem;
  }
}

/* ── 17. ACCESSIBILITY / PREFERS 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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero h1 .handle::after {
    opacity: 1;
    transform: scaleX(1);
  }

  .status-dot,
  .scroll-hint .sh-line,
  .nav-cursor,
  .tw-block-cur,
  .hero-glow,
  .hero-glow2 {
    animation: none;
  }
}


/* ═══════════════════════════════════════════════════════════
   CHATBOT — "Ask about zurai02" widget (pairs with chatbot.js)
   ═══════════════════════════════════════════════════════════ */


.zc-root {
  --zc-bg:      var(--bg-card, #0d1219);
  --zc-bg2:     var(--bg-card2, #111820);
  --zc-border:  var(--border-hi, #263040);
  --zc-text:    var(--text, #eaf1fa);
  --zc-muted:   #93a1b5;
  --zc-accent:  var(--accent, #ff6b35);
  --zc-accent2: var(--accent-hi, #ff9560);
  --zc-on-accent: #170a04;

  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 950;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--zc-text);
}

.zc-root *, .zc-root *::before, .zc-root *::after { box-sizing: border-box; }
.zc-root [hidden] { display: none !important; }

/* Floating button */
.zc-toggle {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--zc-accent);
  color: var(--zc-on-accent);
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(255, 107, 53, .35), 0 2px 6px rgba(0, 0, 0, .4);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.zc-toggle:hover { transform: translateY(-2px) scale(1.04); background: var(--zc-accent2); }
.zc-toggle:active { transform: scale(.96); }
.zc-toggle:focus-visible,
.zc-icon-btn:focus-visible,
.zc-chip:focus-visible,
.zc-send:focus-visible,
.zc-link:focus-visible {
  outline: 2px solid var(--zc-accent2);
  outline-offset: 2px;
}

/* Panel */
.zc-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 110px));
  overflow: hidden;
  background: rgba(13, 18, 25, .94);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--zc-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  transform-origin: bottom right;
  animation: zc-pop .22s cubic-bezier(.2, .8, .2, 1);
}

@keyframes zc-pop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* Header */
.zc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid var(--zc-border);
}
.zc-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.zc-title strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.zc-title small { display: block; font-size: 12px; color: var(--zc-muted); }
.zc-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success, #3fb950);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, .18);
}
.zc-icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--zc-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.zc-icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--zc-text); }
.zc-icon-btn svg { width: 18px; height: 18px; }

/* Messages */
.zc-log {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.zc-log::-webkit-scrollbar { width: 6px; }
.zc-log::-webkit-scrollbar-thumb { background: var(--zc-border); border-radius: 6px; }

.zc-msg { display: flex; animation: zc-in .2s ease-out; }
@keyframes zc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.zc-user { justify-content: flex-end; }
.zc-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.zc-bubble p { margin: 0; }
.zc-bubble p + p { margin-top: 8px; }

.zc-bot .zc-bubble {
  background: var(--zc-bg2);
  border: 1px solid var(--zc-border);
  border-bottom-left-radius: 4px;
}
.zc-user .zc-bubble {
  background: var(--zc-accent);
  color: var(--zc-on-accent);
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* Links inside answers */
.zc-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.zc-link {
  padding: 4px 10px;
  border: 1px solid rgba(255, 107, 53, .4);
  border-radius: 999px;
  color: var(--zc-accent2);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.zc-link:hover { background: rgba(255, 107, 53, .12); border-color: var(--zc-accent); }

/* Typing indicator */
.zc-typing .zc-bubble { display: flex; gap: 4px; padding: 13px 14px; }
.zc-tdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zc-muted);
  animation: zc-bounce 1s infinite ease-in-out;
}
.zc-tdot:nth-child(2) { animation-delay: .15s; }
.zc-tdot:nth-child(3) { animation-delay: .3s; }
@keyframes zc-bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Suggestion chips */
.zc-chips {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.zc-chips::-webkit-scrollbar { display: none; }
.zc-chip {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--zc-border);
  border-radius: 999px;
  background: transparent;
  color: var(--zc-muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.zc-chip:hover { color: var(--zc-text); border-color: var(--zc-accent); background: rgba(255, 107, 53, .08); }

/* Input */
.zc-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--zc-border);
}
.zc-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--zc-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--zc-text);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  outline: none;
  transition: border-color .15s, background .15s;
}
.zc-input::placeholder { color: var(--zc-muted); }
.zc-input:focus { border-color: var(--zc-accent); background: rgba(255, 255, 255, .06); }
.zc-send {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--zc-accent);
  color: var(--zc-on-accent);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.zc-send:hover { background: var(--zc-accent2); }
.zc-send:active { transform: scale(.94); }
.zc-send svg { width: 18px; height: 18px; }

/* Small screens: near full-width sheet */
@media (max-width: 480px) {
  .zc-root { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .zc-panel {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    height: min(72dvh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zc-panel, .zc-msg, .zc-tdot { animation: none; }
  .zc-toggle, .zc-log { transition: none; scroll-behavior: auto; }
}


/* ═══════════════════════════════════════════════════════════
   PERFORMANCE — lighter glass on phones / touch screens
   The particle canvas animates behind every glass element, and each
   backdrop-filter has to re-blur what is behind it on every frame. These
   panels are already nearly opaque, so on touch devices the blur is dropped
   and the background made a little more solid. Desktop is unchanged.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px), (pointer: coarse) {
  nav.scrolled,
  .skill-card,
  .link-card,
  .verify-block,
  .tw-terminal,
  #copy-toast,
  .zc-panel {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  nav.scrolled { background: rgba(7, 9, 14, 0.97); }
  .skill-card  { background: rgba(13, 18, 25, 0.92); }
  .link-card   { background: rgba(13, 18, 25, 0.90); }
  .tw-terminal { background: rgba(5, 8, 12, 0.96); }
  .zc-panel    { background: rgba(13, 18, 25, 0.98); }
}
