/*
  ABC Normal (ABC Dinamo), web font files in /fonts (from the web license package).
  Only add .woff2 web files here, never the desktop .otf/.ttf files.
*/
@font-face {
  font-family: "ABC Normal";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/ABCNormal-Book.woff2") format("woff2");
}
@font-face {
  font-family: "ABC Normal";
  font-weight: 420;
  font-style: normal;
  font-display: swap;
  src: url("fonts/ABCNormal-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "ABC Normal";
  font-weight: 460;
  font-style: normal;
  font-display: swap;
  src: url("fonts/ABCNormal-Normal.woff2") format("woff2");
}
@font-face {
  font-family: "ABC Normal";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/ABCNormal-Neutral.woff2") format("woff2");
}

/*
  Three neutral themes, dark to light: Ink, Slate (graphite), Glacier (mist).
  Dark values follow libraries.dev (#121212 bg, #ededed text).
  Three base colors each; muted/faint are derived from --text.
  Registering them with @property lets the browser animate the switch.
*/
@property --bg   { syntax: "<color>"; inherits: true; initial-value: #121212; }
@property --card { syntax: "<color>"; inherits: true; initial-value: #1a1a1a; }
@property --text { syntax: "<color>"; inherits: true; initial-value: #ededed; }

:root {
  --bg: #121212;
  --card: #1a1a1a;
  --text: #ededed;
  --muted: color-mix(in srgb, var(--text) 78%, transparent);
  --faint: color-mix(in srgb, var(--text) 70%, transparent);
  transition: --bg 0.5s ease, --card 0.5s ease, --text 0.5s ease;
  --radius: 32px;
  --sidebar: 240px;
  --gap: 16px;
  --sans: "ABC Normal", system-ui, -apple-system, sans-serif;
}
:root[data-theme="ink"]     { --bg: #121212; --card: #1a1a1a; --text: #ededed; }
:root[data-theme="slate"]   { --bg: #1f1f1f; --card: #2a2a2a; --text: #ededed; }
:root[data-theme="glacier"] { --bg: #e8e8e8; --card: #dcdcdc; --text: #161616; }

:root.no-anim, :root.no-anim * { transition: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

p { font-size: 16px; font-weight: 400; }

a { color: inherit; text-decoration: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.name { display: block; font-size: 18px; font-weight: 500; line-height: 1.15; margin-bottom: 10px; }
.role { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.25; margin-bottom: 24px; }
.nav, .contact { display: flex; flex-direction: column; gap: 6px; }
.nav a, .contact a { font-size: 15px; font-weight: 460; transition: opacity 0.15s ease; }
.nav a:hover, .contact a:hover { opacity: 0.6; }
/* Current page: small dot to the right of the label */
.nav a { display: inline-flex; align-items: center; width: fit-content; }
.nav a::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav a.active::after { opacity: 1; transform: scale(1); }

/* ---------- Theme slider ---------- */
.sidebar-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.theme {
  --h: 40px;
  --pos: 0;
  position: relative;
  width: 40px;
  height: var(--h);
  transition: height 0.35s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.theme.open { --h: 128px; height: var(--h); }
.theme-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.theme-track:focus-visible { box-shadow: 0 0 0 2px var(--text); }
.theme-ticks {
  position: absolute;
  inset: 20px 0;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.theme.open .theme-ticks { opacity: 1; transition-delay: 0.12s; }
.theme-ticks span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 40%, transparent);
}
.theme-thumb {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: bottom 0.35s cubic-bezier(0.3, 0.7, 0.2, 1), transform 0.2s ease;
}
.theme.open .theme-thumb {
  bottom: calc(var(--pos) * (var(--h) - 40px));
  background: var(--bg);
  transform: scale(0.8);
  cursor: grab;
}
.theme.open .theme-thumb:active { cursor: grabbing; }
.theme-track:hover .theme-thumb svg { transform: rotate(30deg); }
.theme-thumb svg { transition: transform 0.4s ease; }

/* ---------- Main ---------- */
main {
  margin-left: var(--sidebar);
  padding: 24px 24px 24px 0;
  max-width: calc(var(--sidebar) + 1200px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform 0.25s ease;
}
a.card:hover { transform: scale(0.985); }

/* Image cards */
.card.media img,
.card.media .placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.placeholder {
  background:
    radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--tint, #555) 90%, white 10%), transparent 70%),
    var(--tint, #555);
}
.placeholder.checker {
  --sq2: color-mix(in srgb, var(--card), var(--text) 8%);
  background: conic-gradient(var(--sq2) 25%, var(--card) 0 50%, var(--sq2) 0 75%, var(--card) 0) 0 0 / 25% 25%;
}

/* Text cards */
.card.text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
}
.card.text h3 { font-size: 24px; font-weight: 500; line-height: 1.4; margin-bottom: 14px; }
.card.text p { color: var(--muted); max-width: 30em; }
.arrow { color: var(--muted); font-size: 0.8em; }
.caption {
  position: absolute;
  left: 40px;
  bottom: 32px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--faint) !important;
}

/* ---------- About ---------- */
.about {
  padding: 120px 0 80px;   /* left edge lines up with the cards */
  max-width: 720px;
}
.about-name { color: var(--text); font-weight: 500; }
.about p.about-name { margin-bottom: 8px; }
.about p { font-size: 17px; line-height: 1.6; margin-bottom: 20px; }
.about .muted { color: var(--muted); }
.about p:not(.about-name), .links a { font-weight: 400; }
.links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.links a { color: var(--muted); transition: color 0.15s ease; }
.links a:hover { color: var(--text); }

.footer {
  padding: 40px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 15px;
}

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .card.text { padding: 28px; }
  .card.text h3 { font-size: 20px; }
  .caption { left: 28px; bottom: 22px; }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 28px 16px 24px;
    flex-direction: row;
    align-items: flex-start;
  }
  .role { margin-bottom: 16px; }
  /* theme slider floats in the bottom-left corner on phones */
  .theme { position: fixed; left: 16px; bottom: 16px; z-index: 20; }
  .theme-track { background: color-mix(in srgb, var(--card), var(--text) 12%); }
  .nav { flex-direction: row; gap: 18px; }
  main { margin-left: 0; padding: 0 16px 16px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { border-radius: 24px; }
  /* text cards don't need to be square on a phone */
  .card.text { aspect-ratio: auto; min-height: 260px; padding: 28px 24px 64px; }
  .caption { left: 24px; }
  .about { padding: 72px 0 40px; }
  .footer { padding: 24px 8px; }
}

/* Screenshot cards: show the whole image, centered with breathing room */
.card.media.shot {
  display: grid;
  place-items: center;
  padding: 36px;
}
.card.media.shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.25));
}
@media (max-width: 720px) {
  .card.media.shot { padding: 20px; }
}

/* =====================================================================
   Case study pages (work/*.html)
   ===================================================================== */
.case {
  --line: color-mix(in srgb, var(--text) 14%, transparent);
  --col: 620px;   /* reading column */
  --gutter: 40px;
  --bleed: 25px;  /* images run a little wider than the text column */
  margin-left: 0; /* no sidebar on project pages */
  padding: 0 var(--gutter) 96px;
  max-width: none;
}
.case > * { max-width: var(--col); margin-left: auto; margin-right: auto; }
/* Banner, next project + footer run the full page width */
.case > .case-banner, .case > .next, .case > .footer {
  max-width: none;
  margin-left: calc(-1 * var(--gutter));
  margin-right: calc(-1 * var(--gutter));
  padding-left: max(var(--gutter), calc(50% + var(--gutter) - var(--col) / 2));
  padding-right: max(var(--gutter), calc(50% + var(--gutter) - var(--col) / 2));
}
/* Round back button, pinned top-left */
.case-back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 20;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s ease;
}
.case-back:hover { transform: translateX(-2px); background: color-mix(in srgb, var(--bg), var(--text) 8%); }
.case-back:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* Theme slider stays available, bottom-left */
.case-theme { position: fixed; left: 24px; bottom: 24px; z-index: 20; }

/* Full-bleed banner with the project's main image on a filled background */
.case-banner {
  display: grid;
  place-items: center;
  height: clamp(380px, 50vw, 640px);
  padding-top: 88px !important;
  padding-bottom: 56px !important;
  background: var(--card);
  margin-bottom: 72px;
}
.case-banner :is(img, video) {
  display: block;
  max-width: min(100%, 1040px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.3));
}

.case-hero h1 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 4px;
}
.case-sub { font-size: 17px; line-height: 1.5; color: var(--muted); }
.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.meta dt, .label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.meta dd { font-size: 16px; line-height: 1.45; }

.block { margin-top: 96px; }
.block.tight { margin-top: 48px; }
.block h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 16px;
}
.block > p, .lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}
.block > p + p { margin-top: 16px; }
.block > p.lede, .lede { color: var(--text); font-size: 17px; line-height: 1.6; }
.block > p.summary { color: var(--text); font-size: 17px; line-height: 1.7; }
.note { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* Figures */
.fig { margin-top: 56px; }
.fig + .fig, .fig + .figs, .figs + .fig, .figs + .figs { margin-top: 88px; }
.fig figure { margin: 0; }
figure.fig { margin: 56px 0 0; }   /* space between text and the asset below it */
.shotbox {
  display: grid;
  place-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 48px);
}
/* Images bleed slightly past the text column */
.case figure.fig .shotbox, .case .figs { margin-left: calc(-1 * var(--bleed)); margin-right: calc(-1 * var(--bleed)); }
.case .figs figcaption { padding: 0 4px; }
.shotbox img {
  display: block;
  max-width: 100%;
  max-height: 680px;
  width: auto;
  height: auto;
  border-radius: 10px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.25));
}
.shotbox.flush { padding: 0; overflow: hidden; }
.shotbox.flush img { border-radius: 0; filter: none; max-height: none; width: 100%; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; line-height: 1.45; max-width: 40em; }

