/* ============================================================
   Abul Kalam Azad — Security Portfolio
   Hand-built. No framework, no build step.
   ------------------------------------------------------------
   1.  Tokens
   2.  Reset & base
   3.  Layout primitives
   4.  Buttons / chips / badges
   5.  Header & nav
   6.  Hero (grid, glitch, terminal, stats)
   7.  Section headers
   8.  About
   9.  Skills
   10. Certifications
   11. Projects
   12. CTF
   13. Write-ups
   14. Timeline
   15. Achievements
   16. Contact
   17. Footer
   18. Motion / reveal
   19. Responsive
   20. Print & forced-colors
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* surfaces — cool, desaturated, near-black blue */
  --bg:          #0a0d12;
  --bg-alt:      #0c1017;
  --surface:     #11161f;
  --surface-2:   #151c26;
  --border:      #1e2733;
  --border-soft: #182029;

  /* text */
  --text:        #e4eaf1;
  --text-dim:    #93a2b4;
  --text-mute:   #7a8899; /* WCAG AA: 5.38:1 on --bg, 5.01:1 on --surface, 4.74:1 on --surface-2 */

  /* accent — muted teal-cyan, deliberately not "matrix green" */
  --accent:      #45d6c4;
  --accent-2:    #34b8a8;
  --accent-soft: rgba(69, 214, 196, .10);
  --accent-line: rgba(69, 214, 196, .28);

  /* functional severity palette (mirrors a real VAPT report) */
  --crit:  #f2555f;
  --high:  #ff8a3d;
  --med:   #ffc44d;
  --low:   #4d9df5;
  --ok:    #3ddc84;
  --gold:  #e8c877;

  /* type */
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* metrics */
  --wrap: 1140px;
  --r:    10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.6);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--accent); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: #6fe6d7; }

svg.ico, svg.link-ico, svg.proj-ico {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
svg[fill="currentColor"] { stroke: none; }

code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .35em;
  color: var(--accent);
}

.mono { font-family: var(--mono); }

/* focus — visible, accent, never removed */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--accent);
  color: #05221e;
  font-weight: 600;
  font-size: .9rem;
  padding: .6rem 1rem;
  border-radius: var(--r-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: #05221e; }

/* scroll progress bar */
.progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  z-index: 120;
  transition: width .08s linear;
}

/* ---------- 3. Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border-soft); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  position: relative;
  transition: border-color .22s var(--ease), transform .22s var(--ease), background .22s var(--ease);
}

/* ---------- 4. Buttons / chips / badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--mono);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -.01em;
  padding: .7rem 1.15rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { font-size: .8rem; padding: .5rem .85rem; }

.btn-primary {
  background: var(--accent);
  color: #04231f;
  font-weight: 600;
}
.btn-primary:hover { background: #5fe4d3; color: #04231f; }

.btn-outline {
  border-color: var(--border);
  color: var(--text-dim);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.5;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .26em .6em;
  white-space: nowrap;
}
.chips-tag li { color: var(--text-mute); background: transparent; }

/* chips that link out to a certificate / credential */
.chips-link li { padding: 0; }
.chips-link a {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  color: var(--text-dim);
  padding: .26em .6em;
  border-radius: 4px;
}
.chips-link a:hover { color: var(--accent); background: var(--accent-soft); }
.chips-link .ico { width: .78em; height: .78em; color: var(--text-mute); }
.chips-link a:hover .ico { color: var(--accent); }

.badge {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .3em .65em;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}
.badge-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge-gold   { color: var(--gold);   border-color: rgba(232,200,119,.28); background: rgba(232,200,119,.09); }
.badge-gov    { color: var(--low);    border-color: rgba(77,157,245,.3);   background: rgba(77,157,245,.09); }

.bullets li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: .6rem;
  color: var(--text-dim);
  font-size: .935rem;
}
.bullets li:last-child { margin-bottom: 0; }
.bullets li::before {
  content: "▸";
  position: absolute;
  left: 0; top: -.05em;
  color: var(--accent);
  font-size: .85em;
}
.bullets strong { color: var(--text); font-weight: 600; }

