/* Portfolio styles. Light mode only. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* =====================================================
   Design tokens: light mode only, sky-blue accent.
   ===================================================== */
:root {
  --bg: #fbfbfa;
  --fg: #16171a;
  --ink-2: #33353a;
  --muted: #6b6e76;
  --line: #e4e5e8;
  --soft: #f1f2f4;
  --raised: #ffffff;
  --accent: #0a6fd1;
  --live: #16a36b;
  --live-ink: #0d6b4a;
  --live-bg: #e7f5ee;
  --live-line: #c4e6d4;

  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --header-h: 4.75rem;
  --max: 72rem;
  color-scheme: light;
}

html {
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}

.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important;
  margin: -1px !important; padding: 0 !important; border: 0 !important;
}

/* ---------- Shared bits ---------- */
.section { padding-block: 5rem; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .section { padding-block: 3.5rem; } }
.eyebrow { margin: 0 0 .9rem; font: 500 .8rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.h2 { margin: 0; font: 600 clamp(1.8rem, 3.6vw, 2.6rem)/1.12 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.h3 { margin: 0; font: 600 1.2rem/1.3 var(--display); letter-spacing: -.015em; }
.muted { color: var(--muted); }

.otw {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .8rem .4rem .65rem;
  border-radius: 99px; background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--bg));
  font: 500 .85rem/1 var(--body); white-space: nowrap; width: fit-content;
}
.pulse { position: relative; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex: none; }
.live {
  display: inline-flex; align-items: center; gap: .4rem; width: fit-content;
  font: 500 .75rem/1 var(--body); color: var(--live-ink); padding: .32rem .6rem .32rem .5rem;
  border-radius: 99px; background: var(--live-bg); border: 1px solid var(--live-line);
}
.live .pulse { width: .45rem; height: .45rem; background: var(--live); }
@media (prefers-reduced-motion: no-preference) {
  .pulse::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
    animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite;
  }
  @keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }
}

.btn {
  display: inline-flex; align-items: center; gap: .45rem; height: 2.75rem; padding-inline: 1.2rem;
  border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--fg);
  font: 500 .95rem/1 var(--body); cursor: pointer; white-space: nowrap;
  transition: border-color .2s, background-color .2s, color .2s;
}
.btn:hover { border-color: var(--fg); }
.btn-solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { width: 17px; height: 17px; flex: none; }

.chips { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; padding: .3rem .65rem;
  border-radius: 99px; border: 1px solid var(--line); background: var(--bg); white-space: nowrap;
}
.chip img { width: 14px; height: 14px; flex: none; }

/* ---------- Header + navbar ---------- */
.site-top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .25s;
}
.site-top.is-scrolled { border-bottom-color: var(--line); }
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 50; background: var(--bg);
}
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 2rem; height: var(--header-h); }
.brand { font: 600 1.1rem/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.site-nav { flex: none; }
.menu-button {
  display: none; align-items: center; gap: .5rem; font: 500 .9rem/1 var(--body); color: var(--fg);
  background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: .6rem .9rem; cursor: pointer;
}
.menu-button svg { width: 15px; height: 15px; }
.hdr:not(.is-wide) .menu-button { display: inline-flex; }
.site-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2.1rem; font-size: .94rem; }
.site-menu a { display: flex; align-items: center; gap: .4rem; color: var(--muted); white-space: nowrap; transition: color .2s, background-color .2s; }
.site-menu a::before { content: ""; width: .35rem; height: .35rem; border-radius: 50%; background: transparent; transition: background-color .2s; }
.site-menu a:hover, .site-menu a[aria-current="true"] { color: var(--fg); }
.site-menu a[aria-current="true"]::before { background: var(--accent); }
.site-menu a.cta { color: var(--bg); background: var(--fg); padding: .55rem 1.15rem; border-radius: 99px; margin-left: .25rem; }
.site-menu a.cta::before { display: none; }
.site-menu a.cta:hover, .site-menu a.cta[aria-current="true"] { background: var(--accent); color: #fff; }

/* Collapsed: the same list becomes a popover under the Menu button */
.site-menu[popover] {
  position: fixed; inset: auto; margin: 0; top: 4.5rem; right: 1rem;
  width: min(80dvw, 16rem); max-height: calc(100dvh - 6rem); overflow: auto;
  flex-direction: column; align-items: stretch; gap: .15rem; padding: .4rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--fg);
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / .25);
}
.site-menu[popover]:not(:is(:popover-open, .\:popover-open)) { display: none; }
.site-menu[popover]:is(:popover-open, .\:popover-open) { display: flex; }
.site-menu[popover] a { padding: .65rem .8rem; border-radius: 8px; color: var(--fg); }
.site-menu[popover] a::before { display: none; }
.site-menu[popover] a:hover, .site-menu[popover] a[aria-current="true"] { background: var(--soft); }
.site-menu[popover] a.cta { margin: .25rem 0 0; justify-content: center; color: var(--bg); background: var(--fg); }
@media (prefers-reduced-motion: no-preference) {
  .site-menu[popover] { transition: opacity .18s, translate .18s, display .18s, overlay .18s; transition-behavior: allow-discrete; }
  @starting-style { .site-menu[popover]:is(:popover-open, .\:popover-open) { opacity: 0; translate: 0 -4px; } }
}
.hdr.is-measuring * { transition: none !important; }
@media (forced-colors: active) { .site-menu a[aria-current="true"] { outline: 2px solid CanvasText; } }

