/* ─────────────────────────────────────────
   ROOT
───────────────────────────────────────── */
:root {
  --bg:    #080808;
  --blue:  #3b9eff;
  --white: #f0f4ff;
  --muted: rgba(240,244,255,.32);
  --dim:   rgba(240,244,255,.07);
  --line:  rgba(240,244,255,.06);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}
body.js-ready { cursor: none; }

/* ─────────────────────────────────────────
   GRAIN
───────────────────────────────────────── */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1000; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .022; mix-blend-mode: overlay;
}

/* ─────────────────────────────────────────
   BLOB (midnight.works style)
───────────────────────────────────────── */
#blob-wrap {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
}
#blob {
  width: 42vmax; height: 42vmax;
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,158,255,.55) 0%, rgba(20,80,200,.35) 40%, transparent 70%);
  filter: blur(9vmax);
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  will-change: transform;
  mix-blend-mode: screen;
}

/* ─────────────────────────────────────────
   CUSTOM CURSOR
───────────────────────────────────────── */
#cur {
  position: fixed; width: 8px; height: 8px;
  background: var(--white); border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
}
#cur-r {
  position: fixed; width: 32px; height: 32px;
  border: 1px solid rgba(240,244,255,.25); border-radius: 50%;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: width .22s, height .22s, border-color .22s;
}

/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 60px;
}
.logo {
  font-family: 'IBM Plex Mono', monospace; font-size: .68rem;
  color: var(--muted); letter-spacing: .22em; text-transform: uppercase;
  transition: color .2s;
}
.logo:hover { color: var(--white); }
.nav-links { display: flex; gap: 40px; }
.nav-links a {
  font-family: 'IBM Plex Mono', monospace; font-size: .62rem;
  color: var(--muted); text-decoration: none; letter-spacing: .14em;
  text-transform: uppercase; transition: color .2s;
}
.nav-links a:hover { color: var(--white); }

/* ─────────────────────────────────────────
   HERO — midnight.works style
───────────────────────────────────────── */
#hero {
  position: relative; z-index: 3;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 0;
  text-align: center;
  padding: 0 40px;
}

/* EYES */
.eyes {
  display: flex; gap: 32px;
  margin-bottom: 52px;
}
.eye {
  width: 72px; height: 72px;
  background: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  box-shadow: 0 0 40px rgba(59,158,255,.2);
}
.pupil {
  width: 32px; height: 32px;
  background: #080808;
  border-radius: 50%;
  position: absolute;
  transition: transform .05s linear;
}
.pupil::after {
  content: '';
  position: absolute; top: 6px; left: 6px;
  width: 8px; height: 8px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--blue);
}

/* NAME */
.h-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(4.5rem, 12vw, 10rem);
  line-height: .88;
  letter-spacing: -.04em;
  margin-bottom: 24px;
  overflow: hidden;
}
.h-name .word { display: block; overflow: hidden; }
.h-name .word span { display: inline-block; }
.h-name em { font-style: italic; color: var(--blue); }

.h-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem; color: var(--muted);
  letter-spacing: .28em; text-transform: uppercase;
  margin-bottom: 48px;
  opacity: 0; animation: fup .6s .9s forwards;
}
.h-sub b { color: var(--white); font-weight: 400; }

/* Avatar */
.h-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  border: 2px solid rgba(59,158,255,.35);
  margin-bottom: 40px;
  position: relative;
  opacity: 0; animation: fup .6s .3s forwards;
  box-shadow: 0 0 0 6px rgba(59,158,255,.08), 0 0 30px rgba(59,158,255,.15);
  filter: contrast(1.05);
}
.h-avatar svg { opacity: .35; }
.h-avatar span {
  font-family: 'IBM Plex Mono', monospace; font-size: .38rem;
  letter-spacing: .15em; color: var(--muted);
}
.av-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px dashed rgba(59,158,255,.2);
  animation: spinR 28s linear infinite;
}
.av-ring::before {
  content: ''; position: absolute; top: -3px; left: 50%;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); transform: translateX(-50%);
  box-shadow: 0 0 8px var(--blue);
}
@keyframes spinR { to { transform: rotate(360deg); } }

/* scroll hint */
.h-scroll {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: 'IBM Plex Mono', monospace; font-size: .5rem;
  color: var(--muted); letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; animation: fup .5s 1.3s forwards;
}
.h-scroll::after {
  content: ''; width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--muted), transparent);
}

