/* ============================================================
   danberget.com
   Palette from the copy desk: layout paper, black ink,
   non-photo blue (the pencil mark the camera never saw),
   one red pen per page.
   ============================================================ */

:root {
  --paper:     #E7EAEC;
  --paper-2:   #F1F3F4;
  --ink:       #14161A;
  --ink-soft:  #2A2E35;
  --graphite:  #5C646E;
  --blue:      #7FC4E0;
  --blue-deep: #2A6E8C;
  --red:       #C4392F;

  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body:    "Spectral", Georgia, serif;
  --util:    "JetBrains Mono", ui-monospace, monospace;

  --t-mast: clamp(2.5rem, 7vw, 5.25rem);
  --t-h1:   clamp(2rem, 4.5vw, 3.5rem);
  --t-h2:   clamp(1.35rem, 2.2vw, 1.85rem);
  --t-lede: clamp(1.05rem, 1.35vw, 1.25rem);
  --t-body: 1.0625rem;
  --t-util: 0.6875rem;

  --rail-w: 16.5rem;
  --margin-w: 13rem;
  --gutter: clamp(1.5rem, 4vw, 4.5rem);
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1rem;
  font-family: var(--util); font-size: var(--t-util);
}
.skip:focus { left: 0; }

/* ---------- rail ---------- */
.rail { background: var(--ink); color: var(--paper); }
.rail__inner {
  position: sticky; top: 0;
  display: flex; flex-direction: column; gap: 2.5rem;
  min-height: 100vh; padding: 2.75rem 1.75rem 2rem;
}
.rail__id { display: block; text-decoration: none; color: inherit; }
.rail__name {
  display: block; font-family: var(--display);
  font-variation-settings: "wdth" 78, "opsz" 48; font-weight: 700;
  font-size: 2.35rem; line-height: 0.92; letter-spacing: -0.015em;
  text-transform: uppercase;
}
.rail__role {
  display: block; margin-top: 0.7rem; padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--blue) 45%, transparent);
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue);
}
.nav { flex: 1; }
.nav__group {
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: color-mix(in srgb, var(--blue) 70%, var(--ink));
  margin: 1.9rem 0 0.6rem;
}
.nav__list { display: flex; flex-direction: column; }
.nav__link {
  position: relative; display: block; padding: 0.3rem 0 0.3rem 1.1rem;
  color: color-mix(in srgb, var(--paper) 78%, var(--ink));
  font-family: var(--display); font-variation-settings: "wdth" 92;
  font-weight: 500; font-size: 1.05rem; text-decoration: none;
  transition: color 0.15s ease;
}
.nav__link::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 0.45rem; height: 1px; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform 0.18s ease;
}
.nav__link:hover { color: var(--paper); }
.nav__link:hover::before { transform: scaleX(1); }
.nav__link.is-here { color: var(--paper); }
.nav__link.is-here::before { transform: scaleX(1); width: 0.7rem; }
.rail__foot {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
}
.rail__out {
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue);
  text-decoration: none; border-bottom: 1px solid transparent;
}
.rail__out:hover { border-bottom-color: var(--blue); }
.rail-toggle { position: absolute; opacity: 0; pointer-events: none; }
.rail-button { display: none; }

/* ---------- main ---------- */
.main { padding: var(--gutter); padding-bottom: 6rem; max-width: 78rem; }