/* ---------- Hero ---------- */
.hero { padding-block: 4.5rem 5rem; }
.hero-grid { display: grid; gap: 2.5rem 3.5rem; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr) 20rem; } }
.hero h1 { margin: 0; font: 600 clamp(2.4rem, 5.4vw, 4.2rem)/1.03 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.hero .eyebrow { margin: 1.4rem 0 .8rem; }
.hero-lede { margin: 1.3rem 0 0; max-width: 36rem; font-size: 1.15rem; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 2rem; }
.hero-soc { display: inline-flex; gap: 1.25rem; margin-left: .5rem; font-size: .94rem; color: var(--muted); }
.hero-soc a:hover { color: var(--fg); }
.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; max-width: 20rem; height: auto; margin-inline: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgb(0 0 0 / .55) 72%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgb(0 0 0 / .55) 72%, transparent 96%);
}
.portrait figcaption { margin-top: -.25rem; text-align: center; font-size: .85rem; color: var(--muted); }
@media (max-width: 899px) {
  .hero { padding-block: 2rem 3.5rem; }
  .portrait { order: -1; }
  .portrait img { max-width: 13rem; margin-inline: 0; }
  .portrait figcaption { text-align: left; }
}
@media (max-width: 520px) { .hero-soc { margin-left: 0; width: 100%; } }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .8s cubic-bezier(.16, 1, .3, 1) both; }
  .rise:nth-child(2) { animation-delay: .06s; }
  .rise:nth-child(3) { animation-delay: .12s; }
  .rise:nth-child(4) { animation-delay: .18s; }
  .rise:nth-child(5) { animation-delay: .24s; }
  @keyframes rise { from { opacity: 0; translate: 0 14px; } }
}

