:root {
  color-scheme: dark;

  --graphite: #18191b;
  --graphite-2: #222427;
  --cloud: #eff0f1;
  --cloud-2: #e1e2e5;
  --grey-on-dark: #9c9ea3;
  --grey-on-light: #575a60;
  --orange: #ff4a1f;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step-small: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  --step-title: clamp(1.75rem, 1.1rem + 2vw, 2.75rem);
  --step-head: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(0.75rem, 1.4vw, 1.5rem);
  --sec-gap: clamp(3.5rem, 2rem + 4vw, 6.5rem);
  --fade-h: 88px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

[data-skin] {
  --bg: var(--graphite);
  --surface: var(--graphite-2);
  --ink: var(--cloud);
  --muted: var(--grey-on-dark);
  --i-bg: var(--cloud);
  --i-surface: var(--cloud-2);
  --i-ink: var(--graphite);
  --i-muted: var(--grey-on-light);
  --accent: var(--orange);
  --accent-ink: var(--graphite);
}
[data-skin="light"] {
  color-scheme: light;
  --bg: var(--cloud);
  --surface: var(--cloud-2);
  --ink: var(--graphite);
  --muted: var(--grey-on-light);
  --i-bg: var(--graphite);
  --i-surface: var(--graphite-2);
  --i-ink: var(--cloud);
  --i-muted: var(--grey-on-dark);
}
.inv {
  --bg: var(--i-bg);
  --surface: var(--i-surface);
  --ink: var(--i-ink);
  --muted: var(--i-muted);
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 800; hyphens: none; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.hdr {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: flex-end; gap: 24px;
  padding: 22px var(--margin);
  font-size: var(--step-small); font-weight: 600;
}
.hdr nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.nv, .lang-btn, .skin-btn {
  color: var(--ink); text-decoration: none;
  text-underline-offset: 0.25em; text-decoration-thickness: 0.08em;
}
.nv:hover, .lang-btn:hover, .skin-btn:hover, .nv[data-on="1"] { text-decoration-line: underline; }
.skin-btn {
  font: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}

.nv-act {
  background: var(--accent); color: var(--accent-ink);
  padding: 9px 16px; border-radius: 999px;
  transition: transform .2s var(--ease);
}
.nv-act:hover { text-decoration-line: none; transform: translateY(-1px); }
.nv-act[data-on="1"] { text-decoration-line: none; }

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter); row-gap: clamp(28px, 3.5vw, 48px);
  padding: clamp(120px, 16vh, 180px) var(--margin) 0;
}

.name {
  grid-column: 1 / 10; grid-row: 1; position: relative;
  font-size: clamp(3rem, 1.2rem + 6.4vw, 7.5rem);
  line-height: 0.92; letter-spacing: -0.05em;
  margin-left: -0.04em;
}
.name-fx { position: absolute; left: 0; top: 0; white-space: nowrap; }
.name.is-fx .name-txt { color: transparent; }
.name-fx .g { color: var(--accent); }
.caret {
  display: inline-block; width: 0.08em; height: 0.78em; margin-left: 0.06em;
  background: var(--accent); vertical-align: baseline;
  opacity: 0;
}

.name.is-fx > .caret { opacity: 0; }
.name-fx .caret { opacity: 1; }
.name.is-done .caret { opacity: 1; animation: blink 1s steps(1) infinite; }
.name.is-gone .caret { opacity: 0; animation: none; transition: opacity .4s; }
@keyframes blink { 50% { opacity: 0; } }

.cr-on { position: relative; }
.cr-on .cr-ph {
  display: inline-block;
  opacity: 0; filter: blur(10px); letter-spacing: 0.12em;
  transform: translateY(6px);
}
.cr-render .cr-ph {
  opacity: 1; filter: blur(0); letter-spacing: inherit; transform: none;
  transition: opacity .5s var(--ease), filter .6s var(--ease),
              letter-spacing .7s var(--ease), transform .6s var(--ease);
}
.cr-fx {
  position: absolute; left: 0; bottom: 0.08em;
  font-family: var(--font-code); font-weight: 400;
  font-size: max(14px, 0.42em); letter-spacing: 0; line-height: 1.2;
  white-space: nowrap;
}

.cr-t { color: var(--accent); }
.cr-k { color: var(--muted); }
.cr-a { color: var(--muted); }
.cr-x { color: var(--ink); }
.cr-cur {
  display: inline-block; width: 0.55em; height: 1.05em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--accent);
  animation: blink .8s steps(1) infinite;
}
.cr-render .cr-fx {
  opacity: 0; filter: blur(6px); transform: translateY(-0.6em);
  transition: opacity .35s var(--ease), filter .35s var(--ease), transform .45s var(--ease);
}

