/* ============================================================
   Knyazovich — portfolio
   Monochrome · Cinematic · Minimal · Technical · Premium
   ============================================================ */

:root {
  --bg: #060606;
  --bg-soft: #0b0b0b;
  --surface: #101010;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f5;
  --text-dim: #a3a3a3;
  --text-faint: #646464;
  --max: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-disp: "Space Grotesk", "Inter", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
ul { list-style: none; }

::selection { background: #fff; color: #000; }

:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%);
  transition: width .28s var(--ease), height .28s var(--ease), background .28s, opacity .2s;
}
.cursor span {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.55);
  opacity: 0;
  transition: opacity .3s, transform .3s;
  transform: scale(0.6);
}
.cursor.grow { width: 42px; height: 42px; background: transparent; }
.cursor.grow span { opacity: 1; transform: scale(1); }
body.cursor-none, body.cursor-none * { cursor: none; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.bg-video {
  position: absolute;
  top: 50%; left: 50%;
  min-width: 100%; min-height: 100%;
  width: auto; height: auto;
  transform: translate(calc(-50% + var(--px, 0px)), calc(-50% + var(--py, 0px))) scale(1.08);
  object-fit: cover;
  filter: grayscale(0.55) contrast(1.05) brightness(0.72);
  transition: transform .6s var(--ease);
}
/* cinematic slow zoom — oversize wrapper so edges never show */
.bg-media {
  position: absolute;
  inset: -8%;
  will-change: transform;
  animation: slowZoom 38s ease-in-out infinite alternate;
}
@keyframes slowZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}
.bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 18%, rgba(6,6,6,0.5) 0%, rgba(6,6,6,0.76) 55%, rgba(6,6,6,0.92) 100%);
}
.bg-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 95% at 50% 50%, transparent 52%, rgba(0,0,0,0.6) 100%);
}
/* subtle technical grid */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(90% 80% at 50% 45%, #000 30%, transparent 100%);
  mask-image: radial-gradient(90% 80% at 50% 45%, #000 30%, transparent 100%);
}
/* film grain */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(2) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-6px, 4px); }
  50%  { transform: translate(5px, -5px); }
  75%  { transform: translate(-4px, -3px); }
  100% { transform: translate(0, 0); }
}

