:root {
  --bg:       oklch(0.155 0.008 65);
  --bg-2:     oklch(0.185 0.009 65);
  --panel:    oklch(0.215 0.010 65);
  --panel-2:  oklch(0.255 0.011 65);
  --fg:       oklch(0.94 0.010 80);
  --dim:      oklch(0.68 0.014 72);
  --dimmer:   oklch(0.50 0.012 70);
  --accent:   oklch(0.80 0.145 72);
  --accent-2: oklch(0.86 0.10 78);
  --line:     oklch(0.30 0.010 70);
  --line-2:   oklch(0.40 0.013 70);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --maxw: 1180px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--sans);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; cursor: none;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 36px; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.dim { color: var(--dim); }

/* custom cursor */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; }
.cursor-dot { width: 6px; height: 6px; background: var(--accent); transform: translate(-50%,-50%); }
.cursor-ring {
  width: 34px; height: 34px; border: 1px solid var(--accent); transform: translate(-50%,-50%);
  transition: width .18s, height .18s, background .18s, opacity .18s; opacity: .55;
}
.cursor-ring.hot { width: 56px; height: 56px; background: color-mix(in oklch, var(--accent) 14%, transparent); opacity: 1; }
@media (hover: none) { body { cursor: auto; } .cursor-dot, .cursor-ring { display: none; } }

/* grain overlay */
body::after {
  content:""; position: fixed; inset:0; z-index: 9000; pointer-events:none; opacity:.035;
  background-image: radial-gradient(var(--fg) 0.5px, transparent 0.5px); background-size: 4px 4px;
}

/* nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; mix-blend-mode: difference; }
.nav-in {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 36px; max-width: var(--maxw); margin: 0 auto;
}
.nav .logo { font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: -0.02em; color: #fff; }
.nav .logo b { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-family: var(--mono); font-size: 13px; }
.nav-links a { color: #fff; opacity: .8; position: relative; }
.nav-links a:hover { opacity: 1; }
.nav-links a span { color: var(--accent); }

/* scroll reveal */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }

/* hero */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; position: relative; padding-top: 80px; }
.hero-tag {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  margin-bottom: 28px; display: flex; gap: 14px; align-items: center;
}
.hero-tag::before { content:""; width: 40px; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(54px, 12vw, 170px); font-weight: 600; line-height: 0.92; letter-spacing: -0.045em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 44px; max-width: 1000px; }
.hero-sub p { font-size: clamp(16px, 2vw, 21px); color: var(--dim); max-width: 48ch; }
.hero-sub p b { color: var(--fg); font-weight: 500; }
.scrollcue {
  position: absolute; bottom: 34px; left: 36px; font-family: var(--mono); font-size: 12px; color: var(--dim);
  display: flex; align-items: center; gap: 10px;
}
.scrollcue .ln { width: 1px; height: 40px; background: var(--line-2); position: relative; overflow: hidden; }
.scrollcue .ln::after {
  content:""; position:absolute; top:-50%; left:0; width:100%; height:50%;
  background: var(--accent); animation: drop 1.8s infinite;
}
@keyframes drop { to { top: 100%; } }