/* ---------- 5. Header & nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 13, 18, .72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.stuck { border-bottom-color: var(--border); background: rgba(10,13,18,.88); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}
.brand-text { font-size: .9rem; font-weight: 500; }
.brand-name { color: var(--text); }
.brand-dim  { color: var(--text-mute); }

.nav { margin-left: auto; }
.nav ul { display: flex; align-items: center; gap: 2px; }
.nav a {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
  padding: .45rem .6rem;
  border-radius: var(--r-sm);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav-idx { font-size: .68rem; color: var(--text-mute); transition: color .18s var(--ease); }
.nav a:hover .nav-idx { color: var(--accent); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.nav a.active .nav-idx { color: var(--accent); }

.header-cta { flex: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  margin-left: auto;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: transform .22s var(--ease), opacity .18s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding: 116px 0 92px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }

/* faint technical grid — static, ~3% opacity */
.hero-bg .grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(to right,  rgba(148,180,200,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,180,200,.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 28%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 28%, #000 25%, transparent 78%);
}
.hero-bg .glow {
  position: absolute;
  top: -280px; left: 50%;
  width: 900px; height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(69,214,196,.11), transparent 62%);
  filter: blur(10px);
}

.hero-inner { position: relative; }

.status {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: .6em;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .35rem .85rem .35rem .7rem;
  margin: 0 0 26px;
}
.status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61,220,132,.16);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(61,220,132,.16); }
  50%     { box-shadow: 0 0 0 6px rgba(61,220,132,.04); }
}

.hero-name {
  font-size: clamp(2.3rem, 7.2vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
  margin: 0 0 14px;
}

/* glitch — restrained RGB split, plays once on load, repeats on hover */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
}
.glitch::before { color: var(--accent); transform: translate(-2px, 0); }
.glitch::after  { color: var(--crit);   transform: translate(2px, 0); }
/* the hero H1 must own its line; fit-content keeps the pseudo-elements text-width */
.hero-name.glitch { display: block; width: fit-content; max-width: 100%; }

.glitch.fire::before { animation: glitch-a .62s steps(2, end) 1; }
.glitch.fire::after  { animation: glitch-b .62s steps(2, end) 1; }
.glitch:hover::before { animation: glitch-a .62s steps(2, end) 1; }
.glitch:hover::after  { animation: glitch-b .62s steps(2, end) 1; }

@keyframes glitch-a {
  0%   { opacity: 0;   clip-path: inset(0 0 100% 0); }
  12%  { opacity: .75; clip-path: inset(12% 0 61% 0); transform: translate(-3px, 0); }
  28%  { opacity: .55; clip-path: inset(48% 0 28% 0); transform: translate(2px, 0); }
  46%  { opacity: .7;  clip-path: inset(72% 0 12% 0); transform: translate(-2px, 0); }
  64%  { opacity: .4;  clip-path: inset(28% 0 55% 0); transform: translate(1px, 0); }
  100% { opacity: 0;   clip-path: inset(0 0 100% 0); transform: translate(0, 0); }
}
@keyframes glitch-b {
  0%   { opacity: 0;   clip-path: inset(0 0 100% 0); }
  16%  { opacity: .55; clip-path: inset(62% 0 18% 0); transform: translate(3px, 0); }
  34%  { opacity: .4;  clip-path: inset(22% 0 64% 0); transform: translate(-2px, 0); }
  52%  { opacity: .6;  clip-path: inset(8% 0 78% 0);  transform: translate(2px, 0); }
  70%  { opacity: .3;  clip-path: inset(56% 0 30% 0); transform: translate(-1px, 0); }
  100% { opacity: 0;   clip-path: inset(0 0 100% 0);  transform: translate(0, 0); }
}

.hero-role {
  font-size: clamp(.92rem, 2.1vw, 1.08rem);
  color: var(--accent);
  letter-spacing: -.01em;
  margin: 0 0 22px;
}
.hero-role .sep { color: var(--text-mute); margin-inline: .35em; }

.hero-lede {
  max-width: 62ch;
  font-size: 1.04rem;
  color: var(--text-dim);
  margin: 0 0 34px;
}

