/* Shared case-study styles (copied from skyn-site; keep the two in sync) */

:root {
  --black: #000;
  --black-60: #666;
  --surface: #f4f4f4;
  --bg: #fbfbfc;

  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Hedvig Letters Serif", Georgia, serif;

  --page-width: 1377px;   /* hero width; left edge of details + sidebar */
  --content-width: 1160px;
  --sidebar-width: 91px;
  --sidebar-gap: 96px;    /* 458 - 271 - 91 */
  --gutter: 24px;
  --text-gap: 48px;      /* between side-by-side text columns */
  --label-size: 16px;    /* every small grey label: sidebar, dividers, section labels */
}

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

html { scroll-behavior: smooth; }

body {
  zoom: var(--fit, 1);
  margin: 0;
  background: var(--bg);
  color: var(--black);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3 { margin: 0; font-weight: 400; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  max-width: 1920px;
  margin: 0 auto;
  padding: 40px 70px 0;
  display: flex;
  justify-content: flex-end;
}
.site-nav {
  display: flex;
  gap: 40px;
  font-family: var(--font-sans);
  font-size: 18px; /* same as body text */
}
.site-nav a:hover { color: var(--black-60); }

/* Page frame */
.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 0 240px;
}

/* Overview */
.overview {
  display: grid;
  /* Overview starts on the content's right text column:
     left col spans to that column, right col matches its width. */
  grid-template-columns:
    calc(var(--sidebar-width) + var(--sidebar-gap) + (var(--content-width) - var(--text-gap)) / 2)
    calc((var(--content-width) - var(--text-gap)) / 2);
  column-gap: var(--text-gap);
  margin-top: 172px;
  font-size: 18px;
}
.overview__label {
  color: var(--black-60);
  font-size: var(--label-size);
  line-height: normal;
  margin-bottom: 12px;
}
.overview p:not(.overview__label) { line-height: 1.5; }

.hero {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 72px;
  border-radius: 30px;
}

/* Two-column layout with sticky sidebar */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width));
  column-gap: var(--sidebar-gap);
  margin-top: 133px;
}
.sidebar {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: var(--label-size);
  white-space: nowrap;
}
.sidebar a { color: var(--black-60); transition: color .15s; }
.sidebar a:hover, .sidebar a.is-active { color: var(--black); }

.content { display: flex; flex-direction: column; gap: 240px; }

/* Sections */
/* Divider header marking each sidebar group */
.divider {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--black-60);
  font-size: var(--label-size);
  line-height: 1;
  margin-bottom: -40px;
}
/* 80px below the divider in every section, whatever the section's own gap */
.section--final > .divider { margin-bottom: 16px; }
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e0e0e0;
}
.section { display: flex; flex-direction: column; gap: 120px; scroll-margin-top: 40px; }
.section--final { gap: 64px; }

.subsection { display: flex; flex-direction: column; gap: 32px; }
.subsection--wide-gap { gap: 64px; }
/* follows the previous subsection closely (64px instead of the section's 120px) */
.subsection--continue { margin-top: -56px; }

.intro { display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px; }
.intro--flush { padding-bottom: 0; }
.intro--stacked { padding-bottom: 0; }
/* standalone statement centered in the column */
.intro--center { align-items: center; text-align: center; }
.intro--stacked > .heading { margin-bottom: 20px; }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--text-gap);
  align-items: start;
}

/* Type styles (skyn/*) */
.heading, .subheading, .display { text-wrap: balance; }
.body, .overview p { text-wrap: pretty; }
.label { color: var(--black-60); font-size: var(--label-size); line-height: normal; }
.number { color: var(--black-60); font-size: 14px; line-height: normal; }
.heading { font-family: var(--font-serif); font-size: 26px; line-height: 1.3; }
.subheading { font-family: var(--font-serif); font-size: 22px; line-height: 1.3; }
.display { font-family: var(--font-serif); font-size: 36px; line-height: 1.4; }
/* larger question type gets a proportionally larger gap under its label (12px at 26px → ~20px at 36px) */
.intro > .label + .display { margin-top: 8px; }

.body { font-size: 18px; line-height: 1.5; }
.body--muted { color: var(--black-60); }
/* Intro under a full-width statement: two thirds of the content width. */
.lede { max-width: calc(var(--content-width) * 2 / 3); }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}
.cards--3 { grid-template-columns: repeat(3, 1fr); }
/* Problem → solution rows */
.pairs { display: flex; flex-direction: column; gap: var(--gutter); }
.pair { column-gap: var(--text-gap); }
.pair > .card:first-child { position: relative; }
/* plain arrow centered in the gap between problem and solution */
.pair > .card:first-child::after {
  content: "→";
  position: absolute;
  left: calc(100% + var(--text-gap) / 2);
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--black-60);
  font-size: 20px;
  line-height: 1;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px;
  background: var(--surface);
  border-radius: 16px;
}

