:root {
  --bg: #05070a;
  --panel: #0a0f14;
  --line: #16232b;
  --cyan: #22d3ee;
  --cyan-dim: #1b9fb6;
  --amber: #d9a23a;
  --ok: #3fb985;
  --text: #c5d3da;
  --muted: #7f929c;
  --gutter: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(34, 211, 238, .035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(34, 211, 238, .035) 1px, transparent 1px) 0 0 / 48px 48px,
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 3px);
  animation: drift 60s linear infinite;
}
@keyframes drift { to { background-position: 0 48px, 48px 0, 0 0; } }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 72px 0; }
.eyebrow { color: var(--amber); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 8px; }
h1, h2, h3 { font-family: 'Rajdhani', system-ui, sans-serif; margin: 0; line-height: 1.1; color: #e6f1f5; }
h2 { font-size: clamp(28px, 5vw, 38px); font-weight: 600; letter-spacing: .04em; margin-bottom: 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(5, 7, 10, .82);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: .12em; color: #e6f1f5; }
nav { display: flex; gap: 20px; font-size: 14px; }
nav a { color: var(--muted); }
nav a:hover { color: var(--cyan); text-decoration: none; }

.rv { animation: rvIn .9s both; }
.intro:not(.opened) .rv { animation: none; opacity: 0; }
.rv:nth-child(2) { animation-delay: .12s; }
.rv:nth-child(3) { animation-delay: .24s; }
@keyframes rvIn {
  0% { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  35% { opacity: .7; }
  48% { opacity: .15; }
  62% { opacity: 1; }
  100% { opacity: 1; transform: none; filter: none; }
}

.hero { min-height: calc(100vh - 56px); display: flex; align-items: center; padding: 48px 0; }
.hero .wrap { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) { .hero .wrap { grid-template-columns: 1.6fr 1fr; } }
.hero h1 {
  font-size: clamp(48px, 11vw, 104px);
  font-weight: 700;
  letter-spacing: .03em;
  text-shadow: 0 0 28px rgba(34, 211, 238, .22);
}
.typed { margin: 20px 0 0; min-height: 1.6em; font-size: clamp(15px, 2.6vw, 20px); color: var(--cyan); }
.typed::after { content: '_'; margin-left: 2px; animation: blink 1.1s steps(1) infinite; color: var(--amber); }
@keyframes blink { 50% { opacity: 0; } }
.logo {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 280px);
  justify-self: center;
}
.logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.45);
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 28%, transparent 40%);
  mask-image: radial-gradient(circle, #000 28%, transparent 40%);
}
.logo .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo .ring circle { fill: none; transform-origin: 100px 100px; }
.logo .r1 { stroke: rgba(34, 211, 238, .45); stroke-width: 1; stroke-dasharray: 2 7; animation: spin 80s linear infinite; }
.logo .r2 { stroke: rgba(34, 211, 238, .75); stroke-width: 1.5; stroke-dasharray: 36 14 4 14; animation: spin 50s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.hud { position: relative; background: var(--panel); border: 1px solid var(--line); padding: 24px; }
.hud::before, .hud::after, .hud i::before, .hud i::after {
  content: ''; position: absolute; width: 14px; height: 14px; border: 0 solid var(--cyan);
}
.hud::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud::after { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.hud i::before { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.hud i::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.card h3 { font-size: 24px; font-weight: 600; letter-spacing: .05em; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .idx { color: var(--amber); font-size: 12px; letter-spacing: .15em; display: block; margin-bottom: 12px; }

.term { padding: 0; overflow: hidden; }
.term .bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12px; letter-spacing: .08em;
}
.term .bar b { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.term .bar span { margin-left: 8px; }
.term .screen {
  height: 400px; overflow: hidden; padding: 14px;
  background: #04070a;
  font-size: 13px; line-height: 1.5; color: #b9c8cf;
}
.term .screen div { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.5em; }
.term .ok { color: var(--ok); }
.term .p { color: var(--cyan); }
.term .k { color: var(--amber); }
.term .dim { color: var(--muted); }
.term .cur { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@media (max-width: 520px) { .term .screen { font-size: 11px; height: 360px; } }

.contact ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact li { display: flex; gap: 16px; flex-wrap: wrap; }
.contact .label { color: var(--muted); min-width: 80px; }
.contact a { overflow-wrap: anywhere; }

footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }

.visor { display: none; }
.intro .visor { display: block; position: fixed; inset: 0; z-index: 100; overflow: hidden; }
.intro body { overflow: hidden; }

.plate { position: absolute; inset: 0; transition: transform 1.15s cubic-bezier(.76, 0, .24, 1); will-change: transform; }
.visor.open .plate.top { transform: translateY(-100%); }
.visor.open .plate.bot { transform: translateY(100%); }
.plate .face {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(34, 211, 238, .025) 0 1px, transparent 1px 90px),
    radial-gradient(ellipse at 50% 50%, #0c1822 0, #05080c 55%, #020304 100%);
}
.plate.top .face { clip-path: polygon(0 0, 100% 0, 100% 50%, 64% 50%, 50% 58%, 36% 50%, 0 50%); }
.plate.bot .face { clip-path: polygon(0 50%, 36% 50%, 50% 58%, 64% 50%, 100% 50%, 100% 100%, 0 100%); }
.plate .edge {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, .75));
  transform-origin: center;
  animation: seam .55s ease-out both;
}
.plate .edge polyline { fill: none; stroke: var(--cyan); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
@keyframes seam { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.eyes {
  position: absolute; left: 50%; top: 50%;
  width: min(74vw, 780px);
  transform: translate(-50%, calc(-100% - 5vh));
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, .9)) drop-shadow(0 0 28px rgba(34, 211, 238, .45));
  animation: eyeOn 1s steps(1) .35s both;
}
.eyes polygon { fill: #b8f4ff; }
@keyframes eyeOn {
  0% { opacity: 0; } 12% { opacity: .9; } 20% { opacity: .05; } 34% { opacity: 1; }
  44% { opacity: .25; } 58% { opacity: 1; } 100% { opacity: 1; }
}

.hudfx {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, .85), inset 0 0 60px rgba(34, 211, 238, .08);
  --c: linear-gradient(var(--cyan), var(--cyan));
  background:
    var(--c) 16px 16px / 26px 2px no-repeat, var(--c) 16px 16px / 2px 26px no-repeat,
    var(--c) calc(100% - 16px) 16px / 26px 2px no-repeat, var(--c) calc(100% - 16px) 16px / 2px 26px no-repeat,
    var(--c) 16px calc(100% - 16px) / 26px 2px no-repeat, var(--c) 16px calc(100% - 16px) / 2px 26px no-repeat,
    var(--c) calc(100% - 16px) calc(100% - 16px) / 26px 2px no-repeat, var(--c) calc(100% - 16px) calc(100% - 16px) / 2px 26px no-repeat;
}
.hudfx::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px var(--cyan);
  opacity: 0;
}
.visor.open .hudfx { animation: hudOut .7s ease .85s forwards; }
.visor.open .hudfx::after { animation: scan 1s cubic-bezier(.5, 0, .7, 1) .1s; }
@keyframes scan { 0% { transform: translateY(0); opacity: .9; } 100% { transform: translateY(100vh); opacity: 0; } }
@keyframes hudOut { to { opacity: 0; } }

.readout {
  position: absolute; left: 30px; bottom: 30px;
  width: min(300px, calc(100% - 60px));
  color: var(--cyan); font-size: 13px; line-height: 1.7;
  text-shadow: 0 0 8px rgba(34, 211, 238, .45);
  transition: opacity .25s;
}
.readout .head { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .18em; margin-bottom: 8px; }
.readout .track { height: 2px; background: var(--line); margin-bottom: 12px; }
.readout .track i { display: block; height: 100%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transform: scaleX(0); transform-origin: left; }
.readout pre { margin: 0; font: inherit; min-height: 6.8em; }
.visor.open .readout, .visor.open .skip { opacity: 0; pointer-events: none; }
.skip {
  position: absolute; right: 30px; top: 30px;
  background: none; color: var(--muted);
  border: 1px solid var(--line); padding: 8px 14px;
  font: inherit; font-size: 12px; letter-spacing: .12em; cursor: pointer;
  transition: opacity .25s, color .2s, border-color .2s;
}
.skip:hover { color: var(--cyan); border-color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  html { scroll-behavior: auto; }
  .typed::after, .term .cur { animation: none; }
  .logo .ring circle { animation: none; }
  .rv { animation: none; }
}

.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--panel); color: var(--cyan); border: 1px solid var(--cyan); padding: 8px 12px; }
.skip-link:focus { top: 8px; }
nav a[aria-current="page"] { color: var(--cyan); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { border: 1px solid var(--line); color: var(--text); font-size: 12px; padding: 3px 10px; background: rgba(34, 211, 238, .04); }
.skills-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
.skills-grid h3 { font-size: 20px; font-weight: 600; letter-spacing: .05em; }
.skills-grid .cat { color: var(--amber); font-size: 12px; letter-spacing: .15em; display: block; margin-bottom: 6px; }

.proj { display: block; color: inherit; }
.proj:hover { text-decoration: none; border-color: var(--cyan-dim); }
.proj h3 { font-size: 22px; font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; color: var(--cyan); }
.proj p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.proj .meta { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); }

