/* ============================================================
   Angga Saputra — Personal Site
   Premium dark, cyber-tech, fully tweakable
   ============================================================ */

:root {
  /* Tokens — overridden by JS via setTweak */
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-glow: rgba(34, 211, 238, 0.4);

  --bg-0: #07080b;
  --bg-1: #0c0e13;
  --bg-2: #11141b;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f4f4f7;
  --text-muted: rgba(244, 244, 247, 0.62);
  --text-faint: rgba(244, 244, 247, 0.4);

  --font-display: 'Bricolage Grotesque', 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --bg-pattern: grid;
}

html[data-theme='light'] {
  --bg-0: #f6f5f0;
  --bg-1: #ecebe4;
  --bg-2: #1a1d24;          /* dark for terminal mocks in light theme */
  --surface: rgba(20, 22, 28, 0.04);
  --surface-hover: rgba(20, 22, 28, 0.07);
  --border: rgba(20, 22, 28, 0.1);
  --border-strong: rgba(20, 22, 28, 0.22);

  --text: #15171c;
  --text-muted: rgba(21, 23, 28, 0.7);
  --text-faint: rgba(21, 23, 28, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body { min-height: 100vh; }

/* ───────────────────────── Background patterns ───────────────────────── */
.bg-layer {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg-0);
}
.bg-layer::before {
  content: '';
  position: absolute; inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 80%);
}
html[data-bg='dots'] .bg-layer::before {
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
}
html[data-bg='solid'] .bg-layer::before { display: none; }
html[data-bg='noise'] .bg-layer::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.5'/></svg>");
  background-size: 180px 180px;
  opacity: 0.07;
  mask-image: none;
}

.bg-glow {
  position: fixed;
  width: 60vmax; height: 60vmax;
  left: 50%; top: -30vmax;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-glow), transparent 60%);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}
html[data-theme='light'] .bg-glow { opacity: 0.25; }

/* ───────────────────────── Layout ───────────────────────── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: 32px;
}
@media (max-width: 720px) {
  .container { padding-inline: 20px; }
}

/* ───────────────────────── Nav ───────────────────────── */
.nav {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 18px;
  background: color-mix(in oklab, var(--bg-1) 70%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.06) inset;
  max-width: calc(100vw - 24px);
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.nav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.nav-links {
  display: flex;
  gap: 2px;
}
.nav-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active { color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }

.nav-actions {
  display: flex;
  gap: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}
.icon-btn {
  appearance: none;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 14px; height: 14px; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav { padding: 6px 8px 6px 14px; }
}

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 40px;
  padding-block: 120px 60px;
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-block: 100px 40px; gap: 24px; }
}
@media (max-width: 560px) {
  .hero { padding-block: 90px 30px; }
}