/* ---------- About ---------- */
.about-top { display: grid; gap: 1.5rem 3rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .about-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.bio { display: grid; gap: 1rem; color: var(--muted); font-size: 1.06rem; line-height: 1.65; max-width: 38rem; }
.bio p { margin: 0; text-wrap: pretty; }
.bio strong { color: var(--fg); font-weight: 500; }
.groups { display: grid; gap: 2rem; margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.group { display: grid; gap: .9rem 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .group { grid-template-columns: 15rem minmax(0, 1fr); align-items: center; } }
.group-sub { margin: .25rem 0 0; font-size: .88rem; color: var(--muted); }
.tiles { list-style: none; margin: 0 0 0 -.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
.tile {
  position: relative; width: 3.25rem; height: 3.25rem; border-radius: 12px; display: grid; place-items: center;
  transition: transform .2s, background-color .2s; cursor: default;
}
.tile img { width: 2.25rem; height: 2.25rem; display: block; }
.tile.wide img { width: 3rem; }
.tile:hover, .tile:focus-visible { transform: translateY(-2px); background: var(--soft); }
.tile::after {
  content: attr(data-name); position: absolute; bottom: calc(100% + 8px); left: 50%; translate: -50% 4px;
  padding: .35rem .55rem; border-radius: 6px; background: var(--fg); color: var(--bg); font: 500 .75rem/1 var(--body);
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, translate .15s; z-index: 2;
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; translate: -50% 0; }
@media (max-width: 520px) { .tile { width: 2.9rem; height: 2.9rem; } .tile img { width: 2rem; height: 2rem; } }

/* ---------- Live systems ---------- */
.sys-list { list-style: none; margin: 2.25rem 0 0; padding: 0; display: grid; gap: 2.5rem 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .sys-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .sys-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sys { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.browser {
  display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--raised);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -18px rgb(0 0 0 / .25); transition: transform .3s, box-shadow .3s;
}
.browser:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 22px 44px -20px rgb(0 0 0 / .3); }
.browser-bar { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.dots { display: flex; gap: .35rem; flex: none; }
.dots i { width: .55rem; height: .55rem; border-radius: 50%; background: #d9dbe0; }
.addr {
  flex: 1; min-width: 0; text-align: center; font: 400 .75rem/1 var(--mono); color: var(--muted); background: var(--raised);
  border: 1px solid var(--line); border-radius: 6px; padding: .35rem .5rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-right: 1.4rem;
}
.browser img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.sys-body { display: flex; flex-direction: column; flex: 1; }
.sys-top { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sys-top .h3 { font-size: 1.35rem; letter-spacing: -.025em; }
.sys-body p { margin: .5rem 0 0; color: var(--muted); }
.sys-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: auto; padding-top: 1.25rem; }

/* ---------- Projects ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.25rem; }
.view-toggle { display: inline-flex; padding: .2rem; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); }
.view-toggle button {
  display: inline-flex; align-items: center; gap: .4rem; border: 0; background: transparent; color: var(--muted);
  font: 500 .85rem/1 var(--body); padding: .5rem .85rem; border-radius: 99px; cursor: pointer;
  transition: color .2s, background-color .2s, box-shadow .2s;
}
.view-toggle button svg { width: 15px; height: 15px; }
.view-toggle button:hover { color: var(--fg); }
.view-toggle button[aria-pressed="true"] { background: var(--raised); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
@media (max-width: 599px) { .view-toggle { display: none; } }

.plist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.prow {
  position: relative; display: grid; gap: .5rem 2rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line);
  grid-template-columns: minmax(0, 1fr); view-transition-class: proj; transition: background-color .2s;
}
@media (min-width: 640px) {
  .plist[data-view="list"] .prow { grid-template-columns: minmax(0, 1fr) 7rem; }
  .plist[data-view="list"] .pcat { text-align: right; padding-top: .35rem; }
}
.plist[data-view="list"] .prow.has-link:hover { background: linear-gradient(to right, transparent, var(--soft) 12%, var(--soft) 88%, transparent); }
@media (max-width: 639px) { .pcat { order: -1; } }
.pcat { font: 500 .75rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pmain p { margin: .45rem 0 0; color: var(--muted); max-width: 40rem; }
.pmain .h3 { transition: color .2s; }
.plink::after { content: ""; position: absolute; inset: 0; }
.plink:focus-visible { outline: none; }
.prow:has(.plink:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.more { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; font-size: .9rem; font-weight: 500; }
.more .arr { transition: translate .2s; }
.prow.has-link:hover .h3, .prow.has-link:hover .more { color: var(--accent); }
.prow.has-link:hover .more .arr { translate: 4px 0; }
.pcover { display: none; margin: 0; }

.plist[data-view="grid"] { display: grid; gap: 1rem; border-top: 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .plist[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .plist[data-view="grid"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plist[data-view="grid"] .prow {
  display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem; border: 1px solid var(--line);
  border-radius: 14px; background: var(--raised); transition: border-color .2s, transform .2s;
}
.plist[data-view="grid"] .prow.has-link:hover { border-color: var(--fg); transform: translateY(-2px); }
.plist[data-view="grid"] .pcat { order: -1; }
.plist[data-view="grid"] .pmain { display: flex; flex-direction: column; flex: 1; }
.plist[data-view="grid"] .pmain p { font-size: .95rem; }
.plist[data-view="grid"] .more { margin-top: auto; padding-top: 1rem; }
.plist[data-view="grid"] .pcover {
  display: grid; place-items: center; order: -2; margin: -.55rem -.55rem .4rem; aspect-ratio: 16 / 10;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, var(--soft) 0 12px, #eceef1 12px 13px);
}
.plist[data-view="grid"] .pcover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pcover span { font: 600 1.05rem/1 var(--display); color: var(--muted); }

::view-transition-group(.proj) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition { pointer-events: none; }

/* ---------- Experience (timeline) ---------- */
.tl { list-style: none; margin: 2.25rem 0 0; padding: 0; }
.t-item { display: grid; grid-template-columns: 1rem minmax(0, 1fr); column-gap: 1.25rem; padding-bottom: 2.5rem; }
.t-item:last-child { padding-bottom: 0; }
.t-period { grid-column: 2; margin-bottom: .35rem; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-dot { grid-column: 1; grid-row: 1 / span 2; position: relative; }
.t-dot::before {
  content: ""; position: absolute; left: 50%; top: .45rem; translate: -50% 0; width: .7rem; height: .7rem;
  border-radius: 50%; background: var(--bg); border: 2px solid #b9bcc3; z-index: 1;
}
.t-item.is-current .t-dot::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.t-item:not(:last-child) .t-dot::after { content: ""; position: absolute; left: 50%; top: 1.3rem; bottom: -2.9rem; width: 1px; background: var(--line); }
.t-body { grid-column: 2; }
.t-co { margin: .25rem 0 0; color: var(--muted); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.current-tag {
  display: inline-flex; align-items: center; gap: .35rem; font: 500 .72rem/1 var(--body); color: var(--fg);
  padding: .3rem .55rem .3rem .45rem; border-radius: 99px; background: color-mix(in srgb, var(--accent) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--bg));
}
.current-tag::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.bullets { list-style: disc; margin: .9rem 0 0; padding-left: 1.1rem; color: #3d3f45; display: grid; gap: .4rem; max-width: 42rem; }
.bullets li::marker { color: var(--muted); }
@media (min-width: 760px) {
  .t-item { grid-template-columns: 10rem 1rem minmax(0, 1fr); }
  .t-period { grid-column: 1; grid-row: 1; margin: 0; padding-top: .15rem; text-align: right; }
  .t-dot { grid-column: 2; grid-row: 1; }
  .t-body { grid-column: 3; grid-row: 1; }
}

/* ---------- Contact (dark band) ---------- */
.contact { padding-block: 3rem 4rem; }
.cband {
  display: grid; gap: 2.5rem; padding: clamp(1.75rem, 5vw, 3.5rem); border-radius: 22px;
  background: #16171a; color: #f4f5f7; grid-template-columns: minmax(0, 1fr); align-items: start;
}
@media (min-width: 900px) { .cband { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }
.cband .h2 { margin-top: 1.25rem; color: #fff; }
.cband .lead { margin: 1rem 0 0; color: #a9adb6; font-size: 1.08rem; max-width: 30rem; }
.otw.dark { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .16); color: #fff; }
.otw.dark .pulse { background: #4ea8ff; }
.c-links { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.75rem; }
.btn-ghost-dark { color: #fff; border-color: rgb(255 255 255 / .25); }
.btn-ghost-dark:hover { border-color: #fff; background: rgb(255 255 255 / .06); }
.btn-light { background: #fff; color: #16171a; border-color: #fff; }
.btn-light:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cform { display: grid; gap: .5rem; padding: 1.5rem; border-radius: 16px; background: #1f2024; border: 1px solid rgb(255 255 255 / .08); }
.cf-title { margin: 0 0 .25rem; font: 600 1.15rem/1.3 var(--display); color: #fff; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .88rem; font-weight: 500; color: #d7d9de; }
.field input, .field textarea {
  font: inherit; font-size: max(1rem, 1em); color: #fff; background: #16171a; border: 1px solid #4a4d55;
  border-radius: 10px; padding: .7rem .85rem; min-height: 48px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: #4ea8ff; box-shadow: 0 0 0 3px rgb(78 168 255 / .3); }
.field :is(input, textarea):is(:user-invalid, .is-invalid) { border-color: #ff8a80; background: #2a1b1b; }
.err { visibility: hidden; margin: 0; min-height: 1.35rem; font-size: .85rem; line-height: 1.35rem; color: #ffb4ab; }
.err-ico {
  display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; margin-right: .3rem; border-radius: 50%;
  background: #ffb4ab; color: #16171a; font-weight: 700; font-size: .72rem;
}
.field :is(input, textarea):is(:user-invalid, .is-invalid) + .err { visibility: visible; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.send { justify-self: start; }
.send[disabled] { opacity: .6; cursor: progress; }
.cf-status { margin: 0; min-height: 1.4em; font-size: .92rem; color: #b8f0d4; }
.cf-status.is-error { color: #ffb4ab; }

/* ---------- Footer ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.75rem 2.25rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.foot nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.foot a:hover { color: var(--fg); }
.foot-ic { display: flex; gap: 1rem; }
.foot-ic svg { width: 18px; height: 18px; display: block; }
@media (max-width: 640px) { .foot { flex-direction: column; align-items: flex-start; } }

/* ---------- Case study page ---------- */
.cs-back { display: inline-flex; align-items: center; gap: .4rem; margin-top: 2.25rem; font-size: .9rem; color: var(--muted); transition: color .2s; }
.cs-back:hover { color: var(--fg); }
.cs-back span { transition: translate .2s; }
.cs-back:hover span { translate: -3px 0; }
.cs-head .eyebrow { margin-top: 1.75rem; }
.cs-head h1 { margin: 0; font: 600 clamp(2.4rem, 6vw, 4rem)/1.03 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.cs-summary { margin: 1.1rem 0 0; max-width: 40rem; font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.cs-meta { margin: 2.25rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .cs-meta { grid-template-columns: 1fr 1fr 2.2fr 1fr; } }
.cs-meta > div { padding: 1rem 0; min-width: 0; }
.cs-meta > div + div { border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .cs-meta > div { padding-right: 1.25rem; }
  .cs-meta > div + div { border-top: 0; border-left: 1px solid var(--line); padding-left: 1.25rem; }
}
.cs-meta dt { font: 500 .75rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cs-meta dd { margin: .6rem 0 0; font-weight: 500; }
.cs-meta .chips { margin-top: .1rem; }
.cs-meta .chip { font-weight: 400; }
.cs-links { display: flex; flex-direction: column; gap: .3rem; }
.cs-links a:hover { color: var(--accent); }
.cs-cover { margin: 2.5rem 0 0; }
.cs-cover-box { background: var(--soft); border-radius: 16px; padding: clamp(1rem, 4vw, 2.5rem); overflow-x: auto; }
.cs-cover-box img { display: block; width: 100%; height: auto; border-radius: 8px; }
.cs-cover figcaption { margin-top: .7rem; font-size: .85rem; color: var(--muted); }
.cs-body { display: grid; gap: 2rem 4rem; grid-template-columns: minmax(0, 1fr); padding-block: 3.5rem 4rem; }
@media (min-width: 1000px) { .cs-body { grid-template-columns: 12rem minmax(0, 42rem); } }
.toc { display: none; }
@media (min-width: 1000px) { .toc { display: block; position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
.toc p { margin: 0 0 .9rem; font: 500 .75rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.toc nav { scroll-target-group: auto; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem .9rem; margin-left: -1px; border-left: 2px solid transparent; font-size: .9rem; color: var(--muted); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--fg); }
.toc a:is(:target-current, .target-current) { color: var(--fg); font-weight: 500; border-left-color: var(--accent); }
.cs-next { border-top: 1px solid var(--line); }
.cs-next a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 2.25rem 3rem; }
.cs-next small { display: block; font: 500 .75rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.cs-next strong { font: 600 clamp(1.4rem, 3vw, 2rem)/1.15 var(--display); letter-spacing: -.025em; }
.cs-next .arrow { font-size: 1.6rem; color: var(--muted); transition: translate .2s, color .2s; }
.cs-next a:hover .arrow { translate: 4px 0; color: var(--accent); }

/* Write-up typography (the MDX content) */
.prose { min-width: 0; font-size: 1.075rem; line-height: 1.75; color: var(--ink-2); }
.prose h2 { margin: 3rem 0 1rem; font: 600 1.6rem/1.2 var(--display); letter-spacing: -.025em; color: var(--fg); text-wrap: balance; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 2rem 0 .75rem; font: 600 1.2rem/1.3 var(--display); color: var(--fg); }
.prose p { margin: 0 0 1.1rem; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.2rem; }
.prose ul { list-style: disc; }
.prose ul.stats { list-style: none; padding: 0; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--muted); }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--soft); padding: .1em .35em; border-radius: 4px; }
.prose pre { margin: 1.5rem 0; padding: 1.1rem 1.25rem; border-radius: 12px; background: #16171a; color: #e7e8ea; font: 400 .85rem/1.65 var(--mono); overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.callout {
  margin: 1.5rem 0; padding: 1.1rem 1.25rem; border-radius: 12px; font-size: 1rem; line-height: 1.6;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--bg));
}
.callout-title { display: block; margin-bottom: .25rem; font: 600 .78rem/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.callout p:last-child { margin-bottom: 0; }
.stats { list-style: none; margin: 1.25rem 0 1.5rem !important; padding: 0 !important; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stats li { margin: 0; padding: 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
.stat-num { display: block; font: 600 1.9rem/1 var(--display); letter-spacing: -.03em; color: var(--fg); font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: .45rem; font-size: .88rem; line-height: 1.4; color: var(--muted); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .browser, .browser:hover, .tile, .tile:hover, .plist[data-view="grid"] .prow.has-link:hover { transition: none; transform: none; }
}