.site { position: relative; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6,6,6,0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  font-family: var(--font-disp);
  font-size: 14px;
  letter-spacing: 0.32em;
  font-weight: 600;
  transition: color .25s;
}
.nav-brand:hover { color: #fff; }
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  position: relative;
  padding: 4px 0;
  transition: color .25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 0;
  background: #fff;
  transition: width .3s var(--ease);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 34px; height: 26px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span { display: block; height: 1.5px; background: #fff; transition: transform .3s var(--ease), opacity .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 92px 0 0;
  position: relative;
}
.hero-frame {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 40px;
}
.hero-frame-top {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.hero-frame-bottom {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.hmeta {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.online { display: inline-flex; align-items: center; gap: 9px; font-size: 10px; letter-spacing: 0.26em; color: var(--text-dim); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: #fff; position: relative; display: inline-block; }
.pulse::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.5); opacity: 0.9; }
  70% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.hero-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  will-change: transform;
}
.hero-name {
  font-family: var(--font-disp);
  font-size: clamp(48px, 9.5vw, 120px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: #fff;
}
.hero-role {
  margin-top: 8px;
  font-family: var(--font-disp);
  font-size: clamp(14px, 2.2vw, 22px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 400;
}
.hero-sub {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero-tag {
  margin-top: 22px;
  font-size: clamp(14px, 1.9vw, 16px);
  color: var(--text-dim);
  font-weight: 300;
  max-width: 520px;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-size: 12px;
  letter-spacing: 0.24em;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease), color .3s, border-color .3s, background .3s, box-shadow .3s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}
.btn-primary { background: #fff; color: #000; }
.btn-primary::before { display: none; }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 34px rgba(255,255,255,0.18);
}
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost::before { background: rgba(255,255,255,0.06); }
.btn-ghost:hover { border-color: #fff; color: #fff; transform: translateY(-2px); }
.btn-ghost:hover::before { transform: scaleX(1); }
.btn > * { position: relative; z-index: 1; }
.arr { transition: transform .3s var(--ease); display: inline-block; }
.btn:hover .arr, .proj-link:hover .arr, .footer-link:hover .arr { transform: translate(2px, -2px); }

/* ---------- Sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 92px 40px 8px;
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}
.sec-num {
  font-family: var(--font-disp);
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.sec-title {
  font-family: var(--font-disp);
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.sec-line { flex: 1; height: 1px; background: var(--line); }
.sec-meta {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 60px;
  align-items: start;
}
.about-media { position: relative; }
.about-frame {
  border: 1px solid var(--line-strong);
  padding: 10px;
  background: var(--bg-soft);
}
.about-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.about-frame-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  padding: 0 2px;
}
.about-body .about-lead {
  font-family: var(--font-disp);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.4;
  font-weight: 400;
  color: var(--text);
  max-width: 640px;
}
.about-body .about-text {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 300;
  max-width: 640px;
}
.about-meta {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
  max-width: 720px;
}
.meta-col { display: flex; flex-direction: column; gap: 12px; }
.meta-label { font-size: 10px; letter-spacing: 0.28em; color: var(--text-faint); }
.meta-val { font-family: var(--font-disp); font-size: 15px; color: var(--text); }
.meta-col ul { display: flex; flex-direction: column; gap: 6px; }
.meta-col li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.meta-col li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 7px; height: 7px;
  border: 1px solid var(--text-faint);
  border-radius: 50%;
}

/* ---------- Focus ---------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.focus-card {
  background: var(--bg-soft);
  padding: 28px 26px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: background .3s, transform .3s var(--ease);
}
.focus-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 70% at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.06), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.focus-card:hover { background: var(--surface); transform: translateY(-4px); }
.focus-card:hover::before { opacity: 1; }
.focus-num { font-family: var(--font-disp); font-size: 13px; color: var(--text-faint); letter-spacing: 0.1em; margin-bottom: auto; }
.focus-card h3 { font-family: var(--font-disp); font-size: 16px; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 9px; }
.focus-card p { color: var(--text-dim); font-size: 13px; font-weight: 300; line-height: 1.55; }
.focus-arrow {
  position: absolute;
  top: 26px; right: 24px;
  font-size: 15px;
  color: var(--text-faint);
  opacity: 0;
  transform: translate(4px, -4px);
  transition: opacity .3s, transform .3s var(--ease), color .3s;
}
.focus-card:hover .focus-arrow { opacity: 1; transform: translate(0, 0); color: #fff; }

/* ---------- Projects ---------- */
.proj-main {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%), var(--bg-soft);
  padding: 38px 42px;
  min-height: 340px;
  position: relative;
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.proj-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 90% at var(--mx, 80%) var(--my, 10%), rgba(255,255,255,0.06), transparent 60%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.proj-main:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.4); }
.proj-main:hover::before { opacity: 1; }
.proj-main-top, .proj-main-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.proj-num { font-family: var(--font-disp); font-size: 12px; letter-spacing: 0.22em; color: var(--text-dim); }
.proj-status {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 5px 12px;
  transition: color .3s, border-color .3s;
}
.proj-main:hover .proj-status, .proj-card:hover .proj-status { color: var(--text-dim); border-color: var(--line-strong); }
.proj-main-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0 28px; }
.proj-name {
  font-family: var(--font-disp);
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: letter-spacing .4s var(--ease);
}
.proj-main:hover .proj-name, .proj-card:hover .proj-name { letter-spacing: 0.005em; }
.proj-desc { margin-top: 18px; max-width: 560px; color: var(--text-dim); font-size: 15px; font-weight: 300; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-tags span {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 4px 11px;
  transition: color .3s, border-color .3s;
}
.proj-tags span:hover { color: #fff; border-color: var(--line-strong); }
.proj-link {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.proj-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 30px 32px 28px;
  min-height: 300px;
  position: relative;
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.proj-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 70% at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.05), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.proj-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.35); background: var(--surface); }
.proj-card:hover::before { opacity: 1; }
.proj-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.proj-card .proj-name { font-size: clamp(30px, 4vw, 44px); margin-top: 28px; }
.proj-card .proj-desc { font-size: 14px; margin-top: 12px; flex: 1; }
.proj-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

/* ---------- Currently ---------- */
.currently-lead {
  font-family: var(--font-disp);
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1.45;
  color: var(--text-dim);
  font-weight: 300;
  max-width: 720px;
  margin-bottom: 34px;
}
.currently-list { border-top: 1px solid var(--line); }
.currently-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 24px 6px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .4s var(--ease), background .3s;
}
.currently-item:hover { padding-left: 16px; background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent 60%); }
.currently-num { font-family: var(--font-disp); color: var(--text-faint); font-size: 13px; letter-spacing: 0.1em; }
.currently-item h3 { font-family: var(--font-disp); font-size: clamp(20px, 3vw, 30px); font-weight: 500; letter-spacing: 0.02em; }