.figs { display: grid; gap: 40px 28px; margin-top: 56px; }
.figs.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figs.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.figs .shotbox { height: 100%; padding: 16px; border-radius: 20px; }
.figs figure { display: flex; flex-direction: column; }
.figs figure .shotbox { flex: 1; }
.figs .shotbox img { max-height: 520px; }

/* Columns: challenges, problems, goals */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; margin-top: 48px; }
.cols h3 { font-size: 18px; font-weight: 500; line-height: 1.3; margin-bottom: 10px; }
.cols p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.cols .label { margin-bottom: 8px; }
.cols .outcome { margin-top: 24px; }
.cols .num { font-size: 18px; color: var(--muted); margin-bottom: 8px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 48px; }
.stats > div { background: var(--card); border-radius: 28px; padding: 36px 32px; }
.stats strong { display: block; font-size: clamp(36px, 4vw, 48px); font-weight: 500; line-height: 1; letter-spacing: -0.02em; margin-bottom: 16px; }
.stats p { color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Next project */
.next {
  display: block;
  margin-top: 160px;
  padding-top: 0;
  padding-bottom: 0;
  position: relative;
}
.next > * { padding-right: 80px; }
.next-arrow {
  position: absolute;
  top: 50%;
  right: max(var(--gutter), calc(50% - var(--col) / 2));
  transform: translateY(-50%);
  padding-right: 0;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.25s ease;
}
.next:hover .next-arrow { transform: translate(6px, -50%); }
.next .label { margin-bottom: 10px; }
.next strong { display: block; font-size: 24px; font-weight: 500; line-height: 1.3; }
.next span.sub { display: block; margin-top: 4px; color: var(--muted); font-size: 17px; }
.case .footer { padding-top: 72px; padding-bottom: 40px; }

@media (max-width: 900px) {
  .cols, .figs.c3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .case { --gutter: 16px; --bleed: 0px; padding: 0 var(--gutter) 64px; }
  .case-banner { height: auto; min-height: 280px; padding-top: 80px !important; padding-bottom: 32px !important; margin-bottom: 48px; }
  .case-banner :is(img, video) { border-radius: 8px; }
  .case-back { top: 16px; left: 16px; }
  .case-theme { left: 16px; bottom: 16px; }
  .meta, .cols, .stats, .figs.c2, .figs.c3 { grid-template-columns: 1fr; }
  .meta { gap: 16px; margin-top: 36px; }
  .block { margin-top: 72px; }
  .shotbox { border-radius: 20px; }
  .stats > div { border-radius: 22px; padding: 28px 24px; }
  .next { margin-top: 112px; }
  .next > * { padding-right: 48px; }

  .fig + .fig, .fig + .figs, .figs + .fig, .figs + .figs { margin-top: 64px; }
}

/* ---------- Homepage project cards: screenshot on top, text below ---------- */
.card.project {
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: visible;        /* lets the card grow if the text needs more room */
}
.card.project .thumb {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 22px;
  background: color-mix(in srgb, var(--card), var(--text) 5%);
  overflow: hidden;
}
.card.project .thumb :is(img, video) {
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.25));
}
.card.project .card-body { padding: 40px 26px 0; }
.card.project h3 { font-size: 24px; font-weight: 500; line-height: 1.4; margin-bottom: 12px; }
.card.project .card-body p { color: var(--muted); font-size: 18px; max-width: 30em; }
.card.project .caption {
  position: static;
  margin-top: auto;
  padding: 24px 26px 18px;
}
@media (max-width: 1000px) {
  .card.project .card-body { padding: 28px 14px 0; }
  .card.project h3 { font-size: 20px; }
  .card.project .card-body p { font-size: 16px; }
  .card.project .caption { padding: 20px 14px 10px; }
}
@media (max-width: 720px) {
  .card.project { aspect-ratio: auto; padding: 12px; }
  .card.project .thumb { border-radius: 16px; }
  .card.project .thumb :is(img, video) { inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); }
  .card.project .card-body { padding: 24px 12px 0; }
  .card.project .caption { padding: 20px 12px 10px; }
}