/* terminal card */
.term {
  max-width: 640px;
  background: #080b10;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 9px; height: 9px; border-radius: 50%; background: #2b3543; }
.term-dots i:first-child { background: #3a4453; }
.term-title { font-size: .74rem; color: var(--text-mute); }

.term-body { padding: 16px 18px; font-size: .84rem; line-height: 1.85; }
.term-body p { margin: 0; }
.term-body .line { color: var(--text); }
.term-body .prompt { color: var(--accent); margin-right: .6em; font-weight: 700; }
.term-body .out { color: var(--text-dim); padding-left: 1.35em; }
.term-body .out-accent { color: var(--accent); }
.term-body [data-step] { opacity: 0; transition: opacity .22s var(--ease); }
.term-body [data-step].shown { opacity: 1; }

.cursor {
  display: inline-block;
  width: 8px; height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}
.cursor.done { animation: none; opacity: 0; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 52px; }

/* stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.stat { padding: 20px 22px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat dt {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.stat dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.stat .num {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.stat .unit { font-size: .78rem; color: var(--text-dim); }

/* ---------- 7. Section headers ---------- */
.sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 44px;
}
.sec-idx {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent);
  padding: .2em .5em;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 4px;
  flex: none;
}
.sec-title {
  font-size: clamp(1.45rem, 3.4vw, 1.95rem);
  letter-spacing: -.025em;
  flex: none;
}
.sec-path { font-size: .78rem; color: var(--text-mute); flex: none; }
.sec-rule {
  flex: 1 1 auto;
  height: 1px;
  min-width: 24px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.sub-head {
  font-size: .82rem;
  color: var(--text-mute);
  letter-spacing: .02em;
  margin: 44px 0 20px;
}

/* ---------- 8. About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.about-body p { color: var(--text-dim); font-size: 1rem; margin-bottom: 1.1em; }
.about-body strong { color: var(--text); font-weight: 600; }

.facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 6px 4px;
  position: sticky;
  top: 84px;
}
.fact-list li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 11px 16px;
  font-size: .8rem;
  border-bottom: 1px solid var(--border-soft);
}
.fact-list li:last-child { border-bottom: 0; }
.fact-list .k { color: var(--text-mute); }
.fact-list .k::before { content: "· "; color: var(--accent); }
.fact-list .v { color: var(--text-dim); }
.fact-list .v-ok { color: var(--ok); }

/* ---------- 9. Skills ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.skill { padding: 22px; }
.skill:hover { border-color: var(--accent-line); }
.skill-title {
  font-size: .95rem;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5em;
}
.skill-title::before {
  content: "";
  width: 3px; height: 13px;
  background: var(--accent);
  border-radius: 2px;
  flex: none;
}

/* ---------- 10. Certifications ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.cert { padding: 20px; display: flex; flex-direction: column; }
.cert:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.cert-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cert-tag {
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: .2em .5em;
}
.cert-date { font-size: .7rem; color: var(--text-mute); }
.cert-name {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 6px;
}
.cert-name-sm { font-size: 1.05rem; }
.cert-full { font-size: .85rem; color: var(--text-dim); margin-bottom: 10px; }
.cert-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;      /* keeps footer lines aligned across a row */
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.cert-issuer {
  font-size: .74rem;
  color: var(--text-mute);
  margin: 0;
}
/* "Verify" affordance — only rendered on cards that have a real credential URL */
.cert-verify {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .2em .5em;
  white-space: nowrap;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.cert-verify:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.cert-verify .ico { width: .8em; height: .8em; }

.paths { margin-top: 16px; padding: 20px 22px; }
.paths-title {
  font-size: .78rem;
  color: var(--text-mute);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}

/* ---------- 11. Projects ---------- */
.feature {
  padding: 30px;
  border-color: var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.feature::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(69,214,196,0));
  border-radius: var(--r) var(--r) 0 0;
}
.feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.feature-kicker {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.feature-title { font-size: clamp(1.2rem, 2.8vw, 1.5rem); margin-bottom: 8px; }
.feature-sub { font-size: .92rem; color: var(--text-dim); margin: 0; }

.scope-note {
  display: flex;
  align-items: flex-start;
  gap: .6em;
  font-size: .74rem;
  color: var(--text-mute);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: .6rem .8rem;
  margin-bottom: 20px;
}
.scope-badge {
  color: var(--low);
  border: 1px solid rgba(77,157,245,.3);
  background: rgba(77,157,245,.09);
  border-radius: 3px;
  padding: 0 .45em;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  flex: none;
}

/* severity strip — reads like a real report summary */
.sev-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.sev {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  border-left-width: 3px;
}
.sev-n { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; line-height: 1.15; letter-spacing: -.03em; }
.sev-l { font-size: .7rem; color: var(--text-mute); letter-spacing: .04em; text-transform: uppercase; }
.sev-crit  { border-left-color: var(--crit); }
.sev-crit  .sev-n { color: var(--crit); }
.sev-high  { border-left-color: var(--high); }
.sev-high  .sev-n { color: var(--high); }
.sev-total { border-left-color: var(--accent); }
.sev-total .sev-n { color: var(--accent); }
.sev-doc   { border-left-color: var(--text-mute); }
.sev-doc   .sev-n { color: var(--text-dim); }

.feature .bullets { margin-bottom: 20px; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.proj { display: flex; flex-direction: column; }
.proj:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.proj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.proj-ico { width: 17px; height: 17px; color: var(--accent); }
.proj-title { font-size: 1.02rem; }
.proj-sub { font-size: .74rem; color: var(--text-mute); margin-bottom: 14px; }
.proj .bullets { margin-bottom: 16px; }
.proj .chips-tag { margin-bottom: 16px; }
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-size: .74rem;
  color: var(--text-mute);
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  word-break: break-all;
}
.proj-link:hover { color: var(--accent); }

/* ---------- 12. CTF ---------- */
.ctf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.ctf { display: flex; flex-direction: column; }
.ctf:hover { border-color: var(--accent-line); }
.ctf-primary { grid-column: span 2; }
.ctf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ctf-title { font-size: 1.08rem; }
.ctf-rank { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.ctf-rank .num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.04em;
  line-height: 1.05;
}
.ctf-rank .unit { font-size: .74rem; color: var(--text-mute); }
.ctf-meta { font-size: .74rem; color: var(--text-mute); margin-bottom: 10px; }
.ctf-desc { font-size: .9rem; color: var(--text-dim); margin-bottom: 14px; }
.ctf-desc strong { color: var(--text); font-weight: 600; }
.ctf .proj-link { margin-top: auto; }

/* ---------- 13. Write-ups ---------- */
.wu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.wu:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.wu-meta {
  display: flex;
  align-items: center;
  gap: .5em;
  font-size: .72rem;
  color: var(--text-mute);
  margin-bottom: 12px;
}
.wu-plat { color: var(--accent); }
.wu-dot { color: var(--border); }
.wu-title { font-size: 1.12rem; margin-bottom: 10px; }
.wu-title a {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: .4em;
}
.wu-title a:hover { color: var(--accent); }
.wu-title .ico { width: .68em; height: .68em; color: var(--text-mute); }
.wu-title a:hover .ico { color: var(--accent); }
.wu-desc { font-size: .9rem; color: var(--text-dim); margin-bottom: 14px; }
.wu-note { font-size: .74rem; color: var(--text-mute); }
.wu-more { border-style: dashed; background: transparent; }

/* ---------- 14. Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent-line), var(--border) 40%, transparent);
}
.tl-item { position: relative; margin-bottom: 18px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-marker {
  position: absolute;
  left: -30px; top: 26px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-marker-edu { border-color: var(--text-mute); }
.tl-body { padding: 22px 24px; }
.tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.tl-role { font-size: 1.05rem; }
.tl-date {
  font-size: .74rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: .15em .5em;
  white-space: nowrap;
}
.tl-org { font-size: .88rem; color: var(--text-mute); margin-bottom: 14px; }
.tl-course { font-size: .86rem; color: var(--text-dim); margin: 0; }
.tl-course-k {
  display: block;
  font-size: .7rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 4px;
}

/* ---------- 15. Achievements ---------- */
.ach-feature {
  padding: 28px 30px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.ach-feature::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--low), rgba(77,157,245,0));
  border-radius: var(--r) var(--r) 0 0;
}
.ach-feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ach-date { font-size: .74rem; color: var(--text-mute); }
.ach-feature-title { font-size: clamp(1.15rem, 2.6vw, 1.4rem); margin-bottom: 6px; }
.ach-feature-org { font-size: .76rem; color: var(--text-mute); margin-bottom: 14px; }
.ach-feature-desc { font-size: .95rem; color: var(--text-dim); margin-bottom: 16px; max-width: 78ch; }

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ach { padding: 20px 22px; }
.ach:hover { border-color: var(--accent-line); }
.ach-rank {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(232,200,119,.28);
  background: rgba(232,200,119,.08);
  border-radius: 3px;
  padding: .2em .55em;
  margin-bottom: 12px;
}
.ach-title { font-size: 1rem; margin-bottom: 8px; }
.ach-meta { font-size: .74rem; color: var(--text-mute); line-height: 1.6; }