.hero-copy {
  grid-column: 1 / 8; grid-row: 2; align-self: start;
  display: flex; flex-direction: column;
}

.code-flow {
  grid-column: 8 / -1; grid-row: 1 / 3; align-self: stretch;
  position: relative; overflow: hidden; min-height: 420px;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 84%, transparent);
}
.cf-back { position: absolute; left: -40px; top: 0; will-change: transform; }
.cf-back canvas {
  display: block; will-change: transform;
  animation: cf-scroll linear infinite;
}
.cf-front { position: absolute; inset: 0; display: block; }
.code-flow.is-paused .cf-back canvas { animation-play-state: paused; }
@keyframes cf-scroll { to { transform: translate3d(0, calc(-1 * var(--loop)), 0); } }
.name { z-index: 1; }

.lead {
  font-size: var(--step-lead); font-weight: 600; line-height: 1.12; letter-spacing: -0.03em;
  max-width: 22ch;
}
#mainDesc { margin-top: 32px; max-width: 54ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 36px; }

.btn {
  display: inline-flex; align-items: center; min-height: 48px;
  padding: 0 24px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
  transition: transform .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.tlink {
  font-weight: 600; text-decoration: underline;
  text-underline-offset: 0.22em; text-decoration-thickness: 0.07em;
  transition: text-decoration-thickness .15s;
}
.tlink:hover { text-decoration-thickness: 0.16em; }

.avail { margin-top: 20px; font-size: var(--step-small); color: var(--muted); }

.sec {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  padding: var(--sec-gap) var(--margin) 0;
}
.sec > * { grid-column: 5 / -1; }
.sec > .sec-head {
  grid-column: 1 / 5; align-self: start;
  position: sticky; top: 32px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding-right: var(--gutter);
}
.sec-h { font-size: var(--step-head); line-height: 1; letter-spacing: -0.04em; }
.count { font-size: var(--step-small); color: var(--muted); }
.section-desc { color: var(--muted); max-width: 30ch; }
.section-desc b { color: var(--ink); font-weight: 600; }

.card, .row, .job { position: relative; }
.card::before, .row::before {
  content: ""; position: absolute; inset: 0 -16px;
  border-radius: 10px;
  background: var(--surface); opacity: 0; z-index: -1;
  transition: opacity .2s var(--ease);
}
.card:hover::before, .card:focus-visible::before, .row:hover::before { opacity: 1; }

.feat { display: flex; flex-direction: column; }
.card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 24px; row-gap: 6px;
  padding: 20px 0; text-decoration: none;
}
.card-t {
  grid-column: 1; font-size: var(--step-lead); font-weight: 600;
  line-height: 1.15; letter-spacing: -0.03em;
  transition: color .2s;
}
a.card:hover .card-t { color: var(--accent); }

