/*
  Shared by the overview (index.html) and the five project pages.
  Consultant briefing: white paper, navy ink, one orange accent from the resume.
  One column, written for a phone first. No scripts anywhere.
  Type: Archivo for headings and figures, IBM Plex Sans for reading.
  Orange is for figures and part numbers; links in running text stay navy.
*/

:root {
  --paper: #ffffff;
  --panel: #f3f5f8;
  --ink: #12233f;
  --soft: #55627a;
  --accent: #b24a0c;
  --rule: #d5dae3;

  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --small: 0.875rem;
  --body: 1.0625rem;
  --h3: 1.3rem;
  --h2: 1.6rem;
  --h1: clamp(2rem, 1.3rem + 3.4vw, 3.4rem);

  --page: 46rem;
  --gutter: 1.25rem;
  color-scheme: light;
}

/*
  Dark mode. Same roles, night values. Follows the device unless the visitor
  picked a side with the moon/sun switch (the page script sets data-theme).
*/
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1724;
    --panel: #182235;
    --ink: #e7ebf2;
    --soft: #9ba7bb;
    --accent: #f0955a;
    --rule: #2b3850;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1724;
  --panel: #182235;
  --ink: #e7ebf2;
  --soft: #9ba7bb;
  --accent: #f0955a;
  --rule: #2b3850;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: 1.55;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 2;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 0.9rem;
}
.skip:focus { top: 0.75rem; }

a { color: var(--ink); text-underline-offset: 0.18em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

p { margin: 0 0 1rem; }
img { display: block; max-width: 100%; height: auto; }

/* Every region shares one column. */
.masthead-inner,
main {
  width: min(var(--page), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

/*
  Top bar: thin, stays at the top, and a hairline keeps scrolling text from
  running into it. Photo and name left; Contact, LinkedIn, theme switch right.
*/
.masthead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.4rem;
}
.identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
}
.avatar {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  /* navy circle with initials-size type shows if the photo is blocked */
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
}
.name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}
/* the middle initial is a capital set at lowercase height (small cap) */
.name .initial { font-size: 0.8em; }
.reach {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* square icon buttons: email, LinkedIn, light/dark */
.icon-btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.icon-btn[hidden] { display: none; }
.icon-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn svg { fill: currentColor; }
.icon-btn .stroke,
.theme .sun { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .moon { display: none; }
  :root:not([data-theme="light"]) .theme .sun { display: block; }
}

/* headings */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { margin: 0 0 1.1rem; font-size: var(--h1); line-height: 1.04; letter-spacing: -0.025em; }
h2 { margin: 0 0 0.7rem; font-size: var(--h2); }
h3 { margin: 0 0 0.4rem; font-size: var(--h3); }

.opening { padding-block: 2.5rem 2rem; }
.lede { max-width: 36rem; font-size: 1.2rem; line-height: 1.45; color: var(--soft); }
.kicker {
  margin: 0 0 0.4rem;
  color: var(--soft);
  font-size: var(--small);
  font-weight: 500;
}
.note { color: var(--soft); }

/* buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover { background: var(--paper); color: var(--ink); }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: var(--ink); color: var(--paper); }

/* overview: the two numbered jump links under the headline */
.jump {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}
.jump a {
  display: block;
  padding: 0.9rem 1rem;
  border-top: 3px solid var(--ink);
  background: var(--panel);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.jump a:hover { background: var(--ink); color: var(--paper); }
.jump span, .part-label span { color: var(--accent); margin-right: 0.35rem; }

/* overview: the two parts */
.part { padding-block: 2.5rem; border-top: 3px solid var(--ink); }
.part-label {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--small);
  letter-spacing: 0.02em;
}

/* professional highlights: big figure on the left, what it counts beside it */
.highlights { margin: 1.25rem 0 1.75rem; padding: 0; list-style: none; }
.highlights li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.8rem;
  border-top: 1px solid var(--rule);
}
.highlights li:last-child { border-bottom: 1px solid var(--rule); }
.highlights .figure {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

/* personal: picture tiles, then text-only rows for projects without screens */
.tiles {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.tile a {
  display: block;
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s;
}
.tile a:hover { border-color: var(--ink); }
.tile img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  transition: transform 0.4s ease;
}
.tile a:hover img { transform: scale(1.02); }

/* Livi Home tile: the product tour plays silently on a loop.
   The script starts it only when the visitor allows motion; otherwise the poster stays. */
.tile.video { position: relative; }
.tile video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
}
.tile .play {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}
.tile .play .resume { display: none; }
.tile .play[aria-pressed="true"] .pause { display: none; }
.tile .play[aria-pressed="true"] .resume { display: block; }
.tile-text { display: block; padding: 0.9rem 1rem 1.1rem; }
.tile-kind { display: block; color: var(--soft); font-size: var(--small); font-weight: 500; }
.tile-name {
  display: block;
  margin: 0.1rem 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--h3);
  line-height: 1.15;
}
.tile a:hover .tile-name, .more a:hover .tile-name { text-decoration: underline; }
.tile-line { display: block; }