/* Hover: the screenshot panel grows to cover the whole tile.
   Only on devices with a real pointer and wide enough for square tiles;
   phones keep the stacked layout above. */
@media (hover: hover) and (min-width: 721px) {
  .card.project {
    position: relative;
    padding-top: 50%;          /* reserves the top half for the panel (square tile) */
  }
  .card.project .thumb {
    position: absolute;
    z-index: 2;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 50%;
    aspect-ratio: auto;
    transition:
      top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      right 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      bottom 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      border-radius 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .card.project .thumb :is(img, video) { transition: inset 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
  a.card.project:hover { transform: none; }
  .card.project:hover .thumb,
  .card.project:focus-visible .thumb {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius);
  }
  .card.project:hover .thumb :is(img, video),
  .card.project:focus-visible .thumb :is(img, video) {
    inset: 36px;
    width: calc(100% - 72px);
    height: calc(100% - 72px);
  }
}

/* ---------- Underlined text links (inline links, About links) ---------- */
.role a,
.links a,
.about p a,
.block p a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.role a:hover,
.links a:hover,
.about p a:hover,
.block p a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* ---------- Opening a project: the card expands into the page ----------
   Uses cross-document view transitions (Chrome/Edge 126+, Safari 18.2+).
   The clicked card and the case page's .case-bg share the name "case-card",
   so the browser morphs one into the other; the page content fades in on top. */
@view-transition { navigation: auto; }

.case-bg {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: var(--bg);
  pointer-events: none;
  view-transition-name: case-card;
}
main.case { view-transition-name: case-content; }

::view-transition-group(case-card) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
::view-transition-old(case-card),
::view-transition-new(case-card) {
  height: 100%;
  object-fit: cover;
  object-position: top left;
  animation-duration: 0.6s;
}

/* Page content arrives after the card has mostly opened */
::view-transition-new(case-content) {
  animation: case-content-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both;
}
::view-transition-old(case-content) {
  animation: case-content-out 0.2s ease both;
}
@keyframes case-content-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes case-content-out { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* Fallback for browsers without view transitions: wipe in left to right */
@keyframes case-reveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0.4; transform: translateX(-12px); }
  to   { clip-path: inset(0 0 0 0);    opacity: 1;   transform: none; }
}
@supports not (view-transition-name: none) {
  @media (prefers-reduced-motion: no-preference) {
    main.case { animation: case-reveal 0.9s cubic-bezier(0.65, 0, 0.35, 1) both; }
  }
}

