/* skyn case study — built from the Figma "website" frame (1920px) */

: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-media {
  position: relative;
  margin-top: 72px;
  border-radius: 30px;
  overflow: hidden;
}
.hero {
  display: block;
  width: 100%;
  height: auto;
}
.hero-media__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.hero-media.is-playing .hero-media__video { opacity: 1; }

/* 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; } }

/* Daily routines: two phones playing the create and edit demos */
.phones { display: flex; justify-content: center; gap: 96px; padding: 64px 24px 48px; background: #f4f4f4; border-radius: 16px; }
.phone { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.phone__frame { position: relative; width: 300px; padding: 10px; border-radius: 52px; background: #1a1a1c; box-shadow: 0 0 0 2px #c9c6cc, 0 24px 48px rgba(40, 30, 60, 0.12); }
.phone__frame::after { content: ""; position: absolute; top: 20px; left: 50%; width: 88px; height: 26px; margin-left: -44px; border-radius: 13px; background: #000; } /* dynamic island */
.phone__screen { display: block; width: 100%; height: auto; aspect-ratio: 590 / 1278; object-fit: cover; border-radius: 42px; background: #1a1a1c; }  /* dark behind the video so no light edge shows at the rounded corners */
.phone { transition: opacity .4s ease; }
.phone.is-waiting { opacity: .45; } /* the two demos take turns; the one not playing waits faded on its first frame */

/* 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-media { 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; }
  .phones { gap: 24px; padding: 32px 12px 24px; border-radius: 12px; }
  .phone__frame { width: 100%; max-width: 220px; padding: 7px; border-radius: 38px; }
  .phone__frame::after { display: none; }
  .phone__screen { border-radius: 31px; }
  .phone { flex: 1; min-width: 0; }
  .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); }

/* Design system sheet */
.sheet-panel { padding: 48px; background: var(--surface); border-radius: 16px; }
.sheet-panel__img { display: block; width: 100%; height: auto; border-radius: 12px; }
@media (max-width: 720px) { .sheet-panel { padding: 16px; } }

.phone__frame.is-clickable { cursor: pointer; }
.phone__frame.is-clickable:focus-visible { outline: 2px solid #7d89d4; outline-offset: 6px; }

.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; } }
