/* =====================================================
   KRIM//NODE — portfolio
   Design: brutalist-editorial · node interface
   ===================================================== */

:root {
  --bg:        #080807;
  --bg-2:      #0e0e0c;
  --ink:       #eae7dd;
  --ink-dim:   #8a887e;
  --line:      rgba(234, 231, 221, 0.12);
  --acid:      #ccff00;
  --acid-deep: #a6d400;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Space Grotesk", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--disp);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

::selection { background: var(--acid); color: #000; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* ---------- overlays ---------- */
.grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.blueprint {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
          mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
  opacity: 0.5;
}

/* ---------- node canvas ---------- */
.nodes { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ---------- custom cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot {
  position: fixed; width: 6px; height: 6px; border-radius: 50%;
  background: var(--acid); transform: translate(-50%, -50%);
}
.cursor__ring {
  position: fixed; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--ink); transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease), border-color .25s;
}
.cursor.is-hover .cursor__ring { width: 60px; height: 60px; border-color: var(--acid); }
.cursor.is-hover .cursor__dot { opacity: 0; }
@media (hover: none) { .cursor { display: none; } body { cursor: auto; } }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: grid; place-items: center;
  transition: opacity .6s var(--ease), visibility .6s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot__inner { width: min(560px, 84vw); }
.boot__log { font-family: var(--mono); font-size: 12px; line-height: 1.9; color: var(--ink-dim); white-space: pre-wrap; min-height: 150px; }
.boot__log b { color: var(--acid); }
.boot__bar { height: 2px; background: var(--line); margin-top: 18px; overflow: hidden; }
.boot__bar span { display: block; height: 100%; width: 0; background: var(--acid); }

/* ---------- scroll progress ---------- */
.scrollbar { position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 9990; background: transparent; }
.scrollbar span { display: block; height: 100%; width: 0; background: var(--acid); box-shadow: 0 0 12px var(--acid); }

/* =====================================================
   NAV
   ===================================================== */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 60px);
  mix-blend-mode: difference;
}
.nav__logo { font-family: var(--mono); font-weight: 700; letter-spacing: 1px; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.nav__logo-mark { color: var(--acid); }
.nav__menu { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); font-family: var(--mono); font-size: 12px; letter-spacing: 2px; }
.nav__menu a { position: relative; padding: 4px 0; }
.nav__menu a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px;
  background: var(--acid); transition: width .35s var(--ease);
}
.nav__menu a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta { border: 1px solid var(--ink); padding: 8px 16px; border-radius: 40px; transition: background .3s, color .3s; }
.nav__cta:hover { background: var(--acid); color: #000; border-color: var(--acid); }
.nav__burger { display: none; background: none; border: 0; flex-direction: column; gap: 5px; cursor: none; }
.nav__burger span { width: 24px; height: 2px; background: var(--ink); transition: .3s; }

.blink { animation: blink 1.1s steps(1) infinite; color: var(--acid); }
@keyframes blink { 50% { opacity: 0; } }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative; z-index: 2; min-height: 100svh;
  padding: 120px clamp(20px, 5vw, 60px) 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero__meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ink-dim); margin-bottom: clamp(20px, 4vh, 50px); }
.tag { color: var(--acid); }

.hero__title { font-weight: 700; line-height: 0.84; letter-spacing: -0.03em; text-transform: uppercase; }
.hero__title .line { display: block; overflow: hidden; }
.hero__title .reveal {
  display: inline-block; font-size: clamp(3rem, 13vw, 12rem);
  transform: translateY(110%); transition: transform 1s var(--ease);
}
.boot.done ~ main .hero__title .reveal,
.ready .hero__title .reveal { transform: translateY(0); }
.hero__title .reveal:nth-child(2) { transition-delay: .06s; }
.hero__title .reveal:nth-child(3) { transition-delay: .12s; }
.hero__title .reveal.dim { color: var(--ink-dim); }
.hero__title .reveal.outline {
  -webkit-text-stroke: 2px var(--ink); color: transparent;
}
.line--out .reveal.amp { color: var(--acid); padding: 0 .1em; }