/* Desk research stats */
.stat__value { font-family: var(--font-serif); font-size: 36px; line-height: 1.25; margin-bottom: 4px; }
.stat .number { margin-top: auto; padding-top: 12px; }

/* Desk research narrative: second line picks up after the stats */
.lede--continue { margin-top: 32px; }

/* Existing apps vs skyn */
.compare { gap: 20px; }
.compare .subheading { margin-top: -8px; }
.compare--ours { background: var(--bg); border: 1px solid #cccccc; }

/* Interview quotes */
.quote { margin: 0; justify-content: space-between; gap: 24px; }
/* open pull quotes: no box, a thin rule on the left */
.card.quote { background: none; border-radius: 0; padding: 4px 0 4px 24px; border-left: 1px solid #cccccc; }
.quote .number { line-height: 1.5; }
.quote__text { margin: 0; font-family: var(--font-serif); font-size: 24px; line-height: 1.4; text-wrap: pretty; flex: 1; }

/* Figures (exported from Figma, include their own grey panel) */
.figure { width: 100%; border-radius: 16px; }
/* animated figure: GIF sits where the phone is in the Figma frame (398,56 of 1160x832) */
.figure-anim { position: relative; }
.figure-anim .figure { display: block; }
.figure-anim__gif { position: absolute; left: 34.31%; top: 6.73%; width: 31.38%; height: auto; clip-path: inset(3px); } /* trim resampled edge so no seam shows */
@media (prefers-reduced-motion: reduce) { .figure-anim__gif { display: none; } }

/* User testing */
.changes { display: flex; flex-direction: column; gap: 80px; }
.change { display: flex; flex-direction: column; gap: 24px; }
/* notes on the left, before/after on the right at two thirds width */
.change__body { display: grid; grid-template-columns: 1fr 2fr; gap: var(--text-gap); align-items: center; }
.change__notes { display: flex; flex-direction: column; gap: 48px; }
.change__notes .body { text-wrap: balance; }
/* arrow between the Before and After screens (both are in one image; the gap sits at its center) */
.ba { position: relative; }
.ba::after {
  content: "→";
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  color: var(--black-60);
  font-size: 20px;
  line-height: 1;
}
.note { display: flex; flex-direction: column; gap: 8px; }
.note__label { color: var(--black-60); font-size: var(--label-size); line-height: normal; }

/* Final design features */
.features { display: flex; flex-direction: column; gap: 120px; }
.feature { display: flex; flex-direction: column; gap: 24px; }
.feature__intro { display: flex; flex-direction: column; gap: 8px; padding-bottom: 40px; }
.feature__intro .subheading { margin-bottom: 32px; }
.feature__body { display: flex; flex-direction: column; gap: 20px; }

/* Information architecture map: root, five nav tabs, screen trees below */
.ia {
  margin: 0;
  padding: 0;
  --box-h: 40px;
  --box-gap: 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  --line: #cccccc;
}
.ia__tabs {
  align-self: stretch;
  display: grid;
  /* Browse has the deepest tree, so it gets extra width from Profile */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gutter);
  position: relative;
}
.ia__col { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.ia__tab {
  position: relative;
  height: var(--box-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}
/* Each tab's screens stack down the column's center line; deeper screens are
   narrower boxes, so nesting reads by width rather than indentation. */
.ia__tree, .ia__tree ul { list-style: none; margin: 0; padding: 0; }
.ia__tree ul, .ia__tree li { display: contents; }
/* each top-level screen and its sub-screens sit together as one group */
.ia__tree > li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.ia__tree {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
/* center line from the tab down to the last screen */
.ia__tree::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -20px;
  bottom: calc(var(--box-h) / 2);
  border-left: 1px solid var(--line);
}
.ia__tree span {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--box-h);
  white-space: nowrap;
  padding: 0 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.3;
}
.ia__tree ul span { width: 92%; color: var(--black-60); }
.ia__tree ul ul span { width: 84%; }
.ia__tree ul ul ul span { width: 76%; }
/* shared page: outlined instead of filled */
.ia__tree .ia__link, .ia__legend .ia__link {
  border-style: dashed;
  color: var(--black-60);
}
.ia__legend {
  align-self: flex-start;
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--black-60);
}
.ia__legend .ia__link {
  display: inline-block;
  white-space: nowrap;
  padding: 6px 12px;
  border: 1px dashed var(--line);
}

/* ---------- Responsive ----------
   At 1024px and wider the page keeps the exact 1920px Figma layout and is
   scaled to the window width (see the fit script in index.html), so every
   size and gap stays proportional to the design. Narrower screens get a
   single-column layout. */
@media (max-width: 1023px) {
  .page, .site-header { padding-left: 40px; padding-right: 40px; }
  .page { max-width: calc(var(--page-width) + 80px); }
  .overview { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1023px) {
  .ia__tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { gap: 160px; }
}

@media (max-width: 760px) {
  .page, .site-header { padding-left: 20px; padding-right: 20px; }
  .page { padding-bottom: 120px; }
  .site-header { padding-top: 24px; }
  .site-nav { gap: 24px; font-size: 16px; }
  .overview { grid-template-columns: 1fr; row-gap: 32px; margin-top: 64px; font-size: 16px; }
  .overview__label { margin-bottom: 12px; }
  .hero { margin-top: 40px; border-radius: 16px; }
  .layout { margin-top: 80px; }
  .content { gap: 120px; }
  .section { gap: 80px; }
  .subsection--continue { margin-top: -32px; }
  .section--final > .divider { margin-bottom: -40px; }
  .row, .cards, .cards--3 { grid-template-columns: 1fr; }
  .row { gap: var(--gutter); }
  .pair { row-gap: 40px; }
  .ba::after { font-size: 11px; }
  .pair > .card:first-child::after { content: "↓"; left: 50%; top: calc(100% + 20px); }
  .row > .spacer { display: none; }
  .change__body { grid-template-columns: 1fr; gap: var(--gutter); }
  .card { padding: 24px; }
  .card.quote { padding: 4px 0 4px 20px; }
  .heading { font-size: 23px; }
  .display { font-size: 28px; }
  .body { font-size: 16px; }
  .features { gap: 100px; }
  .figure { border-radius: 12px; }
  .ia { align-items: stretch; }
  .ia__tabs { grid-template-columns: 1fr; row-gap: 32px; }
}

/* Next project link at the end of each case study */
.next {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 48px;
  border-top: 1px solid #e0e0e0;
}
.next a { display: inline-flex; gap: 12px; align-items: baseline; }
.next a:hover .heading { color: var(--black-60); }

/* "What didn't work" cards: icon on the left, text on the right */
.issues { display: flex; flex-direction: column; gap: var(--gutter); }
.issue { flex-direction: row; align-items: center; gap: 32px; padding: 32px 40px; }
.issue__icon { flex: none; color: var(--black); }
.issue__text { display: flex; flex-direction: column; gap: 8px; }
.lede strong, .body strong { font-weight: 500; }

/* Annotated screens: callout lines run from a point on the screen to a label on the right */
.annot { position: relative; margin: 0; }
/* Callouts: small dot set a little away from its target, light grey line, note on the nearer side */
.annot__pin {
  --line: #999999;
  position: absolute; top: var(--y); left: var(--x); right: 0;
  display: flex; align-items: center; gap: 16px;
  transform: translateY(-50%); pointer-events: none;
  background: linear-gradient(var(--line), var(--line)) no-repeat left center / calc(100% - 276px) 1px;
}
.annot__pin::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--line); flex: none; margin-left: -2.5px; }
.annot__pin > span { order: 2; margin-left: auto; width: 260px; font-size: 15px; line-height: 1.35; color: var(--black); text-wrap: balance; }
.annot--left .annot__shot { margin-left: auto; }
.annot--left .annot__pin { left: 0; right: calc(100% - var(--x)); flex-direction: row-reverse; background-position: right center; }
.annot--left .annot__pin::before { margin-left: 0; margin-right: -2.5px; }
.annot--left .annot__pin > span { margin-left: 0; margin-right: auto; text-align: right; }
@media (max-width: 760px) {
  .annot__pin > span { font-size: 11px; width: 90px; }
  .annot__pin { background-size: calc(100% - 106px) 1px; }
  .issue { padding: 24px; gap: 20px; }
}