.hero-content {
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.hero-eyebrow .pill {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.4vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 24px;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-title .stroke {
  -webkit-text-stroke: 2px currentColor;
  color: transparent;
  font-style: italic;
  display: inline-block;
}
html[data-theme='dark'] .hero-title .stroke {
  -webkit-text-stroke-color: rgba(255,255,255,0.9);
}
html[data-theme='light'] .hero-title .stroke {
  -webkit-text-stroke-color: rgba(14,15,18,0.9);
  -webkit-text-stroke-width: 2.5px;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-tagline::before {
  content: '$';
  color: var(--accent);
  font-weight: 600;
}
.hero-tagline .caret {
  display: inline-block;
  width: 9px; height: 16px;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-desc {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border: 0;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0a0b0e;
  box-shadow: 0 0 0 1px var(--accent),
    0 8px 28px var(--accent-glow),
    0 0 0 0 var(--accent) inset;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent),
    0 14px 40px var(--accent-glow);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--accent); color: var(--accent); }

.btn svg { width: 14px; height: 14px; }

/* Mobile-specific overflow fixes — long mono tagline forces grid column wider than viewport */
@media (max-width: 960px) {
  .hero-content, .hero-3d { min-width: 0; }
  .hero-tagline { align-items: flex-start; }
  .hero-tagline > span:first-of-type { flex: 1 1 auto; min-width: 0; word-break: break-word; }
  .hero-desc { max-width: 100%; }
}

/* Hero stats */
.hero-stats {
  margin-top: 56px;
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .hero-stats { margin-top: 36px; gap: 28px; }
}
.stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat-num .plus { color: var(--accent); }
.stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

/* Hero 3D */
.hero-3d {
  position: relative;
  height: clamp(360px, 60vh, 620px);
  width: 100%;
}
@media (max-width: 960px) {
  .hero-3d { height: clamp(320px, 50vh, 460px); }
}
@media (max-width: 560px) {
  .hero-3d { height: 320px; }
}
.hero-3d canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}
.hero-3d canvas:active { cursor: grabbing; }
.hero-3d-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.hero-3d-hint .kbd {
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
}

/* ───────────────────────── Section header ───────────────────────── */
.section {
  position: relative;
  padding-block: 80px;
  z-index: 1;
}
@media (max-width: 720px) {
  .section { padding-block: 60px; }
}
.section-head {
  margin-bottom: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .section-head { margin-bottom: 32px; }
}
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--accent);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 600;
  max-width: 800px;
}
.section-sub {
  color: var(--text-muted);
  max-width: 380px;
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

/* ───────────────────────── About ───────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } }

.about-text p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 18px;
  max-width: 56ch;
}
.about-text p strong { color: var(--text); font-weight: 500; }

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}
.about-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 32px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.about-card::after {
  content: '● ● ●';
  position: absolute;
  top: 8px; left: 14px;
  font-size: 8px;
  letter-spacing: 4px;
  color: var(--text-faint);
}
.about-card-title {
  position: absolute;
  top: 7px; left: 0; right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}
.about-card pre {
  margin: 40px 0 0;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
@media (max-width: 560px) {
  .about-card { padding: 20px; font-size: 12px; }
  .about-card pre { font-size: 11px; }
}
.about-card .k { color: #c084fc; }
.about-card .s { color: #fbbf24; }
.about-card .n { color: var(--accent); }
.about-card .c { color: var(--text-faint); font-style: italic; }

/* ───────────────────────── Tech stack ───────────────────────── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.tech-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  transition: all 0.25s ease;
  overflow: hidden;
  cursor: pointer;
}
.tech-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 200px at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklab, var(--tech-color, var(--accent)) 18%, transparent),
    transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.tech-card:hover {
  border-color: color-mix(in oklab, var(--tech-color, var(--accent)) 40%, var(--border));
  transform: translateY(-3px);
}
.tech-card:hover::before { opacity: 1; }
.tech-card .icon {
  width: 36px; height: 36px;
  margin-bottom: 14px;
  color: var(--tech-color, var(--accent));
  display: grid;
  place-items: center;
}
.tech-card .icon svg { width: 100%; height: 100%; }
.tech-card h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tech-card .role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tech-card .lvl {
  margin-top: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.tech-card .lvl::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--lvl, 80%);
  background: linear-gradient(90deg, var(--tech-color, var(--accent)), color-mix(in oklab, var(--tech-color, var(--accent)) 50%, transparent));
  border-radius: 2px;
}
.tech-card .lvl-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

/* ───────────────────────── Projects ───────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.project {
  position: relative;
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 340px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}
.project:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.project.featured { grid-column: span 8; }
.project.small { grid-column: span 4; min-height: 280px; }
@media (max-width: 980px) {
  .project, .project.featured, .project.small { grid-column: span 12; min-height: 300px; }
}
@media (max-width: 560px) {
  .project { padding: 20px; min-height: 280px; border-radius: 18px; }
  .project h3 { font-size: 21px; }
  .projects-grid { gap: 14px; }
}

.project-mock {
  position: relative;
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
  overflow: hidden;
  min-height: 160px;
}
.project-mock::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, color-mix(in oklab, var(--proj-color, var(--accent)) 30%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, color-mix(in oklab, var(--proj-color, var(--accent)) 20%, transparent), transparent 60%);
}
.project-mock-label {
  position: absolute;
  bottom: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.project-tag {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  background: color-mix(in oklab, var(--proj-color, var(--accent)) 16%, transparent);
  color: var(--proj-color, var(--accent));
  border-radius: 4px;
}
.project-arrow {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.project:hover .project-arrow {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0b0e;
  transform: rotate(-45deg);
}
.project-arrow svg { width: 14px; height: 14px; }

.project h3 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.project p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.project-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.project-stack span {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Project mock — phone */
.mock-phone {
  position: absolute;
  bottom: -10%; right: 8%;
  width: 38%; max-width: 160px;
  aspect-ratio: 9/19;
  border-radius: 22px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-0);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: rotate(-8deg);
  overflow: hidden;
}
.mock-phone::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 36%; height: 12px;
  background: var(--bg-0);
  border-radius: 0 0 8px 8px;
  z-index: 2;
}
.mock-phone-screen {
  position: absolute; inset: 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  padding: 24px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Project mock — desktop */
.mock-desk {
  position: absolute;
  bottom: -8%; right: -4%;
  width: 88%;
  aspect-ratio: 16/10;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.mock-desk-bar {
  height: 22px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
}
.mock-desk-bar i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
}
.mock-desk-content {
  padding: 14px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  height: calc(100% - 22px);
}

/* Tiny chart bits */
.bar {
  height: 5px;
  border-radius: 2px;
  background: var(--surface-hover);
}
.bar.fill { background: var(--proj-color, var(--accent)); }
.candle {
  flex: 1;
  background: linear-gradient(180deg, var(--proj-color, var(--accent)), transparent);
  border-radius: 2px;
  min-height: 8px;
}

/* ───────────────────────── Blog ───────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 780px) {
  .blog-grid { grid-template-columns: 1fr; }
}
.blog-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s ease;
  overflow: hidden;
}
.blog-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.blog-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-3px);
}
.blog-card:hover::before { transform: scaleY(1); }
.blog-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.blog-cat {
  padding: 3px 8px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.blog-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
  transition: color 0.2s ease;
}
.blog-card:hover .blog-title { color: var(--accent); }
.blog-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
.blog-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.blog-tags span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.blog-arrow {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.blog-arrow svg { width: 13px; height: 13px; }
.blog-card:hover .blog-arrow {
  background: var(--accent);
  color: #0a0b0e;
  border-color: var(--accent);
}
.blog-cta-wrap {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}
@media (max-width: 560px) {
  .blog-card { padding: 20px; }
  .blog-title { font-size: 19px; }
}

/* ───────────────────────── Contact ───────────────────────── */
.contact {
  position: relative;
  padding-block: 100px 120px;
  text-align: center;
}
@media (max-width: 720px) {
  .contact { padding-block: 70px 90px; }
  .contact-email { font-size: 18px !important; padding: 12px 18px; word-break: break-all; }
}
.contact-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 18px;
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0 0 12px;
}
.contact-title .gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-sub {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.contact-cta {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.contact-email {
  font-family: var(--font-mono);
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.25s ease;
  letter-spacing: -0.01em;
}
.contact-email:hover {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.contact-socials {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}
.social {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
  text-decoration: none;
}
.social:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.social svg { width: 18px; height: 18px; }

/* ───────────────────────── Footer ───────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.footer .col-r { display: flex; gap: 18px; }
.footer .live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer .live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* ───────────────────────── Loading screen ───────────────────────── */
.boot {
  position: fixed; inset: 0;
  z-index: 9999;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.boot.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.boot::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 0%, transparent 80%);
  opacity: 0.5;
}

.boot-inner {
  position: relative;
  width: min(540px, 92vw);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 100px var(--accent-glow);
}
.boot-bar {
  height: 28px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: var(--text-faint);
  position: relative;
  letter-spacing: 0.04em;
}
.boot-bar .dots { display: flex; gap: 6px; }
.boot-bar .dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: block;
}
.boot-bar .dots i:nth-child(1) { background: #ff5f57; }
.boot-bar .dots i:nth-child(2) { background: #febc2e; }
.boot-bar .dots i:nth-child(3) { background: #28c840; }
.boot-bar .title {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}

.boot-body {
  padding: 20px 22px 22px;
  font-size: 13px;
  line-height: 1.7;
  min-height: 260px;
  color: var(--text-muted);
}
.boot-body .ln { display: block; }
.boot-body .ok { color: #22c55e; font-weight: 600; }
.boot-body .warn { color: #fbbf24; font-weight: 600; }
.boot-body .info { color: var(--accent); font-weight: 600; }
.boot-body .em { color: var(--text); }
.boot-body .caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent);
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}
.boot-progress {
  margin-top: 14px;
  height: 4px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
}
.boot-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}
.boot-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Glitch loading variant */
.boot[data-style='glitch'] .boot-inner {
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: center;
}
.boot[data-style='glitch'] .boot-bar { display: none; }
.boot[data-style='glitch'] .boot-body {
  padding: 0;
  min-height: 0;
}
.glitch-logo {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 700;
  letter-spacing: -0.04em;
  position: relative;
  display: inline-block;
  color: var(--text);
}
.glitch-logo::before,
.glitch-logo::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
}
.glitch-logo::before {
  color: var(--accent);
  animation: glitch1 2.2s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}
.glitch-logo::after {
  color: var(--accent-2);
  animation: glitch2 1.8s infinite linear;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}
@keyframes glitch1 {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 2px); }
}
@keyframes glitch2 {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(3px, -1px); }
  50% { transform: translate(-2px, 1px); }
  75% { transform: translate(1px, -2px); }
}
.glitch-prog {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}

