/* ============================================================
   Victor Luna — portfolio (senior product design)
   One stylesheet for the home page, case studies and 404.
   Screenshots are never cropped: every image keeps its own
   aspect ratio (height: auto) and no ancestor clips it.
   ============================================================ */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------------- tokens ---------------- */

:root {
  color-scheme: light;
  --bg: oklch(0.985 0.004 100);
  --surface: oklch(1 0 0);
  --sunken: oklch(0.955 0.006 100);
  --fg: oklch(0.19 0.01 120);
  --fg-2: oklch(0.4 0.012 120);
  --fg-3: oklch(0.5 0.012 120);
  --line: oklch(0 0 0 / 0.09);
  --accent: oklch(0.5 0.14 150);
  --image-outline: oklch(0 0 0 / 0.1);

  /* soft panels behind each project's screens */
  --panel-camomila: oklch(0.955 0.04 125);
  --panel-enel: oklch(0.945 0.025 255);
  --panel-outoo: oklch(0.95 0.035 160);
  --panel-neutral: oklch(0.95 0.008 100);
  --shot-shadow: 0 14px 32px -14px oklch(0 0 0 / 0.28);

  --shadow-border:
    0 0 0 1px oklch(0 0 0 / 0.06),
    0 1px 2px -1px oklch(0 0 0 / 0.06),
    0 2px 4px 0 oklch(0 0 0 / 0.04);
  --shadow-border-hover:
    0 0 0 1px oklch(0 0 0 / 0.09),
    0 1px 2px -1px oklch(0 0 0 / 0.08),
    0 2px 4px 0 oklch(0 0 0 / 0.06);

  --font-display: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --prose: 640px;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: oklch(0.165 0.006 120);
    --surface: oklch(0.2 0.006 120);
    --sunken: oklch(0.2 0.006 120);
    --fg: oklch(0.96 0.004 110);
    --fg-2: oklch(0.8 0.008 115);
    --fg-3: oklch(0.7 0.008 115);
    --line: oklch(1 0 0 / 0.1);
    --accent: oklch(0.82 0.15 150);
    --image-outline: oklch(1 0 0 / 0.1);

    --panel-camomila: oklch(0.26 0.03 125);
    --panel-enel: oklch(0.26 0.03 255);
    --panel-outoo: oklch(0.26 0.03 160);
    --panel-neutral: oklch(0.24 0.006 120);
    --shot-shadow: 0 14px 32px -14px oklch(0 0 0 / 0.6);

    --shadow-border: 0 0 0 1px oklch(1 0 0 / 0.09);
    --shadow-border-hover: 0 0 0 1px oklch(1 0 0 / 0.16);
  }
}

/* ---------------- base ---------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p, li, dd, figcaption, blockquote { text-wrap: pretty; }

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

.link {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 150ms ease-out;
}

@media (hover: hover) {
  .link:hover { text-decoration-color: currentColor; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: oklch(0.88 0.15 150); color: oklch(0.2 0.01 120); }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -48px;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.tnum { font-variant-numeric: tabular-nums; }

/* Content images: 1px outline that follows the radius. */
.shot {
  border-radius: var(--r-md);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
  background: var(--sunken);
}

/* ---------------- header ---------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease-out;
}
.site-head.is-scrolled { border-bottom-color: var(--line); }

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.site-head__name {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav { display: flex; gap: 4px; font-size: 15px; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 12px;
  border-radius: var(--r-sm);
  color: var(--fg-2);
  transition: color 150ms ease-out, background-color 150ms ease-out;
}
.site-nav a[aria-current="page"] { color: var(--fg); }

@media (hover: hover) {
  .site-nav a:hover { color: var(--fg); background: var(--sunken); }
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: 22px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 550;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--ghost { box-shadow: var(--shadow-border); background: var(--surface); }

@media (hover: hover) {
  .btn--primary:hover { background: color-mix(in oklch, var(--fg) 84%, var(--bg)); }
  .btn--ghost:hover { box-shadow: var(--shadow-border-hover); }
}

.btn svg { width: 16px; height: 16px; flex: none; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------- sections ---------------- */

.section { padding-top: 120px; }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 32px;
  margin-bottom: 40px;
}