@keyframes fup { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* ─────────────────────────────────────────
   SECTION BASE
───────────────────────────────────────── */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 60px; position: relative; z-index: 3; }
.sec-head { margin-bottom: 64px; }
.sec-label {
  font-family: 'IBM Plex Mono', monospace; font-size: .58rem;
  color: var(--blue); letter-spacing: .25em; text-transform: uppercase;
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.sec-label::before { content: ''; width: 28px; height: 1px; background: var(--blue); }
.sec-title {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(2.4rem, 4.5vw, 3.4rem); letter-spacing: -.03em; line-height: 1.02;
}
.sec-title em { font-style: italic; color: var(--blue); }

/* ─────────────────────────────────────────
   ABOUT
───────────────────────────────────────── */
#about { padding: 130px 0; border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 90px; align-items: start; }
.stats { display: flex; flex-direction: column; }
.stat-row {
  display: flex; align-items: baseline; gap: 18px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateX(-16px);
  transition: opacity .6s, transform .6s;
}
.stat-row.vis { opacity: 1; transform: none; }
.stat-big {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: 3.2rem; color: var(--white); line-height: 1; min-width: 88px;
}
.stat-big sup { font-size: 1.4rem; color: var(--blue); }
.stat-info strong { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 2px; }
.stat-info span { font-size: .82rem; color: var(--muted); }
.loc-badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); padding: 10px 18px; margin-top: 28px;
  font-size: .82rem; color: var(--muted);
  font-family: 'IBM Plex Mono', monospace; letter-spacing: .06em;
}
.loc-badge .arr { color: var(--blue); }
.about-body p { font-size: 1rem; line-height: 1.85; color: var(--muted); margin-bottom: 18px; }
.about-body p strong { color: var(--white); font-weight: 700; }
.pull {
  border-left: 3px solid var(--blue); padding: 16px 22px; margin: 26px 0;
  background: rgba(59,158,255,.04); font-size: 1.05rem; line-height: 1.7;
  color: rgba(240,244,255,.55); font-weight: 600; font-style: italic;
}
.pull strong { color: var(--white); font-style: normal; }

/* ─────────────────────────────────────────
   AUTOMATION
───────────────────────────────────────── */
#automation { padding: 130px 0; border-bottom: 1px solid var(--line); }
.manifesto { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.manifesto-text p { font-size: 1rem; line-height: 1.85; color: var(--muted); margin-bottom: 18px; }
.manifesto-text p strong { color: var(--white); font-weight: 700; }
.principles { display: flex; flex-direction: column; }
.principle {
  padding: 24px 0 24px 22px;
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--dim);
  position: relative;
  opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s;
}
.principle.vis { opacity: 1; transform: none; }
.principle::before {
  content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 1px;
  background: var(--blue); transform: scaleY(0); transform-origin: top; transition: transform .3s;
}
.principle:hover::before { transform: scaleY(1); }
.p-num { font-family: 'IBM Plex Mono', monospace; font-size: .52rem; color: var(--blue); letter-spacing: .2em; margin-bottom: 8px; }
.principle p { font-size: .92rem; color: var(--muted); line-height: 1.65; }
.principle p strong { color: var(--white); font-weight: 700; }

/* ─────────────────────────────────────────
   SKILLS
───────────────────────────────────────── */
#skills { padding: 130px 0; border-bottom: 1px solid var(--line); }
.skills-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); }
.sb {
  background: var(--bg); padding: 36px 32px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .5s, transform .5s, background .2s;
}
.sb.vis { opacity: 1; transform: none; }
.sb:hover { background: #0f0f0f; }
.sb h3 { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .95rem; margin-bottom: 16px; color: var(--white); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.t {
  font-family: 'IBM Plex Mono', monospace; font-size: .55rem; color: var(--muted);
  letter-spacing: .04em; border: 1px solid var(--dim); padding: 4px 9px; border-radius: 2px;
  transition: border-color .2s, color .2s;
}
.sb:hover .t { border-color: rgba(59,158,255,.18); color: rgba(240,244,255,.5); }
.sw { grid-column: 1/-1; display: flex; align-items: flex-start; gap: 48px; flex-wrap: wrap; }
.sw > div:first-child { flex-shrink: 0; }

/* ─────────────────────────────────────────
   TIMELINE
───────────────────────────────────────── */
#experience { padding: 130px 0; border-bottom: 1px solid var(--line); }
.tl-item {
  display: grid; grid-template-columns: 160px 1px 1fr;
  gap: 0 42px; padding-bottom: 56px;
  opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s;
}
.tl-item.vis { opacity: 1; transform: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-yr { font-family: 'IBM Plex Mono', monospace; font-size: .6rem; color: var(--muted); letter-spacing: .08em; padding-top: 3px; text-align: right; line-height: 1.4; }
.tl-yr.ac { color: var(--blue); }
.tl-line { position: relative; background: var(--line); }
.tl-dot { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--muted); }
.tl-dot.hot { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 8px rgba(59,158,255,.5), 0 0 20px rgba(59,158,255,.18); }
.tl-body h3 { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; color: var(--white); }
.tl-body p { font-size: .9rem; line-height: 1.72; color: var(--muted); }

/* ─────────────────────────────────────────
   SOCIAL
───────────────────────────────────────── */
#social { padding: 130px 0 180px; }
.soc-desc { max-width: 460px; font-size: 1rem; line-height: 1.8; color: var(--muted); margin-bottom: 60px; }
.soc-desc strong { color: var(--white); font-weight: 700; }
.soc-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); }
.sl {
  background: var(--bg); padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--white);
  position: relative; overflow: hidden;
  opacity: 0; transform: translateY(16px);
  transition: background .22s, opacity .5s, transform .5s;
}
.sl::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.sl:hover::after { transform: scaleX(1); }
.sl.vis { opacity: 1; transform: none; }
.sl:hover { background: #0f0f0f; }
.sl:hover .sl-arrow { transform: translate(3px,-3px); color: var(--blue); }
.sl:hover .si svg path, .sl:hover .si svg rect,
.sl:hover .si svg circle, .sl:hover .si svg line,
.sl:hover .si svg polygon { stroke: var(--blue); }
.sl:hover .si svg .fi { fill: var(--blue); }
.si svg { width: 20px; height: 20px; }
.si svg path, .si svg rect, .si svg circle, .si svg line, .si svg polygon {
  stroke: var(--muted); fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; transition: stroke .22s, fill .22s;
}
.si svg .fi { fill: var(--muted); stroke: none; }
.sl-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .9rem; flex: 1; }
.sl-handle { font-family: 'IBM Plex Mono', monospace; font-size: .52rem; color: var(--muted); letter-spacing: .08em; margin-top: -8px; }
.sl-arrow { font-size: .7rem; color: var(--muted); transition: transform .22s, color .22s; align-self: flex-end; }