/* Minimal loading variant */
.boot[data-style='minimal'] .boot-inner {
  background: transparent;
  border: 0;
  box-shadow: none;
  text-align: center;
  width: auto;
}
.boot[data-style='minimal'] .boot-bar { display: none; }
.boot[data-style='minimal'] .boot-body {
  padding: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.minimal-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────────────────── Reveal on scroll ───────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* Selection */
::selection {
  background: var(--accent);
  color: #0a0b0e;
}

/* ─────────────── Light theme polish ─────────────── */
/* In light mode accent (cyan/violet/etc) is too light — derive a darker accent */
html[data-theme='light'] {
  --accent-text: color-mix(in oklab, var(--accent) 65%, #0c0e13);
}
html[data-theme='light'] .nav-link.active {
  color: var(--accent-text);
  background: color-mix(in oklab, var(--accent) 22%, transparent);
}
html[data-theme='light'] .nav-link:hover { color: var(--text); }

html[data-theme='light'] .hero-eyebrow .pill {
  background: var(--accent-text);
  color: #fff;
}
html[data-theme='light'] .section-eyebrow,
html[data-theme='light'] .contact-eyebrow,
html[data-theme='light'] .blog-cat {
  color: var(--accent-text);
}
html[data-theme='light'] .blog-cat {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
}
html[data-theme='light'] .section-eyebrow::before {
  background: var(--accent-text);
}
html[data-theme='light'] .project-tag {
  background: color-mix(in oklab, var(--proj-color, var(--accent)) 22%, transparent);
  color: color-mix(in oklab, var(--proj-color, var(--accent)) 60%, #0c0e13);
}
html[data-theme='light'] .stat-num .plus { color: var(--accent-text); }

html[data-theme='light'] .hero-tagline::before { color: var(--accent-text); }
html[data-theme='light'] .hero-tagline .caret { background: var(--accent-text); }

html[data-theme='light'] .nav-brand .dot { background: var(--accent-text); }
html[data-theme='light'] .footer .live::before {
  background: #16a34a;
  box-shadow: 0 0 8px #16a34a;
}

html[data-theme='light'] .bg-glow {
  opacity: 0.18;
  mix-blend-mode: multiply;
  filter: blur(40px);
}
html[data-theme='light'] .nav {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 28px rgba(20, 22, 28, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

/* Ghost button hover — text was cyan-on-white (invisible) */
html[data-theme='light'] .btn-ghost:hover {
  color: var(--accent-text);
  border-color: var(--accent-text);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
}
html[data-theme='light'] .contact-email:hover {
  color: var(--accent-text);
  border-color: var(--accent-text);
}

/* Tech card hover should darken to be visible */
html[data-theme='light'] .tech-card:hover {
  border-color: color-mix(in oklab, var(--tech-color, var(--accent)) 60%, #0c0e13);
}

/* Hero title accent gradient — darken end stops in light */
html[data-theme='light'] .hero-title .accent,
html[data-theme='light'] .contact-title .gradient {
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 70%, #0c0e13),
    color-mix(in oklab, var(--accent-2) 70%, #0c0e13));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* About card terminal — keep dark in light theme so syntax stays readable */
html[data-theme='light'] .about-card {
  background: #14171c;
  border-color: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.7);
  box-shadow: 0 20px 50px rgba(20,22,28,0.18);
}
html[data-theme='light'] .about-card::before { background: #0c0e13; border-color: rgba(255,255,255,0.06); }
html[data-theme='light'] .about-card::after { color: rgba(255,255,255,0.3); }
html[data-theme='light'] .about-card-title { color: rgba(255,255,255,0.4); }
html[data-theme='light'] .about-card .k { color: #c084fc; }
html[data-theme='light'] .about-card .s { color: #fbbf24; }
html[data-theme='light'] .about-card .n { color: #22d3ee; }

/* Project mocks — desktop & phone — keep dark for screen-like feel */
html[data-theme='light'] .mock-desk {
  background: #14171c;
  box-shadow: 0 24px 50px rgba(20, 22, 28, 0.22);
  border-color: rgba(20,22,28,0.18);
}
html[data-theme='light'] .mock-desk-bar { background: #0c0e13; border-color: rgba(255,255,255,0.08); }
html[data-theme='light'] .mock-desk .bar { background: rgba(255,255,255,0.08); }
html[data-theme='light'] .mock-desk-content > div:first-child > div { background: rgba(255,255,255,0.1) !important; }

html[data-theme='light'] .mock-phone {
  background: #14171c;
  border-color: rgba(20,22,28,0.22);
  box-shadow: 0 24px 50px rgba(20, 22, 28, 0.25);
}
html[data-theme='light'] .mock-phone::before { background: #0c0e13; }
html[data-theme='light'] .mock-phone-screen {
  background: linear-gradient(180deg, #1a1d24, #0c0e13);
}
html[data-theme='light'] .mock-phone-screen .bar { background: rgba(255,255,255,0.08); }

/* Project mock gradient surface — needs a dark base in light theme */
html[data-theme='light'] .project-mock {
  background: linear-gradient(135deg, #14171c, #0c0e13);
  border-color: rgba(20,22,28,0.16);
}
html[data-theme='light'] .project-mock-label { color: rgba(255,255,255,0.4); }

/* Boot screen in light: still dark, looks premium */
html[data-theme='light'] .boot {
  background: #0a0b0e;
  color: rgba(255,255,255,0.75);
}
html[data-theme='light'] .boot::before {
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
}
html[data-theme='light'] .boot-inner {
  background: #12141a;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme='light'] .boot-bar {
  background: #0c0e13;
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
}
html[data-theme='light'] .boot-body { color: rgba(255,255,255,0.6); }
html[data-theme='light'] .boot-body .em { color: #fff; }
html[data-theme='light'] .boot-progress { background: rgba(255,255,255,0.08); }

/* Tech cards — slight dark overlay for better contrast vs near-white bg */
html[data-theme='light'] .tech-card {
  background: #fff;
  box-shadow: 0 4px 14px rgba(20,22,28,0.04),
    0 1px 0 rgba(255,255,255,0.8) inset;
}
html[data-theme='light'] .tech-card:hover {
  box-shadow: 0 16px 36px rgba(20,22,28,0.12);
}

/* Project cards: white surface with subtle shadow */
html[data-theme='light'] .project {
  background: #fff;
  box-shadow: 0 4px 14px rgba(20,22,28,0.05);
}
html[data-theme='light'] .project:hover {
  box-shadow: 0 24px 60px rgba(20,22,28,0.18);
}
html[data-theme='light'] .project-arrow {
  background: #f4f3ee;
  border-color: rgba(20,22,28,0.1);
}
html[data-theme='light'] .project-stack span {
  background: #f4f3ee;
  border-color: rgba(20,22,28,0.08);
}

/* Blog cards */
html[data-theme='light'] .blog-card {
  background: #fff;
  box-shadow: 0 4px 14px rgba(20,22,28,0.05);
}
html[data-theme='light'] .blog-card:hover {
  background: #fff;
  box-shadow: 0 20px 44px rgba(20,22,28,0.14);
}

/* Contact email card */
html[data-theme='light'] .contact-email {
  background: #fff;
  box-shadow: 0 4px 14px rgba(20,22,28,0.06);
}

/* Primary button in light: darken accent bg so text stays high-contrast */
html[data-theme='light'] .btn-primary {
  background: var(--accent-text);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent-text),
    0 8px 24px color-mix(in oklab, var(--accent-text) 30%, transparent);
}
html[data-theme='light'] .btn-primary:hover {
  box-shadow: 0 0 0 1px var(--accent-text),
    0 14px 36px color-mix(in oklab, var(--accent-text) 40%, transparent);
}

/* Hero stat number — keep dark and crisp */
html[data-theme='light'] .stat-num { color: #15171c; }

/* Selection */
html[data-theme='light'] ::selection { color: #fff; }

/* Hero eyebrow + pill */
html[data-theme='light'] .hero-eyebrow { background: rgba(255,255,255,0.6); }