.section__title {
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.section__note { max-width: 28em; color: var(--fg-2); }

/* ---------------- hero ---------------- */

.hero { padding-top: 72px; }

@media (min-width: 900px) {
  .hero { padding-top: 120px; }
}

.hero__title {
  max-width: 14ch;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.hero__lede {
  max-width: 32em;
  margin-top: 32px;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--fg-2);
}

.hero .actions { margin-top: 36px; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 36px;
  font-size: 15px;
  color: var(--fg-3);
}

.status { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); }

.status__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: oklch(0.72 0.19 150);
  box-shadow: 0 0 0 3px oklch(0.72 0.19 150 / 0.22);
}

/* ---------------- stats ---------------- */

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

@media (min-width: 800px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stats--home {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  margin-top: 12px;
  max-width: 16em;
  font-size: 15px;
  line-height: 1.45;
  color: var(--fg-2);
}

/* ---------------- tags ---------------- */

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding-inline: 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: var(--shadow-border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1;
  color: var(--fg-2);
  white-space: nowrap;
}

/* ---------------- screens on panels (never cropped) ---------------- */

.panel {
  padding: clamp(20px, 3.4vw, 48px);
  border-radius: var(--r-xl);
  background: var(--panel-neutral);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.panel--camomila { background: var(--panel-camomila); }
.panel--enel { background: var(--panel-enel); }
.panel--outoo { background: var(--panel-outoo); }

/* A row of phone screens, side by side, full height */
.phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  max-width: 980px;
  margin-inline: auto;
}

@media (min-width: 720px) {
  .phones { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); }
  .phones--stagger > :nth-child(even) { margin-top: 48px; }
}

.phones img {
  width: 100%;
  border-radius: 5% / 2.3%;
  box-shadow: var(--shot-shadow);
}

/* fewer screens on small phones in the home cards: omit, never crop */
@media (max-width: 719px) {
  .phones--home > :nth-child(n+3) { display: none; }
}

.phones--three { max-width: 740px; }
@media (min-width: 720px) {
  .phones--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .phones--three.phones--stagger > :nth-child(even) { margin-top: 48px; }
}