.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 60px);
  margin-top: clamp(28px, 5vh, 56px); max-width: 1100px;
}
.hero__role { font-family: var(--mono); font-size: 13px; line-height: 2; }
.hero__role-k { display: block; color: var(--ink-dim); letter-spacing: 2px; }
.hero__role-v { display: block; color: var(--acid); font-weight: 700; letter-spacing: 1px; }
.hero__desc { font-size: clamp(1rem, 1.5vw, 1.35rem); line-height: 1.5; color: var(--ink); max-width: 46ch; }
.hero__desc em { font-style: normal; color: var(--acid); }

.hero__foot { margin-top: clamp(32px, 6vh, 64px); display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.hero__status { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; display: inline-flex; align-items: center; gap: 10px; color: var(--ink-dim); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 0 var(--acid); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(204,255,0,.55); } 70% { box-shadow: 0 0 0 12px rgba(204,255,0,0); } 100% { box-shadow: 0 0 0 0 rgba(204,255,0,0); } }

.scroll-hint { position: absolute; bottom: 28px; right: clamp(20px, 5vw, 60px); font-family: var(--mono); font-size: 10px; letter-spacing: 3px; color: var(--ink-dim); display: flex; align-items: center; gap: 12px; }
.scroll-hint__line { width: 60px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.scroll-hint__line::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--acid); animation: slide 1.8s var(--ease) infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 2px; font-weight: 700;
  padding: 16px 28px; border-radius: 50px; border: 1px solid var(--ink);
  transition: background .3s var(--ease), color .3s, border-color .3s;
}
.btn--primary { background: var(--acid); color: #000; border-color: var(--acid); }
.btn--primary:hover { background: transparent; color: var(--acid); }
.btn__arrow { transition: transform .3s var(--ease); }
.btn:hover .btn__arrow { transform: translateY(4px); }

/* =====================================================
   MARQUEE
   ===================================================== */
.marquee {
  position: relative; z-index: 2; border-block: 1px solid var(--line);
  padding: 18px 0; overflow: hidden; background: var(--bg-2);
}
.marquee__track { display: flex; gap: 40px; width: max-content; animation: marquee 26s linear infinite; }
.marquee__track span { font-family: var(--mono); font-weight: 700; font-size: clamp(1.4rem, 3vw, 2.4rem); letter-spacing: 2px; color: transparent; -webkit-text-stroke: 1px var(--ink-dim); white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =====================================================
   SECTIONS (shared)
   ===================================================== */
.section { position: relative; z-index: 2; padding: clamp(80px, 14vh, 180px) clamp(20px, 5vw, 60px); }
.section__head { position: relative; margin-bottom: clamp(40px, 7vh, 80px); }
.section__idx { position: absolute; top: -6px; left: 0; font-family: var(--mono); font-size: 12px; color: var(--acid); letter-spacing: 2px; }
.section__title { font-size: clamp(2.6rem, 8vw, 7rem); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; font-weight: 700; padding-left: 44px; }
.section__note { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); margin-top: 20px; padding-left: 44px; max-width: 40ch; }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

/* =====================================================
   PROJECTS
   ===================================================== */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
  position: relative; border: 1px solid var(--line); border-radius: 4px;
  padding: clamp(24px, 3vw, 40px); background: var(--bg-2);
  min-height: 300px; display: flex; flex-direction: column;
  overflow: hidden; transition: border-color .4s, transform .5s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.project--wide { grid-column: 1 / -1; min-height: 220px; }
.project::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,50%), rgba(204,255,0,.09), transparent 40%);
}
.project:hover { border-color: var(--acid); }
.project:hover::before { opacity: 1; }
.project__top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ink-dim); }
.project__no { color: var(--acid); }
.project__name { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.02em; margin: auto 0 16px; }
.project__ext { color: var(--ink-dim); font-weight: 400; }
.project__desc { color: var(--ink-dim); font-size: 15px; line-height: 1.6; max-width: 44ch; }
.project__desc em { font-style: normal; color: var(--ink); }
.project__desc code { font-family: var(--mono); font-size: 0.85em; color: var(--acid); background: rgba(204,255,0,0.08); padding: 1px 6px; border-radius: 3px; }
.project__go { margin-top: 26px; font-family: var(--mono); font-size: 12px; letter-spacing: 2px; display: inline-flex; align-items: center; gap: 10px; color: var(--acid); }
.project__arrow { transition: transform .3s var(--ease); }
.project:hover .project__arrow { transform: translate(4px, -4px); }