.card-static::before, .row-static::before { display: none; }
.card-b { grid-column: 1; color: var(--muted); max-width: 62ch; }
.card-m {
  grid-column: 2; grid-row: 1; align-self: baseline; justify-self: end;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: var(--step-small); color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.card-s { font-size: var(--step-small); color: var(--muted); }
.ar {
  grid-column: 3; grid-row: 1; justify-self: end; align-self: start;
  font-size: var(--step-body); line-height: 1;
  transition: transform .25s var(--ease), color .2s;
}
.card:hover .ar, .row:hover .ar { transform: translate(3px, -3px); color: var(--accent); }

.archive { margin-top: 12px; }
.row {
  display: grid; grid-template-columns: 8ch minmax(0, 1fr) auto; column-gap: 24px;
  align-items: baseline; padding: 14px 0; text-decoration: none;
}
.row-y { color: var(--muted); font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.row-main { display: flex; flex-direction: column; gap: 2px; }
.row-n { font-weight: 600; }
.row-b { color: var(--muted); font-size: var(--step-small); }
.row-s { display: none; }
.row .ar { grid-column: 3; grid-row: 1; }

.job {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px;
  padding: 20px 0;
}
.job-p {
  grid-column: 1; font-size: var(--step-small); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.job-main { grid-column: 1; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.job-t { font-size: var(--step-lead); font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; }
.job-t .sep { color: var(--muted); }
.job-n { max-width: 62ch; }
.job-tg {
  grid-column: 2; grid-row: 1 / 3; align-self: center;
  width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 20px; font-weight: 400; line-height: 1; cursor: pointer;
  transition: transform .3s var(--ease), background .2s;
}
.job-tg:hover { background: var(--accent); color: var(--accent-ink); }
.job[data-open="1"] .job-tg { transform: rotate(45deg); }

.job-det {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .35s var(--ease);
}
.job[data-open="1"] .job-det { grid-template-rows: 1fr; }
.job-det > ul { overflow: hidden; }
.job-li { position: relative; padding-left: 20px; max-width: 62ch; }
.job-li:first-child { margin-top: 14px; }
.job-li + .job-li { margin-top: 6px; }
.job-li::before {
  content: ""; position: absolute; left: 0; top: 0.68em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
}

.inv { --edge: calc(var(--sec-gap) * 0.8); margin-top: var(--edge); padding-bottom: var(--edge); }
.inv > .sec:first-child { padding-top: var(--edge); }
.inv + .sec { padding-top: calc(var(--sec-gap) * 0.8); }

.stack {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px var(--gutter);
}
.stack-g { font-size: var(--step-lead); font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; }
.stack-pills { margin-top: 10px; color: var(--muted); }
.stack-pill { display: block; }
.stack-pill + .stack-pill { margin-top: 2px; }

.about {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px var(--gutter);
}
.about-main { grid-column: 1 / -1; }

.statement {
  font-size: var(--step-lead); font-weight: 600;
  line-height: 1.3; letter-spacing: -0.02em;
  max-width: 48ch;
}
.about-main p + p { margin-top: 20px; max-width: 62ch; color: var(--muted); }
.about-side {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px var(--gutter);
}
.about-k { font-size: var(--step-small); font-weight: 600; color: var(--muted); }
.about-v { margin-top: 6px; }
.about-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.tagchip {
  background: var(--surface); padding: 6px 14px; border-radius: 999px;
  font-size: var(--step-small); font-weight: 600;
}

.closing {
  margin-top: var(--edge);
  padding: var(--edge) var(--margin) 0;
  overflow: hidden;
}
.contact-box {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  align-items: start;
}
.contact-box > * { grid-column: 5 / -1; justify-self: start; }
.contact-box > .sec-h { grid-column: 1 / 5; grid-row: 1 / 5; }
.contact-mail {
  font-size: var(--step-title); font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  text-decoration: underline; text-underline-offset: 0.12em; text-decoration-thickness: 0.06em;
  overflow-wrap: anywhere;
  transition: color .2s;
}
.contact-mail:hover { color: var(--accent); }
.contact-note { margin-top: 20px; max-width: 46ch; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px; }

.foot { margin-top: clamp(48px, 6vw, 96px); }

.foot-name {
  font-size: clamp(3rem, 1.2rem + 6.4vw, 7.5rem); font-weight: 800;
  line-height: 0.92; letter-spacing: -0.05em;
  margin-left: -0.04em;
}
.foot-row {
  display: flex; justify-content: space-between; gap: 24px;
  font-size: var(--step-small); color: var(--muted);
  padding: 20px 0 calc(var(--fade-h) + 26px);
}

.term {
  --t-bg: #0f1012; --t-bar: #17181b; --t-line: #26282c;
  --t-ink: #e6e7e9; --t-soft: #b4b7bc; --t-dim: #7d8187;
  border: 1px solid var(--t-line); border-radius: 12px;
  background: var(--t-bg); color: var(--t-ink); overflow: hidden;
  font-family: var(--font-code); font-size: 13px; line-height: 1.7; letter-spacing: 0;
}
.term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--t-line); background: var(--t-bar);
}
.term-dots { display: flex; gap: 6px; flex: none; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--t-line); display: block; }
.term-dots i:first-child { background: var(--orange); }
.term-path { font-size: 11px; color: var(--t-dim); }

.term-out {
  padding: 16px; height: 300px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--t-line) transparent;
}
.term-out::-webkit-scrollbar { width: 8px; }
.term-out::-webkit-scrollbar-thumb { background: var(--t-line); border-radius: 4px; }
.term-out::-webkit-scrollbar-track { background: transparent; }