/* ---------- Hairline stroke on cards (inset, so layout doesn't shift) ---------- */
:root { --stroke: color-mix(in srgb, var(--text) 8%, transparent); }
.card, .shotbox, .stats > div { box-shadow: inset 0 0 0 1px var(--stroke); }
.shotbox.flush { box-shadow: none; outline: 1px solid var(--stroke); outline-offset: -1px; }

/* "Try it" link under a project summary */
.block > p.try { margin-top: 24px; color: var(--text); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Full-bleed video: fills the banner / card thumb edge to edge ---------- */
.case-banner.bleed { height: auto; padding: 0 !important; background: #000; }
.case-banner.bleed video {
  width: 100%;
  max-width: none;
  max-height: 80vh;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  filter: none;
}
.card.project .thumb.bleed :is(img, video) {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}
.card.project:hover .thumb.bleed :is(img, video),
.card.project:focus-visible .thumb.bleed :is(img, video) { inset: 0; width: 100%; height: 100%; }

/* Link list on a project page (e.g. Iris press links) */
.links-list { list-style: none; margin-top: 8px; }
.links-list li + li { margin-top: 2px; }
.links-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  font-size: 17px;
  box-shadow: inset 0 -1px 0 var(--stroke);
  transition: opacity 0.15s ease;
}
.links-list a:hover { opacity: 0.65; }
.links-list .src { flex-shrink: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 720px) {
  .links-list a { flex-direction: column; gap: 4px; }
}
.case-banner.bleed img { width: 100%; max-width: none; max-height: 80vh; height: auto; object-fit: cover; border-radius: 0; filter: none; }

/* ---------- Homepage grid: 3 columns on wide screens ---------- */
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card.project { aspect-ratio: auto; }  /* cards in a row share one height */
  .card.project .card-body { padding: 28px 16px 0; }
  .card.project h3 { font-size: 20px; margin-bottom: 8px; }
  .card.project .card-body p { font-size: 15px; line-height: 1.5; }
  .card.project .caption { padding: 16px 16px 12px; font-size: 14px; }
}

