@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-normal-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

:root {
  --paper: #f6f4ef;
  --paper-raised: #ffffff;
  --ink: #343434;
  --ink-muted: #5e5c57;
  --line: #c9c4b8;
  --fjord: #1e4d5c;
  --on-fjord: #ffffff;
  --on-fjord-muted: #c9dade;
  --ember: #c7681f;
  --night: #181616;
  --night-2: #221f1d;
  --cream: #f3f1e4;
  --cream-muted: #b9b5a8;
  --on-cream: #181616;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: 96px;
  --r: 4px;
  --r-pill: 999px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1e1c1b;
    --paper-raised: #25282a;
    --ink: #dadada;
    --ink-muted: #c2c0b8;
    --line: #4a4e50;
    --fjord: #7fb3c0;
    --on-fjord: #10191c;
    --on-fjord-muted: #1f3b43;
    --ember: #e8955a;
    --night: #121010;
    --night-2: #1a1716;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav, .page-shell, .menu-toggle span { transition: none; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html:not([lang="en"]) [lang="en"] { display: none !important; }
html[lang="en"] [lang="no"]:not([data-keep]) { display: none !important; }

img { max-width: 100%; height: auto; }

a { color: var(--fjord); text-underline-offset: 3px; }

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

.skip {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 80;
  transform: translateY(-150%);
  background: var(--cream);
  color: var(--on-cream);
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(76rem, 100%);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.label {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
}

.meta {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.menu-toggle {
  display: none;
  position: fixed;
  z-index: 60;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: rgba(24, 22, 22, 0.88);
  color: var(--cream);
  cursor: pointer;
}

.js .menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.js.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.js.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.js.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.lang-toggle {
  position: fixed;
  z-index: 60;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--r-pill);
  background: rgba(24, 22, 22, 0.88);
}

.lang-toggle button {
  min-width: 44px;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--cream);
  font: 600 12px/16px var(--font-sans);
  letter-spacing: 0.14em;
  cursor: pointer;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--cream);
  color: var(--on-cream);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 20px max(20px, env(safe-area-inset-right, 0px)) 8px max(20px, env(safe-area-inset-left, 0px));
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 2px;
}

.nav a[aria-current="true"] { text-decoration: underline; text-underline-offset: 4px; }

.js .nav {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: min(280px, 84vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: calc(78px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0 24px 24px 0;
  background: rgba(24, 22, 22, 0.94);
  color: var(--cream);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateX(-105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 0.8, 0.22, 1), visibility 0s linear 0.42s;
}

.js.menu-open .nav {
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.js .nav a {
  color: var(--cream);
  padding: 12px 14px;
  border-radius: 14px;
}

.js .nav a:hover { background: rgba(255, 255, 255, 0.1); }
.js .nav a[aria-current="true"] { background: var(--cream); color: var(--on-cream); text-decoration: none; }
.js .nav :focus-visible { outline-color: var(--cream); }

.js .page-shell { transition: margin-left 0.42s cubic-bezier(0.22, 0.8, 0.22, 1); }
.js.menu-open .page-shell { margin-left: min(280px, 84vw); }

.hero {
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 60% 70% at 78% 40%, rgba(199, 104, 31, 0.22), transparent 70%),
    radial-gradient(ellipse 50% 60% at 15% 90%, rgba(30, 77, 92, 0.35), transparent 70%);
  color: var(--cream);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .95  0 0 0 0 .85  0 0 0 1.6 -.9'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: auto;
  padding-top: calc(78px + env(safe-area-inset-top, 0px));
  padding-bottom: var(--s6);
}

.topline { position: relative; z-index: 2; }

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin: 0;
}

.hero-contact a {
  color: var(--cream);
  font-weight: 500;
  text-decoration-thickness: 1px;
}

.hero-contact .sep { color: var(--cream-muted); }

.hero-photo {
  position: relative;
  z-index: 0;
  height: 58vh;
  max-height: 520px;
  margin: var(--s4) calc(-1 * max(20px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(20px, env(safe-area-inset-left, 0px)));
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}

.hero-body { position: relative; z-index: 1; padding-top: var(--s4); }

.hero h1 {
  font-size: clamp(52px, 14vw, 76px);
  line-height: 0.92;
  color: var(--cream);
}

.hero .eyebrow { color: var(--cream-muted); margin-bottom: var(--s4); }

.about-me {
  display: grid;
  gap: var(--s3);
  margin-top: var(--s5);
  max-width: 38em;
}

.about-me .label { color: var(--cream-muted); }

.about-me p:not(.label) {
  margin: 0;
  color: var(--cream);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 17rem);
  min-height: 48px;
  margin-top: var(--s5);
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--cream);
  color: var(--on-cream);
  text-decoration: none;
  font-weight: 600;
}