.phones--two { max-width: 520px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* one web or desktop screenshot at natural ratio */
.screen {
  width: 100%;
  border-radius: var(--r-md);
  box-shadow: var(--shot-shadow);
}

/* desktop + phones composition */
.compo {
  display: grid;
  gap: 24px;
  align-items: center;
}

@media (min-width: 900px) {
  .compo { grid-template-columns: minmax(0, 1fr) 24%; gap: 32px; }
  .compo--two { grid-template-columns: minmax(0, 1fr) 32%; }
}

.compo__phones {
  display: none;
  gap: 16px;
}

@media (min-width: 900px) {
  .compo__phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .compo--two .compo__phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.compo__phones img { width: 100%; border-radius: 5% / 2.3%; box-shadow: var(--shot-shadow); }

/* ---------------- featured work ---------------- */

.case-list { display: grid; gap: 120px; }

.case { display: grid; gap: 32px; }

.case__head {
  display: grid;
  gap: 20px;
}

@media (min-width: 900px) {
  .case__head { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 64px; align-items: end; }
}

.case__label {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.case__label strong { color: var(--fg); font-weight: 600; }

.case__name {
  margin-top: 8px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
  max-width: 16ch;
}

.case__side { display: grid; gap: 20px; }

.case__result {
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.case__result span { color: var(--fg-2); }

.case__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 550;
  color: var(--fg);
}

.case__more svg { width: 16px; height: 16px; transition: transform 150ms ease-out; }

.case__media { display: block; }
.case__media .panel { transition: box-shadow 150ms ease-out; }

@media (hover: hover) {
  .case__media:hover + .case__head .case__more svg,
  .case__more:hover svg { transform: translateX(3px); }
}

/* ---------------- previous work ---------------- */

.prev li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
}

.prev li:last-child { border-bottom: 1px solid var(--line); }

@media (min-width: 720px) {
  .prev li { grid-template-columns: 200px minmax(0, 1fr) 160px; gap: 32px; align-items: center; }
}

.prev__thumbs {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px;
  width: fit-content;
  border-radius: var(--r-md);
  background: var(--panel-neutral);
}

.prev__thumbs img {
  width: 48px;
  border-radius: 6px;
  box-shadow: 0 4px 10px -4px oklch(0 0 0 / 0.25);
}

.prev__thumbs--web img { width: 176px; border-radius: 6px; }

.prev h3 { font-size: 22px; letter-spacing: -0.02em; }
.prev h3 span { color: var(--fg-3); font-family: var(--font-body); font-weight: 400; font-size: 16px; letter-spacing: 0; margin-inline-start: 8px; font-variant-numeric: tabular-nums; }
.prev p { margin-top: 4px; color: var(--fg-2); }
.prev__kind { color: var(--fg-3); font-size: 15px; }

@media (min-width: 720px) {
  .prev__kind { text-align: right; }
}

/* ---------------- principles ---------------- */

.principles { display: grid; gap: 40px; }

@media (min-width: 800px) {
  .principles { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}

.principles li { padding-top: 24px; border-top: 2px solid var(--fg); }
.principles h3 { font-size: 24px; line-height: 1.2; margin-bottom: 12px; }
.principles p { color: var(--fg-2); }

/* ---------------- about ---------------- */

.about { display: grid; gap: 40px; }

@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; align-items: start; }
}

.about__photo {
  width: 100%;
  border-radius: var(--r-xl);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.about__text { display: grid; gap: 20px; max-width: var(--prose); font-size: 19px; line-height: 1.6; }
.about__text p:not(:first-child) { color: var(--fg-2); }

/* ---------------- experience ---------------- */

.roles li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 720px) {
  .roles li { grid-template-columns: 1.2fr 1fr auto; align-items: baseline; }
}

.roles__org { font-weight: 550; font-size: 17px; }
.roles__where { color: var(--fg-2); font-size: 15px; }
.roles__when { color: var(--fg-3); font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }

@media (max-width: 719px) {
  .roles__where { grid-column: 1; }
  .roles__when { grid-column: 2; grid-row: 1; }
}

.roles__more { margin-top: 20px; font-size: 15px; color: var(--fg-2); max-width: 52em; }

/* ---------------- quotes ---------------- */

.quotes { display: grid; gap: 16px; }

@media (min-width: 800px) {
  .quotes { grid-template-columns: repeat(2, 1fr); }
}

.quote {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 28px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-border);
}

.quote blockquote { font-size: 18px; line-height: 1.55; }

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--fg-3);
}

.quote figcaption img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

.quote figcaption strong { display: block; font-weight: 550; color: var(--fg); font-size: 15px; }

.quote--large { max-width: 820px; }
.quote--large blockquote { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 28px); line-height: 1.35; letter-spacing: -0.015em; font-weight: 500; }

/* ---------------- writing ---------------- */

.posts li a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}
.posts li:last-child a { border-bottom: 1px solid var(--line); }

.posts__title { font-weight: 550; font-size: 19px; }
.posts__meta { color: var(--fg-3); font-size: 15px; font-variant-numeric: tabular-nums; }

@media (hover: hover) {
  .posts li a:hover .posts__title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
}

.posts__more { margin-top: 24px; }

/* ---------------- contact / footer ---------------- */

.contact { padding-block: 160px 48px; }

.contact__title {
  font-size: clamp(44px, 9vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 12ch;
}

.contact__text { margin-top: 28px; max-width: 30em; font-size: 20px; color: var(--fg-2); }
.contact .actions { margin-top: 36px; }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 112px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg-3);
}

