/* Shared styles for the case study pages in /projects. Same system as index.html:
   Inter Tight, yellow bar, ink rules, label column on the left. */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-tight-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/inter-tight-latin-500-normal.woff2) format('woff2'); }

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

:root {
  --bar:    #FFD400;
  --ink:    #0A0A0A;
  --paper:  #FFFFFF;
  --rule:   #0A0A0A;
  --muted:  #6B6B6B;
  --soft:   #D4D4D4;
  --font:   'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --gutter: clamp(12px, 1.2vw, 20px);
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--font);
  font-size: clamp(18px, 1.55vw, 24px);
  line-height: 1.35; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--bar), var(--bar)) 0 92% / 100% 0.3em no-repeat;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .15s ease-out;
}
a:hover { background-size: 100% 100%; }
::selection { background: var(--bar); color: var(--ink); }
header ::selection { background: var(--ink); color: var(--bar); }

/* ─── Bar ─── */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bar);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
  font-size: clamp(16px, 1.25vw, 20px); line-height: 1;
}
header a { background: none; }
header a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.12em; }
header nav { display: flex; gap: clamp(14px, 1.6vw, 26px); }

/* ─── Title ─── */
.title {
  padding: clamp(40px, 5vw, 96px) var(--gutter) clamp(40px, 4.5vw, 80px);
  text-align: center;
}
.title .kicker { color: var(--muted); margin-bottom: 0.6em; }
.title h1 {
  font-size: clamp(56px, 9vw, 150px); font-weight: 400;
  line-height: 0.95; letter-spacing: -0.045em;
}
.title .lede {
  font-size: clamp(26px, 3.4vw, 56px); line-height: 1.06; letter-spacing: -0.025em;
  max-width: 20em; margin: 0.45em auto 0; text-wrap: balance;
}

/* ─── Layout ─── */
main {
  max-width: 1220px; margin: 0 auto;
  padding: 0 var(--gutter) clamp(80px, 9vw, 140px);
}

/* Key facts in a row under the title */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1.5em;
  border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule);
  padding: 0.7em 0;
}
.facts dt { color: var(--muted); }

/* Each section: label on the left, text on the right (like the entries on the home page) */
.sec {
  display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 0.25em 1.5em;
  padding: 1em 0 1.6em; border-bottom: 1.5px solid var(--rule);
}
.sec > h2 { font-size: inherit; font-weight: 500; }
.sec p { max-width: 36em; }
.sec p + p { margin-top: 1em; }
.sec h3 { font-size: inherit; font-weight: 500; }
.muted { color: var(--muted); }

/* Small items stacked inside a section, separated by thin rules */
.items > * { padding: 0.7em 0; }
.items > * + * { border-top: 1px solid var(--soft); }
.items > :first-child { padding-top: 0; }
.items > :last-child { padding-bottom: 0; }
.items p { margin-top: 0.25em; }

/* Timeline rows: date column + text */
.steps .step { display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 0 1.2em; }
.steps .when { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Before → after figures in measurement items */
.delta { margin-top: 0.35em; font-variant-numeric: tabular-nums; }
.delta b { font-weight: 500; }

/* Big number line ("335 € ÷ 12 days = 28 €") */
.sum {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2em 0.5em;
  font-size: clamp(32px, 4.6vw, 72px); letter-spacing: -0.035em; line-height: 1.05;
  font-variant-numeric: tabular-nums; margin-bottom: 0.4em;
}
.sum small { font-size: 0.3em; letter-spacing: -0.01em; color: var(--muted); }
.sum .op { color: var(--muted); }

/* Numbered how-it-works list */
.flow { list-style: none; counter-reset: n; }
.flow li { counter-increment: n; display: grid; grid-template-columns: 1.6em minmax(0, 1fr); gap: 0 0.4em; }
.flow li::before { content: counter(n); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Phone screenshots */
.shots {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 32px);
  max-width: 900px;
}
.shots figure img {
  display: block; width: 100%; height: auto;
  border: 1.5px solid var(--rule); border-radius: clamp(14px, 2vw, 28px);
}
/* Desktop screenshots: two wide frames side by side, stacked on phones */
.shots.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.shots.wide figure img { border-radius: clamp(8px, 1vw, 14px); }
.shots figcaption { color: var(--muted); font-size: 0.75em; margin-top: 0.5em; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; margin-top: 0.8em; }
.tags li { border: 1px solid var(--rule); border-radius: 999px; padding: 0.15em 0.6em; font-size: 0.8em; }

.next { padding-top: 1.6em; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6em 2em; }

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding: 14px var(--gutter) 18px;
  border-top: 1.5px solid var(--rule);
  font-size: clamp(14px, 1vw, 16px); color: var(--muted);
}
footer a.quiet { color: inherit; background: none; }
footer a.quiet:hover { text-decoration: underline; }

@media (max-width: 720px) {
  header nav a:not(.keep) { display: none; }
  .facts { grid-template-columns: 1fr 1fr; gap: 0.6em 1.2em; }
  .sec { grid-template-columns: minmax(0, 1fr); }
  .steps .step { grid-template-columns: 1fr; }
  .shots { grid-template-columns: repeat(3, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .shots figure { scroll-snap-align: start; }
  .shots.wide { grid-template-columns: 1fr; overflow: visible; gap: 1.2em; }
}

/* Large visual under the title (full width of the column) */
.hero-img { margin: 0 0 clamp(24px, 3vw, 48px); }
.hero-img img { display: block; width: 100%; height: auto; }

/* Colour palette swatches */
.swatches { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); gap: 0.8em; margin: 0.4em 0 1.2em; max-width: 46em; }
.swatches li { font-size: 0.75em; line-height: 1.3; }
.swatches span { display: block; aspect-ratio: 3 / 2; border: 1px solid var(--soft); border-radius: 8px; margin-bottom: 0.4em; }
.swatches code { color: var(--muted); font-family: inherit; font-variant-numeric: tabular-nums; }

/* Design images: wide detail view next to a tall phone mockup */
.design-shots { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: clamp(12px, 2vw, 32px); align-items: start; margin-top: 1.2em; }
.design-shots img { display: block; width: 100%; height: auto; border-radius: clamp(8px, 1vw, 14px); }
.design-shots img.framed { border: 1.5px solid var(--rule); }
.design-shots figcaption { color: var(--muted); font-size: 0.75em; margin-top: 0.5em; }
@media (max-width: 720px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6em; } .design-shots { grid-template-columns: 1fr; } .design-shots figure:last-child { max-width: 70%; } }