.eyebrow {
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite);
  margin-bottom: 1rem;
}
.lede {
  font-family: var(--body); font-size: var(--t-lede); line-height: 1.5;
  color: var(--ink-soft); max-width: var(--measure); margin-top: 1.75rem;
}
.h2 {
  font-family: var(--display); font-variation-settings: "wdth" 88, "opsz" 24;
  font-weight: 600; font-size: var(--t-h2); line-height: 1.15;
  letter-spacing: -0.01em; margin-bottom: 1rem;
}
.copy { max-width: var(--measure); }
.copy p + p { margin-top: 1.1em; }
.copy a { color: var(--ink); text-decoration-color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.copy a:hover { text-decoration-color: var(--red); }

/* ---------- masthead ---------- */
.masthead { padding: clamp(2rem, 7vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.masthead__line {
  font-family: var(--display); font-variation-settings: "wdth" 80, "opsz" 96;
  font-weight: 700; font-size: var(--t-mast); line-height: 0.94;
  letter-spacing: -0.025em; max-width: 18ch;
}
.cut { position: relative; display: block; color: var(--graphite); }
.cut__text { opacity: 0.55; }
.cut__rule {
  position: absolute; left: -0.1em; right: -0.1em; top: 52%; height: 3px;
  background: var(--red); transform: scaleX(0); transform-origin: left center;
  animation: strike 0.45s cubic-bezier(0.6, 0, 0.3, 1) 0.45s forwards;
}
.keep { display: block; color: var(--ink); opacity: 0; animation: rise 0.5s ease 0.95s forwards; }
@keyframes strike { to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(0.28em); } to { opacity: 1; transform: none; } }

.colophon { margin-top: 3rem; border-top: 1px solid var(--blue); max-width: 34rem; }
.colophon__row {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
}
.colophon dt {
  font-family: var(--util); font-size: var(--t-util); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--graphite); padding-top: 0.2rem;
}
.colophon dd { font-family: var(--body); color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  padding: clamp(1rem, 4vw, 3rem) 0 clamp(2rem, 4vw, 3.25rem);
  border-bottom: 1px solid var(--blue); margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.hero__title {
  font-family: var(--display); font-variation-settings: "wdth" 80, "opsz" 72;
  font-weight: 700; font-size: var(--t-h1); line-height: 0.98;
  letter-spacing: -0.02em; max-width: 16ch;
}
.jump { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 1.75rem; }
.jump__link {
  font-family: var(--util); font-size: var(--t-util); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue-deep); text-decoration: none;
  border-bottom: 1px solid var(--blue);
}
.jump__link:hover { color: var(--red); border-bottom-color: var(--red); }

/* ---------- spread ---------- */
.spread {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--margin-w);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start;
  padding: clamp(2rem, 4vw, 3rem) 0; scroll-margin-top: 1.5rem;
}
.spread + .spread { border-top: 1px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.margin { padding-top: 0.35rem; }
.margin__list { border-top: 2px solid var(--blue); }
.margin__row {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
}
.margin dt { font-family: var(--util); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--graphite); }
.margin dd { font-family: var(--util); font-size: 0.75rem; line-height: 1.4; color: var(--ink); }
.margin__note {
  margin-top: 1rem; font-family: var(--body); font-style: italic;
  font-size: 0.9rem; line-height: 1.5; color: var(--graphite);
}

/* ---------- gallery ---------- */
.gallery {
  display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem); margin-top: 1.5rem;
}
.gallery__item img {
  width: 100%; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  background: var(--paper-2);
}
.gallery figcaption {
  margin-top: 0.6rem; font-family: var(--util); font-size: 0.6875rem;
  line-height: 1.45; color: var(--graphite);
}

/* ---------- index ---------- */
.index { border-top: 1px solid var(--blue); max-width: 44rem; }
.index__link {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1.5rem; padding: 0.9rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
  text-decoration: none; color: var(--ink);
}
.index__title { font-family: var(--display); font-variation-settings: "wdth" 88; font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.index__meta {
  font-family: var(--util); font-size: var(--t-util); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--graphite); text-align: right; flex-shrink: 0;
}
.index__link:hover .index__title { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- linklist (articles) ---------- */
.links { border-top: 1px solid var(--blue); max-width: 46rem; margin-top: 0.5rem; }
.links__item { padding: 0.9rem 0; border-bottom: 1px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.links__link {
  font-family: var(--display); font-variation-settings: "wdth" 90; font-weight: 600;
  font-size: 1.15rem; line-height: 1.2; text-decoration: none;
  text-decoration-color: var(--blue);
}
.links__link:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.links__blurb { margin-top: 0.3rem; font-size: 0.95rem; line-height: 1.5; color: var(--graphite); max-width: 44rem; }

/* ---------- certifications ---------- */
.certs { border-top: 2px solid var(--blue); max-width: 46rem; }
.cert { padding: 1.25rem 0; border-bottom: 1px solid color-mix(in srgb, var(--blue) 55%, transparent); }
.cert__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; }
.cert__name { font-family: var(--display); font-variation-settings: "wdth" 88; font-weight: 600; font-size: 1.3rem; line-height: 1.15; }
.cert__view {
  font-family: var(--util); font-size: var(--t-util); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue-deep); text-decoration: none;
  border-bottom: 1px solid var(--blue); flex-shrink: 0;
}
.cert__view:hover { color: var(--red); border-bottom-color: var(--red); }
.cert__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; margin-top: 0.85rem; }
.cert__meta > div { display: flex; gap: 0.5rem; align-items: baseline; }
.cert__meta dt { font-family: var(--util); font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--graphite); }
.cert__meta dd { font-family: var(--util); font-size: 0.8rem; color: var(--ink); }