.site-foot ul { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ============================================================
   Case study
   ============================================================ */

.cs-head { padding-top: 48px; }

@media (min-width: 900px) {
  .cs-head { padding-top: 72px; }
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 24px;
  font-size: 15px;
  color: var(--fg-2);
}
.back svg { width: 14px; height: 14px; }
@media (hover: hover) { .back:hover { color: var(--fg); } }

.cs-label { font-size: 16px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cs-label strong { color: var(--fg); font-weight: 600; }

.cs-title {
  margin-top: 12px;
  max-width: 16ch;
  font-size: clamp(40px, 7.4vw, 88px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.cs-sub {
  max-width: 34em;
  margin-top: 28px;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--fg-2);
}

.cs-head .tags { margin-top: 24px; }

.cs-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

@media (min-width: 800px) {
  .cs-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.cs-facts dt { color: var(--fg-3); margin-bottom: 4px; }
.cs-facts dd { color: var(--fg); }

.cs-impact { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }

.cs-hero { margin-top: 64px; }

/* Layout: sticky contents beside the article on wide screens */
.cs-layout { display: grid; gap: 48px; padding-top: 120px; }

@media (min-width: 1100px) {
  .cs-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 72px; }
}

.toc { display: none; }

@media (min-width: 1100px) {
  .toc {
    display: block;
    position: sticky;
    top: 92px;
    align-self: start;
    font-size: 14px;
  }
  .toc a {
    display: block;
    padding-block: 6px;
    color: var(--fg-3);
    transition: color 150ms ease-out;
  }
  .toc a[aria-current="true"] { color: var(--fg); font-weight: 550; }
}

@media (hover: hover) { .toc a:hover { color: var(--fg); } }

.article > section { scroll-margin-top: 84px; }
.article > section + section { margin-top: 120px; }

.article h2 {
  max-width: 18em;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
}

.prose {
  display: grid;
  gap: 18px;
  max-width: var(--prose);
  font-size: 18px;
  line-height: 1.65;
  color: var(--fg-2);
}

.prose + .prose { margin-top: 18px; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose ul { display: grid; gap: 12px; }
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-3);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--sunken);
  color: var(--fg);
}

.lead {
  max-width: 26em;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 550;
  color: var(--fg);
}

.callout {
  max-width: var(--prose);
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: var(--sunken);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-2);
}
.callout strong { color: var(--fg); font-weight: 600; }

/* Owned vs shared */
.roles-split {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

@media (min-width: 720px) {
  .roles-split { grid-template-columns: 1fr 1fr; }
}

.roles-split > div {
  padding: 24px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
}

.roles-split h3 { font-size: 20px; margin-bottom: 14px; color: var(--fg); }
.roles-split ul { display: grid; gap: 10px; }
.roles-split li { position: relative; padding-left: 20px; }
.roles-split li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-3);
}

/* Figures */
.fig { margin-top: 40px; }

.fig__frame {
  display: grid;
  place-items: center;
  padding: 24px 16px;
  border-radius: var(--r-xl);
  background: var(--panel-neutral);
  outline: 1px solid var(--image-outline);
  outline-offset: -1px;
}

@media (min-width: 640px) {
  .fig__frame { padding: 40px; }
}

.panel--camomila.fig__frame { background: var(--panel-camomila); }
.panel--enel.fig__frame { background: var(--panel-enel); }
.panel--outoo.fig__frame { background: var(--panel-outoo); }

.fig__frame > img {
  width: 100%;
  max-width: var(--w, 640px);
  border-radius: var(--r-md);
  box-shadow: var(--shot-shadow);
}

.fig__frame > .phones { width: 100%; }

.fig figcaption {
  max-width: var(--prose);
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-3);
}

.fig__grid { display: grid; gap: 16px; }

@media (min-width: 800px) {
  .fig__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.fig__grid .fig__frame { height: 100%; }

/* Decision blocks */
.decision { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }

.decision__num {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 15px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

.decision h3 {
  margin: 0 0 16px;
  max-width: 22ch;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.tradeoff {
  display: grid;
  gap: 12px;
  max-width: var(--prose);
  margin-top: 28px;
}

@media (min-width: 640px) {
  .tradeoff { grid-template-columns: 1fr 1fr; }
}

.tradeoff > div {
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-2);
}

.tradeoff h4 {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}

/* Timeline */
.timeline { max-width: var(--prose); margin-top: 32px; }

.timeline li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--fg-2);
}