/* ---------- About: work experience, speaking, education ---------- */
.cv { margin-top: 48px; }
.cv h3 { font-size: 15px; font-weight: 460; margin-bottom: 12px; }
.cv ul { list-style: none; }
.cv li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  box-shadow: inset 0 1px 0 var(--stroke);
  font-size: 15px;
  line-height: 1.5;
}
.cv-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.cv-what { display: flex; flex-direction: column; }
.cv-title { color: var(--text); }
.cv-org { color: var(--muted); }
@media (max-width: 720px) {
  .cv li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Toast (e.g. "Email copied") ---------- */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--stroke), 0 12px 32px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.toast-close:hover { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.toast-close:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.toast .muted { color: var(--muted); }
@media (max-width: 720px) { .toast { right: 16px; bottom: 16px; left: 72px; } }

/* ---------- Next project: quiet secondary link, primary on hover ---------- */
.next strong { font-size: 18px; font-weight: 400; color: var(--muted); transition: color 0.2s ease; }
.next .next-arrow { font-size: 18px; color: var(--muted); transition: transform 0.25s ease, color 0.2s ease; }
.next:hover strong, .next:hover .next-arrow,
.next:focus-visible strong, .next:focus-visible .next-arrow { color: var(--text); }

/* Iris links: headline stays primary; the source label is secondary and turns primary on hover */
.links-list a { color: var(--text); }
.links-list a:hover, .links-list a:focus-visible { opacity: 1; }
.links-list .src { color: var(--muted); transition: color 0.2s ease; }
.links-list a:hover .src, .links-list a:focus-visible .src { color: var(--text); }

/* ---------- About page (about.html): project-page layout, no banner ---------- */
.about-page { padding-top: 144px; }
.about-page .about { padding: 40px 0 0; max-width: var(--col); }
@media (max-width: 720px) { .about-page { padding-top: 96px; } }

.cv li:first-child { box-shadow: none; }  /* no line between a section heading and its first row */

/* ---------- Project pages: Email / LinkedIn pinned to the bottom ---------- */
.has-contact-bar { padding-bottom: 104px; }
.contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  padding: 64px 40px 24px;   /* bottom matches the theme button (bottom: 24px) */
  background: linear-gradient(to top, var(--bg) 60%, color-mix(in srgb, var(--bg) 0%, transparent));
  pointer-events: none;
}
.contact-bar-inner {
  max-width: 620px;           /* same as the reading column */
  margin: 0 auto;
  display: flex;
  gap: 24px;
  height: 40px;      /* same height as the theme button, so both share a centre line */
  align-items: center;
  font-size: 17px;   /* same as project body text */
  pointer-events: auto;
}
.contact-bar a { color: var(--muted); transition: color 0.2s ease; }
.contact-bar a:hover, .contact-bar a:focus-visible { color: var(--text); }
.has-contact-bar .toast { bottom: 72px; }
@media (max-width: 720px) {
  .contact-bar { padding: 56px 16px 16px; }
  .contact-bar-inner { justify-content: flex-end; }  /* theme slider sits bottom-left */
}