.term-line { color: var(--t-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.term-gap { height: 10px; }
.term-dim { color: var(--t-dim); }

.term-ai { color: var(--t-ink); }
.term-warn { color: var(--orange); }

.term-echo { display: flex; gap: 9px; color: var(--t-ink); margin-top: 8px; }
.term-echo:first-child { margin-top: 0; }
.term-echo .term-ps { flex: none; }

.term-row { display: grid; grid-template-columns: minmax(0, 13ch) minmax(0, 1fr); gap: 14px; }
.term-k { color: var(--orange); overflow-wrap: anywhere; }
.term-v { color: var(--t-soft); overflow-wrap: anywhere; }

.term-form {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-top: 1px solid var(--t-line); background: var(--t-bar);
}
.term-ps { flex: none; color: var(--orange); font-size: 13px; user-select: none; }
.term-in {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; color: var(--t-ink); caret-color: var(--orange); padding: 0;
}
.term-in::placeholder { color: var(--t-dim); }
.term:focus-within { border-color: var(--orange); }

.prog {
  position: fixed; left: 0; right: 0; bottom: 0; height: 3px; z-index: 60;
  pointer-events: none;
}
.prog > i {
  display: block; height: 100%;
  width: calc(var(--p, 0) * 100%); background: var(--accent);
}
.prog[data-on="0"] { opacity: 0; }

.fade-bot {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--fade-h); z-index: 20;
  pointer-events: none; isolation: isolate;
}
.fade-bot > div { position: absolute; inset: 0; }
.fade-bot > div:nth-child(1) {
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 40%, transparent 60%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 20%, #000 40%, transparent 60%);
}
.fade-bot > div:nth-child(2) {
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 20%, #000 40%, #000 60%, transparent 80%);
          mask-image: linear-gradient(to bottom, transparent 20%, #000 40%, #000 60%, transparent 80%);
}
.fade-bot > div:nth-child(3) {
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 40%, #000 60%, #000 80%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 40%, #000 60%, #000 80%, transparent 100%);
}
.fade-bot > div:nth-child(4) {
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 60%, #000 85%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 60%, #000 85%, #000 100%);
}
.fade-bot > div:nth-child(5) {
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 80%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 80%, #000 100%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .fade-bot { display: none; }
}

.js .rv {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms);
}
.js .rv.in { opacity: 1; transform: none; }

.js [data-wait] { visibility: hidden; opacity: 0; }
.js #publicProjectsList { transition: opacity .35s var(--ease); }
.js .hero-copy > *, .js .eyebrow { animation: fade-up .8s var(--ease) both; animation-delay: .9s; }
.js .hero-copy > :nth-child(2) { animation-delay: .97s; }
.js .hero-copy > :nth-child(3) { animation-delay: 1.04s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; transition: none; }
  .cf-back canvas { animation: none; }
  .js .hero-copy > *, .js .eyebrow { animation: none; }
  .caret { display: none; }
  .card-t, .ar, .btn, .nv-act, .job-tg, .job-det { transition: none; }
}

@media (max-width: 1000px) {
  .code-flow { display: none; }
  .name, .hero-copy { grid-column: 1 / -1; }
  .hero-copy { grid-row: 2; }
}

@media (max-width: 760px) {
  :root { --fade-h: 64px; }
  .hdr { padding-top: 16px; padding-bottom: 16px; }
  .hdr .nv:not(.nv-act) { display: none; }
  .nv-act { padding: 8px 14px; }

  .hero { padding-top: 104px; row-gap: 20px; }
  .name { font-size: 15.5vw; }
  #mainDesc { margin-top: 24px; }
  .cta { margin-top: 28px; }

  .sec > *, .sec > .sec-head { grid-column: 1 / -1; }
  .sec > .sec-head { position: static; margin-bottom: 20px; padding-right: 0; }
  .foot-name { font-size: 15.5vw; }
  .card { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; padding: 16px 0; }
  .card .ar { grid-column: 2; }
  .card-m { grid-column: 1; grid-row: auto; justify-self: start; align-items: flex-start; }
  .ar { grid-row: 1; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row-y { grid-column: 1; }
  .row-main { grid-column: 1; }
  .row .ar { grid-column: 2; }
  .stack { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .about-side { grid-template-columns: minmax(0, 1fr); }
  .contact-box > *, .contact-box > .sec-h { grid-column: 1 / -1; grid-row: auto; }
  .contact-box > .sec-h { margin-bottom: 16px; }
  .term { font-size: 12.5px; }
  .term-out { height: 240px; padding: 12px; }
  .term-row { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .foot-row { flex-direction: column; gap: 4px; }

  .contact-mail { font-size: 7.2vw; overflow-wrap: normal; }
}