.timeline time { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.timeline strong { color: var(--fg); font-weight: 550; }

/* Next case */
.next { margin-top: 140px; }

.next a {
  display: grid;
  gap: 24px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: calc(var(--r-xl) + 8px);
  background: var(--surface);
  box-shadow: var(--shadow-border);
  transition: box-shadow 150ms ease-out;
}

@media (min-width: 800px) {
  .next a { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 32px; }
}

.next__media { padding: 20px; border-radius: var(--r-xl); background: var(--panel-neutral); }
.next__media--camomila { background: var(--panel-camomila); }
.next__media--enel { background: var(--panel-enel); }
.next__media--outoo { background: var(--panel-outoo); }

.next__media .phones { max-width: 360px; gap: 12px; }
.next__media .phones--stagger > :nth-child(even) { margin-top: 0; }
.next__media .phones > img { border-radius: 5% / 2.3%; }
.next__media > img { width: 100%; border-radius: var(--r-md); box-shadow: var(--shot-shadow); }

.next__body { display: grid; gap: 8px; padding: 8px 20px 20px; }
@media (min-width: 800px) { .next__body { padding: 20px; } }
.next__body span { color: var(--fg-3); font-size: 15px; }
.next__body strong { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; }
.next__body p { color: var(--fg-2); }

@media (hover: hover) {
  .next a:hover { box-shadow: var(--shadow-border-hover); }
}

/* ---------------- reveal on scroll ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------------- cookie consent ---------------- */

.consent {
  position: fixed;
  left: var(--gutter);
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 12px;
  max-width: 340px;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-border), 0 16px 40px -12px oklch(0 0 0 / 0.2);
  font-size: 14px;
  color: var(--fg-2);
}

.consent[hidden] { display: none; }
.consent__actions { display: flex; gap: 8px; }
.consent .btn { min-height: 40px; padding-inline: 16px; font-size: 14px; }

/* ---------------- 404 ---------------- */

.notfound { min-height: 70svh; display: grid; align-content: center; justify-items: start; gap: 20px; }
.notfound h1 { font-size: clamp(56px, 12vw, 128px); letter-spacing: -0.05em; line-height: 0.95; }
.notfound p { color: var(--fg-2); font-size: 20px; max-width: 24em; }

/* ---------------- case study additions ---------------- */

@media (max-width: 719px) {
  .phones--three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
}

.decision__grid { display: grid; gap: 32px; }

@media (min-width: 900px) {
  .decision--split .decision__grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
  .decision--split .fig { margin-top: 0; }
}

.decision--split .fig { margin-top: 0; }
.decision--split .tradeoff { max-width: none; }

.cs-next-note { margin-top: 28px; }


/* ============================================================
   Freelance site: these pages always use the dark theme and the
   site's orange accent.
   ============================================================ */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: oklch(0.165 0.006 120);
    --surface: oklch(0.2 0.006 120);
    --sunken: oklch(0.2 0.006 120);
    --fg: oklch(0.96 0.004 110);
    --fg-2: oklch(0.8 0.008 115);
    --fg-3: oklch(0.7 0.008 115);
    --line: oklch(1 0 0 / 0.1);
    --accent: oklch(0.82 0.15 150);
    --image-outline: oklch(1 0 0 / 0.1);

    --panel-camomila: oklch(0.26 0.03 125);
    --panel-enel: oklch(0.26 0.03 255);
    --panel-outoo: oklch(0.26 0.03 160);
    --panel-neutral: oklch(0.24 0.006 120);
    --shot-shadow: 0 14px 32px -14px oklch(0 0 0 / 0.6);

    --shadow-border: 0 0 0 1px oklch(1 0 0 / 0.09);
    --shadow-border-hover: 0 0 0 1px oklch(1 0 0 / 0.16);
  --accent: #fa3205;
}

.btn--primary { background: #fa3205; color: #fff; }
@media (hover: hover) {
  .btn--primary:hover { background: #ff4d1f; }
}
.site-nav .btn { min-height: 40px; margin-left: 8px; padding-inline: 16px; font-size: 14px; color: #fff; }
@media (max-width: 520px) {
  .site-nav .hide-sm { display: none; }
}

/* No borders on card-like containers: they read by their fill alone */
.tag,
.panel,
.quote,
.roles-split > div,
.fig__frame,
.tradeoff > div,
.next a {
  box-shadow: none;
  outline: none;
}

/* Page titles: 98% line height, matching the rest of the site */
.cs-title { line-height: 0.98; }
