/* Shared styles for joshdavidoff.com: rules that were identical across the main pages
   (home, /bsh, and the project case studies). Page-specific rules stay inline in each page,
   after this sheet, so they keep overriding it. */

/* Apfel Grotezk by Collletttivo, SIL OFL 1.1 (assets/fonts/ApfelGrotezk-LICENSE.txt). */
@font-face { font-family: "Apfel Grotezk"; src: url("/assets/fonts/ApfelGrotezk-Regular.woff2") format("woff2"); font-weight: 100 400; font-display: swap; }
@font-face { font-family: "Apfel Grotezk"; src: url("/assets/fonts/ApfelGrotezk-Mittel.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Apfel Grotezk"; src: url("/assets/fonts/ApfelGrotezk-Fett.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --bg: oklch(0.36 0.085 153);
  --bg-deep: oklch(0.31 0.08 154);
  --cream: oklch(0.96 0.025 96);
  --muted: oklch(0.86 0.04 110);
  --faint: oklch(0.74 0.05 120);
  --mustard: oklch(0.84 0.15 87);
  --tomato: oklch(0.68 0.17 38);
  --rule: oklch(0.5 0.07 150);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--cream);
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px; line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 44px 32px 100px; }
.mono { font-family: "Apfel Grotezk", system-ui, sans-serif; font-size: 12.5px; letter-spacing: 0.12em; text-transform: uppercase; }
a:focus-visible { outline: 2px solid var(--mustard); outline-offset: 3px; border-radius: 2px; }

.back { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); text-decoration: none; margin-bottom: 46px; transition: color .18s ease; }
.back:hover { color: var(--mustard); }

