/* =====================================================================
   HAFSA MEHDI — CYBER PORTFOLIO
   ===================================================================== */
:root {
  --bg: #04060d;
  --bg-2: #070b17;
  --panel: rgba(10, 18, 36, 0.55);
  --line: rgba(0, 240, 255, 0.18);
  --cyan: #00f0ff;
  --violet: #b14dff;
  --pink: #ff2e88;
  --green: #39ff88;
  --text: #d7e3f4;
  --muted: #7d8aa5;
  --glow: 0 0 12px rgba(0, 240, 255, 0.6), 0 0 32px rgba(0, 240, 255, 0.25);
  --f-display: "Orbitron", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --f-body: "Space Grotesk", system-ui, sans-serif;
  --pad: clamp(16px, 5vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-booting { overflow: hidden; }
::selection { background: var(--cyan); color: var(--bg); }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--f-mono); }
.ok { color: var(--green); }
.blink { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--cyan), var(--violet)); border-radius: 8px; }

/* ---------------- BOOT ---------------- */
#boot {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  transition: opacity .8s ease, visibility .8s, clip-path 1s cubic-bezier(.77,0,.18,1);
  clip-path: inset(0 0 0 0);
}
#boot.done { opacity: 0; visibility: hidden; clip-path: inset(50% 0 50% 0); }
.boot-inner { width: min(640px, 90vw); }
#boot-log {
  margin: 0 0 24px; min-height: 260px; color: var(--cyan);
  font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  text-shadow: 0 0 8px rgba(0,240,255,.5);
}
#boot-log .ok { color: var(--green); }
#boot-log .warn { color: var(--pink); }
.boot-bar { height: 3px; background: rgba(0,240,255,.12); overflow: hidden; }
#boot-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: var(--glow); transition: width .1s linear; }
.boot-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--muted); letter-spacing: .2em; }
.boot-skip {
  position: absolute; bottom: 28px; right: 28px; background: none; border: 1px solid var(--line);
  color: var(--muted); font-family: var(--f-mono); padding: 6px 14px; cursor: pointer;
}
.boot-skip:hover { color: var(--cyan); border-color: var(--cyan); }

