
:root {
  --bg:        #0a0b0d;
  --bg-elev:   #101217;
  --bg-elev-2: #15181e;
  --text:      #f3f4f6;
  --text-muted:#9aa1ac;
  --text-dim:  #656b75;
  --border:    rgba(255,255,255,0.09);
  --border-2:  rgba(255,255,255,0.16);
  --accent:    #c6f24e;
  --accent-text: #c6f24e;
  --accent-ink: #0a0b0d;
  --shadow:    0 24px 60px -28px rgba(0,0,0,0.7);
  --grid-line: rgba(255,255,255,0.04);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;
  --radius-sm: 9px;
}

[data-theme="light"] {
  --bg:        #f4f4f1;
  --bg-elev:   #ffffff;
  --bg-elev-2: #fbfbf9;
  --text:      #14161a;
  --text-muted:#52585f;
  --text-dim:  #868c94;
  --border:    rgba(0,0,0,0.10);
  --border-2:  rgba(0,0,0,0.18);
  --accent:    #c6f24e;
  --accent-text: #4f7a00;
  --accent-ink: #14161a;
  --shadow:    0 24px 60px -30px rgba(20,22,26,0.22);
  --grid-line: rgba(0,0,0,0.04);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}

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

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { position: relative; z-index: 1; padding-block: clamp(72px, 11vw, 150px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--accent-text);
  opacity: .6;
}

.section-head { margin-bottom: clamp(36px, 5vw, 60px); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 50px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 16px;
  max-width: 18ch;
  text-wrap: balance;
}


.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gutter);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }

