:root {
  --paper: #eef0f4;
  --surface: #ffffff;
  --ink: #18203a;
  --muted: #59627a;
  --rule: #cbd1dc;
  --blue: #2b62d9;
  --blue-soft: #dbe5fa;
  --amber: #e39b2d;
  --amber-soft: #fbecd2;
  --focus: #2b62d9;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.015em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { font-weight: 800; text-decoration: none; font-size: 18px; white-space: nowrap; }
.brand-group { display: flex; align-items: center; gap: 16px; }
.badges { display: flex; align-items: center; gap: 12px; }
.badges a { display: block; border-radius: 6px; }
.badges img { height: 44px; width: auto; }
.badges a:hover img { transform: translateY(-1px); }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding: clamp(32px, 7vw, 80px) 0 28px; }
.hero h1 { font-size: clamp(40px, 7.4vw, 84px); max-width: 12ch; letter-spacing: -0.03em; }
.hero p { margin-top: 22px; max-width: 60ch; font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); }
.hero-links { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1.5px solid var(--ink);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }

/* Schedule chart: the signature piece */
.schedule {
  margin: clamp(40px, 6vw, 64px) 0 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 22px 14px;
  border: 1px solid var(--rule);
}
.schedule-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; margin-bottom: 16px; }
.schedule-head h2 { font-size: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--muted); list-style: none; padding: 0; margin: 0; }
.legend li { display: flex; align-items: center; gap: 7px; }
.swatch { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
.k-production { background: var(--blue); }
.k-development { background: var(--amber); }
.k-both { background: repeating-linear-gradient(135deg, var(--blue) 0 6px, var(--amber) 6px 12px); }

.gantt-scroll { overflow-x: auto; padding-bottom: 6px; }
.gantt { position: relative; min-width: 680px; }
.gantt-axis { position: relative; height: 24px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.gantt-axis span { position: absolute; top: 0; transform: translateX(-1px); padding-left: 6px; border-left: 1px solid var(--rule); white-space: nowrap; }
.gantt-rows { position: relative; margin: 0; padding: 6px 0 22px; }
.gantt-grid { position: absolute; inset: 0; pointer-events: none; }
.gantt-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #e2e6ee; }
.gantt-today { position: absolute; top: -24px; bottom: -22px; border-left: 2px solid var(--ink); pointer-events: none; }
.gantt-today b { position: absolute; bottom: 0; right: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.gantt-row { position: relative; height: 44px; }
.gantt-bar {
  position: absolute; top: 9px; height: 26px; min-width: 12px;
  border-radius: 5px; text-decoration: none; display: block;
}
.gantt-bar.ongoing { -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.gantt-label {
  position: absolute; top: 9px; height: 26px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; white-space: nowrap; text-decoration: none; padding: 0 8px;
}
.gantt-label strong { font-weight: 700; }
.gantt-label span { color: var(--muted); }
.gantt-label:hover strong { text-decoration: underline; }
.gantt-label.flip { transform: translateX(-100%); }
.gantt-label.inside { margin-left: 6px; top: 12px; height: 20px; background: var(--surface); border-radius: 4px; padding: 0 8px; font-size: 13px; }
.schedule-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Sections */
.section { padding: clamp(48px, 8vw, 96px) 0 0; }
.section-title { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 24px; }

/* Featured */
.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 36px); }
.feature { text-decoration: none; display: block; }
.feature .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; }
.feature h3 { font-size: clamp(24px, 2.6vw, 30px); margin-top: 18px; }
.feature .role { margin-top: 4px; font-weight: 600; color: var(--blue); }
.feature p { margin-top: 10px; color: var(--muted); max-width: 52ch; }
.feature:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.thumb { position: relative; background: var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.contain img { object-fit: contain; padding: 8%; }

/* Project list */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { border-bottom: 1px solid var(--rule); }
.list a {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 24px; align-items: center;
  padding: 20px 0; text-decoration: none;
}
.list .thumb { aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; }
.list h3 { font-size: 22px; }
.list .meta { margin-top: 2px; font-size: 15px; color: var(--muted); }
.list p { margin-top: 8px; max-width: 60ch; }
.list .award { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; color: #8a5a10; background: var(--amber-soft); border-radius: 999px; padding: 3px 10px; }
.list .kind { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.list a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }

/* Skills */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 36px); }
.skill-col { border-top: 6px solid var(--blue); padding-top: 18px; }
.skill-col.dev { border-top-color: var(--amber); }
.skill-col h3 { font-size: 22px; }
.skill-col p { color: var(--muted); margin-top: 6px; }
.skill-col ul { margin: 16px 0 0; padding: 0; list-style: none; }
.skill-col li { padding: 9px 0; border-bottom: 1px solid var(--rule); }

/* Contact */
.contact { padding-bottom: clamp(48px, 8vw, 96px); }
.contact-box { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 56px); }
.contact-box h2 { font-size: clamp(28px, 4vw, 44px); max-width: 18ch; }
.contact-box p { margin-top: 12px; color: #c7cddb; max-width: 55ch; }
.contact-box .hero-links .btn { border-color: var(--paper); color: var(--paper); }
.contact-box .hero-links .btn:hover { background: var(--paper); color: var(--ink); }
.site-footer { padding: 0 0 32px; font-size: 14px; color: var(--muted); }

/* Project page */
.p-hero { padding: 24px 0 0; }
.back { font-size: 15px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); text-decoration: underline; }
.p-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: 20px; }
.p-head h1 { font-size: clamp(38px, 6vw, 68px); letter-spacing: -0.03em; }
.p-role { margin-top: 10px; font-size: 20px; font-weight: 700; color: var(--blue); }
.p-role.dev { color: #a86a0c; }
.p-pitch { margin-top: 14px; font-size: 19px; color: var(--muted); max-width: 52ch; }
.p-head .thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; }
.award-callout { margin-top: 18px; display: inline-block; background: var(--amber-soft); color: #6f4709; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); }

.facts { margin: clamp(28px, 4vw, 44px) 0 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 14px 16px 14px 0; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }

.p-body { display: grid; grid-template-columns: 1fr 300px; gap: clamp(28px, 5vw, 64px); margin-top: clamp(36px, 5vw, 56px); }
.p-main > section + section { margin-top: clamp(40px, 5vw, 56px); }
.p-main h2 { font-size: 26px; margin-bottom: 14px; }
.p-main p { max-width: 68ch; }
.p-main p + p { margin-top: 12px; }
.lead { font-size: 19px; }
.did { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.did li { padding: 12px 0 12px 28px; border-bottom: 1px solid var(--rule); position: relative; max-width: 68ch; }
.did li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 10px; height: 10px; border-radius: 2px; background: var(--blue); }
.did.dev li::before { background: var(--amber); }

.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goals div { background: var(--surface); border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--rule); }
.goals strong { display: block; }
.goals span { color: var(--muted); font-size: 15px; }