/* ---------------- FX LAYERS ---------------- */
#bg-matrix, #bg-net { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg-matrix { z-index: 0; opacity: .14; }
#bg-net { z-index: 1; }
.fx-grid {
  position: fixed; inset: -50% -50% 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,240,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,.06) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(600px) rotateX(62deg) translateY(var(--grid-y, 0px));
  transform-origin: center top;
  mask-image: linear-gradient(to top, #000 0%, transparent 65%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 65%);
  top: 40%;
}
.fx-scan {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.22) 3px 3px);
  mix-blend-mode: multiply;
}
.fx-scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 140px;
  background: linear-gradient(to bottom, transparent, rgba(0,240,255,.05), transparent);
  animation: scanline 7s linear infinite;
}
@keyframes scanline { from { top: -140px; } to { top: 100%; } }
.fx-noise {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- CURSOR ---------------- */
.cursor { position: fixed; inset: 0; z-index: 999; pointer-events: none; }
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.cursor-dot { width: 6px; height: 6px; background: var(--cyan); box-shadow: var(--glow); }
.cursor-ring {
  width: 38px; height: 38px; border: 1px solid rgba(0,240,255,.6);
  transition: width .25s, height .25s, border-color .25s, background .25s;
}
.cursor.hover .cursor-ring { width: 64px; height: 64px; border-color: var(--violet); background: rgba(177,77,255,.08); }
@media (hover: hover) and (pointer: fine) { body, a, button { cursor: none; } input { cursor: text; } }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------------- PROGRESS + HUD ---------------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
#progress-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); box-shadow: var(--glow); }

.hud { position: fixed; inset: 0; z-index: 40; pointer-events: none; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.hud > div { position: absolute; padding: 10px 14px; }
.hud > div::before { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--cyan); opacity: .7; }
.hud-tl { top: 70px; left: 12px; } .hud-tl::before { top: 0; left: 0; border-right: 0 !important; border-bottom: 0 !important; }
.hud-tr { top: 70px; right: 12px; } .hud-tr::before { top: 0; right: 0; border-left: 0 !important; border-bottom: 0 !important; }
.hud-bl { bottom: 12px; left: 12px; } .hud-bl::before { bottom: 0; left: 0; border-right: 0 !important; border-top: 0 !important; }
.hud-br { bottom: 12px; right: 12px; } .hud-br::before { bottom: 0; right: 0; border-left: 0 !important; border-top: 0 !important; }
.hud .blink { color: var(--green); }
@media (max-width: 900px) { .hud { display: none; } }

/* ---------------- NAV ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  transition: background .3s, backdrop-filter .3s, padding .3s, transform .4s;
}
.nav.scrolled { background: rgba(4,6,13,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.nav.hidden { transform: translateY(-100%); }
.logo { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-family: var(--f-display); font-weight: 900; letter-spacing: .12em; font-size: 15px; }
.logo span { color: var(--text); } .logo b { color: var(--cyan); }
.nav-links { display: flex; gap: 6px; font-family: var(--f-mono); font-size: 13px; }
.nav-links a { padding: 6px 10px; color: var(--muted); position: relative; transition: color .2s; }
.nav-links a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 1px; background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-cta { border: 1px solid var(--cyan); color: var(--cyan) !important; }
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--cyan); color: var(--bg) !important; box-shadow: var(--glow); }
.burger { display: none; background: none; border: 0; width: 36px; height: 36px; position: relative; }
.burger span { position: absolute; left: 6px; right: 6px; height: 2px; background: var(--cyan); transition: transform .3s, top .3s; }
.burger span:first-child { top: 13px; } .burger span:last-child { top: 21px; }
.burger[aria-expanded="true"] span:first-child { top: 17px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 17px; transform: rotate(-45deg); }
@media (max-width: 960px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; align-items: center; gap: 18px;
    background: rgba(4,6,13,.96); backdrop-filter: blur(16px); font-size: 20px;
    clip-path: circle(0% at calc(100% - 40px) 34px); transition: clip-path .6s cubic-bezier(.77,0,.18,1);
    z-index: -1;
  }
  .nav-links.open { clip-path: circle(150% at calc(100% - 40px) 34px); }
}

/* ---------------- LAYOUT ---------------- */
main { position: relative; z-index: 3; }
.section { position: relative; padding: clamp(90px, 14vh, 160px) var(--pad); max-width: 1320px; margin: 0 auto; }
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: 56px; }
.section-no { color: var(--cyan); font-size: 14px; border: 1px solid var(--line); padding: 4px 10px; }
.section-head h2 { margin: 0; font-family: var(--f-display); font-weight: 900; letter-spacing: .08em; font-size: clamp(28px, 5vw, 56px); line-height: 1; background: linear-gradient(90deg, #fff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); position: relative; overflow: hidden; }
.section-line::after { content: ""; position: absolute; inset: 0; width: 30%; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: line-run 3.5s linear infinite; }
@keyframes line-run { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
.sub { color: var(--cyan); font-weight: 500; font-size: 14px; letter-spacing: .1em; margin: 80px 0 24px; }
.tag { color: var(--cyan); letter-spacing: .2em; font-size: 12px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); filter: blur(6px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1), filter 1s; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------------- HERO ---------------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--pad) 80px; position: relative; overflow: hidden; }
#globe { position: absolute; right: -8vw; top: 50%; transform: translateY(-50%); width: min(70vw, 820px); height: min(70vw, 820px); opacity: .9; z-index: 0; }
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-pre { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; }
.hero-pre b { color: var(--green); }
.hero-pre .tag { color: var(--green); margin-right: 8px; }
.glitch {
  position: relative; margin: 18px 0 10px;
  font-family: var(--f-display); font-weight: 900; line-height: .92; letter-spacing: .02em;
  font-size: clamp(52px, 11vw, 150px);
  color: #fff;
  text-shadow: 0 0 30px rgba(0,240,255,.35);
}
.glitch .ch { display: inline-block; opacity: 0; transform: translateY(60px) rotateX(-90deg); transition: opacity .6s, transform .8s cubic-bezier(.2,.9,.3,1.3); transition-delay: calc(var(--i) * 45ms); }
.glitch.in .ch { opacity: 1; transform: none; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.glitch.in::before { opacity: .8; color: var(--cyan); animation: glitch-a 3.2s infinite steps(1); mix-blend-mode: screen; }
.glitch.in::after { opacity: .8; color: var(--pink); animation: glitch-b 2.7s infinite steps(1); mix-blend-mode: screen; }
@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  87% { clip-path: inset(10% 0 60% 0); transform: translate(-6px, 2px); }
  90% { clip-path: inset(55% 0 20% 0); transform: translate(5px, -2px); }
  94% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, 1px); }
}
@keyframes glitch-b {
  0%, 82%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  83% { clip-path: inset(70% 0 5% 0); transform: translate(6px, 0); }
  88% { clip-path: inset(20% 0 65% 0); transform: translate(-5px, 2px); }
  92% { clip-path: inset(45% 0 35% 0); transform: translate(4px, -1px); }
}
.hero-role { font-size: clamp(16px, 2.2vw, 24px); color: var(--cyan); margin: 0 0 18px; min-height: 1.6em; }
.caret { animation: blink .9s steps(2) infinite; }
.hero-tag { font-size: clamp(16px, 1.6vw, 20px); color: var(--muted); max-width: 620px; margin: 0 0 36px; }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-chips { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; }
.hero-chips li { border: 1px solid var(--line); background: var(--panel); padding: 6px 12px; backdrop-filter: blur(6px); }
.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .4em; color: var(--muted); z-index: 2; }
.scroll-hint i { width: 1px; height: 50px; background: linear-gradient(var(--cyan), transparent); position: relative; overflow: hidden; }
.scroll-hint i::after { content: ""; position: absolute; left: -1px; width: 3px; height: 12px; background: var(--cyan); box-shadow: var(--glow); animation: drip 1.8s ease-in infinite; }
@keyframes drip { from { top: -12px; } to { top: 50px; } }
@media (max-width: 760px) { #globe { right: -40vw; opacity: .45; width: 120vw; height: 120vw; } }

/* ---------------- BUTTONS ---------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 30px; font-family: var(--f-mono); font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  overflow: hidden; transition: color .3s, box-shadow .3s; will-change: transform;
}
.btn span { position: relative; z-index: 1; }
.btn-primary { background: var(--cyan); color: var(--bg); font-weight: 700; }
.btn-primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--violet), var(--pink)); transform: translateX(-101%); transition: transform .45s cubic-bezier(.77,0,.18,1); }
.btn-primary:hover { color: #fff; box-shadow: 0 0 40px rgba(177,77,255,.6); }
.btn-primary:hover::before { transform: none; }
.btn-ghost { color: var(--cyan); background: rgba(0,240,255,.05); box-shadow: inset 0 0 0 1px var(--cyan); }
.btn-ghost:hover { background: rgba(0,240,255,.14); box-shadow: inset 0 0 0 1px var(--cyan), var(--glow); }

/* ---------------- MARQUEE ---------------- */
.marquee { position: relative; z-index: 3; overflow: hidden; border-block: 1px solid var(--line); background: rgba(0,240,255,.03); padding: 18px 0; transform: rotate(-2deg) scale(1.05); margin: 40px 0; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; font-family: var(--f-display); font-weight: 700; font-size: clamp(18px, 2.4vw, 30px); letter-spacing: .1em; white-space: nowrap; }
.marquee-track span { color: transparent; -webkit-text-stroke: 1px rgba(0,240,255,.7); }
.marquee-track span:nth-child(3n) { color: var(--cyan); -webkit-text-stroke: 0; text-shadow: var(--glow); }
.marquee-track i { color: var(--violet); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- ABOUT ---------------- */
.about-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } .id-card { max-width: 420px; } }
.id-card {
  position: relative; padding: 24px; background: linear-gradient(160deg, rgba(0,240,255,.08), rgba(177,77,255,.06) 60%, rgba(4,6,13,.6));
  border: 1px solid var(--line); backdrop-filter: blur(10px); transform-style: preserve-3d; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
  transition: transform .15s ease-out;
}
.id-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(0,240,255,.18), transparent 40%); pointer-events: none; }
.id-scan { position: absolute; left: 0; right: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); animation: id-scan 4s ease-in-out infinite; opacity: .7; }
@keyframes id-scan { 0%,100% { top: 0; } 50% { top: 100%; } }
.id-top { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.id-avatar { width: 190px; height: 190px; margin: 22px auto; transform: translateZ(40px); }
.spin-slow { transform-origin: center; animation: spin 18s linear infinite; }
.spin-rev { transform-origin: center; animation: spin 12s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.id-fields { margin: 0; font-size: 12.5px; }
.id-fields div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.id-fields dt { color: var(--muted); letter-spacing: .14em; }
.id-fields dd { margin: 0; text-align: right; color: var(--text); }
.id-barcode { height: 34px; margin-top: 18px; background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 4px, var(--text) 4px 5px, transparent 5px 9px, var(--text) 9px 12px, transparent 12px 14px); opacity: .5; }
.about-text p { font-size: clamp(17px, 1.5vw, 20px); color: var(--text); margin: 0 0 22px; }
.about-text p b { color: var(--cyan); font-weight: 600; }
.about-text p:first-child { font-size: clamp(20px, 2vw, 26px); color: #fff; line-height: 1.5; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
.stat { padding: 22px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); transition: width 1.4s cubic-bezier(.2,.7,.2,1) .3s; }
.stat.in::after { width: 100%; }
.stat b { display: block; font-family: var(--f-display); font-size: clamp(34px, 4vw, 52px); font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 0 24px rgba(0,240,255,.4); }
.stat span { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }

/* ---------------- SKILLS ---------------- */
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 900px) { .skills-grid { grid-template-columns: 1fr; } }
.radar-wrap { position: relative; aspect-ratio: 1; max-width: 520px; width: 100%; margin: 0 auto; }
#radar { width: 100%; height: 100%; }
.radar-sweep { position: absolute; inset: 9%; border-radius: 50%; background: conic-gradient(from 0deg, rgba(0,240,255,.28), transparent 18%); animation: spin 5s linear infinite; mix-blend-mode: screen; pointer-events: none; }
.bar { margin-bottom: 26px; }
.bar-head { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 14px; margin-bottom: 10px; }
.bar-head span:last-child { color: var(--cyan); }
.bar-track { height: 8px; background: rgba(0,240,255,.08); position: relative; overflow: hidden; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.bar-fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: var(--glow); transition: width 1.6s cubic-bezier(.2,.7,.2,1); }
.bar-fill::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(4,6,13,.6) 6px 8px); }
.hex-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.hex {
  font-family: var(--f-mono); font-size: 13px; padding: 12px 20px; border: 1px solid var(--line); background: var(--panel);
  position: relative; transition: transform .3s, border-color .3s, color .3s, box-shadow .3s; overflow: hidden;
}
.hex::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(0,240,255,.25), transparent 70%); transform: translateX(-100%); transition: transform .6s; }
.hex:hover { transform: translateY(-4px); border-color: var(--cyan); color: var(--cyan); box-shadow: var(--glow); }
.hex:hover::before { transform: translateX(100%); }

