:root {
  --bg: #0a0b10;
  --surface: #11131a;
  --surface-2: #0d0f16;
  --text: #d6d9e9;
  --muted: #8c91ab;
  --accent: #22e3ff; /* locked cyber blue */
  --radius: 14px;
  --shadow: 0 0 0.5px rgba(255,255,255,0.1), 0 10px 30px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 64px; /* offset for fixed header */
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 600px at 10% 10%, rgba(34, 227, 255, 0.09), transparent 60%),
    radial-gradient(800px 500px at 80% 20%, rgba(255, 43, 209, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 30% 80%, rgba(166, 255, 0, 0.06), transparent 60%);
}

.background::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  mask-image: radial-gradient(100% 100% at 50% 50%, black, transparent 70%);
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(255,255,255,0.015) 3px,
    rgba(0,0,0,0) 4px
  );
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  backdrop-filter: saturate(140%) blur(8px);
  background: linear-gradient( to bottom, rgba(10,11,16,0.75), rgba(10,11,16,0.35) );
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__logo {
  font-family: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, "Liberation Mono", monospace;
  color: var(--accent);
  text-shadow: 0 0 12px color-mix(in oklab, var(--accent), black 60%);
}
.brand__text { opacity: 0.9; letter-spacing: 0.4px; }

.menu { display: none; gap: 18px; }
.menu__link { color: var(--text); text-decoration: none; opacity: 0.8; font-weight: 500; }
.menu__link:hover { color: white; opacity: 1; text-shadow: 0 0 10px color-mix(in oklab, var(--accent), white 10%); }

/* Ensure nav overlays content reliably */
.nav * { position: relative; }