/* Banner with three images (Growth experiments): centre image fully visible, side images run off the edges */
.case-banner.trio {
  --shot-h: clamp(180px, 27vw, 380px);   /* height of the centre (Pro) dialog */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  height: auto;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
}
.case-banner.trio img {
  height: var(--shot-h);
  width: auto;
  max-width: none;
  max-height: none;
  border-radius: 0;
}
/* Side dialogs keep the same UI scale as the exports: height = export height / Pro export height (1358px) */
.case-banner.trio img:first-child { justify-self: end; height: calc(var(--shot-h) * 724 / 1358); }   /* Cancel export 1040x724 (left) */
.case-banner.trio img:last-child { justify-self: start; height: calc(var(--shot-h) * 1728 / 1358); }  /* Ads export 1964x1728 (right) */
@media (max-width: 720px) {
  .case-banner.trio { gap: 16px; --shot-h: 160px; }
}

/* ---------- Light theme (Mist): stop text from rendering thin ----------
   "antialiased" smoothing makes dark-on-light text look spindly on macOS,
   so the light theme uses the system's normal smoothing and slightly stronger grey text. */
:root[data-theme="glacier"] body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }
:root[data-theme="glacier"] {
  --muted: color-mix(in srgb, var(--text) 84%, transparent);
  --faint: color-mix(in srgb, var(--text) 76%, transparent);
}

/* ---------- Typewriter name (sidebar): Sharon Dayoung Lee <-> 이다영 ---------- */
.tw { display: inline-block; min-height: 1.15em; white-space: nowrap; }
.tw::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.1em;
  background: currentColor;
  animation: tw-blink 1s steps(1) infinite;
}
.tw.typing::after { animation: none; }   /* solid cursor while typing/deleting */
@keyframes tw-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tw::after { display: none; } }

/* ---------- Mascot (Mochi) above the name: breathes, blinks, eyes follow the cursor ---------- */
.mascot { display: inline-block; margin-bottom: 14px; line-height: 0; }
.mascot svg { overflow: visible; }
.mascot-body { transform-box: fill-box; transform-origin: 50% 100%; animation: mochi-breathe 3.2s ease-in-out infinite; }
.mascot:hover .mascot-body { animation: mochi-squish 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.mascot-face { transition: transform 0.15s ease-out; }
.mascot-eyes { transform-box: fill-box; transform-origin: 50% 50%; transition: transform 0.08s ease; }
.mascot.blink .mascot-eyes { transform: scaleY(0.12); }
@keyframes mochi-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 0.96); } }
@keyframes mochi-squish { 0% { transform: scale(1, 1); } 35% { transform: scale(1.12, 0.86); } 70% { transform: scale(0.95, 1.06); } 100% { transform: scale(1, 1); } }
@media (prefers-reduced-motion: reduce) { .mascot-body { animation: none; } }