/* section heading */
.shead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  margin-bottom: 56px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 28px;
}
.shead .idx { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.shead h2 { font-size: clamp(30px, 5vw, 56px); font-weight: 600; letter-spacing: -0.03em; }
.shead .meta { font-family: var(--mono); font-size: 13px; color: var(--dim); }

section.block { padding: 110px 0; }

/* projects */
.proj-list { display: flex; flex-direction: column; gap: 90px; }
.proj { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.proj.alt { direction: rtl; }
.proj.alt > * { direction: ltr; }
.proj-visual { position: relative; }
.proj-frame {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2);
  box-shadow: 0 30px 70px -40px rgba(0,0,0,.8);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), border-color .4s;
  will-change: transform;
}
.proj:hover .proj-frame { border-color: var(--line-2); }
.frame-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.fb-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.fb-dot.a { background: var(--accent); }
.fb-name { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.frame-body { padding: 22px; font-family: var(--mono); font-size: 13px; line-height: 1.75; min-height: 230px; }
.frame-body .p { color: var(--accent); }
.frame-body .c { color: var(--fg); }
.frame-body .o { color: var(--dim); }
.frame-body .k { color: var(--accent); }
.frame-body .n { color: var(--accent-2); }
.frame-body pre { font-family: var(--mono); white-space: pre; color: var(--dim); }
.bignum { position: absolute; top: -38px; left: -10px; font-family: var(--mono); font-size: 15px; color: var(--accent); }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 130px; margin-bottom: 18px; }
.spark span { flex: 1; background: color-mix(in oklch, var(--accent) 45%, transparent); border-radius: 3px 3px 0 0; min-height: 5px; }
.spark span.last { background: var(--accent); }
.mrow { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 8px 0; }
.mrow .mk { color: var(--dim); }
.mrow .mv { color: var(--accent); }
.stripe {
  min-height: 230px; background-image: repeating-linear-gradient(135deg, var(--panel) 0 11px, var(--bg-2) 11px 22px);
  display:flex; align-items:center; justify-content:center; margin:-22px;
}
.stripe span { background: var(--bg); border: 1px solid var(--line); color: var(--dim); padding: 7px 13px; border-radius: 5px; font-family: var(--mono); font-size: 12px; }
.proj-info .pn-row { display: flex; align-items: baseline; gap: 16px; }
.proj-info h3 { font-size: clamp(30px, 4vw, 48px); font-weight: 600; letter-spacing: -0.03em; }
.proj-info .yr { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.proj-info .blurb { font-size: 18px; color: var(--fg); margin-top: 18px; max-width: 42ch; }
.proj-info .detail { font-size: 15px; color: var(--dim); margin-top: 16px; max-width: 46ch; }
.proj-info .role { font-family: var(--mono); font-size: 13px; color: var(--dim); margin-top: 22px; }
.proj-info .role b { color: var(--fg); font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.tag {
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 13px;
  transition: background .2s, color .2s;
}
.proj:hover .tag { border-color: color-mix(in oklch, var(--accent) 45%, var(--line-2)); }
.proj-link { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-top: 18px; display: inline-block; transition: opacity .2s; }
.proj-link.pending { color: var(--dimmer); cursor: default; pointer-events: none; }

/* stack */
.stack-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.stack-col { background: var(--bg); padding: 30px 26px; transition: background .25s; }
.stack-col:hover { background: var(--bg-2); }
.stack-col .h {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 22px;
}
.stack-col .item { font-size: 20px; font-weight: 500; padding: 9px 0; color: var(--fg); border-bottom: 1px solid transparent; transition: color .15s; }
.stack-col .item:hover { color: var(--accent); }
.stack-num { font-family: var(--mono); font-size: 12px; color: var(--dimmer); margin-right: 12px; }

/* contact */
.cta { text-align: center; padding: 60px 0 30px; }
.cta .small { font-family: var(--mono); font-size: 14px; color: var(--accent); margin-bottom: 26px; }
.cta h2 { font-size: clamp(40px, 9vw, 120px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
.cta h2 a { color: var(--accent); text-decoration: none; position: relative; white-space: nowrap; }
.cta h2 a::after {
  content:""; position:absolute; left:0; bottom: 0.08em; width:100%; height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.cta h2 a:hover::after { transform: scaleX(1); }
.links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 60px; }
.links a {
  font-family: var(--mono); font-size: 14px; color: var(--dim);
  border: 1px solid var(--line); padding: 12px 22px; border-radius: 999px; transition: all .2s;
}
.links a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

footer { border-top: 1px solid var(--line); padding: 40px 0; }
.foot-in { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: center; }
.switch { color: var(--accent); border: 1px solid color-mix(in oklch,var(--accent) 50%, var(--line)); padding: 7px 16px; border-radius: 999px; transition: all .2s; }
.switch:hover { background: var(--accent); color: var(--bg); }

@media (max-width: 860px) {
  .proj, .proj.alt { grid-template-columns: 1fr; direction: ltr; gap: 28px; }
  .stack-grid { grid-template-columns: repeat(2,1fr); }
  .nav-links { display: none; }
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
  section.block { padding: 80px 0; }
}