/* ---------- 16. Contact ---------- */
.section-contact { padding-bottom: 88px; }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.contact-h { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 14px; letter-spacing: -.025em; }
.contact-lead p { color: var(--text-dim); max-width: 58ch; margin-bottom: 26px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-actions .btn-primary { font-size: .82rem; }

.links { display: flex; flex-direction: column; gap: 8px; }
.links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text-dim);
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .16s var(--ease);
}
.links a:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateX(3px);
  color: var(--text-dim);
}
.link-ico { width: 19px; height: 19px; color: var(--text-mute); }
.links a:hover .link-ico { color: var(--accent); }
.link-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.link-k { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); }
.link-v { font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.link-arrow { margin-left: auto; width: 14px; height: 14px; color: var(--text-mute); }
.links a:hover .link-arrow { color: var(--accent); }

/* ---------- 17. Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 24px;
}
.site-footer p { font-size: .76rem; color: var(--text-mute); margin: 0; }
.footer-prompt { color: var(--accent); margin-right: .4em; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ---------- 18. Motion / reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- 19. Responsive ---------- */
@media (max-width: 1000px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .facts { position: static; }
  .ctf-primary { grid-column: span 1; }
}

@media (max-width: 900px) {
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    margin: 0;
    background: rgba(10,13,18,.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 20px;
    display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: .8rem .5rem; font-size: .9rem; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
  .nav a .nav-idx { width: 2em; }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); }
  .sev-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 18px; }
  .section { padding: 68px 0; }
  .hero { padding: 76px 0 64px; }
  .sec-head { flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
  .sec-path { display: none; }
  .card { padding: 20px; }
  .feature, .ach-feature { padding: 22px 20px; }
  .feature-head { flex-direction: column; gap: 14px; }
  .hero-cta .btn, .contact-actions .btn { width: 100%; justify-content: center; }
  .contact-actions .btn-primary { font-size: .74rem; }
  .term-body { font-size: .76rem; }
  .timeline { padding-left: 22px; }
  .tl-marker { left: -22px; }
  .tl-body { padding: 18px 18px; }
  .fact-list li { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: 0; }
  .sev-strip { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .glitch::before, .glitch::after { display: none; }
  .status .dot { animation: none; }
  .cursor { animation: none; }
  .term-body [data-step] { opacity: 1; }
}

/* ---------- 20. Print & forced-colors ---------- */
@media print {
  .site-header, .progress, .hero-bg, .nav-toggle, .hero-cta, .contact-actions, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .facts, .term { border: 1px solid #ccc; background: #fff; box-shadow: none; }
  .section, .hero { padding: 20px 0; }
  a { color: #000; text-decoration: underline; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .sec-idx, .chips li, .badge { color: #000; border-color: #999; background: #fff; }
}

@media (forced-colors: active) {
  .card, .facts, .term, .btn, .chips li { border: 1px solid CanvasText; }
  .glitch::before, .glitch::after { display: none; }
}