/* =====================================================
   STACK
   ===================================================== */
.stack__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stack__col { background: var(--bg); padding: clamp(24px, 3vw, 44px); }
.stack__label { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--acid); }
.stack__list { list-style: none; margin-top: 28px; }
.stack__list li {
  position: relative; font-size: clamp(1.1rem, 2vw, 1.7rem); font-weight: 500;
  padding: 14px 0 14px 28px; border-top: 1px solid var(--line);
  transition: color .3s, padding .3s var(--ease);
}
.stack__list li::before { content: "→"; position: absolute; left: 0; color: var(--acid); opacity: 0; transform: translateX(-8px); transition: .3s var(--ease); }
.stack__list li:hover { color: var(--acid); padding-left: 40px; }
.stack__list li:hover::before { opacity: 1; transform: translateX(0); }

/* =====================================================
   ABOUT
   ===================================================== */
.about__layout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 5vw, 70px); align-items: start; }
.about__visual { position: relative; border: 1px solid var(--line); overflow: hidden; align-self: stretch; }
.about__visual img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(0.35) contrast(1.08) brightness(0.9);
  mix-blend-mode: luminosity; opacity: 0.9;
}
.about__visual::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, rgba(204,255,0,0.10), rgba(8,8,7,0.85));
  mix-blend-mode: color;
}
.about__visual-scan {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 3px, rgba(0,0,0,0.18) 3px 4px);
}
.about__visual figcaption {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--acid); background: linear-gradient(0deg, rgba(8,8,7,0.9), transparent);
}
.about__body { max-width: 62ch; }
.about__lead { font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.15; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 40px; }
.about__lead mark { background: none; color: var(--acid); }
.about__body p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.7; color: var(--ink-dim); max-width: 62ch; }
.about__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(48px, 8vh, 90px); }
.fact { border-top: 1px solid var(--line); padding-top: 20px; }
.fact__n { display: block; font-family: var(--mono); font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 700; color: var(--acid); line-height: 1; }
.fact__l { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ink-dim); }

/* =====================================================
   CONTACT
   ===================================================== */
.contact { position: relative; text-align: left; }
.contact__pre { font-family: var(--mono); font-size: 12px; letter-spacing: 3px; color: var(--acid); margin-bottom: 20px; padding-left: 44px; }
.contact__title { font-size: clamp(3rem, 12vw, 11rem); line-height: 0.86; letter-spacing: -0.03em; text-transform: uppercase; font-weight: 700; }
.contact__title-out { -webkit-text-stroke: 2px var(--ink); color: transparent; }
.contact__links { margin-top: clamp(48px, 8vh, 90px); border-top: 1px solid var(--line); }
.contact__link {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: clamp(20px, 3vw, 34px) 0; border-bottom: 1px solid var(--line);
  transition: padding .4s var(--ease), background .4s;
}
.contact__link:hover { padding-left: 24px; background: linear-gradient(90deg, rgba(204,255,0,.05), transparent); }
.contact__link-k { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--ink-dim); }
.contact__link-v { font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; transition: color .3s; }
.contact__link:hover .contact__link-v { color: var(--acid); }
.contact__link-v em { font-style: normal; color: var(--acid); font-size: .7em; }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  padding: 30px clamp(20px, 5vw, 60px); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--ink-dim);
}
.footer a:hover { color: var(--acid); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 860px) {
  .nav__menu { display: none; }
  .nav__burger { display: flex; }
  .hero__grid { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .stack__grid { grid-template-columns: 1fr; }
  .about__facts { grid-template-columns: 1fr; gap: 4px; }
  .fact { display: flex; align-items: baseline; gap: 14px; }
  .about__layout { grid-template-columns: 1fr; }
  .about__visual { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero__title .reveal { transform: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