/* Mascot: drag it around (springs back) or tap it for a squish */
.mascot { position: relative; z-index: 30; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.mascot.dragging { cursor: grabbing; }
.mascot.dragging .mascot-body { animation: none; transform: scale(1.08); }
.mascot.returning { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mascot.pop .mascot-body { animation: mochi-squish 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.mascot.pop .mascot-eyes { transform: scaleY(0.12); }

/* Mascot on the light theme: soft shadow so the white body doesn't disappear */
:root[data-theme="glacier"] .mascot svg { filter: drop-shadow(0 3px 6px rgba(20, 24, 60, 0.18)) drop-shadow(0 1px 1.5px rgba(20, 24, 60, 0.12)); }
/* Tap: a little vertical hop */
.mascot.jump svg { animation: mochi-jump 0.55s cubic-bezier(.3, .7, .4, 1); }
@keyframes mochi-jump {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-12px); }
  65%  { transform: translateY(0); }
  80%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .mascot.jump svg { animation: none; } }

/* ---------- Showcase sections (asset-first, wider than the text column) ---------- */
.case > .showcase { max-width: var(--col); margin-top: 140px; }   /* images stay within the content column */
.showcase-text { max-width: var(--col); margin-left: auto; margin-right: auto; }
.showcase h2 { font-size: 24px; font-weight: 500; line-height: 1.35; margin-bottom: 12px; }
.showcase-text > p:not(.label) { font-size: 17px; line-height: 1.65; color: var(--muted); }
.shot { margin: 40px 0 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--stroke); }
.shot figcaption { max-width: var(--col); margin: 14px auto 0; text-align: center; }
.shot-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shot-row .shot { margin-top: 16px; }
.showcase .cols { margin-top: 32px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps { margin-top: 28px; padding-left: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: 16px; padding: 14px 0; font-size: 17px; box-shadow: inset 0 1px 0 var(--stroke); }
.steps li:first-child { box-shadow: none; }
.steps li::before { content: counter(step, decimal-leading-zero); color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .case > .showcase { margin-top: 96px; }
  .shot-row, .showcase .cols { grid-template-columns: 1fr; }
  .shot img { border-radius: 12px; }
}

.showcase .cols p:not(.num) { font-size: 15px; line-height: 1.55; color: var(--muted); }
.showcase .cols h3 { font-size: 17px; font-weight: 460; margin-bottom: 6px; }
.showcase .cols .num { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.shot-row .shot figcaption { text-align: left; }

/* ---------- Text groups are always a single-column list, never a grid ---------- */
.cols, .showcase .cols { display: block; margin-top: 24px; }
.cols > div { padding: 16px 0; box-shadow: inset 0 1px 0 var(--stroke); }
.cols > div:first-child { box-shadow: none; padding-top: 4px; }
.cols > div h3 { margin-bottom: 4px; }
.showcase .cols .num { display: inline; margin: 0 10px 0 0; }
.showcase .cols .num + h3 { display: inline; }
.showcase .cols .num ~ p:last-child { margin-top: 4px; }

/* ---------- Assets: one per row by default, never side by side ---------- */
.shot-row, .figs, .figs.c2, .figs.c3 { display: block; }
.shot-row .shot { margin-top: 40px; }
.shot-row .shot figcaption { text-align: center; }

/* ---------- Card screenshot never covers the title ----------
   The panel's height used to be 50% of the card's HEIGHT, while the space
   reserved for it (padding-top: 50%) is 50% of the card's WIDTH. When text made
   a card taller than wide, the panel grew over the title. Now the panel's size
   is tied to the card's width, so it always ends exactly where the reserved space ends. */
@supports (width: 1cqw) {
  @media (hover: hover) and (min-width: 721px) {
    .card.project { container-type: inline-size; }
    .card.project .thumb { bottom: calc(100% - 14px - 50cqw); }
    .card.project:hover .thumb,
    .card.project:focus-visible .thumb { bottom: 0; }
  }
}

/* ---------- Uniform gap between the screenshot and the card text ----------
   Text sits at the bottom of each card; the screenshot panel stretches to fill
   everything above it (its ratio adapts per card), so the gap to the title is
   always the same. --stack (set in site.js) = height of the text block. */
@media (hover: hover) and (min-width: 721px) {
  .card.project .card-body { margin-top: auto; }
  .card.project .caption { margin-top: 0; }
  .card.project .thumb { bottom: var(--stack, 50%); }
  @supports (width: 1cqw) {
    .card.project .thumb { bottom: var(--stack, calc(100% - 14px - 50cqw)); }
  }
  .card.project:hover .thumb,
  .card.project:focus-visible .thumb { bottom: 0; }
}

/* ---------- Cards stay square; the screenshot takes whatever space the text leaves ---------- */
@media (min-width: 721px) {
  .card.project { aspect-ratio: 1 / 1; overflow: hidden; }
  /* keep descriptions short enough to fit a square card */
  .card.project .card-body p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
}
@media (min-width: 1100px) {
  .card.project { aspect-ratio: 1 / 1; }
}
@media (hover: hover) and (min-width: 721px) {
  /* the screenshot sizes itself to the space above the text, so no fixed space needs reserving */
  .card.project { padding-top: 14px; align-self: start; }
}

/* Column count: wide enough cards that a square still leaves room for the screenshot */
@media (min-width: 721px) and (max-width: 1039px) { .grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1040px) and (max-width: 1359px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) and (max-width: 1359px) {
  /* undo the 3-column text tightening while there are 2 columns */
  .card.project .card-body { padding: 28px 16px 0; }
}

/* Tighter gap between card screenshot and title */
@media (min-width: 721px) { .card.project .card-body { padding-top: 18px; } }

/* ---------- Password gate on locked project pages ---------- */
main.case.locked { padding-top: 180px; min-height: 70vh; }
.lock-gate { max-width: var(--col); margin: 0 auto; }
.lock-form { display: flex; gap: 8px; margin-top: 28px; max-width: 360px; }
.lock-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--stroke);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.lock-form input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--text); }
.lock-form button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 15px;
  font-weight: 460;
  cursor: pointer;
}
.lock-form button:disabled { opacity: 0.6; cursor: default; }
.lock-error { margin-top: 12px; font-size: 15px; color: var(--muted); }
@media (max-width: 720px) { main.case.locked { padding-top: 120px; } }