/* ---------- rule ---------- */
.rule { display: flex; align-items: center; gap: 1rem; margin: 2.5rem 0; }
.rule::after { content: ""; flex: 1; height: 1px; background: var(--blue); }
.rule__text { font-family: var(--util); font-size: var(--t-util); letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite); }

/* ---------- desktop grid ---------- */
@media (min-width: 60rem) {
  body { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
}

/* ---------- mobile ---------- */
@media (max-width: 59.999rem) {
  :root { --margin-w: 0; }
  .rail__inner { min-height: 0; position: static; padding: 1.5rem 1.25rem 1.75rem; gap: 1.5rem; }
  .rail__name { font-size: 1.75rem; }
  .nav, .rail__foot { display: none; }
  .rail-toggle:checked ~ .rail .nav,
  .rail-toggle:checked ~ .rail .rail__foot { display: flex; flex-direction: column; }
  .rail-toggle:checked ~ .rail .rail__foot { flex-direction: row; }
  .rail-button {
    display: flex; align-items: center; gap: 0.5rem;
    position: absolute; top: 1.6rem; right: 1.25rem; z-index: 10; cursor: pointer;
    color: var(--blue); font-family: var(--util); font-size: var(--t-util);
    letter-spacing: 0.12em; text-transform: uppercase;
  }
  .rail-button__bars { width: 1.1rem; height: 7px; border-top: 1px solid var(--blue); border-bottom: 1px solid var(--blue); }
  .spread { grid-template-columns: 1fr; gap: 1.75rem; }
  .margin { border-left: 2px solid var(--blue); padding-left: 1rem; padding-top: 0; }
  .margin__list { border-top: none; }
  .margin__row { flex-direction: row; gap: 0.75rem; align-items: baseline; }
  .margin dt { flex: 0 0 6.5rem; }
  .gallery { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .colophon__row { grid-template-columns: 1fr; gap: 0.15rem; }
  .cert__head { flex-direction: column; gap: 0.35rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cut__rule { animation: none; transform: scaleX(1); }
  .keep { animation: none; opacity: 1; }
  .nav__link::before { transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
@media print {
  .rail, .rail-button { display: none; }
  body { display: block; background: #fff; }
  .margin { border: none; }
}

/* ============================================================
   Case — the excerpt is the work; the screenshot is the proof
   ============================================================ */
.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--margin-w);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
  scroll-margin-top: 1.5rem;
}
.case + .case,
.case + .spread,
.spread + .case { border-top: 1px solid color-mix(in srgb, var(--blue) 55%, transparent); }

/* the excerpt: real, selectable, indexable copy */
.excerpt {
  margin: 1.75rem 0 0;
  padding: 1.35rem 0 1.35rem 1.5rem;
  border-left: 3px solid var(--blue);
  max-width: 40rem;
}
.excerpt__label {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline;
  font-family: var(--util); font-size: 0.625rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--graphite); margin-bottom: 0.85rem;
}
.excerpt__source { color: var(--blue-deep); text-transform: none; letter-spacing: 0.04em; }
.excerpt__body { font-size: 1.1rem; line-height: 1.6; color: var(--ink); }
.excerpt__body p + p { margin-top: 0.9em; }
.excerpt.is-todo { border-left-style: dashed; border-left-color: var(--red); }
.excerpt.is-todo .excerpt__body { color: var(--graphite); font-style: italic; }
.excerpt.is-todo .excerpt__label { color: var(--red); }

/* ============================================================
   Clickable shots
   ============================================================ */
.gallery--wide { --cols: 2; margin-top: 2rem; }
.shotbtn {
  position: relative; display: block; width: 100%; padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background: var(--paper-2); cursor: zoom-in; overflow: hidden;
  transition: border-color 0.15s ease;
}
.shotbtn img { width: 100%; display: block; }
.shotbtn:hover { border-color: var(--red); }
.shotbtn__cue {
  position: absolute; left: 0; bottom: 0;
  padding: 0.4rem 0.7rem;
  background: var(--ink); color: var(--blue);
  font-family: var(--util); font-size: 0.625rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0; transform: translateY(100%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.shotbtn:hover .shotbtn__cue,
.shotbtn:focus-visible .shotbtn__cue { opacity: 1; transform: none; }

/* ============================================================
   Lightbox
   ============================================================ */
.lb-open { overflow: hidden; }
.lb {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--ink) 96%, transparent);
}
.lb[hidden] { display: none; }
.lb__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem clamp(0.85rem, 3vw, 1.75rem);
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
  flex-shrink: 0;
}
.lb__caption {
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue);
}
.lb__controls { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.lb__btn {
  font-family: var(--util); font-size: var(--t-util);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper); background: transparent; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--blue) 45%, transparent);
  padding: 0.4rem 0.75rem;
}
.lb__btn:hover { border-color: var(--blue); color: var(--blue); }
.lb__btn[hidden] { display: none; }
.lb__btn--close { border-color: var(--red); color: var(--red); }
.lb__btn--close:hover { background: var(--red); color: var(--paper); }
.lb__stage {
  flex: 1; overflow: auto; display: flex; justify-content: center;
  padding: clamp(0.85rem, 3vw, 2rem);
  cursor: zoom-out;
}
/* default: fill the width so tall screenshots are readable, scroll down to read */
.lb__img {
  width: auto; max-width: 100%; height: auto;
  align-self: flex-start; cursor: zoom-in;
  background: var(--paper-2);
}
@media (min-width: 45rem) {
  .lb__img { width: min(100%, 62rem); max-width: none; }
}
/* toggled: whole image visible at once */
.lb.is-fit .lb__stage { align-items: center; }
.lb.is-fit .lb__img {
  width: auto; max-width: 100%; max-height: 100%;
  align-self: center; cursor: zoom-in;
}
.lb__hint {
  padding: 0.6rem clamp(0.85rem, 3vw, 1.75rem);
  border-top: 1px solid color-mix(in srgb, var(--blue) 25%, transparent);
  font-family: var(--util); font-size: 0.625rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--blue) 70%, var(--ink));
  flex-shrink: 0;
}
@media (max-width: 34rem) { .lb__hint { display: none; } }