/* CSS-only 'active' nav link via :target (click-based) */
body:not(:has(:target)) .menu__link[href="#home"],
:root:has(#home:target) .menu__link[href="#home"],
:root:has(#skills:target) .menu__link[href="#skills"],
:root:has(#projects:target) .menu__link[href="#projects"],
:root:has(#experience:target) .menu__link[href="#experience"],
:root:has(#contact:target) .menu__link[href="#contact"] {
  color: white; opacity: 1;
  text-shadow: 0 0 10px color-mix(in oklab, var(--accent), white 10%);
}

/* color picker removed */

@media (min-width: 900px) { .menu { display: flex; } }

/* Sections */
.section { padding: 40px 0; }
.section__title {
  font-size: clamp(22px, 3.5vw, 30px);
  margin: 0 0 22px;
  letter-spacing: 0.4px;
}
.muted { color: var(--muted); }
.lede { color: #c4c9df; max-width: 72ch; }

/* Hero */
.hero__inner { display: grid; gap: 36px; align-items: center; }
.hero__copy { display: grid; gap: 18px; }
.hero__panel { display: none; }
.eyebrow {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: #aab1cd; opacity: 0.9;
}

.glitch {
  font-size: clamp(28px, 5.4vw, 54px);
  line-height: 1.08;
  font-weight: 800;
  position: relative;
  text-shadow: 0 0 18px color-mix(in oklab, var(--accent), black 60%);
}
.glitch::before, .glitch::after {
  content: attr(data-glitch);
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
}
.glitch::before { transform: translate(1px, -1px); color: #22e3ff; clip-path: polygon(0 2%, 100% 2%, 100% 44%, 0 44%); animation: glitchTop 3.5s infinite linear alternate-reverse; }
.glitch::after { transform: translate(-1px, 1px); color: #ff2bd1; clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); animation: glitchBot 3.8s infinite linear alternate-reverse; }
@keyframes glitchTop { 0%{transform:translate(1px,-1px)} 50%{transform:translate(2px,-2px)} 100%{transform:translate(0,0)} }
@keyframes glitchBot { 0%{transform:translate(-1px,1px)} 50%{transform:translate(-2px,2px)} 100%{transform:translate(0,0)} }

.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  --bcol: color-mix(in oklab, var(--accent), white 8%);
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: white; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px; padding: 10px 14px;
  background: linear-gradient( to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0.02) );
  box-shadow: 0 0 0 1px var(--bcol) inset, 0 12px 30px rgba(0,0,0,0.4);
}
.btn:hover { box-shadow: 0 0 0 1px var(--bcol) inset, 0 0 24px color-mix(in oklab, var(--accent), black 30%); transform: translateY(-1px); }
.btn--primary { background: linear-gradient( to bottom, color-mix(in oklab, var(--accent), white 12%), var(--accent) ); color: #140814; border-color: transparent; text-shadow: 0 1px 0 rgba(255,255,255,0.2); }
.btn--ghost { background: rgba(255,255,255,0.03); }
.btn--tiny { padding: 8px 10px; font-size: 13px; border-radius: 10px; }
.icon { width: 18px; height: 18px; }

.social { display: flex; gap: 12px; }
.social__link { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; color: var(--muted); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; background: rgba(255,255,255,0.03); }
.social__link:hover { color: white; border-color: color-mix(in oklab, var(--accent), white 8%); box-shadow: 0 0 18px color-mix(in oklab, var(--accent), black 40%); }

@media (min-width: 980px) {
  .hero__inner { grid-template-columns: 1.2fr 1fr; }
  .hero__panel { display: block; }
}

/* Terminal panel */
.terminal {
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklab, var(--accent), #000 70%) inset;
  overflow: hidden;
}
.terminal__header { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.25); }
.terminal__title { margin-left: auto; color: var(--muted); font-size: 12px; letter-spacing: 0.3px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #ffbd2e; }
.dot--green { background: #28c840; }
.terminal__body { margin: 0; padding: 14px 16px; color: #cfe3ff; font-size: 13px; overflow: auto; max-height: 380px; background: radial-gradient(120% 120% at 0% 0%, rgba(34,227,255,0.08), transparent 50%), rgba(0,0,0,0.1); }
.terminal__body code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; white-space: pre-wrap; display: block; }

/* Windows 11 style caption bar */
.terminal__header--win11 {
  height: 40px;
  padding: 0 6px 0 12px;
  gap: 0;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.12));
}
.terminal__header--win11 .terminal__title {
  margin: 0;
  color: #cbd2ef;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.win-controls { display: flex; margin-left: auto; }
.win-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 46px; height: 40px;
  border: none; outline: none;
  background: transparent; color: var(--muted);
  position: relative; cursor: default;
}
.win-btn::before {
  content: '';
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: currentColor; font-size: 14px; line-height: 1;
}
.win-min::before { content: '–'; transform: translate(-50%, -55%); }
.win-max::before { content: '□'; font-size: 12px; }
.win-close::before { content: '×'; font-size: 16px; }
.win-btn:hover { background: rgba(255,255,255,0.06); color: #e7ebff; }
.win-close:hover { background: #c42b1c; color: #fff; }

/* Tiny app icon for Win11 caption bar */
.app-icon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent), white 22%), color-mix(in oklab, var(--accent), black 30%));
  border: 1px solid color-mix(in oklab, var(--accent), black 30%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 0 12px color-mix(in oklab, var(--accent), black 60%);
}

/* Pills */
.pill-groups { display: grid; gap: 18px; }
.pill-group { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.10); padding: 16px; border-radius: 16px; box-shadow: var(--shadow); }
.pill-group__title { color: #cbd2ef; font-weight: 700; margin-bottom: 10px; letter-spacing: 0.3px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: linear-gradient( to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0.03) ); border: 1px solid rgba(255,255,255,0.14); padding: 6px 10px; border-radius: 999px; font-size: 13px; box-shadow: 0 0 12px rgba(0,0,0,0.3); }

@media (min-width: 900px) { .pill-groups { grid-template-columns: 1fr 1fr; } }

/* Projects */
.grid.projects { display: grid; gap: 18px; }
@media (min-width: 760px) { .grid.projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid.projects { grid-template-columns: repeat(4, 1fr); } }

/* Pure-CSS hover tilt approximation */
.grid.projects { perspective: 900px; }
.tilt { transform-style: preserve-3d; transition: transform 180ms ease, box-shadow 200ms ease; }
.tilt:hover { transform: translateY(-6px) rotateX(3deg) rotateY(4deg); }

.card {
  position: relative;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card:hover {
  border-color: color-mix(in oklab, var(--accent), white 10%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent), white 10%) inset, 0 10px 30px rgba(0,0,0,0.6), 0 0 30px color-mix(in oklab, var(--accent), black 50%);
}
.card__title { margin: 0 0 6px; font-size: 18px; }
.card__desc { margin: 0 0 12px; color: #c7cbe0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tags span { font-size: 12px; color: #b7bfdc; border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 4px 8px; }
.card__actions { display: flex; gap: 8px; }

/* Timeline */
.timeline { position: relative; margin-left: 14px; }
.timeline::before { content: ""; position: absolute; left: -14px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--accent), rgba(255,255,255,0.1)); box-shadow: 0 0 12px color-mix(in oklab, var(--accent), black 50%); }
.timeline__item { position: relative; padding: 0 0 18px 0; }
.timeline__dot { position: absolute; left: -19px; top: 6px; width: 12px; height: 12px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 16px color-mix(in oklab, var(--accent), black 30%); border: 2px solid rgba(0,0,0,0.6); }
.timeline__content { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.10); padding: 12px 14px; border-radius: 12px; }
.timeline__content ul { margin: 8px 0 0 18px; padding: 0; }
.timeline__content li { margin: 4px 0; color: #c7cbe0; }

/* Writing list */
.list { display: grid; gap: 10px; }
.list__item { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--text); background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.10); }
.list__item:hover { border-color: color-mix(in oklab, var(--accent), white 10%); box-shadow: 0 0 20px color-mix(in oklab, var(--accent), black 60%); }
.list__title { font-weight: 700; }
.list__meta { color: var(--muted); font-size: 14px; }

/* Contact */
.contact { display: grid; gap: 14px; }
.contact__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* About */
.about { display: grid; gap: 12px; }
.about__points { margin: 4px 0 0 0; padding-left: 0; list-style-position: inside; }
.about__points li { color: #c7cbe0; margin: 4px 0; }
.about__box .lede { margin: 0 0 8px; }

/* Footer */
.footer { padding: 36px 0; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all 220ms ease; background: rgba(20,22,30,0.9); border: 1px solid rgba(255,255,255,0.14); color: var(--text); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Utilities */
a { color: color-mix(in oklab, var(--accent), white 20%); }
a:hover { color: white; text-shadow: 0 0 12px color-mix(in oklab, var(--accent), black 60%); }

/* Tilt baseline so it looks nice even without JS */
.tilt { will-change: transform; transform-style: preserve-3d; }

/* Responsive spacing tweaks */
@media (max-width: 560px) {
  .section { padding: 32px 0; }
}

/* Ensure bottom sections can align under sticky header */
main { padding-bottom: 120px; }