/* ---------- Phone: centered password gate with the button below the field ---------- */
@media (max-width: 720px) {
  main.case.locked {
    padding-top: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .lock-gate { width: 100%; text-align: center; margin-top: -40px; }
  .lock-form { flex-direction: column; max-width: none; gap: 10px; }
  .lock-form input { flex: none; height: 48px; }
  .lock-form button { width: 100%; height: 48px; }
}

/* ---------- About lists: same text size as the About paragraphs ---------- */
.cv li { font-size: 17px; }
.cv h3 { font-size: 17px; }

/* Mascot on the password screen */
.lock-gate .lock-mascot { display: inline-block; margin-bottom: 20px; }
.lock-gate .lock-mascot svg { width: 64px; height: 64px; }

/* ---------- Phone: centered header; tap the mascot to open the nav as an overlay ---------- */
@media (max-width: 720px) {
  .sidebar { justify-content: center; }
  .sidebar .intro { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }
  .sidebar .role { margin-bottom: 0; }
  .mascot { cursor: pointer; z-index: 60; -webkit-tap-highlight-color: transparent; }
  .mascot:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; border-radius: 50%; }

  /* nav hidden until the mascot is tapped */
  .sidebar .nav {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }
  .sidebar .nav a { font-size: 28px; transform: translateY(8px); transition: transform 0.3s cubic-bezier(.2, .8, .2, 1); }
  body.nav-open .sidebar .nav { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }
  body.nav-open .sidebar .nav a { transform: none; }
  body.nav-open { overflow: hidden; }
  /* the mascot stays above the overlay so tapping it again closes the menu */
  .toast { z-index: 70; }
}

/* ---------- Phone homepage: Email / LinkedIn at the end of the scroll ---------- */
.home-contact { display: none; }
@media (max-width: 720px) {
  .home-contact {
    display: flex;
    justify-content: flex-end;   /* the theme button sits bottom-left */
    align-items: center;
    gap: 24px;
    height: 40px;                /* same as the theme button, so they line up at the bottom */
    margin-top: 48px;
    font-size: 17px;
  }
  .home-contact a { color: var(--muted); transition: color 0.2s ease; }
  .home-contact a:hover { color: var(--text); }
}

/* ---------- Locked pages: pile of mascot copies ---------- */
.mochi-pile { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.mochi { position: absolute; left: 0; top: 0; width: 72px; height: 72px; pointer-events: auto; cursor: grab; touch-action: none; will-change: transform; }
.mochi.held { cursor: grabbing; }
.mochi svg { width: 100%; height: 100%; display: block; overflow: visible; }
:root[data-theme="glacier"] .mochi svg { filter: drop-shadow(0 2px 4px rgba(20, 24, 60, 0.18)); }
.mochi-pile.full { animation: pile-shake 0.3s ease; }
@keyframes pile-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