.embed { background: var(--ink); border-radius: var(--radius-lg); overflow: hidden; }
.embed iframe { display: block; width: 100%; border: 0; }
.embed.video { aspect-ratio: 16 / 9; }
.embed.video iframe { height: 100%; }
.small-note { margin-top: 10px; font-size: 14px; color: var(--muted); }

.prod { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px); }
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.prod h3 { font-size: 17px; margin-bottom: 6px; }
.prod ul { margin: 0; padding-left: 20px; }
.prod li + li { margin-top: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 0; }
.tags li { margin: 0 !important; background: var(--blue-soft); color: #1c3f8f; font-size: 14px; font-weight: 600; border-radius: 999px; padding: 4px 12px; }
.artifacts { margin-top: 22px; display: grid; gap: 18px; }
.artifact h3 { margin-bottom: 8px; }
.artifact iframe { width: 100%; height: 420px; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #fff; }
.artifact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.artifact-links .btn { font-size: 14px; padding: 8px 14px; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery button { padding: 0; border: 0; background: var(--ink); border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery.odd button:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 8; }

.p-side { align-self: start; position: sticky; top: 24px; }
.side-block + .side-block { margin-top: 28px; }
.side-block h2 { font-size: 17px; margin-bottom: 10px; }
.team { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.team li { padding: 7px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 10px; }
.team li span { color: var(--muted); text-align: right; }
.team li.me { font-weight: 700; }
.side-links { display: flex; flex-direction: column; gap: 8px; }
.side-links .btn { justify-content: center; }

.next { margin-top: clamp(56px, 8vw, 96px); padding: 28px 0 56px; border-top: 1px solid var(--rule); }
.next a { text-decoration: none; display: inline-block; }
.next span { color: var(--muted); font-size: 15px; }
.next strong { display: block; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.next a:hover strong { text-decoration: underline; text-underline-offset: 5px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(14, 18, 34, 0.86); }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: var(--radius-sm); }
.lightbox button { margin: 10px auto 0; display: block; }

.notfound { padding: 80px 0; }

/* Responsive */
@media (max-width: 900px) {
  .p-head, .p-body { grid-template-columns: 1fr; }
  .p-side { position: static; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { gap: 14px; }
  .featured, .skills, .goals, .prod-grid { grid-template-columns: 1fr; }
  .list a { grid-template-columns: 96px 1fr; gap: 16px; align-items: start; }
  .list .kind { display: none; }
  .list h3 { font-size: 19px; }
  .list p { display: none; }
  .schedule { padding: 18px 16px 10px; }
  .artifact iframe { height: 320px; }
}
@media (prefers-reduced-motion: no-preference) {
  .gantt-bar { transform-origin: left center; animation: grow 700ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 70ms + 150ms); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

.artifacts-wrap { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 14px; }
.artifacts-wrap summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.artifacts-wrap[open] summary { margin-bottom: 4px; }
.mobile-only { display: none; }
@media (max-width: 720px) { .mobile-only { display: inline; } }

/* Résumé page */
.resume { display: grid; grid-template-columns: 320px 1fr; gap: clamp(24px, 4vw, 48px); padding-top: 24px; padding-bottom: 64px; align-items: start; }
.resume h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; }
.resume h2 { font-size: 20px; margin: 32px 0 6px; }
.resume .did li { font-size: 15px; }
.resume-pdf { width: 100%; height: min(1100px, 130vh); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); }
.resume-fallback { padding: 24px; }
@media (max-width: 900px) {
  .resume { grid-template-columns: 1fr; }
  .resume-pdf { height: 80vh; }
}
@media (max-width: 520px) {
  .badges img { height: 36px; }
  .brand-group { gap: 10px; }
  .badges { gap: 8px; }
  .site-header .wrap { flex-wrap: wrap; row-gap: 12px; }
}

/* Credentials row on the home page */
.creds { list-style: none; margin: 0 0 clamp(28px, 4vw, 44px); padding: 0; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.creds a { display: flex; align-items: center; gap: 14px; text-decoration: none; max-width: 420px; }
.creds img { height: 72px; width: auto; flex: none; }
.creds span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.creds strong { display: block; color: var(--ink); font-size: 16px; }
.creds a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .creds img { height: 56px; } }

/* Code samples */
.code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 36px); }
.code-card { min-width: 0; }
.code-visual { aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: #0f1426; margin: 0; }
.code-visual iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
.code-snippet { color: #c9d3ea; font: 13px/1.6 ui-monospace, "SF Mono", Consolas, monospace; padding: 22px; white-space: pre; overflow: hidden; display: flex; align-items: center; }
.code-card h3 { font-size: 22px; margin-top: 16px; }
.code-card .meta { font-size: 15px; color: var(--muted); margin-top: 2px; }
.code-card p { margin-top: 8px; max-width: 56ch; }
.code-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-weight: 600; font-size: 15px; }
.code-links a { color: var(--blue); text-underline-offset: 3px; }

/* Photography highlight */
.photo-note { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: clamp(28px, 4vw, 44px); padding-top: 24px; border-top: 1px solid var(--rule); }
.photo-strip { display: flex; gap: 8px; }
.photo-strip img { height: 96px; width: auto; border-radius: var(--radius-sm); }
.photo-note h3 { font-size: 18px; }
.photo-note p { color: var(--muted); margin-top: 4px; max-width: 64ch; }
@media (max-width: 720px) {
  .code-grid { grid-template-columns: 1fr; }
  .photo-note { grid-template-columns: 1fr; }
  .photo-strip img { height: auto; width: calc(50% - 4px); }
}

/* Production artifacts */
.prod-figure { margin: 24px 0 0; }
.prod-figure button { padding: 0; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; display: block; width: 100%; max-height: 520px; }
.prod-figure img { width: 100%; height: auto; object-fit: cover; object-position: top; }
.prod-figure figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.raci { margin-top: 28px; }
.raci h3, .contract h3 { font-size: 17px; margin-bottom: 6px; }
.raci-key { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.raci-key b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; margin-right: 4px; font-size: 12px; }
.raci-scroll { overflow-x: auto; margin-top: 10px; }
.raci table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
.raci th, .raci td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: center; }
.raci thead th { font-weight: 700; font-size: 13px; vertical-align: bottom; }
.raci thead th:first-child, .raci tbody th[scope="row"] { text-align: left; font-weight: 400; }
.raci-group th { text-align: left; font-weight: 700; padding-top: 14px; color: var(--muted); font-size: 13px; }
.raci td { font-weight: 700; }
.raci-r { background: var(--blue); color: #fff; }
.raci-a { background: #1c3f8f; color: #fff; }
.raci-c { background: var(--amber-soft); color: #6f4709; }
.raci-i { background: transparent; color: var(--muted); font-weight: 400 !important; }
.raci tbody th[scope="row"]:first-child { white-space: nowrap; }
.contract { margin-top: 28px; }
.contract dl { margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contract dl div { border-left: 3px solid var(--blue); padding: 2px 0 2px 12px; }
.contract dt { font-weight: 700; }
.contract dd { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
@media (max-width: 720px) { .contract dl { grid-template-columns: 1fr; } }
.p-main, .p-side, .prod { min-width: 0; }