.brand {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent); }
  50%     { box-shadow: 0 0 0 7px color-mix(in oklab, var(--accent) 6%, transparent); }
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 3px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-num { color: var(--text-dim); margin-right: 3px; }

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

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, transform .2s, background .2s;
}
.theme-toggle:hover { border-color: var(--border-2); transform: rotate(-12deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }

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


.hero {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 90px;
}
.hero-inner { max-width: 960px; }

.hero .status {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 30px;
  white-space: nowrap;
}
.hero .status .live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.hero .status .live::after {
  content:""; position:absolute; inset:-4px; border-radius:50%;
  border: 1px solid var(--accent);
  animation: ring 2s ease-out infinite;
}
@keyframes ring { 0%{transform:scale(.6);opacity:.8} 100%{transform:scale(1.6);opacity:0} }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 9vw, 116px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 26px;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line span { display: inline-block; }
.hero h1 em {
  font-style: normal;
  color: var(--text-dim);
}

.hero .role {
  font-family: var(--font-mono);
  font-size: clamp(15px, 2.4vw, 21px);
  color: var(--text-muted);
  margin-bottom: 34px;
  min-height: 1.6em;
}
.hero .role .typed { color: var(--text); }
.hero .role .caret {
  display: inline-block;
  width: 9px; height: 1.05em;
  background: var(--accent);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero .lead {
  max-width: 56ch;
  color: var(--text-muted);
  font-size: clamp(16px, 2vw, 19px);
  margin-bottom: 40px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 13px 20px;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  transition: transform .2s, background .2s, border-color .2s, color .2s;
  cursor: pointer;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px color-mix(in oklab, var(--accent) 55%, transparent); }
.btn-ghost:hover { border-color: var(--text); transform: translateY(-2px); }

.hero-meta {
  margin-top: clamp(48px, 8vw, 96px);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 6vw, 70px);
  border-top: 1px solid var(--border);
  padding-top: 26px;
}
.hero-meta .stat .num {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-meta .stat .num b { color: var(--accent-text); font-weight: 600; }
.hero-meta .stat .lbl {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about-body p { margin-bottom: 20px; color: var(--text-muted); font-size: clamp(17px,2vw,20px); }
.about-body p strong { color: var(--text); font-weight: 600; }
.about-body p:last-child { margin-bottom: 0; }

.about-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}
.about-card .row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.about-card .row:last-child { border-bottom: 0; padding-bottom: 0; }
.about-card .row:first-child { padding-top: 0; }
.about-card .k { color: var(--text-dim); }
.about-card .v { color: var(--text); text-align: right; }
.about-card .v a:hover { color: var(--accent-text); }


.projects { display: flex; flex-direction: column; gap: 22px; }

.project {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.project::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(700px circle at var(--mx,50%) var(--my,0%), color-mix(in oklab,var(--accent) 9%, transparent), transparent 45%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.project:hover { border-color: var(--border-2); transform: translateY(-3px); }
.project:hover::after { opacity: 1; }

.project.featured {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: clamp(24px, 4vw, 50px);
  align-items: center;
}

.project .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.project h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.project.featured h3 { font-size: clamp(30px, 4.5vw, 48px); }
.project h3 { font-size: clamp(22px, 3vw, 30px); }

.project .meta-line {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.project p { color: var(--text-muted); margin-bottom: 20px; max-width: 60ch; }
.project.featured p { font-size: 17px; }

.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack .chip {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  white-space: nowrap;
}

.terminal {
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  box-shadow: var(--shadow);
}
.terminal .bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.terminal .bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.terminal .bar .r { background: #ff5f57; } .terminal .bar .y { background: #febc2e; } .terminal .bar .g { background: #28c840; }
.terminal .bar .ttl { margin-left: 8px; color: var(--text-dim); font-size: 12px; }
.terminal .body { padding: 18px; line-height: 1.85; }
.terminal .ln { display: block; white-space: pre-wrap; }
.terminal .c-key { color: var(--accent-text); }
.terminal .c-str { color: #e8d77a; }
.terminal .c-dim { color: var(--text-dim); }
[data-theme="light"] .terminal .c-str { color: #9a7d00; }

.proj-side { display: flex; flex-direction: column; gap: 20px; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.proj-grid .project { padding: clamp(22px, 3vw, 32px); }


.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.skill-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 26px;
}
.skill-group h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.skill-group h4 .idx { color: var(--accent-text); }
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list span {
  font-family: var(--font-mono);
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  transition: border-color .2s, color .2s, transform .2s;
}
.skill-list span:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }


.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 90px); }

.timeline { position: relative; }
.tl-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 34px;
  border-left: 1px solid var(--border);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute; left: -5px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text-dim);
  transition: border-color .3s, background .3s;
}
.tl-item.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab,var(--accent) 20%, transparent); }
.tl-item .when {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.tl-item h4 { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.tl-item .org { color: var(--accent-text); font-size: 14.5px; margin-bottom: 8px; font-family: var(--font-mono); }
.tl-item p { color: var(--text-muted); font-size: 15px; }

.col-head {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  margin-bottom: 26px;
  display: flex; align-items: center; gap: 10px;
}
.col-head::before { content:""; width: 22px; height:1px; background: var(--accent-text); opacity:.6; }


.contact { text-align: center; }
.contact .big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 8vw, 90px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 18px 0 14px;
}
.contact .big a { transition: color .2s; }
.contact .big a:hover { color: var(--accent-text); }
.contact .sub { color: var(--text-muted); max-width: 48ch; margin: 0 auto 36px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.footer {
  border-top: 1px solid var(--border);
  padding: 30px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  position: relative; z-index: 1;
}
.footer a:hover { color: var(--text); }


@keyframes reveal-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.reveal-on .reveal { opacity: 0; }
.reveal-on .reveal.in {
  animation: reveal-in .7s cubic-bezier(.2,.7,.2,1) both;
}
.reveal-on .reveal.in[data-d="1"] { animation-delay: .08s; }
.reveal-on .reveal.in[data-d="2"] { animation-delay: .16s; }
.reveal-on .reveal.in[data-d="3"] { animation-delay: .24s; }
.reveal-on .reveal.in[data-d="4"] { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal-on .reveal, .reveal-on .reveal.in { opacity: 1; transform: none; animation: none; }
}


@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .project.featured { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .proj-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 22px 36px; }
  .btn { flex: 1 1 auto; justify-content: center; }
}
