/* tomberchenbriter.com
   One stylesheet, no build. Cool paper ground, cobalt band, one grotesque.
   The memorable element is the career timeline; everything else stays quiet. */

:root {
  --ground: #f3f5f8;
  --panel: #ffffff;
  --ink: #14181f;
  --ink-2: #4a5261;
  --rule: #d3d9e3;
  --cobalt: #1d3fbf;
  --cobalt-deep: #122a80;
  --cobalt-tint: #e4e9fa;
  --cobalt-ink: #c9d4ff;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1120px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--cobalt); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
  border-radius: 2px;
}

p { margin: 0 0 1rem; max-width: var(--measure); }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1.25rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
ul { padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- site nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.nav .brand { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
.nav .brand:hover { text-decoration: none; color: var(--cobalt); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav li { margin: 0; }
.nav a.item { color: var(--ink-2); font-weight: 500; }
.nav a.item:hover { color: var(--cobalt); text-decoration: none; }
.nav a.item[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--cobalt); }
.nav a.external::after { content: " \2197"; font-weight: 400; }

/* ---------- cobalt band (home hero and page headers) ---------- */
.band {
  background: var(--cobalt);
  color: #fff;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem);
}
.band h1 {
  font-size: clamp(2.4rem, 6.2vw, 4.8rem);
  max-width: 18ch;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.band p { color: var(--cobalt-ink); font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 48ch; margin-top: 1.5rem; }
.band a { color: #fff; }
.band .actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 2rem; }
.band .actions p { margin: 0; }
.band .fine { font-size: 0.95rem; margin-top: 1rem; color: var(--cobalt-ink); }

/* ---------- newsletter form (band) ---------- */
.signup { margin-top: 2rem; max-width: 34rem; }
.signup > label { display: block; font-weight: 600; color: #fff; margin-bottom: 0.6rem; }
.signup .row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1 1 14rem; min-width: 0; font: inherit; font-size: 1rem;
  padding: 0.7rem 0.9rem; border: 2px solid rgba(255,255,255,0.55); border-radius: 4px;
  background: #fff; color: var(--ink);
}
.signup input[type="email"]:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-color: #fff; }
.signup .btn { flex: 0 0 auto; cursor: pointer; font: inherit; font-size: 1rem; }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup .fine { margin-top: 0.75rem; }
.signup .notice { display: none; color: #fff; }
.signup .notice:target { display: block; }
.signup .notice a { text-decoration: underline; }

.btn {
  display: inline-block; padding: 0.75rem 1.2rem; border-radius: 4px;
  font-weight: 600; line-height: 1.2; border: 2px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn.solid { background: #fff; color: var(--cobalt-deep); }
.btn.solid:hover { background: var(--cobalt-tint); }
.btn.ghost { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn.ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn.dark { background: var(--cobalt); color: #fff; }
.btn.dark:hover { background: var(--cobalt-deep); }

/* page header variant: shorter band, small intro */
.band.page { padding: clamp(2.2rem, 5vw, 4rem) 0; }
.band.page h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.band.page p { margin-top: 1rem; }

/* ---------- sections ---------- */
.section { padding: clamp(2.5rem, 5vw, 4.5rem) 0; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); max-width: 56ch; }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem var(--gutter); }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.cols p { font-size: 1rem; color: var(--ink-2); }
.cols h3 a { color: var(--ink); }
.cols h3 a:hover { color: var(--cobalt); }

/* two-column: side heading + content */
.split { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem var(--gutter); align-items: start; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
.split h2 { font-size: 1.2rem; margin: 0; color: var(--ink-2); font-weight: 600; line-height: 1.4; }

/* ---------- career timeline ---------- */
.timeline { padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(2.5rem, 5vw, 4.5rem); background: var(--panel); border-bottom: 1px solid var(--rule); }
.timeline h2 { font-size: 1.2rem; color: var(--ink-2); font-weight: 600; margin-bottom: 1.75rem; }
.tl { --cols: 32; }
.tl .row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 0.35rem 3px;
  margin-bottom: 0.5rem;
}
.tl .era {
  background: var(--cobalt-tint);
  color: var(--cobalt-deep);
  border-left: 3px solid var(--cobalt);
  padding: 0.5rem 0.6rem;
  min-height: 3.6rem;
  font-size: 0.86rem;
  line-height: 1.3;
  overflow: hidden;
}
.tl .era b { display: block; color: var(--ink); font-weight: 700; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tl .era span { display: block; color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tl .era.now { background: var(--cobalt); color: #fff; border-left-color: var(--cobalt-deep); }
.tl .era.now b, .tl .era.now span { color: #fff; }
.tl .era.now span { color: var(--cobalt-ink); }
.tl .era.own { background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--cobalt); }
.tl .axis {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  border-top: 1px solid var(--rule);
  padding-top: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tl .axis span { grid-row: 1; }
.tl .key { font-size: 0.86rem; color: var(--ink-2); margin: 1.25rem 0 0; max-width: none; }
/* below 900px the eras stack as a plain list; the grid needs width to read */
@media (max-width: 900px) {
  .tl .row { display: flex; flex-direction: column; gap: 0.35rem; }
  .tl .era { min-height: 0; }
  .tl .era b::before { content: attr(data-years) "  "; color: var(--cobalt); font-weight: 600; }
  .tl .era b, .tl .era span { white-space: normal; }
  .tl .axis { display: none; }
}

/* ---------- resume ---------- */
.resume-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; color: var(--cobalt-ink); margin-top: 1.25rem; font-size: 1rem; }
.resume-meta a { color: #fff; }
.resume-meta p { margin: 0; font-size: 1rem; }

.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem var(--gutter); }
@media (max-width: 820px) { .skills { grid-template-columns: 1fr; } }
.skills div { border-top: 2px solid var(--cobalt-tint); padding-top: 0.6rem; }
.skills h3 { font-size: 1rem; margin-bottom: 0.3rem; }
.skills p { font-size: 0.95rem; color: var(--ink-2); margin: 0; max-width: none; }

.job { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.5rem var(--gutter); padding: 1.5rem 0; border-top: 1px solid var(--rule); }
.job:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 720px) { .job { grid-template-columns: 1fr; } }
.job .when { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 0.95rem; padding-top: 0.2rem; }
.job h3 { font-size: 1.2rem; }
.job .where { color: var(--ink-2); margin-bottom: 0.75rem; }
.job ul { margin: 0; max-width: 72ch; }
.job li { color: var(--ink); font-size: 1rem; }
.job .earlier li b { font-weight: 600; }

.certs { columns: 2; column-gap: var(--gutter); max-width: none; }
@media (max-width: 720px) { .certs { columns: 1; } }
.certs li { break-inside: avoid; }

.download { background: var(--panel); border: 1px solid var(--rule); padding: 1.5rem; display: flex; gap: 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.download p { margin: 0; color: var(--ink-2); }

/* ---------- books ---------- */
.book { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem var(--gutter); padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.book .cover { display: block; width: 100%; height: auto; margin-bottom: 0.9rem; box-shadow: 0 1px 2px rgba(20,24,31,0.18), 0 8px 24px rgba(20,24,31,0.12); }
.book .dedication { font-style: italic; color: var(--ink-2); }
.book .trailer { margin: 1.5rem 0 0; max-width: 40rem; }
.book .trailer video { display: block; width: 100%; height: auto; background: var(--ink); border-radius: 4px; }
.book .trailer figcaption { font-size: 0.9rem; color: var(--ink-2); margin-top: 0.5rem; }
.book:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 720px) { .book { grid-template-columns: 1fr; } .book .cover { max-width: 14rem; } }
.book .status { color: var(--ink-2); font-size: 0.95rem; line-height: 1.4; }
.book .status b { display: block; color: var(--cobalt-deep); font-weight: 600; }
.book h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin-bottom: 0.25rem; }
.book .sub { color: var(--ink-2); font-size: 1.1rem; margin-bottom: 1rem; }
.book details { border-top: 1px solid var(--rule); margin-top: 1rem; }
.book summary { cursor: pointer; padding: 0.9rem 0; font-weight: 600; color: var(--cobalt); list-style: none; display: flex; align-items: center; gap: 0.6rem; }
.book summary::-webkit-details-marker { display: none; }
.book summary::before { content: ""; width: 0.55rem; height: 0.55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; flex: none; }
.book details[open] summary::before { transform: rotate(45deg); }
.book ol { margin: 0 0 1.25rem; padding-left: 1.6rem; max-width: 70ch; }
.book ol li { margin-bottom: 0.55rem; }
.book ol li b { font-weight: 600; }
.book ol li span { color: var(--ink-2); }

/* ---------- vision ---------- */
.essay h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.essay h2:first-child { margin-top: 0; }
.essay p { max-width: 62ch; }
.links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem var(--gutter); }
@media (max-width: 720px) { .links { grid-template-columns: 1fr; } }
.links li { margin: 0; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.links a { font-weight: 600; }
.links span { display: block; color: var(--ink-2); font-size: 0.95rem; }

/* ---------- footer ---------- */
.foot { padding: 2rem 0 3rem; color: var(--ink-2); font-size: 0.95rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; justify-content: space-between; }
.foot p { margin: 0; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--cobalt); }

/* timeline placement: (year - 1994) for start and end on the 32-column grid.
   Classes rather than style attributes so the CSP can stay without 'unsafe-inline'. */
.tl .g1-5 { grid-column: 1 / 5; }
.tl .g5-8 { grid-column: 5 / 8; }
.tl .g8-11 { grid-column: 8 / 11; }
.tl .g11-19 { grid-column: 11 / 19; }
.tl .g19-20 { grid-column: 19 / 20; }
.tl .g20-22 { grid-column: 20 / 22; }
.tl .g22-23 { grid-column: 22 / 23; }
.tl .g23-31 { grid-column: 23 / 31; }
.tl .g30-33 { grid-column: 30 / 33; }
.tl .g31-33 { grid-column: 31 / 33; }
.tl .a1 { grid-column: 1; }
.tl .a6 { grid-column: 6; }
.tl .a11 { grid-column: 11; }
.tl .a16 { grid-column: 16; }
.tl .a21 { grid-column: 21; }
.tl .a26 { grid-column: 26; }
.tl .a32 { grid-column: 32; }