.pill:hover { background: #ffffff; }

.on-night :focus-visible { outline-color: var(--cream); }

section[id], footer[id], #top { scroll-margin-top: 84px; }

.block { padding: var(--s6) 0 0; }

.sec-head { display: grid; gap: var(--s3); margin-bottom: var(--s5); }

.sec-head h2 { font-size: clamp(44px, 10vw, 64px); line-height: 0.98; }

.sec-stat,
.role-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 16px;
  line-height: 1.45;
}

.sec-stat .n,
.role-stat .n {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.sec-stat .n { font-size: 40px; line-height: 1; }
.role-stat .n { font-size: clamp(44px, 8vw, 60px); line-height: 1; }
.role-stat .n.spark,
.sec-stat .n.spark { color: var(--ember); }
.role-stat .arrow { font-family: var(--font-sans); font-size: 0.42em; padding-inline: 0.25em; }

.timeline { margin: 0; padding: 0; }

.role {
  display: grid;
  gap: var(--s2);
  padding: var(--s5) 0;
  border-top: 1px solid var(--line);
}

.role:last-child { border-bottom: 1px solid var(--line); }

.when {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.role ul { margin: var(--s3) 0 0; padding-left: 1.15em; max-width: 42em; }
.role li + li { margin-top: var(--s2); }
.role .desc { margin: var(--s3) 0 0; max-width: 42em; }

.split { display: grid; gap: var(--s5); }

.list, .certs, .tags, .refs { list-style: none; margin: 0; padding: 0; }
.list { display: grid; gap: var(--s5); }
.list p { margin: var(--s2) 0 0; }

.small-sec { display: grid; gap: var(--s2); margin-top: var(--s5); }
.small-sec p { margin: 0; }
.small-sec h3 { font-size: 12px; line-height: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }

.tags { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tags li {
  padding: 6px 14px;
  border: 1px solid var(--ink-muted);
  border-radius: var(--r-pill);
  font-size: 14px;
  line-height: 20px;
}

.certs { margin-top: var(--s3); }
.certs li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: var(--s3);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.45;
}
.certs li:last-child { border-bottom: 1px solid var(--line); }
.certs .yr {
  font-family: var(--font-display);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.course-head { margin-bottom: var(--s2); }

.refs-feature { margin: 0; }
.refs-feature blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 8vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.refs-feature blockquote p { margin: 0; }
.refs-feature figcaption {
  margin-top: var(--s4);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-muted);
}
.refs-feature figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.refs {
  display: grid;
  gap: var(--s5);
  margin-top: var(--s6);
}

.ref {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}

.ref blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 23px;
  line-height: 1.35;
}
.ref blockquote p { margin: 0; }
.ref figcaption { font-size: 15px; line-height: 1.45; }
.ref figcaption strong { display: block; font-style: normal; font-weight: 600; }
.ref figcaption span { color: var(--ink-muted); }

.refs-note {
  margin: var(--s5) 0 0;
  max-width: 40em;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.contact {
  margin-top: var(--s6);
  background: var(--fjord);
  color: var(--on-fjord);
}

.contact a { color: var(--on-fjord); }
.contact .wrap { display: grid; gap: var(--s5); padding-block: var(--s6) var(--s5); }
.contact h2 { font-size: clamp(48px, 12vw, 80px); line-height: 0.95; color: var(--on-fjord); }
.contact .intro { margin: var(--s4) 0 0; max-width: 28em; }
.contact .label { color: var(--on-fjord); }
.cards { display: grid; gap: var(--s4); }
.ccard .val {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.2;
  color: var(--on-fjord);
  overflow-wrap: anywhere;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.ccard .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.copybtn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--on-fjord);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--on-fjord);
  font: 600 11px/14px var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.contact :focus-visible { outline-color: var(--on-fjord); }
.foot {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s3);
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--on-fjord-muted);
  font-size: 14px;
}

@media (min-width: 760px) {
  .wrap { padding-left: max(64px, env(safe-area-inset-left, 0px)); padding-right: max(64px, env(safe-area-inset-right, 0px)); }
  .role { grid-template-columns: 12rem minmax(0, 1fr); gap: var(--s5); align-items: start; }
  .refs { grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s5); }
  .contact .wrap { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; }
  .foot { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .hero .wrap { min-height: min(92vh, 860px); padding-bottom: var(--s7); }
  .hero-photo {
    position: absolute;
    z-index: 0;
    inset: 0 0 0 auto;
    width: 52%;
    max-width: 760px;
    height: auto;
    max-height: none;
    margin: 0;
  }
  .hero-photo img {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 38%);
    mask-image: linear-gradient(to right, transparent 0%, #000 38%);
  }
  .hero-body { max-width: min(40rem, 46vw); margin-top: auto; padding-top: var(--s6); }
  .hero h1 { font-size: clamp(64px, 7vw, 112px); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .sec-head h2 { font-size: clamp(56px, 6vw, 84px); }
}

@media (min-width: 1100px) {
  .refs { grid-template-columns: 1fr 1fr 1fr; }
}