/* Stacked screens */
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > .label + .figure { margin-top: -12px; }
.stack > .figure + .label { margin-top: 24px; }
.issue__text .body { text-wrap: balance; }

/* Two screens side by side on the white page, no grey panel */
.duo { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; column-gap: 48px; row-gap: 16px; align-items: start; position: relative; }
/* screens show uncropped; captions share one row so they line up even when screen heights differ */
.duo__item { margin: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.duo__shot { width: 100%; height: auto; border-radius: 12px; border: 1.5px solid #e0e0e0; }
.duo--arrow { container-type: inline-size; }
/* centered on the screens (each 16:10, half the width minus the gap), not the captions */
.duo--arrow::after { content: "→"; position: absolute; left: 50%; top: calc((100cqw - 48px) / 6.3); transform: translate(-50%, -50%); color: var(--black-60); font-size: 20px; line-height: 1; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; row-gap: 12px; } .duo__item + .duo__item { margin-top: 20px; } .duo--arrow::after { display: none; } }

/* Anything narrower than full width sits on the white page: no grey panel */
.annot__shot { display: block; width: 72%; height: auto; border-radius: 12px; border: 1.5px solid #e0e0e0; }

/* Screen recordings in the same grey frame as the still screens */
.figure-video { background: var(--surface); padding: 5.17%; }
.figure-video video { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid #e0e0e0; box-shadow: 0 8px 24px rgba(0,0,0,.06); background: #fff; }

/* Research details row (Sample / Timeline / Method) */
.facts { display: flex; flex-wrap: wrap; gap: 6px 32px; margin: -16px 0 0; font-size: var(--label-size); line-height: 1.5; color: var(--black-60); }
.facts > div { display: flex; gap: 8px; }
.facts dt { color: #999999; }
.facts dd { margin: 0; }
.facts__todo { color: #b07a00; }
@media (max-width: 760px) { .facts { flex-direction: column; gap: 8px; font-size: 14px; } }
.balance { text-wrap: balance; }

/* Reflection columns: subhead + paragraph */
.reflect { display: flex; flex-direction: column; gap: 12px; }
#reflection .row { margin-top: 24px; }
.row--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .row--3 { grid-template-columns: 1fr; } }

/* ---- Design Hero additions: print + motion gallery ---- */
/* Work is shown flat: square corners, no grey panels, no shadows (mockups are styled separately). */
.gallery { display: flex; flex-direction: column; gap: var(--gutter); }
.panel { display: flex; justify-content: center; align-items: flex-start; }
.panel img, .panel video { display: block; height: auto; max-width: 100%; }
.panel--covers { gap: var(--gutter); }
.panel--covers img { width: calc((100% - var(--gutter)) / 2); }
.panel--poster img { width: 58%; }
.spread { display: block; width: 100%; height: auto; }
.mockup { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #f1f0ee; }
.motion { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.clips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: 8px; }
.clip { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
@media (max-width: 760px) {
  .clips { gap: 12px; }
  .panel--poster img { width: 80%; }
}

/* Mockups and presented shots sit on their own backgrounds, so they get the same rounded corners as the cover;
   flat work (motion, clips) keeps square corners. */
.spread--framed { border-radius: 16px; }
.mockup { border-radius: 16px; }

/* Booklet flip book */
.flipbook { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #f1f0ee; }
.flipbook__v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.flipbook__v.is-shown { opacity: 1; }
.flipbook__hit { position: absolute; top: 0; bottom: 0; width: 50%; margin: 0; padding: 0 20px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; color: #222; -webkit-tap-highlight-color: transparent; }
.flipbook__hit--prev { left: 0; justify-content: flex-start; }
.flipbook__hit--next { right: 0; justify-content: flex-end; }
.flipbook__hit:disabled { cursor: default; }
.flipbook__arrow { display: grid; place-items: center; width: 44px; height: 44px; color: #222; filter: drop-shadow(0 0 3px rgba(255,255,255,.9)); opacity: 0; transform: scale(.9); transition: opacity .3s ease, transform .3s ease; }
.flipbook.is-ready .flipbook__arrow { opacity: .9; transform: none; }
.flipbook.is-ready .flipbook__hit:hover .flipbook__arrow, .flipbook__hit:focus-visible .flipbook__arrow { opacity: 1; transform: scale(1.06); }
.flipbook__hit:disabled .flipbook__arrow { opacity: 0 !important; }
.flipbook__hit:focus-visible { outline: none; }
.flipbook__hit:focus-visible .flipbook__arrow { outline: 2px solid #222; outline-offset: 2px; border-radius: 8px; }
.flipbook.is-ready .flipbook__hit--next:not(:disabled) .flipbook__arrow { animation: flipbook-nudge 1.6s ease-in-out 3; }
.flipbook.is-touched .flipbook__hit--next .flipbook__arrow { animation: none; }
@keyframes flipbook-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.flipbook.is-ready .flipbook.is-touched .flipbook__count { position: absolute; right: 18px; bottom: 18px; margin: 0; font-size: 12px; color: #777; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.flipbook.is-touched .flipbook__count { opacity: 1; }
@media (max-width: 760px) {
  .flipbook, .mockup, .spread--framed { border-radius: 12px; }
  .flipbook__arrow { width: 36px; height: 36px; }
  .flipbook__hit { padding: 0 10px; }
  }

.site-header { justify-content: space-between; align-items: center; }
.site-logo { display: block; line-height: 0; }
.site-logo img { height: 30px; width: auto; }
.site-logo:hover { opacity: 0.6; }
@media (max-width: 640px) { .site-logo img { height: 24px; } }