/* ─────────────────────────────────────────
   FOOTER (midnight.works style)
───────────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  position: relative; z-index: 3;
  padding: 0 60px 64px;
  overflow: hidden;
}
.footer-big {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(5rem, 14vw, 13rem);
  line-height: .88; letter-spacing: -.05em;
  color: var(--white);
  margin-bottom: 48px; padding-top: 48px;
}
.footer-big em {
  font-style: italic;
  background: linear-gradient(135deg, var(--blue), #60b8ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.footer-meta {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 24px;
}
.footer-meta .fl, .footer-meta .fr {
  font-family: 'IBM Plex Mono', monospace; font-size: .56rem;
  color: var(--muted); letter-spacing: .14em;
}
.footer-email {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace; font-size: 1.1rem;
  color: var(--muted); text-decoration: none; letter-spacing: .04em;
  margin-bottom: 48px;
  position: relative; transition: color .25s;
}
.footer-email::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.footer-email:hover { color: var(--white); }
.footer-email:hover::after { transform: scaleX(1); }
.fd { color: var(--blue); }

/* ─────────────────────────────────────────
   UTIL
───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.vis { opacity: 1; transform: none; }

@media(max-width: 900px) {
  nav { padding: 20px 24px; } .nav-links { display: none; }
  .wrap { padding: 0 24px; }
  .h-name { font-size: clamp(3.5rem, 16vw, 6rem); }
  .eye { width: 54px; height: 54px; } .pupil { width: 24px; height: 24px; }
  .eyes { gap: 20px; margin-bottom: 36px; }
  .about-grid, .manifesto { grid-template-columns: 1fr; gap: 48px; }
  .skills-grid { grid-template-columns: 1fr 1fr; } .sw { grid-column: auto; }
  .soc-grid { grid-template-columns: 1fr 1fr; }
  .tl-item { grid-template-columns: 86px 1px 1fr; gap: 0 18px; }
  footer { padding: 0 24px 48px; }
  .footer-big { font-size: clamp(3.5rem, 16vw, 6rem); }
  .footer-meta { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── SKILL ICONS ── */
.sk-icon {
  width: 32px; height: 32px; margin-bottom: 22px;
  color: var(--blue); position: relative;
}
.sk-icon svg { width: 100%; height: 100%; overflow: visible; }
.sk-icon svg .p { transition: opacity .3s, stroke-dashoffset .5s; }
.sk-icon svg .f { transition: fill-opacity .3s; }
.sb:hover .sk-icon { color: var(--blue); }
.sb:hover .sk-icon svg .p { opacity: 1 !important; }
.sb:hover .sk-icon svg .f { fill-opacity: .25 !important; }
.burger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px; background: none; border: none;
}
.burger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--muted); transition: all .3s ease;
}
.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--white); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--white); }

#mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(8,8,8,.97); backdrop-filter: blur(8px);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 40px;
}
#mobile-nav.open { display: flex; }
#mobile-nav a {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(2rem, 8vw, 3rem); color: var(--muted);
  text-decoration: none; letter-spacing: -.02em;
  transition: color .2s;
}
#mobile-nav a:hover { color: var(--white); }
#mobile-nav .close-btn {
  position: absolute; top: 24px; right: 24px;
  font-family: 'IBM Plex Mono', monospace; font-size: .6rem;
  color: var(--muted); letter-spacing: .15em; cursor: pointer;
  background: none; border: none; padding: 8px;
}

@media(max-width: 900px) {
  .burger { display: flex; }
}