/* ---------- GitHub ---------- */
.gh {
  border: 1px solid var(--line-strong);
  background: radial-gradient(50% 70% at 0% 0%, rgba(255,255,255,0.04), transparent 60%), var(--bg-soft);
  padding: 46px 50px;
}
.gh-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.gh-id { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.gh-name { font-family: var(--font-disp); font-size: clamp(30px, 5vw, 52px); font-weight: 700; letter-spacing: -0.02em; }
.gh-handle { font-family: var(--font-disp); font-size: 15px; color: var(--text-dim); }
.gh-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 6px 14px;
  white-space: nowrap;
}
.gh-desc { margin-top: 16px; color: var(--text-dim); font-weight: 300; font-size: 15px; max-width: 520px; }
.gh-stats { display: flex; gap: 64px; margin: 40px 0 6px; padding-top: 32px; border-top: 1px solid var(--line); }
.gh-stat { display: flex; flex-direction: column; gap: 6px; }
.gh-stat-num { font-family: var(--font-disp); font-size: 36px; font-weight: 600; color: #fff; }
.gh-stat-label { font-size: 10px; letter-spacing: 0.24em; color: var(--text-faint); }
.gh-cta { margin-top: 40px; }

/* ---------- Technologies ---------- */
.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tech-list li {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 12px 24px;
  transition: color .3s, border-color .3s, background .3s, transform .3s var(--ease);
}
.tech-list li:hover { color: #fff; border-color: var(--line-strong); background: var(--surface); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 40px 46px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 32px 0;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand { font-family: var(--font-disp); font-size: 14px; letter-spacing: 0.32em; font-weight: 600; }
.footer-loc, .footer-link { font-size: 11px; letter-spacing: 0.22em; color: var(--text-dim); }
.footer-link { display: inline-flex; align-items: center; gap: 8px; transition: color .25s; }
.footer-link:hover { color: #fff; }
.footer-copy { text-align: center; font-size: 11px; letter-spacing: 0.14em; color: var(--text-faint); }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 0.75s var(--ease), transform 0.9s var(--ease), filter 0.75s var(--ease);
  will-change: opacity, transform, filter;
}
.reveal.in { opacity: 1; transform: translateY(0); filter: blur(0); }
.reveal[data-r="left"] { transform: translateX(-26px); }
.reveal[data-r="right"] { transform: translateX(26px); }
.reveal[data-r="zoom"] { transform: scale(0.94); }
.reveal[data-d="1"] { transition-delay: 0.08s; }
.reveal[data-d="2"] { transition-delay: 0.16s; }
.reveal[data-d="3"] { transition-delay: 0.24s; }
.reveal[data-d="4"] { transition-delay: 0.32s; }
.no-anim .reveal { opacity: 1; transform: none; filter: none; }

/* ---------- Section header draw-in ---------- */
.sec-head .sec-line {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
}
.sec-head.in .sec-line { transform: scaleX(1); }
.sec-head .sec-num {
  opacity: 0;
  transition: opacity 0.5s var(--ease) 0.1s;
}
.sec-head.in .sec-num { opacity: 1; }

/* ---------- Hero micro-layers ---------- */
.hero-coord {
  position: absolute;
  bottom: 110px;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--text-faint);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  will-change: transform;
}
.hero-coord-l { left: 40px; }
.hero-coord.in { opacity: 1; transform: translateY(0); }

.hmeta, .online {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.hmeta[data-hd="1"], .online[data-hd="1"] { transition-delay: 0.5s; }
.hmeta[data-hd="2"], .online[data-hd="2"] { transition-delay: 0.6s; }
.hmeta[data-hd="3"] { transition-delay: 0.7s; }
.hmeta.in, .online.in { opacity: 1; transform: translateY(0); }

/* scroll hint bounce */
.scroll-hint { animation: hintFloat 2.6s ease-in-out infinite; }
@keyframes hintFloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* button press + icon shift */
.btn { transition: transform .35s var(--ease), color .3s, border-color .3s, background .3s, box-shadow .3s; }
.btn:active { transform: translateY(1px) scale(0.97); }
.btn-primary .arr, .btn-ghost .arr { transition: transform .35s var(--ease); }

/* project card content motion */
.proj-main-body, .proj-main-top, .proj-main-foot { transition: transform .45s var(--ease); }
.proj-main:hover .proj-main-body { transform: translateY(-2px); }
.proj-main:hover .proj-main-foot { transform: translateY(-2px); }
.proj-card { transform-origin: 50% 100%; transition: transform .45s var(--ease), border-color .3s, background .3s; }
.proj-card:hover { transform: translateY(-4px); }
.proj-card .proj-num { transition: transform .4s var(--ease), color .3s; }
.proj-card:hover .proj-num { transform: translateX(6px); color: #fff; }
.proj-card .proj-link { transition: color .3s, letter-spacing .3s var(--ease); }
.proj-card:hover .proj-link { letter-spacing: 0.26em; }

/* focus card number shift */
.focus-num { transition: color .3s, letter-spacing .3s var(--ease); }
.focus-card:hover .focus-num { color: #fff; letter-spacing: 0.18em; }

/* cursor glow dot on interactive */
.cursor.glow span { border-color: #fff; box-shadow: 0 0 16px rgba(255,255,255,0.35); }

/* decorative frame corner marks */
.hero-frame-top::before,
.hero-frame-top::after,
.hero-frame-bottom::before,
.hero-frame-bottom::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-color: rgba(255,255,255,0.35);
  opacity: 0;
  transition: opacity 1s var(--ease) 0.9s;
}
.hero-frame { position: relative; }
.hero-frame-top::before { top: -1px; left: 30px; border-left: 1px solid; border-top: 1px solid; }
.hero-frame-top::after { top: -1px; right: 30px; border-right: 1px solid; border-top: 1px solid; }
.hero-frame-bottom::before { bottom: -1px; left: 30px; border-left: 1px solid; border-bottom: 1px solid; }
.hero-frame-bottom::after { bottom: -1px; right: 30px; border-right: 1px solid; border-bottom: 1px solid; }
.hero-frame.in::before, .hero-frame.in::after { opacity: 1; }

/* stat numbers entrance */
.gh-stat { transition: transform .4s var(--ease), opacity .5s var(--ease); }

/* github card hover lift */
.gh { transition: transform .45s var(--ease), border-color .3s; }
.gh:hover { border-color: var(--line-strong); transform: translateY(-2px); }

/* footer line draw */
.footer-inner { border-top: 1px solid transparent; }
.footer-inner::after {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  height: 1px; width: 100%;
  background: var(--line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease) 0.2s;
}
.footer-inner.in::after { transform: scaleX(1); }
.footer-inner { position: relative; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 260px 1fr; gap: 40px; }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: rgba(6,6,6,0.96);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 60px 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s var(--ease), visibility .35s;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links a { font-size: 30px; letter-spacing: 0.06em; color: var(--text); font-weight: 500; padding: 12px 0; }
  .nav-links a::after { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 320px; }
}

@media (max-width: 720px) {
  .section { padding: 72px 24px 8px; }
  .sec-head { margin-bottom: 36px; gap: 12px; }
  .sec-meta { display: none; }
  .hero { padding-top: 76px; }
  .hero-inner { padding: 0 24px; }
  .hero-frame-top, .hero-frame-bottom { padding: 14px 24px; }
  .proj-grid { grid-template-columns: 1fr; }
  .proj-main { padding: 30px 26px; }
  .proj-main-foot, .proj-card-foot { flex-direction: column; align-items: flex-start; gap: 18px; }
  .focus-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: 170px; }
  .about-meta { grid-template-columns: 1fr 1fr; }
  .gh { padding: 36px 26px; }
  .gh-stats { gap: 40px; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
  .hero-coord { display: none; }
  .gh-head { flex-direction: column; align-items: flex-start; }
  .about-meta { grid-template-columns: 1fr; }
  .currently-item { grid-template-columns: 1fr; gap: 8px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal, .hero-coord, .hmeta, .online { opacity: 1; transform: none; filter: none; }
  .bg-media, .bg::after, .scroll-hint, .pulse::after { animation: none !important; }
  .sec-line, .footer-inner::after { transform: scaleX(1) !important; }
}
