:root {
  --bg: #0a0a0a;
  --surface: #0f0f0f;
  --text: #ededed;
  --muted: #6f6f6f;
  --faint: #3a3a3a;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #e8ff5e;
  --accent-dim: rgba(232, 255, 94, 0.12);

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", Georgia, serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1240px;
}

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

html { scroll-behavior: smooth; }

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

@media (pointer: coarse) {
  body { cursor: auto; }
}

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

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

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

/* ---------- CURSOR ---------- */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.25s;
  mix-blend-mode: difference;
}
@media (pointer: coarse) { .cursor-dot { display: none; } }

/* ---------- FLOATING PREVIEW ---------- */
.preview {
  position: fixed;
  top: 0; left: 0;
  width: clamp(280px, 26vw, 420px);
  aspect-ratio: 1280 / 820;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0,0,0,0.4);
  background: var(--surface);
  will-change: transform, opacity;
}
.preview.show { opacity: 1; }
.preview img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (pointer: coarse), (max-width: 880px) {
  .preview { display: none; }
}

/* ---------- SHELL ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
}

/* ---------- NAV ---------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
}
.nav-mark {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav-mark::before {
  content: "◆";
  color: var(--accent);
  margin-right: 8px;
  font-size: 10px;
  vertical-align: middle;
}
.nav-links {
  display: flex;
  gap: 32px;
  color: var(--muted);
}
.nav-links a {
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.nav-links a:hover { color: var(--text); }

/* ---------- HERO ---------- */
.hero {
  padding: 120px 0 140px;
  border-bottom: 1px solid var(--border);
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 80px;
  letter-spacing: 0.02em;
}
.status { display: inline-flex; align-items: center; gap: 8px; }
.status-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232,255,94,0.5); }
  70% { box-shadow: 0 0 0 9px rgba(232,255,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,255,94,0); }
}

.hero-title {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 8.5vw, 6.6rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 56px;
}
.hero-title .line {
  display: block;
  overflow: hidden;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
  position: relative;
}
.hero-title em::after {
  content: "";
  position: absolute;
  left: -2px; right: -2px;
  bottom: 0.08em;
  height: 0.5em;
  background: var(--accent-dim);
  z-index: -1;
  transform: skewX(-8deg);
}

.hero-bio {
  max-width: 540px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 100px;
}
.hero-bio .name-accent { color: var(--text); font-size: 1.1em; }

.hero-scroll {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
  max-width: 320px;
}

/* ---------- SECTION HEAD ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.section-index { color: var(--accent); font-weight: 500; }
.section-title { color: var(--text); }
.section-count { margin-left: auto; color: var(--faint); }

/* ---------- WORK / PROJECTS ---------- */
.work { padding: 100px 0; border-bottom: 1px solid var(--border); }

.project-list { list-style: none; }

.project {
  position: relative;
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease);
}
.project::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.45s var(--ease);
}
.project:hover { background: rgba(255,255,255,0.015); }
.project:hover::before { transform: scaleY(1); }

.project-link {
  display: grid;
  grid-template-columns: 60px 1.4fr 2fr 1.2fr 40px;
  align-items: center;
  gap: 28px;
  padding: 34px 16px;
}
.project-index { color: var(--faint); font-size: 13px; transition: color 0.3s; }
.project:hover .project-index { color: var(--accent); }
.project-name {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color 0.3s, transform 0.45s var(--ease);
}
.project:hover .project-name { transform: translateX(8px); }
.project-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 420px;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 10.5px;
  padding: 4px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: border-color 0.3s, color 0.3s;
}
.project:hover .tag { border-color: rgba(255,255,255,0.28); color: var(--text); }
.project-arrow {
  font-size: 20px;
  color: var(--muted);
  text-align: right;
  transition: transform 0.45s var(--ease), color 0.3s;
}
.project:hover .project-arrow { transform: translateX(6px) translateY(-6px); color: var(--accent); }
.project-thumb { display: none; }

/* ---------- CONTACT ---------- */
.contact { padding: 100px 0; border-bottom: 1px solid var(--border); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 80px;
  max-width: 560px;
}
.contact-card {
  padding: 40px 32px;
  border: 1px solid var(--border);
  margin: -0.5px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: background 0.3s, border-color 0.3s;
  min-height: 150px;
}
.contact-card:hover { background: rgba(255,255,255,0.02); border-color: var(--border-strong); }
.contact-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.contact-value {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.contact-arrow {
  position: absolute;
  top: 36px; right: 32px;
  font-size: 18px;
  color: var(--muted);
  transition: transform 0.4s var(--ease), color 0.3s;
}
.contact-card:hover .contact-arrow { transform: translate(4px, -4px); color: var(--accent); }

.cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cta p {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
}
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 14px;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, gap 0.3s;
}
.cta-link:hover { border-color: var(--accent); gap: 16px; }

/* ---------- FOOTER ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 0;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.footer-built { color: var(--faint); }
.to-top { transition: color 0.2s; }
.to-top:hover { color: var(--text); }

/* ---------- REVEAL ANIMATION ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
[data-reveal].in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
  .shell { padding: 0 22px; }
  .nav { padding: 20px 0; }
  .nav-links { gap: 18px; }
  .hero { padding: 70px 0 90px; }
  .hero-meta { margin-bottom: 50px; }
  .hero-title { margin-bottom: 40px; }
  .hero-bio { margin-bottom: 70px; }

  .project-link {
    grid-template-columns: 40px 1fr 30px;
    grid-template-areas:
      "idx name arrow"
      "thumb thumb thumb"
      ".   desc desc"
      ".   tags tags";
    gap: 12px 18px;
    padding: 26px 8px;
  }
  .project-index { grid-area: idx; }
  .project-name { grid-area: name; }
  .project-thumb {
    display: block;
    grid-area: thumb;
    width: 100%;
    aspect-ratio: 1280 / 820;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: 4px;
  }
  .project-desc { grid-area: desc; }
  .project-tags { grid-area: tags; }
  .project-arrow { grid-area: arrow; }
  .project:hover .project-name { transform: none; }

  .contact-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 10px; text-align: center; }
}

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