:root {
  --paper: #eef0f2;
  --surface: #ffffff;
  --ink: #16202e;
  --muted: #566173;
  --rule: #cbd2da;
  --accent: #2e6f5e;
  --accent-soft: #d6e7e1;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121821;
    --surface: #1a222d;
    --ink: #e7ebf0;
    --muted: #9aa5b4;
    --rule: #2c3644;
    --accent: #6fc2a8;
    --accent-soft: #1f3a33;
  }
}

* { 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: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.site-head .home {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.site-head nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-head nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-head nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: end;
  padding: 56px 0 72px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(3rem, 8vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  font-weight: 800;
}
.hero .role {
  font-size: 1.375rem;
  line-height: 1.35;
  margin: 0 0 12px;
  font-weight: 600;
}
.hero .pitch { color: var(--muted); max-width: 44ch; margin: 0 0 28px; }

.links { display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0; list-style: none; }
.links a {
  display: inline-block;
  padding: 9px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.links a.primary { background: var(--ink); color: var(--paper); }
.links a:hover { background: var(--accent-soft); }
.links a.primary:hover { background: var(--accent); border-color: var(--accent); }

/* The curve: the one bold element */
.curve figure { margin: 0; }
.curve svg { width: 100%; height: auto; display: block; overflow: visible; }
.curve .grid line { stroke: var(--rule); stroke-width: 1; }
.curve .axis { fill: var(--muted); font-size: 12px; font-family: inherit; }
.curve .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.8s cubic-bezier(.4,0,.2,1) .2s forwards;
}
.curve .dot { fill: var(--accent); opacity: 0; animation: pop .3s ease 1.9s forwards; }
.curve figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 10px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .curve .line { animation: none; stroke-dashoffset: 0; }
  .curve .dot { animation: none; opacity: 1; }
}

/* Sections */
section { padding: 64px 0; }
section + section { border-top: 1px solid var(--rule); }
h2 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 8px;
}
.section-intro { color: var(--muted); max-width: var(--measure); margin: 0 0 32px; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project .media {
  aspect-ratio: 16 / 9;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  padding: 16px;
}
.project .media img, .project .media video { width: 100%; height: 100%; object-fit: cover; }
.project .body { padding: 20px 22px 24px; }
.project h3 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 6px; }
.project .facts { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.project p { margin: 0 0 14px; }
.project.upcoming { border-style: dashed; background: transparent; }
.project.upcoming .media { background: transparent; border-bottom: 1px dashed var(--rule); color: var(--muted); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about p { max-width: var(--measure); margin: 0 0 16px; }
.skills { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.skills li { padding-left: 16px; border-left: 3px solid var(--accent); }
.skills strong { display: block; }
.skills span { color: var(--muted); font-size: 0.95rem; }

.site-foot { padding: 40px 0 56px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--rule); }

/* Case study page */
.cs-head { padding: 40px 0 32px; }
.cs-head .back { color: var(--muted); text-decoration: none; font-weight: 500; }
.cs-head h1 {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 20px 0 16px;
  max-width: 20ch;
}
.cs-head .lede { font-size: 1.2rem; color: var(--muted); max-width: 52ch; margin: 0; }

.video {
  aspect-ratio: 16 / 9;
  background: var(--accent-soft);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  padding: 16px;
  margin-bottom: 24px;
}
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; }

.fact-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 8px;
}
.fact-strip div { background: var(--surface); padding: 14px 16px; }
.fact-strip dt { color: var(--muted); font-size: 0.85rem; }
.fact-strip dd { margin: 2px 0 0; font-weight: 600; }

.cs-body { max-width: 760px; }
.cs-body section { padding: 48px 0; }
.cs-body h2 { font-size: 1.6rem; margin-bottom: 14px; }
.cs-body p, .cs-body li { max-width: var(--measure); }
.cs-body ul { padding-left: 1.2em; }
.cs-body li { margin-bottom: 8px; }
.placeholder { color: var(--muted); font-style: italic; }

.shot {
  margin: 24px 0;
  background: var(--accent-soft);
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  padding: 16px;
}
.shot + figcaption, figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: -12px; margin-bottom: 24px; }
figure { margin: 0; }

.decisions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.decisions div { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.decisions h3 { margin: 0 0 6px; font-size: 1.05rem; }
.decisions p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Responsive */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 32px 0 56px; }
  .projects, .about, .decisions { grid-template-columns: 1fr; }
  .fact-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .fact-strip { grid-template-columns: 1fr; }
}