.kicker { color: var(--mustard); font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.kicker .dot { color: var(--mustard); display: inline-block; font-family: Georgia, serif; font-size: 15px; line-height: 1; }
.kicker .dot::before { content: "✽"; }
.page-updated { color: var(--faint); margin: 18px 0 0; font-variant-numeric: tabular-nums; }
.title {
  font-family: "Apfel Grotezk", system-ui, sans-serif;
  font-size: clamp(36px, 6.5vw, 55px); line-height: 1.0; font-weight: 800;
  letter-spacing: -0.025em; color: var(--cream); margin: 0 0 14px; text-wrap: balance;
}

p { margin: 0 0 22px; max-width: 60ch; text-wrap: pretty; }

section { margin-top: 36px; }
.label {
  color: var(--mustard); font-weight: 600; margin: 0 0 14px;
  display: flex; align-items: center; gap: 11px;
  padding-bottom: 8px; border-bottom: 2px solid var(--rule);
}
.label .star { color: var(--mustard); display: inline-block; font-family: Georgia, serif; font-size: 0; line-height: 1; }
.label .star::before { content: "✽"; font-size: 15px; }
.body { color: var(--muted); }
.body strong { color: var(--cream); font-weight: 600; }

.deck { margin-top: 52px; margin-bottom: 52px; }
.deck-inner { max-width: 960px; margin: 0 auto; padding: 0 32px; }
.deck .label { max-width: 680px; margin-left: auto; margin-right: auto; }
a.zoom, a.zoom:hover { display: block; box-shadow: none; background-image: none; padding: 0; cursor: zoom-in; }
.slide-viewer { margin: 0 auto; }
.slide-viewer img { width: 100%; aspect-ratio: 16/9; object-fit: contain; border-radius: 10px; border: 2px solid var(--rule); display: block; background: oklch(0.22 0.05 153); }
.slide-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.slide-btn { background: none; border: 2px solid var(--rule); color: var(--cream); font-family: "Apfel Grotezk", sans-serif; font-weight: 700; font-size: 15px; padding: 8px 18px; border-radius: 8px; cursor: pointer; transition: border-color .18s ease, color .18s ease; }
.slide-btn:hover { border-color: var(--mustard); color: var(--mustard); }
.slide-btn:disabled { opacity: .3; cursor: default; }
.slide-btn:disabled:hover { border-color: var(--rule); color: var(--cream); }
.slide-counter { color: var(--faint); font-family: "Apfel Grotezk", system-ui, sans-serif; font-size: 11px; letter-spacing: 0.08em; }

.diagram-box {
  background: var(--bg-deep); border: 2px solid var(--mustard);
  border-radius: 10px; padding: 24px; margin: 0 0 22px;
}
@media (max-width: 480px) { .diagram-box { padding: 18px 16px; } }

/* ── Flow diagrams (case pages) ──
   Boxes are HTML, so they grow with their labels instead of overflowing a fixed drawing.
   Below 960px the items stack in source order and only .step arrows are drawn, pointing down;
   a .flow-pair puts a side input beside its target, joined by a .side arrow.
   From 960px the box widens past the text column and the items sit on a grid: the diagram sets
   its columns with --cols (and an optional --max width) and each item its place with --at (a
   grid-area value). A .c cell draws lines from its center to the edges named by l, r, t and b,
   with an arrowhead at the edge named by to-l, to-r, to-t or to-b. A .fill box stretches to its
   row's height; a .fit box wraps to its column's width instead of widening the column. */
.flow {
  --line: #869a6a; --lw: 1.5px;
  display: flex; flex-direction: column;
  font-family: "Apfel Grotezk", system-ui, sans-serif; font-size: 12px; line-height: 1.35; color: var(--faint);
}
.flow-head { color: var(--mustard); font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.flow-node {
  display: flex; flex-direction: column; justify-content: center;
  border: var(--lw) solid var(--line); border-radius: 6px; padding: 7px 12px 8px;
  text-align: center; text-wrap: balance;
}
.flow-node b { font-weight: 600; font-size: 13px; line-height: 1.3; }
.flow-node.key { border-color: var(--mustard); color: var(--mustard); }
.flow-node.warm { border-color: var(--tomato); color: var(--tomato); }
.flow-node.grey { border-color: #999; color: #bdbdbd; }
.flow-node.dashed { border-style: dashed; }
.flow-node .w { color: var(--tomato); }
.flow-node .n { color: var(--faint); font-size: 11.5px; margin-top: 3px; }
.flow-note { color: var(--faint); font-size: 11.5px; text-align: center; text-wrap: balance; margin-top: 12px; }
.flow .c { --col: var(--line); position: relative; }
.flow .c.warm { --col: var(--tomato); }
.flow .c::after { position: absolute; width: 0; height: 0; border: 4.5px solid transparent; }
.flow-duo small { font-size: 11px; line-height: 1.3; color: var(--faint); }

@media (max-width: 959.98px) {
  .flow { max-width: 460px; margin-inline: auto; }
  .flow-head { margin: 4px 0 6px; }
  .flow .c { display: none; }
  .flow .c.step { display: block; height: 26px; background: linear-gradient(var(--col), var(--col)) 50% 0 / var(--lw) 100% no-repeat; }
  .flow .c.step::after { content: ""; left: 50%; bottom: 0; margin-left: -4.5px; border-bottom: 0; border-top: 8px solid var(--col); }
  .flow .c.step + .flow-head { margin-top: -4px; }
  .flow-note.loop::before { content: "↺\00a0"; }
  .flow-pair { display: flex; align-items: stretch; }
  .flow-pair > .flow-node { flex: 1 1 0; }
  .flow .c.side { display: block; flex: 0 0 24px; align-self: center; height: 9px; background: linear-gradient(var(--col), var(--col)) 0 50% / 100% var(--lw) no-repeat; }
  .flow .c.side::after { content: ""; left: 0; top: 0; border-left: 0; border-right: 8px solid var(--col); }
  .flow .c.fork { display: block; height: 12px; margin: 12px calc(25% - 2.5px) 0; border: var(--lw) solid var(--col); border-bottom: 0; }
  .flow .c.fork::before { content: ""; position: absolute; left: 50%; top: -13.5px; height: 12px; margin-left: -0.75px; border-left: var(--lw) solid var(--col); }
  .flow-fan { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .flow-fan > .fan-r { grid-column: 2; }
  .flow-duo { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; }
  .flow-duo .c { display: block; width: 9px; height: 100%; background: linear-gradient(var(--col), var(--col)) 50% 0 / var(--lw) 100% no-repeat; }
  .flow-duo .c::after { content: ""; left: 0; bottom: 0; border-bottom: 0; border-top: 8px solid var(--col); }
  .flow-duo .c.dash { background: repeating-linear-gradient(180deg, var(--col) 0 4px, transparent 4px 7px) 50% 0 / var(--lw) 100% no-repeat; }
  .flow-duo .c.dash::after { top: 0; bottom: auto; border-top: 0; border-bottom: 8px solid var(--col); }
  .flow-duo small { margin-left: 6px; }
}

@media (min-width: 960px) {
  .diagram-box:has(> .flow) { margin-inline: calc((100% - 880px) / 2); }
  .flow { display: grid; grid-template-columns: var(--cols); align-items: center; max-width: var(--max, none); margin-inline: auto; }
  .flow-note.loop { margin-top: 0; }
  .flow > *, .flow-pair > *, .flow-fan > * { grid-area: var(--at, auto); }
  .flow-pair, .flow-fan { display: contents; }
  .flow-head { align-self: end; padding-bottom: 5px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
  .flow .fill { align-self: stretch; }
  .flow .fit { contain: inline-size; }
  .flow .c {
    align-self: stretch; min-width: 20px; min-height: 22px;
    background:
      linear-gradient(var(--col), var(--col)) 0 50% / var(--l, 0) var(--lw) no-repeat,
      linear-gradient(var(--col), var(--col)) 100% 50% / var(--r, 0) var(--lw) no-repeat,
      linear-gradient(var(--col), var(--col)) 50% 0 / var(--lw) var(--t, 0) no-repeat,
      linear-gradient(var(--col), var(--col)) 50% 100% / var(--lw) var(--b, 0) no-repeat;
  }
  .flow .c.l { --l: calc(50% + var(--lw) / 2); }
  .flow .c.r { --r: calc(50% + var(--lw) / 2); }
  .flow .c.t { --t: calc(50% + var(--lw) / 2); }
  .flow .c.b { --b: calc(50% + var(--lw) / 2); }
  .flow .c.dash { background-image: repeating-linear-gradient(90deg, var(--col) 0 4px, transparent 4px 7px), repeating-linear-gradient(90deg, var(--col) 0 4px, transparent 4px 7px), none, none; }
  .flow .c.to-r::after { content: ""; right: 0; top: 50%; margin-top: -4.5px; border-right: 0; border-left: 8px solid var(--col); }
  .flow .c.to-l::after { content: ""; left: 0; top: 50%; margin-top: -4.5px; border-left: 0; border-right: 8px solid var(--col); }
  .flow .c.to-t::after { content: ""; top: 0; left: 50%; margin-left: -4.5px; border-top: 0; border-bottom: 8px solid var(--col); }
  .flow .c.to-b::after { content: ""; bottom: 0; left: 50%; margin-left: -4.5px; border-bottom: 0; border-top: 8px solid var(--col); }
  .flow .c.side, .flow .c.fork { display: none; }
  .flow-duo { align-self: center; position: relative; display: flex; flex-direction: column; gap: 7px; }
  .flow-duo .c { height: 9px; min-height: 0; }
  .flow-duo small { position: absolute; top: calc(100% + 6px); left: 0; right: 0; text-align: center; }
}

.note { font-size: 15px; color: var(--faint); font-style: italic; margin-top: 48px; }

footer { margin-top: 56px; padding-top: 28px; border-top: 2px solid var(--rule); }
.links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 18px; }
.loc { margin-top: 24px; font-size: 14px; color: var(--mustard); font-weight: 600; }
h2 { font-size: inherit; font-weight: inherit; margin: 0; }

.more-cases { margin-top: 52px; }
.case-links { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.case-link-row { display: flex; align-items: baseline; gap: 12px; }
.case-link-row .cn { font-family: "Apfel Grotezk", system-ui, sans-serif; font-size: 13px; color: var(--tomato); font-weight: 600; flex-shrink: 0; }
.case-link-row a { font-size: 18px; }

/* ── Cross-page polish (view transitions, selection, grain) ── */
@view-transition { navigation: auto; }
::selection { background: var(--mustard); color: var(--bg-deep); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.arr { display: inline-block; transition: transform .2s cubic-bezier(.2,.6,.2,1); }
a:hover .arr { transform: translateX(4px); }
a:hover .arr-back { transform: translateX(-4px); }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-size: 180px 180px;
}

/* ── Site nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--bg) 82%, transparent); border-bottom: 1px solid color-mix(in oklch, var(--rule) 72%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.site-nav-inner { max-width: 680px; margin: 0 auto; padding: 0 32px; height: 50px; display: flex; align-items: center; justify-content: space-between; }
.site-nav-name .nav-dot { color: var(--mustard); font-family: Georgia, serif; font-size: 12px; line-height: 1; }
.site-nav-name .nav-dot::before { content: "✽"; }
.site-nav-links { display: flex; gap: 22px; align-items: center; }
.site-nav-links a { color: var(--faint); font-family: "Newsreader", Georgia, serif; font-size: 16px; }
.site-nav-links .linkedin-icon { border: 1px solid var(--rule); border-radius: 4px; display: inline-grid; place-items: center; font-family: "Apfel Grotezk", system-ui, sans-serif; font-size: 11px; font-weight: 600; height: 22px; letter-spacing: 0; line-height: 1; width: 22px; }
.site-nav-links a { position: relative; }
.site-nav-links a::after { content: ""; position: absolute; inset: -11px -8px; }
.site-nav-links .linkedin-icon:hover { border-color: var(--mustard); }

/* "Not work" slides the nav row left to a second row: back, My music, My taste. Both rows share
   one grid cell, so the bar keeps its size. assets/nav.js does the sliding; without it, "Not
   work" is a plain link to the Beyond the work section. */
/* The padding keeps link hit areas and focus rings inside the clip that hides the sliding rows. */
.site-nav-links { display: grid; overflow: hidden; padding: 12px 8px; margin: -12px -8px; }
/* Visibility flips at once when a row arrives and after the slide when it leaves. */
.nav-panel { grid-area: 1 / 1; display: flex; gap: 22px; align-items: center; justify-content: flex-end; transition: transform .24s ease-out, opacity .24s ease-out, visibility 0s linear 0s; }
.nav-sub { transform: translateX(45%); opacity: 0; visibility: hidden; transition-delay: 0s, 0s, .24s; }
.site-nav-links.sub-open .nav-main { transform: translateX(-45%); opacity: 0; visibility: hidden; transition-delay: 0s, 0s, .24s; }
.site-nav-links.sub-open .nav-sub { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.nav-open, .nav-back { display: inline-flex; align-items: center; gap: 7px; }
.site-nav-links .nav-open::after { content: ""; position: static; inset: auto; width: 5px; height: 5px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.site-nav-links .nav-open.current { color: var(--mustard); }
.nav-open::before { content: ""; position: absolute; inset: -11px -8px; }  /* the chevron took ::after, the hit area moves here */
.nav-back { position: relative; padding: 0; border: 0; background: none; cursor: pointer; color: var(--mustard); font-family: "Newsreader", Georgia, serif; font-size: 16px; }
.nav-back::before { content: ""; width: 5px; height: 5px; border-bottom: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(45deg); }
.nav-back::after { content: ""; position: absolute; inset: -11px -8px; }
.nav-back:hover { color: var(--cream); }
.site-nav-links .nav-sub a[aria-current="page"] { color: var(--mustard); }
.nav-back:focus-visible, .site-nav-links a:focus-visible { outline: 2px solid var(--mustard); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { .nav-panel { transition: none; } }
@media (max-width: 480px) {
  .site-nav-links { grid-template-columns: 100%; padding: 12px 0; margin: -12px 0; }
  .nav-panel { gap: 10px; justify-content: space-between; }
  .nav-back { font-size: 14px; }
}