/* ---------------- TIMELINE ---------------- */
.timeline { position: relative; padding-left: 0; }
.timeline-rail { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--line); transform: translateX(-50%); }
#timeline-fill { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: linear-gradient(var(--cyan), var(--violet)); box-shadow: var(--glow); }
.t-item { position: relative; width: 50%; padding: 0 56px 64px 0; }
.t-item:nth-child(odd) { margin-left: 50%; padding: 0 0 64px 56px; }
.t-node { position: absolute; top: 6px; right: -9px; width: 18px; height: 18px; border: 2px solid var(--cyan); background: var(--bg); transform: rotate(45deg); transition: background .4s, box-shadow .4s; }
.t-item:nth-child(odd) .t-node { right: auto; left: -9px; }
.t-item.in .t-node { background: var(--cyan); box-shadow: var(--glow); }
.t-card { padding: 26px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(8px); position: relative; transition: border-color .3s, transform .3s; }
.t-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.t-when { font-family: var(--f-mono); font-size: 12px; color: var(--cyan); letter-spacing: .12em; }
.t-tag { float: right; font-family: var(--f-mono); font-size: 10px; letter-spacing: .2em; padding: 3px 8px; border: 1px solid currentColor; color: var(--violet); }
.t-tag.EDUCATION { color: var(--green); } .t-tag.CERTIFICATION { color: var(--pink); }
.t-card h3 { font-family: var(--f-display); font-size: clamp(18px, 2vw, 22px); margin: 10px 0 4px; color: #fff; letter-spacing: .03em; }
.t-org { color: var(--text); font-weight: 500; margin: 0; }
.t-place { color: var(--muted); font-size: 13px; font-family: var(--f-mono); margin: 2px 0 12px; }
.t-card p:last-child { color: var(--muted); margin: 0; font-size: 15px; }
.t-item.reveal { transform: translateX(-60px); }
.t-item:nth-child(odd).reveal { transform: translateX(60px); }
.t-item.reveal.in { transform: none; }
@media (max-width: 760px) {
  .timeline-rail { left: 9px; transform: none; }
  .t-item, .t-item:nth-child(odd) { width: 100%; margin-left: 0; padding: 0 0 44px 40px; }
  .t-node, .t-item:nth-child(odd) .t-node { left: 1px; right: auto; }
  .t-item.reveal, .t-item:nth-child(odd).reveal { transform: translateX(40px); }
}

/* ---------------- PROJECTS ---------------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; perspective: 1200px; }
.p-card {
  position: relative; padding: 30px; min-height: 290px; display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(10,18,36,.85), rgba(4,6,13,.85)); border: 1px solid var(--line);
  transform-style: preserve-3d; transition: transform .2s ease-out, border-color .3s;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.p-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(0,240,255,.16), transparent 40%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.p-card:hover { border-color: rgba(0,240,255,.6); }
.p-card:hover::before { opacity: 1; }
.p-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: .14em; transform: translateZ(30px); }
.p-top .ok::before { content: "● "; }
.p-icon { width: 54px; height: 54px; margin: 26px 0 18px; color: var(--cyan); transform: translateZ(50px); filter: drop-shadow(0 0 10px rgba(0,240,255,.6)); }
.p-card h3 { font-family: var(--f-display); font-size: 21px; margin: 0 0 10px; color: #fff; letter-spacing: .03em; transform: translateZ(40px); }
.p-card p { color: var(--muted); font-size: 15px; margin: 0 0 22px; flex: 1; transform: translateZ(20px); }
.p-stack { display: flex; flex-wrap: wrap; gap: 8px; transform: translateZ(30px); }
.p-stack span { font-family: var(--f-mono); font-size: 11px; color: var(--cyan); padding: 3px 9px; background: rgba(0,240,255,.08); border: 1px solid var(--line); }
.p-corner { position: absolute; top: 0; right: 0; width: 22px; height: 22px; background: linear-gradient(225deg, var(--cyan) 50%, transparent 50%); opacity: .7; }

/* ---------------- CERTS ---------------- */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 24px; }
.c-card { display: flex; gap: 22px; align-items: center; padding: 26px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; transition: border-color .3s, transform .3s; }
.c-card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.c-card::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.12), transparent); transform: skewX(-20deg); transition: left .8s; }
.c-card:hover::after { left: 130%; }
.c-badge { flex: none; width: 72px; height: 72px; display: grid; place-items: center; color: var(--cyan); }
.c-badge svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(0,240,255,.5)); }
.c-card h3 { font-family: var(--f-display); font-size: 18px; color: #fff; margin: 0 0 4px; letter-spacing: .03em; }
.c-card p { margin: 0; color: var(--muted); font-size: 14px; }
.c-meta { font-family: var(--f-mono); font-size: 12px; color: var(--cyan) !important; margin-top: 8px !important; }
.c-verified { position: absolute; top: 14px; right: 14px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .2em; color: var(--green); }

/* ---------------- TERMINAL ---------------- */
.term { max-width: 960px; margin: 0 auto; border: 1px solid var(--line); background: rgba(3,6,14,.88); box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(0,240,255,.05), 0 0 60px rgba(0,240,255,.08); backdrop-filter: blur(10px); border-radius: 10px; overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(0,240,255,.05); border-bottom: 1px solid var(--line); }
.dot { width: 12px; height: 12px; border-radius: 50%; } .dot.r { background: #ff5f57; } .dot.y { background: #febc2e; } .dot.g { background: #28c840; }
.term-title { margin-left: 12px; font-size: 12px; color: var(--muted); }
.term-body { height: 420px; overflow-y: auto; padding: 18px 20px; font-size: 14px; line-height: 1.7; }
.term-body .l { white-space: pre-wrap; word-break: break-word; }
.term-body .c-cyan { color: var(--cyan); } .term-body .c-green { color: var(--green); } .term-body .c-pink { color: var(--pink); } .term-body .c-violet { color: var(--violet); } .term-body .c-muted { color: var(--muted); }
.term-body a { color: var(--cyan); text-decoration: underline; }
.term-line { display: flex; gap: 8px; align-items: center; }
.term-line label { white-space: nowrap; }
.pr-user { color: var(--green); } .pr-path { color: var(--violet); }
#term-input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; caret-color: var(--cyan); }
.term-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }
.term-hint button { background: none; border: 1px solid var(--line); color: var(--cyan); font: inherit; padding: 3px 10px; margin: 4px; transition: background .2s, border-color .2s; }
.term-hint button:hover { background: rgba(0,240,255,.1); border-color: var(--cyan); }

/* ---------------- CONTACT ---------------- */
.contact { text-align: center; min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.contact-ring { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.contact-ring span { position: absolute; border: 1px solid var(--line); border-radius: 50%; animation: ping 6s cubic-bezier(.2,.6,.3,1) infinite; }
.contact-ring span:nth-child(1) { width: 300px; height: 300px; }
.contact-ring span:nth-child(2) { width: 300px; height: 300px; animation-delay: 2s; }
.contact-ring span:nth-child(3) { width: 300px; height: 300px; animation-delay: 4s; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.contact-title { font-family: var(--f-display); font-weight: 900; font-size: clamp(38px, 8vw, 110px); line-height: .98; margin: 18px 0 24px; background: linear-gradient(90deg, #fff, var(--cyan) 50%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact-sub { color: var(--muted); font-size: clamp(16px, 1.6vw, 20px); max-width: 560px; margin: 0 0 40px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

/* ---------------- FOOTER / TOAST ---------------- */
.footer { position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 28px var(--pad); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.footer-hint { opacity: .5; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 140%); z-index: 200; background: rgba(4,6,13,.95); border: 1px solid var(--cyan); color: var(--cyan); padding: 12px 20px; font-size: 13px; box-shadow: var(--glow); transition: transform .4s cubic-bezier(.2,.9,.3,1.3); max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* hack mode (konami / `hack` command) */
body.hacked { --cyan: #39ff88; --violet: #00ff41; --line: rgba(57,255,136,.25); }
body.hacked #bg-matrix { opacity: .45; }

/* ---------------- REDUCED MOTION ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* ---------------- FIXES / COMBINED TRANSITIONS ---------------- */
.glitch::before, .glitch::after { white-space: pre-line; }
.nav.menu-open { backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; }
.hex.reveal, .c-card.reveal, .p-card.reveal, .id-card.reveal, .t-item.reveal {
  transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1), filter 1s, border-color .3s, color .3s, box-shadow .3s;
  transition-delay: var(--d, 0s);
}
[data-tilt].tilting { transition: transform .12s ease-out, border-color .3s !important; transition-delay: 0s !important; }
html, body { overflow-x: clip; }
.toast { visibility: hidden; opacity: 0; transition: transform .4s cubic-bezier(.2,.9,.3,1.3), opacity .3s, visibility .4s; }
.toast.show { visibility: visible; opacity: 1; }
@media (max-width: 760px), (max-height: 760px) { .scroll-hint { display: none; } }
