/* ---------- reset & base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000000;
  --surface: #0a0a0c;
  --text: #f5f5f7;
  --muted: #86868b;
  --border: rgba(245,245,247,0.1);
  --accent: #2997ff;
  --accent-2: #a855f7;
  --ease: cubic-bezier(.16,1,.3,1);
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0,0,0,0.1);
}

html {
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
  cursor: none;
}

@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  #cursor-dot { display: none; }
}

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

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

.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease), background .25s var(--ease), opacity .25s;
  mix-blend-mode: difference;
}
#cursor-dot.active {
  width: 44px; height: 44px;
  background: rgba(41,151,255,0.25);
}
#cursor-dot.hidden { opacity: 0; }

section { position: relative; z-index: 1; }

/* ---------- nav ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(24px, 5vw, 64px);
  backdrop-filter: blur(0px);
  transition: backdrop-filter .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  backdrop-filter: blur(16px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-mark {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 100px;
}

.nav-links {
  display: flex;
  gap: 36px;
  font-size: 0.88rem;
  color: var(--muted);
}
.nav-links a { transition: color .25s; }
.nav-links a:hover { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  background: none;
  cursor: none;
  transition: border-color .25s, color .25s, transform .3s var(--ease);
  position: relative;
}
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.icon-btn.lg { width: 52px; height: 52px; }
.icon-btn.lg svg { width: 20px; height: 20px; }

#theme-toggle .icon-moon { display: none; }
[data-theme="light"] #theme-toggle .icon-sun { display: none; }
[data-theme="light"] #theme-toggle .icon-moon { display: block; }

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */
.hero {
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, var(--bg) 100%);
  opacity: 0.9;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}
.hero-inner .hero-actions { pointer-events: auto; }

.eyebrow {
  font-family: 'Fira Code', monospace;
  font-size: clamp(0.68rem, 1.2vw, 0.8rem);
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(3.4rem, 11vw, 8rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero h1 .line { display: block; }

.hero-sub {
  max-width: 520px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  line-height: 1.55;
  font-weight: 300;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.btn {
  padding: 13px 26px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform .3s var(--ease), background .3s, border-color .3s, box-shadow .3s;
  display: inline-block;
  cursor: none;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(41,151,255,0.25);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { opacity: 0; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ---------- marquee ---------- */
.marquee-wrap {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 22px 0;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: scroll-x 32s linear infinite;
}
.marquee-track span {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- section shared ---------- */
.section-head {
  padding: clamp(90px,14vw,150px) clamp(24px,6vw,64px) 40px;
}
.tag {
  display: inline-block;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 700px;
}

/* ---------- about ---------- */
.about-grid {
  padding: 0 clamp(24px,6vw,64px) 70px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
}
.about-text {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  font-weight: 300;
  line-height: 1.5;
  color: color-mix(in srgb, var(--text) 85%, var(--muted));
  max-width: 620px;
}
.stats {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.stat {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-num {
  font-size: 2rem;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  color: var(--text);
}
.stat-label { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ---------- focus ---------- */
.focus-grid {
  padding: 0 clamp(24px,6vw,64px) 150px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.focus-card {
  background: var(--bg);
  padding: 44px 34px;
  transition: background .35s var(--ease);
}
.focus-card:hover { background: var(--surface); }
.focus-index {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
  margin-bottom: 26px;
}
.focus-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.focus-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  font-weight: 300;
}

@media (max-width: 860px) {
  .focus-grid { grid-template-columns: 1fr; }
}

/* ---------- work ---------- */
.work-grid {
  padding: 0 clamp(24px,6vw,64px) 150px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.work-card {
  background: var(--bg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  transition: background .35s var(--ease);
  position: relative;
  overflow: hidden;
}
.work-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(41,151,255,0.12), transparent 60%);
  opacity: 0;
  transition: opacity .4s;
}
.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle,0deg), var(--accent), var(--accent-2), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  animation: spin-border 3s linear infinite;
}
@keyframes spin-border { to { --angle: 360deg; } }
@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.work-card:hover { background: var(--surface); }
.work-card:hover::before { opacity: 1; }
.work-card:hover::after { opacity: 1; }

.work-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: auto;
  padding-bottom: 60px;
}
.work-index {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--muted);
}
.work-arrow {
  color: var(--muted);
  transition: transform .3s var(--ease), color .3s;
}
.work-card:hover .work-arrow {
  transform: translate(3px,-3px);
  color: var(--accent);
}

.work-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.work-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 300;
  flex-grow: 1;
}
.work-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.work-tags span {
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  border: 1px solid rgba(41,151,255,0.25);
  padding: 4px 10px;
  border-radius: 100px;
}

@media (max-width: 980px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- skills ---------- */
.skills-grid {
  padding: 0 clamp(24px,6vw,64px) 150px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 60px;
}
.skill-group {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.skill-group h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 10px;
}
.skill-group p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  font-weight: 300;
}

@media (max-width: 860px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- contact ---------- */
.contact {
  padding-top: clamp(100px,14vw,160px);
  min-height: 90svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.contact-inner {
  padding: 0 clamp(24px,6vw,64px);
  text-align: center;
}
.contact h2 {
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 14px 0 40px;
}
.contact-email {
  display: inline-block;
  font-size: clamp(1rem, 2vw, 1.3rem);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  transition: border-color .3s, color .3s;
}
.contact-email:hover { color: var(--accent); border-color: var(--accent); }

.contact-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 46px;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 26px clamp(24px,6vw,64px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 90px;
}

/* ---------- reveal animation base state ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
}
