:root {
  --paper: #eef1ec;
  --ink: #17221e;
  --muted: #5b6a63;
  --line: #c9d2cb;
  --caption: #ffd43b;
  --surface: #f7f9f5;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --hero: clamp(2.4rem, 6.2vw, 4.6rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }

a { color: inherit; }
a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: .5rem 1rem;
  z-index: 10;
}
.skip:focus { top: 1rem; }

.wrap {
  width: min(1080px, 100% - 3rem);
  margin-inline: auto;
}

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}
.me {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 700;
  text-decoration: none;
}
.me img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.top nav { display: flex; gap: 1.5rem; font-size: var(--step--1); }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero { padding-block: clamp(3rem, 10vw, 7rem) clamp(3rem, 8vw, 5.5rem); }
.role { color: var(--muted); margin-bottom: 1.25rem; }

h1 {
  font-size: var(--hero);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 17ch;
}

/* Karaoke caption: words light up one by one, like a Short's subtitle */
h1 .w {
  display: inline;
  padding: 0 .08em;
  margin: 0 -.08em;
  border-radius: .12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color .12s, background-color .12s;
}
h1.playing .w { color: #a9b5ae; }
h1.playing .w.said { color: var(--ink); }
h1.playing .w.on { color: var(--ink); background: var(--caption); }

.lede {
  margin-top: 2rem;
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.5;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}
.btn {
  display: inline-block;
  padding: .7rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--caption); color: var(--ink); border-color: var(--ink); }

/* Section layout: heading column + content column */
.block {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 2rem 4rem;
  padding-block: 3.5rem;
  border-top: 2px solid var(--ink);
}
.head h2 {
  font-size: var(--step-2);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.sub { margin-top: .5rem; color: var(--muted); font-size: var(--step--1); }
.body { max-width: 66ch; }
.body > * + * { margin-top: 1.25rem; }

.stack { color: var(--muted); font-size: var(--step--1); }
.note { color: var(--muted); }

.link {
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--caption);
}
.link:hover { text-decoration-color: var(--ink); }

/* Pipeline steps drawn as clips on an editing timeline */
.track {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1.3fr 1.3fr 1fr;
  gap: 4px;
  margin-block: 2rem;
  counter-reset: clip;
}
.track li {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: .75rem .8rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  counter-increment: clip;
}
.track li:last-child { background: var(--caption); }
.track .step { font-weight: 800; }
.track .step::before {
  content: counter(clip) " ";
  color: var(--muted);
  font-weight: 500;
}
.track li:last-child .step::before { color: var(--ink); }
.track .what { font-size: .8rem; line-height: 1.35; color: var(--muted); }
.track li:last-child .what { color: var(--ink); }

/* Qintess cases */
.cases > div {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.cases > div:first-child { padding-top: 0; }
.cases dt { font-weight: 800; font-size: var(--step-1); }
.cases dd + dd { margin-top: .4rem; }
.cases dd:first-of-type { margin-top: .35rem; }

/* Projects */
.projects li {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.projects li:first-child { padding-top: 0; }
.projects a { text-decoration: none; display: inline-block; }
.projects h3 {
  font-size: var(--step-1);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  text-decoration-color: var(--caption);
}
.projects a:hover h3 { text-decoration-color: var(--ink); }
.projects p { margin-top: .35rem; }
.minor { font-size: var(--step-1); font-weight: 800; margin-top: 2.25rem !important; }

/* Tools */
.tools > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding-block: .6rem;
  border-bottom: 1px solid var(--line);
}
.tools dt { font-weight: 700; }

/* Footer */
.foot {
  border-top: 2px solid var(--ink);
  padding-block: 4rem 5rem;
}
.foot h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.foot > p { margin-top: 1rem; max-width: 55ch; }
.mail a {
  font-size: var(--step-2);
  font-weight: 700;
  text-decoration-color: var(--caption);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  word-break: break-all;
}
.mail a:hover { text-decoration-color: var(--ink); }

@media (max-width: 820px) {
  .block { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2.75rem; }
  .track { grid-template-columns: 1fr; }
  .track li { flex-direction: row; align-items: baseline; gap: .75rem; }
  .track .step { min-width: 7.5rem; }
  .top nav { display: none; }
}

@media (max-width: 480px) {
  .tools > div { grid-template-columns: 1fr; gap: .1rem; }
  .track li { flex-direction: column; gap: .2rem; }
}