@media (max-width: 59.999rem) {
  .case { grid-template-columns: 1fr; gap: 1.75rem; }
  .gallery--wide { --cols: 1; }
  .excerpt { padding-left: 1rem; }
}

/* divider inside an excerpt, when one section shows two samples */
.excerpt__rule {
  display: block;
  margin: 1.6rem 0 0.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--blue) 60%, transparent);
  font-family: var(--util);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}

/* ============================================================
   Brandmark — client logo at the top of a career page.
   Sits above the hero, left-aligned, height-capped so wide and
   tall marks occupy the same optical weight.
   ============================================================ */
.brandmark {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 0.5rem;
}
.brandmark__img {
  height: var(--mark-h, 2.5rem);
  width: auto;
  max-width: min(100%, 18rem);
  object-fit: contain;
  object-position: left center;
}
.brandmark__note {
  font-family: var(--util);
  font-size: var(--t-util);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--graphite);
}

/* Optional: uncomment to render marks in ink rather than full colour.
   Keeps the palette disciplined if the logo colours fight the page.
.brandmark__img { filter: grayscale(1) contrast(1.15); opacity: 0.85; }
*/

@media (max-width: 59.999rem) {
  .brandmark__img { height: var(--mark-h, 2rem); }
}

/* ============================================================
   Cropped galleries — tall page screenshots show their top only,
   full height on click. Keeps a long category page from dwarfing
   the section it belongs to.
   ============================================================ */
.gallery--crop .shotbtn {
  max-height: 20rem;
  overflow: hidden;
}
.gallery--crop .shotbtn img {
  display: block;
  object-fit: cover;
  object-position: top center;
}
.gallery--crop .shotbtn::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6rem;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--paper-2) 0%, transparent),
    var(--paper-2));
  pointer-events: none;
  z-index: 1;
}
.gallery--crop .shotbtn__cue { z-index: 2; }
/* cue is always visible on a cropped shot — the image is truncated,
   so the affordance has to be obvious rather than hover-only */
.gallery--crop .shotbtn__cue { opacity: 1; transform: none; }
.gallery--crop .shotbtn:hover .shotbtn__cue { background: var(--red); color: var(--paper); }

@media (max-width: 59.999rem) {
  .gallery--crop .shotbtn { max-height: 15rem; }
  .gallery--crop .shotbtn::after { height: 4rem; }
}

/* ============================================================
   Featured nav item — the career overview sits above its siblings
   ============================================================ */
.nav__link--feature {
  font-size: 1.15rem;
  font-variation-settings: "wdth" 88;
  font-weight: 600;
  color: var(--paper);
  padding-bottom: 0.5rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
}
.nav__link--feature::before {
  transform: scaleX(1);
  width: 0.7rem;
  background: var(--red);
}
.nav__link--feature.is-here::before { background: var(--blue); }
