/* Layout idea: one calm column. A sticky skills rail sits beside the experience timeline.
   Cool neutrals with a single ledger-green accent; weight and tight tracking carry the personality. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --ink: #111a16;
  --muted: #55645d;
  --line: #dce3df;
  --accent: #0a7a5c;
  --accent-soft: #e0f2ea;
  --on-accent: #ffffff;

  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --wrap: 1040px;
  --header-h: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1210;
    --surface: #131b18;
    --ink: #e8eeeb;
    --muted: #93a39b;
    --line: #25302b;
    --accent: #3ecf9f;
    --accent-soft: #12332a;
    --on-accent: #06231a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c1210;
  --surface: #131b18;
  --ink: #e8eeeb;
  --muted: #93a39b;
  --line: #25302b;
  --accent: #3ecf9f;
  --accent-soft: #12332a;
  --on-accent: #06231a;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
a { color: inherit; }
ul, ol, dl, dd, p, h1, h2, h3 { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }

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

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

/* Lens: show only what belongs to the selected focus */
body[data-lens="finance"] [data-only="it"],
body[data-lens="it"] [data-only="finance"] { display: none; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.nav { display: none; gap: 1.5rem; margin-left: auto; font-size: 0.9375rem; color: var(--muted); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--ink); }
@media (min-width: 820px) { .nav { display: flex; } }

.lens {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.lens button {
  font: 500 0.8125rem var(--font-body);
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.lens button:hover { color: var(--ink); }
.lens button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4rem); }
.eyebrow {
  font: 500 0.8125rem var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
h1 {
  font-size: clamp(2.75rem, 9vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.headline {
  margin-top: 1rem;
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--accent);
  max-width: 34rem;
  line-height: 1.25;
}
.summary { margin-top: 1.5rem; max-width: 40rem; font-size: 1.1875rem; line-height: 1.6; color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-1px); }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.facts dt {
  font: 500 1.625rem var(--font-mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.facts dd { color: var(--muted); font-size: 0.9375rem; max-width: 12rem; }

/* Experience + skills */
.split { display: grid; gap: 2.5rem; padding-block: 2rem 4rem; }
@media (min-width: 900px) {
  .split { grid-template-columns: 250px minmax(0, 1fr); gap: 4rem; align-items: start; }
  .skills { position: sticky; top: calc(var(--header-h) + 24px); }
}

h2 {
  font-size: 0.8125rem;
  font: 500 0.8125rem var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.skills { display: flex; flex-direction: column; gap: 1.5rem; }
.skills h2 { margin-bottom: 0; order: -3; }
.hint { color: var(--muted); font-size: 0.9375rem; margin-top: -0.75rem; order: -2; }
.skill-group h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.6rem; }
body[data-lens="it"] .skill-group[data-group="tech"] { order: -1; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font: 500 0.875rem var(--font-body);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Timeline bar */
.tl { margin-bottom: 2.5rem; }
.tl-bar { display: flex; gap: 3px; height: 2.75rem; }
.tl-bar li { flex: var(--w) 1 0; min-width: 0; }
.tl-bar a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.7rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 500 0.75rem var(--font-mono);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.tl-bar a:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
.tl-bar .is-now a { background: var(--accent); color: var(--on-accent); }
.tl-axis { position: relative; height: 1.25rem; margin-top: 0.45rem; font: 400 0.6875rem var(--font-mono); color: var(--muted); }
.tl-axis span { position: absolute; left: var(--x); transform: translateX(-50%); }
.tl-axis span:first-child { transform: none; }

/* Roles */
.role {
  position: relative;
  margin-left: 0.4rem;
  padding: 0 0 2.5rem 1.75rem;
  border-left: 2px solid var(--line);
  transition: opacity 0.2s, border-color 0.2s;
}
.role:last-child { padding-bottom: 0; }
.role::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background 0.2s;
}
.role .when { font: 500 0.8125rem var(--font-mono); color: var(--muted); letter-spacing: 0.02em; }
.role h3 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin-top: 0.25rem; }
.role .org { color: var(--muted); margin-top: 0.15rem; }
.bullets { margin-top: 0.9rem; display: grid; gap: 0.5rem; max-width: 42rem; }
.bullets li { position: relative; padding-left: 1.1rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 2px; background: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tags li {
  font: 500 0.75rem var(--font-mono);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
}
.tags li.is-hit { background: var(--accent); color: var(--on-accent); }

.role:target { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* Highlight states from the skill chips */
.is-dim { opacity: 0.38; }
.role.is-match { border-left-color: var(--accent); }
.role.is-match::before { background: var(--accent); }
.card.is-match { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Blocks and cards */
.block { padding-block: 0 4rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.375rem 1.5rem;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card h3 { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 0.75rem; }
.card p { color: var(--muted); font-size: 1rem; }
.card .tags { margin-top: 1rem; }

.plain { display: grid; gap: 0.9rem; }
.plain li { display: grid; }
.plain span { color: var(--muted); font-size: 0.9375rem; }

.certs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.certs li {
  font: 500 0.8125rem var(--font-mono);
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
body[data-lens="it"] .certs li.feat { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sub { font: 500 0.75rem var(--font-mono); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin: 1.25rem 0 0.6rem; }

.contact p { color: var(--muted); }
.contact .actions { margin-top: 1.25rem; }

.footer { border-top: 1px solid var(--line); padding-block: 1.75rem; color: var(--muted); font-size: 0.875rem; }

/* Skill status pill */
.status {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  padding: 0.45rem 0.45rem 0.45rem 1.1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.status button {
  font: 600 0.8125rem var(--font-body);
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

@media (max-width: 480px) {
  .lens button { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
  .brand { font-size: 0.9375rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Print: a clean one-column resume in the selected lens */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #bbb; --accent: #0a5c46; --accent-soft: #fff; }
  body { font-size: 10.5pt; }
  .topbar, .skills, .tl, .status, .nav, .footer, .actions .btn:not(.btn-primary) { display: none !important; }
  .split { display: block; padding-block: 1rem; }
  .hero { padding-block: 1rem; }
  h1 { font-size: 28pt; }
  .block { padding-bottom: 1.5rem; }
  .role, .card { break-inside: avoid; }
  .is-dim { opacity: 1; }
}