.more { margin: 1rem 0 0; padding: 0; list-style: none; }
.more a {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.more li:first-child a { border-top: 1px solid var(--rule); }

/* more detail: the parked material, set quieter than the two parts above */
.part h3 { margin-top: 2rem; }
.part h2 + h3 { margin-top: 1rem; }

.history { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.1rem 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--rule);
}
.history strong { font-weight: 600; }
.history .years { color: var(--soft); font-size: var(--small); white-space: nowrap; }
.history .role { grid-column: 1 / -1; color: var(--soft); font-size: var(--small); }

.shows { margin: 0; }
.shows div { padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.shows dt { font-weight: 600; }
.shows dd { margin: 0.15rem 0 0; }
.shows dd span { font-weight: 600; }

/* project pages: a row of figures, the number first, what it counts underneath */
.figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
  padding-block: 1rem;
  border-block: 1px solid var(--rule);
}
.figures div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.figures dt { color: var(--soft); font-size: 0.8125rem; line-height: 1.3; }
.figures dd {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.1rem);
  line-height: 1;
  color: var(--accent);
}

main > section { padding-block: 2rem; border-top: 2px solid var(--ink); }

.go {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--accent);
  font-weight: 600;
}

/* short rules and plain lists */
.rules, .plain { margin: 0; padding: 0; list-style: none; }
.rules li, .plain li { padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.rules li:first-child, .plain li:first-child { border-top: 0; padding-top: 0.2rem; }
.rules strong { font-weight: 600; }

/* numbered steps */
.steps {
  margin: 0 0 1.25rem;
  padding: 1rem;
  list-style: none;
  counter-reset: step;
  background: var(--panel);
  border-radius: 6px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.15rem 0 0.6rem 2.5rem;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.75rem;
  text-align: center;
}

/* Screens: swipe sideways on a phone, scroll on a desktop. */
.screens-label { margin: 0 0 0.5rem; color: var(--soft); font-size: var(--small); }
.screens {
  display: flex;
  gap: 0.75rem;
  margin: 0 calc(-1 * var(--gutter)) 0.75rem;
  padding: 0 var(--gutter) 0.75rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
}
.screens li { flex: 0 0 min(84vw, 34rem); scroll-snap-align: start; }
.screens.phone li { flex-basis: min(64vw, 17rem); }
.screens figure { margin: 0; }
.screens img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--panel);
}
.screens figcaption {
  margin-top: 0.4rem;
  color: var(--soft);
  font-size: var(--small);
  line-height: 1.35;
}

/* project page: previous, overview, next */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}
.pager a {
  display: block;
  height: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; color: var(--soft); font-weight: 400; }
.pager .all { grid-column: 1 / -1; }
.pager .all a { text-align: center; }

/* the overview ends with its last part; give it room above the fold-out */
main { padding-bottom: 3rem; }

@media (min-width: 40rem) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile.wide { grid-column: 1 / -1; }
  .more { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
  .more li a { border-top: 1px solid var(--rule); }
}

@media (min-width: 48rem) {
  :root { --body: 1.125rem; --h2: 1.9rem; --h3: 1.4rem; }
  .opening { padding-block: 4rem 3rem; }
  .highlights li { grid-template-columns: 7rem minmax(0, 1fr); }
  .highlights .figure { font-size: 2.5rem; }
}

/* phones: the bar uses a tighter edge so name, two buttons and the switch fit;
   on the narrowest screens the name breaks onto two short lines */
@media (max-width: 30rem) {
  .masthead-inner { width: calc(100% - 1.5rem); gap: 0.5rem; }
  .name { font-size: 0.9375rem; }
  .reach { gap: 0.3rem; }
  .jump a { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tile img, .button { transition: none; }
  .tile a:hover img { transform: none; }
}

@media print {
  .skip, .reach, .jump, .actions, .screens-label, .pager { display: none; }
  .masthead { position: static; }
  .screens { flex-wrap: wrap; overflow: visible; }
  .screens li { flex-basis: 45%; }
}