.term .inline { display: flex; align-items: baseline; gap: 0; min-height: 1.5em; }
.term .inline .p { white-space: pre; flex: none; }
.term input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: 0; padding: 0; margin: 0;
  color: var(--text); font: inherit; caret-color: var(--cyan);
}
.term:focus-within { border-color: var(--cyan-dim); }
.term .screen a { color: var(--cyan); }
.term .hint { color: var(--muted); font-size: 12px; padding: 8px 14px; border-top: 1px solid var(--line); }

.prose { max-width: 740px; }
.prose h1 { font-size: clamp(32px, 6vw, 48px); margin-bottom: 8px; }
.prose h2 { font-size: 26px; margin: 36px 0 12px; }
.prose h3 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text); }
.prose code { background: rgba(34, 211, 238, .08); padding: 1px 6px; font-size: .92em; }
.prose pre { background: #04070a; border: 1px solid var(--line); padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose .date { color: var(--amber); font-size: 13px; letter-spacing: .12em; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.post-list a { display: block; color: inherit; }
.post-list a:hover { text-decoration: none; }
.post-list h3 { font-size: 24px; color: var(--cyan); margin: 6px 0; }
.post-list p { margin: 0; color: var(--muted); font-size: 14px; }

.e404 { min-height: 60vh; display: flex; align-items: center; }
.e404 .big { font-family: 'Rajdhani', sans-serif; font-size: clamp(64px, 18vw, 150px); font-weight: 700; color: #e6f1f5; line-height: 1; text-shadow: 0 0 28px rgba(34, 211, 238, .22); }
.e404 pre { margin: 16px 0 0; white-space: pre-wrap; color: var(--muted); }
.e404 .err { color: var(--amber); }

@media (max-width: 640px) {
  header.top .wrap { height: auto; flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 10px; padding-bottom: 10px; }
  nav { flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
  .hero { min-height: calc(100vh - 96px); }
}
