/* daveking.fyi — shared styles
   Color encodes meaning: teal = growth work, indigo = platform work. */

:root {
  --paper: #F4F6F5;
  --white: #FFFFFF;
  --ink: #141C24;
  --muted: #55616B;
  --rule: #D3D9D7;
  --growth: #0A7A6F;
  --platform: #3B3FB8;
  --band: #141C24;
  --band-text: #E8EEEC;
  --band-muted: #A9B6B2;

  --head: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1080px;
  --gutter: clamp(20px, 4vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

img, svg { max-width: 100%; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  font-family: var(--head);
  z-index: 10;
}
.skip:focus { left: 8px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3, h4 {
  font-family: var(--head);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------- Site header ---------- */
.site-header { padding-block: 22px; }
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-nav { display: flex; gap: 26px; font-family: var(--head); font-weight: 500; font-size: 1rem; }
.site-nav a { text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; padding: 0; }
.btn {
  display: inline-block;
  font-family: var(--head);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 15px 22px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn-solid { background: var(--ink); color: var(--white); }
.btn-solid:hover { background: var(--platform); border-color: var(--platform); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 7vw, 88px) clamp(48px, 7vw, 96px); }
.hero-grid { display: grid; gap: 48px; }
.hero h1 {
  font-size: clamp(2.35rem, 5.6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 17ch;
}
.lead {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  max-width: 34em;
  margin: 28px 0 0;
}

.facts { margin: 0; align-self: end; border-top: 3px solid var(--ink); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--head); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 1.05rem; line-height: 1.4; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 6vw, 80px); }
.section-head { margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; }
.section-head p { margin: 10px 0 0; color: var(--muted); max-width: 40em; }

/* Growth / platform split */
.split { display: grid; gap: 0; background: var(--white); border: 1px solid var(--rule); }
.split > div { padding: clamp(24px, 3vw, 40px); }
.split .growth { border-top: 6px solid var(--growth); }
.split .platform { border-top: 6px solid var(--platform); border-left: 0; }
.split h3 { font-size: 1.6rem; font-weight: 700; }
.split .growth h3 { color: var(--growth); }
.split .platform h3 { color: var(--platform); }
.split p { margin: 10px 0 18px; }
.split ul { margin: 0; padding: 0; list-style: none; }
.split li { padding: 11px 0; border-top: 1px solid var(--rule); font-size: 1.02rem; line-height: 1.5; }
@media (min-width: 800px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split .platform { border-left: 1px solid var(--rule); }
}

/* Work rows */
.work { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.work li { border-bottom: 1px solid var(--rule); }
.work a {
  display: grid;
  gap: 6px;
  padding: 30px 0 30px 24px;
  text-decoration: none;
  border-left: 6px solid var(--growth);
  margin-left: 0;
}
.work a.platform { border-left-color: var(--platform); }
.work .kind { font-family: var(--head); font-weight: 600; font-size: 0.95rem; color: var(--growth); }
.work a.platform .kind { color: var(--platform); }
.work h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; max-width: 26ch; }
.work p { margin: 4px 0 0; max-width: 42em; color: var(--muted); }
.work a:hover h3, .work a:focus-visible h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.work a:hover { background: var(--white); }

/* Background list */
.history { margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--ink); }
.history li { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.history strong { font-family: var(--head); font-size: 1.15rem; }
.history span { color: var(--muted); font-size: 1rem; line-height: 1.45; }
.history .when { font-family: var(--head); font-size: 0.95rem; color: var(--muted); }
.history .what { display: grid; gap: 2px; }
@media (min-width: 760px) {
  .history li { grid-template-columns: 190px 1fr; gap: 24px; align-items: baseline; }
}

.more-link { margin-top: 24px; font-family: var(--head); font-weight: 600; }
.more-link a { text-underline-offset: 4px; }

/* ---------- Contact band ---------- */
.band { background: var(--band); color: var(--band-text); padding-block: clamp(52px, 7vw, 88px); }
.band h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; color: var(--white); }
.band p { max-width: 36em; margin: 16px 0 0; color: var(--band-muted); font-size: 1.15rem; }
.band .actions { margin-top: 28px; }
.band .btn { border-color: var(--band-text); color: var(--band-text); }
.band .btn:hover { background: var(--band-text); color: var(--ink); }
.band .btn-solid { background: var(--white); color: var(--ink); border-color: var(--white); }
.band .btn-solid:hover { background: #CFE0DC; border-color: #CFE0DC; color: var(--ink); }
.band :focus-visible { outline-color: #9EA2FF; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 28px 40px; font-family: var(--head); font-size: 0.95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { text-underline-offset: 3px; }

/* ---------- Case study pages ---------- */
.case-head { padding-block: clamp(20px, 4vw, 48px) 40px; }
.back { font-family: var(--head); font-weight: 500; font-size: 0.95rem; text-underline-offset: 4px; }
.case-head .kind {
  margin: 36px 0 12px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--growth);
  padding-left: 14px;
  border-left: 6px solid var(--growth);
  line-height: 1.2;
}
.case-head .kind.platform { color: var(--platform); border-left-color: var(--platform); }
.case-head h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 20ch;
}
.meta { display: grid; gap: 0; margin: 40px 0 0; border-top: 3px solid var(--ink); }
.meta div { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.meta dt { font-family: var(--head); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.meta dd { margin: 0; font-size: 1.02rem; line-height: 1.45; }
@media (min-width: 760px) {
  .meta div { grid-template-columns: 150px 1fr; gap: 24px; align-items: baseline; }
}

.case-section { display: grid; gap: 14px; padding-block: 36px; border-top: 1px solid var(--rule); }
.case-section h2 { font-size: 1.4rem; font-weight: 700; }
.case-section .content { max-width: 40em; }
.case-section .content p { margin: 0 0 1em; }
.case-section .content p:last-child { margin-bottom: 0; }
.case-section ul.steps { margin: 0; padding: 0; list-style: none; }
.case-section ul.steps li { padding: 14px 0 14px 22px; border-top: 1px solid var(--rule); position: relative; }
.case-section ul.steps li:first-child { border-top: 0; padding-top: 0; }
.case-section ul.steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05em;
  width: 8px;
  height: 8px;
  background: var(--growth);
}
.case-section ul.steps li:first-child::before { top: 0.5em; }
.platform-page .case-section ul.steps li::before { background: var(--platform); }
.case-section ul.steps strong { font-family: var(--head); font-weight: 600; }
@media (min-width: 900px) {
  .case-section { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
}

.results { list-style: none; margin: 0; padding: 0; max-width: 46em; border-top: 3px solid var(--ink); }
.results li { display: grid; gap: 4px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.results .num {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--growth);
}
.platform-page .results .num { color: var(--platform); }
.results .what { font-size: 1.02rem; line-height: 1.5; }
@media (min-width: 640px) {
  .results li { grid-template-columns: 170px 1fr; gap: 24px; align-items: baseline; }
}

.next { padding-block: 44px 64px; border-top: 1px solid var(--rule); }
.next .wrap { display: grid; gap: 20px; }
.next a { text-decoration: none; display: block; padding: 18px 0 18px 20px; border-left: 6px solid var(--growth); }
.next a.platform { border-left-color: var(--platform); }
.next .label { display: block; font-family: var(--head); font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.next .title { display: block; font-family: var(--head); font-weight: 700; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.02em; margin-top: 4px; }
.next a:hover .title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
@media (min-width: 760px) { .next .wrap { grid-template-columns: 1fr 1fr; gap: 40px; } }

/* ---------- Resume page ---------- */
.resume-head { padding-block: clamp(20px, 4vw, 48px) 8px; }
.resume-head h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 700; letter-spacing: -0.03em; }
.resume-head .role { font-family: var(--head); font-size: 1.2rem; margin: 10px 0 0; color: var(--muted); }
.resume-head .contact { font-family: var(--head); font-size: 1rem; margin: 6px 0 0; color: var(--muted); }
.resume-head .contact a { text-underline-offset: 3px; }

.r-section { display: grid; gap: 14px; padding-block: 32px; border-top: 1px solid var(--rule); }
.r-section > h2 { font-size: 1.35rem; font-weight: 700; }
@media (min-width: 900px) { .r-section { grid-template-columns: 220px minmax(0, 1fr); gap: 48px; } }

.r-section .body { max-width: 44em; }
.r-section .body p { margin: 0 0 1em; }

.highlights { list-style: none; margin: 0; padding: 0; }
.highlights li { padding: 12px 0; border-top: 1px solid var(--rule); font-size: 1.02rem; line-height: 1.5; }
.highlights li:first-child { border-top: 0; padding-top: 0; }
.highlights strong { font-family: var(--head); font-weight: 700; }

.skills { margin: 0; }
.skills div { padding: 12px 0; border-top: 1px solid var(--rule); }
.skills div:first-child { border-top: 0; padding-top: 0; }
.skills dt { font-family: var(--head); font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.skills dd { margin: 2px 0 0; font-size: 1.02rem; line-height: 1.5; }

.job { padding: 0 0 36px; }
.job:last-child { padding-bottom: 0; }
.job-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; align-items: baseline; }
.job-top h3 { font-size: 1.3rem; font-weight: 700; }
.job-top .dates { font-family: var(--head); font-size: 0.95rem; color: var(--muted); }
.job .note { margin: 2px 0 0; font-family: var(--head); font-size: 0.95rem; color: var(--muted); }
.role-block { margin-top: 18px; }
.role-block h4 { font-size: 1.05rem; font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; }
.role-block h4 .dates { font-weight: 500; font-size: 0.92rem; color: var(--muted); }
.job ul { margin: 10px 0 0; padding-left: 1.15em; }
.job li { margin: 0 0 9px; font-size: 1.02rem; line-height: 1.55; padding-left: 2px; }
.job li::marker { color: var(--muted); }
.job li strong { font-family: var(--head); font-weight: 600; }

/* ---------- Print (for people who print the resume page) ---------- */
@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.45; }
  .site-header, .site-footer, .band, .actions, .skip { display: none; }
  .r-section { grid-template-columns: 1fr; gap: 6px; padding-block: 14px; break-inside: avoid-page; }
  .job { break-inside: avoid; }
}

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