/* ---------- tokens ---------- */
:root {
  --bg: #1C1D26;
  --bg-elev: #262832;
  --ink: #F8F7F3;
  --dim: #B4B4C0;
  --line: #3D3F4C;

  --dev: #4C6FFF;        /* developer / code accent */
  --dev-soft: rgba(76, 111, 255, 0.14);
  --words: #E7A94A;      /* writer / quotes accent */
  --words-soft: rgba(231, 169, 74, 0.12);

  --font-display: 'Space Grotesk', sans-serif;
  --font-serif: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;

  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { cursor: auto; }
  .cursor-dot { display: none; }
  #heroCanvas { display: none; }
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
em { font-style: italic; }
em.serif { font-family: var(--font-serif); color: var(--words); font-style: italic; }

:focus-visible {
  outline: 2px solid var(--dev);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}

.meta-label {
  display: block;
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: 6px;
}

/* custom cursor */
.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease, border 0.2s ease;
  mix-blend-mode: difference;
}

.cursor-dot.hover {
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--ink);
}

/* film grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.03;
  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");
}

/* ---------- reveal-on-scroll base state ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}
.reveal-ready [data-reveal] {
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28, 29, 38, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  display: inline-block;
}

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 0.95rem;
  color: var(--dim);
  transition: color 0.15s ease;
  display: inline-block;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(28,29,38,0) 0%, rgba(28,29,38,0.5) 65%, rgba(28,29,38,0.9) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-kicker {
  font-size: 0.95rem;
  color: var(--dim);
  max-width: 46ch;
}

.hero-name {
  font-weight: 700;
  font-size: clamp(3.2rem, 12vw, 8.5rem);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 18px 0 28px;
}

.hero-name .line {
  display: block;
  overflow: hidden;
}

.hero-name .line-inner {
  display: inline-block;
  transform: translateY(110%);
}

.hero-tag {
  max-width: 54ch;
  font-size: 1.15rem;
  color: var(--dim);
}

.hero-tag em:not(.serif) { color: var(--dev); font-style: normal; font-weight: 600; }

.hero-signature {
  margin-top: 22px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--words);
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--dev);
  color: #fff;
}

.btn-primary:hover { transform: translateY(-2px); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--words);
  transform: translateY(-2px);
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 60px;
  background: var(--line);
  z-index: 2;
  overflow: hidden;
}

.scroll-cue span {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dev);
  animation: cue 2.2s ease-in-out infinite;
}

@keyframes cue {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ---------- sections ---------- */
section:not(.hero) {
  padding: 130px 0;
  position: relative;
}

.about { background: var(--bg); }
.work { background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.words {
  background: linear-gradient(180deg, var(--bg) 0%, #2b2419 100%);
  border-bottom: 1px solid var(--line);
  padding-top: 80px;
  padding-bottom: 80px;
}
.stack { background: var(--bg); }
.contact { background: var(--bg-elev); border-top: 1px solid var(--line); }

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

/* about */
.two-col {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 48px;
  align-items: start;
}

.about-mark {
  position: sticky;
  top: 120px;
}

.mark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 7rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line);
  display: block;
}

.about-body h2 { margin-bottom: 32px; }

.about-body p {
  max-width: 62ch;
  color: var(--dim);
  margin-bottom: 20px;
}

.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--ink); font-weight: 600; }

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.credential p {
  font-size: 1rem;
  color: var(--ink);
}

/* work */
.project {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  padding: 44px 0;
  border-top: 1px solid var(--line);
}

.project:first-of-type { border-top: none; }

.project-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.project h3 {
  font-size: 1.6rem;
}

.status-tag {
  font-size: 0.75rem;
  color: var(--words);
  border: 1px solid var(--words);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
}

.project-role {
  color: var(--dev);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.project-desc {
  color: var(--dim);
  max-width: 62ch;
  margin-bottom: 18px;
}

.project-features {
  margin: 0;
  padding-left: 20px;
  color: var(--dim);
  max-width: 58ch;
}

.project-features li { margin-bottom: 8px; }
.project-features li:last-child { margin-bottom: 0; }

.project-meta p {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* words */
.words h2 { margin-bottom: 16px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }

.words-intro {
  color: var(--dim);
  max-width: 46ch;
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.quote-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quote {
  margin: 0;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.quote:first-child { border-top: none; padding-top: 0; }

.quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--words);
  max-width: 28ch;
}

/* stack */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stack-group p {
  font-size: 1.05rem;
}

/* contact */
.contact-headline {
  font-size: clamp(2rem, 5vw, 3.6rem);
  margin-bottom: 28px;
  max-width: 14ch;
}

.contact-headline .dev-word { color: var(--dev); }
.contact-headline .words-word {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--words);
  font-weight: 500;
}

.contact-intro {
  color: var(--dim);
  max-width: 46ch;
  margin-bottom: 44px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.contact-link {
  display: block;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.contact-link:hover .contact-value,
.contact-link:focus-visible .contact-value {
  color: var(--dev);
  border-color: var(--dev);
}

.social-links {
  display: flex;
  gap: 28px;
  margin-top: 44px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--words);
}

/* footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 0.9rem;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .about-mark { position: static; }
  .mark-text { font-size: 4rem; }
  .project { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 20px;
    gap: 18px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  section:not(.hero) { padding: 90px 0; }
  .contact-links { gap: 32px; }
  .stack-grid { grid-template-columns: 1fr; }
  .quote p { max-width: 100%; }
}
