/* ==========================================================================
   Dippi case study  (/dippi/)
   ========================================================================== */
.page-dippi { background: #fff; color: #000; }
.page-dippi main { position: relative; }

/* --------------------------------------------------------------------------
   Hero (dark, gradient blobs, device mockups)
   -------------------------------------------------------------------------- */
.dp-hero { position: relative; height: 691px; background: #121213; color: #fff; overflow: hidden; }
.dp-hero-stage { position: relative; height: 100%; max-width: 1440px; margin: 0 auto; }
.dp-hero .blob { position: absolute; max-width: none; pointer-events: none; user-select: none; }
.blob-1 { left: -65px; top: 272px; width: 599px; height: 468px; transform: rotate(-167deg); }
.blob-2 { right: -286px; top: 272px; width: 599px; height: 468px; transform: rotate(113deg); }
.blob-3 { right: -413px; top: -133px; width: 908px; height: 710px; }
.blob-4 { right: -149px; top: -199px; width: 908px; height: 710px; }

.imac {
  position: absolute; left: -159px; top: 422px; width: 581px; height: 351px;
  border-radius: 12px; overflow: hidden; transform: rotate(20deg);
}
.imac-screen { position: absolute; left: 11px; top: 29px; width: 547px; height: 302px; max-width: none; object-fit: fill; }
.imac-frame { position: absolute; left: 0; top: 0; width: 580px; height: 486px; max-width: none; object-fit: cover; }

.dp-hero-copy { position: absolute; left: 120px; top: 109px; width: min(697px, calc(100% - 640px)); z-index: 2; }
.dp-hero-copy h1 { font-size: 32px; line-height: 1.2; font-weight: 700; }
.dp-tags { display: flex; gap: 15px; margin-top: 16px; font-size: 20px; line-height: 24px; font-weight: 700; text-transform: uppercase; }
.dp-intro { margin-top: 16px; font-size: 16px; line-height: 1.2; }
.dp-site-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 140px; height: 40px; margin-top: 32px; border: 1px solid rgba(255,255,255,.85); border-radius: 6px;
  font-size: 16px; font-weight: 500; color: #fff;
  transition: background-color .25s, color .25s, transform .25s var(--ease-out), box-shadow .25s;
}
.dp-site-btn img { width: 20px; height: 20px; transition: filter .25s; }
.dp-site-btn:hover { background: #fff; color: #121213; box-shadow: 0 8px 24px rgba(108, 94, 207, .45); }
.dp-site-btn:hover img { filter: invert(1); }
.dp-meta { margin-top: 32px; font-size: 14px; line-height: 1.2; }
.dp-meta .k { color: rgba(255,255,255,.6); font-weight: 500; }

.phones { position: absolute; inset: 0; pointer-events: none; }
.device { position: absolute; margin: 0; width: 241px; height: 488px; }
.device-1 { right: 237px; top: 46px; }
.device-2 { right: 41px; top: 150px; }
.device .screen { position: absolute; left: 13px; top: 9px; width: 215px; height: 469px; object-fit: cover; border-radius: 26px; }
.device-2 .screen { top: 11px; width: 217px; height: 465px; }
.device .frame { position: absolute; inset: 0; width: 241px; height: 487px; }

/* --------------------------------------------------------------------------
   Facts card overlapping hero
   -------------------------------------------------------------------------- */
.dp-facts {
  position: relative; z-index: 3;
  display: flex; justify-content: center; gap: 70px;
  width: min(858px, calc(100% - 40px)); margin: -124px auto 0; padding: 23px 58px;
  background: #fff; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,.07);
}
.fact {
  flex: 1 1 200px; max-width: 200px; height: 115px; padding-top: 24px;
  display: flex; flex-direction: column; align-items: center;
  border: 1px solid #e5e5e5; border-radius: 8px; background: #fff;
  font-size: 14px; line-height: 1.2; font-weight: 500; text-align: center;
  transition: transform .25s var(--ease-out), box-shadow .25s, border-color .25s;
}
.fact:hover { border-color: #d4d0f2; box-shadow: 0 8px 20px rgba(108, 94, 207, .12); }
.fact img { width: 24px; height: 25px; }
.fact .k { color: rgba(0,0,0,.6); }
.fact .v { margin-top: 8px; color: #000; }

/* --------------------------------------------------------------------------
   Generic sections
   -------------------------------------------------------------------------- */
.dp-section { padding: 70px 0; margin-top: 24px; }
.dp-title {
  font-size: 24px; line-height: 36px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
  text-align: center; color: #000;
}

/* Tech stack */
.dp-stack .tools { max-width: 1200px; gap: 24px 10px; margin-top: 56px; padding: 0 20px; }
.page-dippi .tool { padding: 12px 24px; border-radius: 12px; border-color: #e5e5e5; }
.page-dippi .tool img { width: 50px; height: 50px; border-radius: 12px; }
.page-dippi .tool img.round { border-radius: 36px; object-fit: cover; }
.page-dippi .tool img.sq { border-radius: 0; object-fit: cover; }
.page-dippi .tool h3 { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 28px; color: #171717; }
.page-dippi .tool p { color: #525252; }

/* Challenge */
.dp-challenge { margin-top: 0; }
.dp-prose { max-width: 1140px; margin: 16px auto 0; padding: 0 20px; font-size: 16px; line-height: 1.2; }
.dp-prose p + p { margin-top: 19.2px; }

/* --------------------------------------------------------------------------
   Solution flow
   -------------------------------------------------------------------------- */
.dp-flow { padding-top: 56px; }
.flow-grid {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 584px));
  justify-content: center; gap: 100px; margin: 56px auto 0; padding: 0 20px; max-width: 1308px;
}
.flow-grid::before { /* vertical divider */
  content: ""; position: absolute; left: 50%; top: -17px; bottom: -85px; width: 1px; background: #e5e5e5;
}
.flow-grid::after { /* horizontal divider */
  content: ""; position: absolute; left: 4px; right: 4px; top: calc(50% - 9px); height: 1px; background: #e5e5e5;
}
.flow-item { position: relative; z-index: 1; }
.flow-media {
  margin: 0; padding: 20px; height: 370px; border-radius: 12px; background: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,.07); overflow: hidden;
}
.flow-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; transition: transform .6s var(--ease-out); }
.flow-item:hover .flow-media img { }
.flow-item h3 { margin-top: 23px; font-size: 24px; line-height: 1.2; font-weight: 700; color: #1c1b1f; }
.flow-item h3 .sp { display: inline-block; width: .3em; }
.flow-rows { margin: 12px 0 0; }
.flow-rows > div { display: flex; align-items: center; min-height: 100px; padding: 15px 0; }
.flow-rows dt { flex: none; width: 105px; padding-left: 16px; font-weight: 700; font-size: 16px; line-height: 1.2; }
.flow-rows dd {
  margin: 0; flex: 1; min-height: 70px; display: flex; align-items: center;
  padding: 0 13px 0 26px; border-left: 1px solid #e5e5e5; font-size: 16px; line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Final products
   -------------------------------------------------------------------------- */
.products {
  display: grid; grid-template-columns: repeat(3, minmax(0, 329px)); justify-content: center; column-gap: 116px;
  margin: 32px auto 0; padding: 0 20px;
}
.product { position: relative; padding: 26px 0; }
.product + .product::before {
  content: ""; position: absolute; left: -58px; top: 0; bottom: 0; width: 1px; background: #e5e5e5;
}
.product-media {
  margin: 0; height: 262px; padding: 12px 16px; border-radius: 8px; background: #fff;
  box-shadow: 0 0 11.25px rgba(0,0,0,.07);
}
.product-media > img { width: 100%; height: 100%; border-radius: 6px; object-fit: fill; }
.product:hover .product-media > img { }
.product-qr { padding-top: 23px; }
.qr-card {
  position: relative; height: 100%; border-radius: 6px; box-shadow: 0 0 20px rgba(0,0,0,.07); overflow: hidden;
}
.qr-card img { width: 100%; height: 100%; object-fit: fill; }
.qr-card span {
  position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 20px; line-height: 24px; font-weight: 500; color: #000;
}
.qr-top { top: 16px; }
.qr-bottom { top: 198px; }
.product-tag {
  display: flex; align-items: center; justify-content: center; height: 44px; margin-top: 16px;
  background: #fff; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,.07);
  font-size: 16px; font-weight: 700;
}
.product h3 { margin-top: 16px; font-size: 20px; line-height: 24px; font-weight: 700; color: #1c1b1f; }
.product-desc { margin-top: 8px; font-size: 14px; line-height: 1.2; }
.product-link { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 14px; line-height: 1.2; }
.product-link a { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; transition: color .2s; }
.product-link a img { width: 20px; height: 20px; transition: transform .25s var(--ease-out); }
.product-link a:hover { color: #6c5ecf; }
.product-link a:hover img { }
.product-note { margin-top: 8px; font-size: 12px; line-height: 1.2; color: #a3a3a3; }

/* --------------------------------------------------------------------------
   Branding + design system
   -------------------------------------------------------------------------- */
.brand-board {
  position: relative; width: min(1062px, calc(100% - 40px)); aspect-ratio: 1062 / 588; margin: 56px auto 0;
  background: #e9e9e9; overflow: hidden;
}
.brand-board img { position: absolute; object-fit: contain; object-position: top left; }

.ds { max-width: 1240px; margin: 56px auto 0; padding: 0 20px; color: rgba(0,0,0,.85); }
.ds-h { display: flex; align-items: center; gap: 10px; font-size: 24px; line-height: 36px; font-weight: 700; }
.ds-h span { font-family: "Inter", var(--font-sans); font-weight: 400; color: #6c5ecf; }
.ds-p { margin-top: 8px; font-size: 14px; line-height: 28px; }
.ds-sub { margin-top: 24px; font-size: 18px; line-height: 36px; font-weight: 500; }
.ds-note { padding-left: 28px; max-width: 1138px; font-size: 14px; line-height: 22px; }
.ds-p-tight { margin-top: 24px; line-height: 22px; }
.ds-hr { margin: 56px 0; border: 0; border-top: 1px solid #e5e5e5; }

/* palettes */
.palettes { position: relative; max-width: 1110px; margin: 35px 0 0 45px; }
.palette + .palette { margin-top: 35px; }
.pal-name { padding-left: 4px; font-size: 20px; line-height: 30px; font-weight: 500; color: #111928; }
.pal-code { padding-left: 5px; font-size: 18px; line-height: 27px; color: #6b7280; }
.swatches {
  display: grid; grid-template-columns: repeat(8, 109fr) 129fr 109fr; height: 75px; margin-top: 13px;
  border-radius: 15px; overflow: hidden;
}
.swatches span {
  display: grid; place-items: center; font-family: "Inter", var(--font-sans); font-size: 16px; line-height: 24px; font-weight: 600;
  transition: transform .2s var(--ease-out);
}
.pal-line { position: absolute; top: 44px; bottom: -23px; width: 1px; background: #000; pointer-events: none; }
.pal-line-1 { left: 39.28%; }
.pal-line-2 { left: 49.1%; }
.pal-line::before, .pal-line::after {
  content: ""; position: absolute; left: -2.2px; width: 5.4px; height: 5.4px; border-radius: 50%; background: #000;
}
.pal-line::before { top: -2px; }
.pal-line::after { bottom: -2px; }

.ds-reading { width: 600px; max-width: 100%; height: auto; margin-top: 8px; }

/* font scale card */
.scale-card { margin-top: 16px; width: 907px; max-width: 100%; border: 1px solid #e5e5e5; border-radius: 12px; overflow-x: auto; }
.scale-inner { position: relative; width: 843px; margin: 24px 32px; }
.scale-row { position: relative; display: flex; align-items: center; height: 48px; }
.scale-row-lh { margin-top: 26px; }
.scale-row-lh::before { content: ""; position: absolute; left: -1px; top: -14px; width: 783px; height: 1px; background: #000; }
.scale-k { flex: none; display: grid; place-items: center; width: 73px; height: 48px; border: 1px solid #000; background: #fff; font-size: 14px; line-height: 28px; color: #000; }
.scale-k-sm { width: 77px; font-size: 12px; }
.scale-v { position: absolute; left: 125px; right: 0; display: grid; grid-template-columns: repeat(11, 64.3px) auto; }
.scale-v span { font-family: "Figtree", var(--font-sans); font-size: 14px; line-height: 19.6px; color: #000; }

/* type system table */
.type-card {
  margin-top: 24px; padding: 32px 32px 32px 32.5px; background: #fff; border-radius: 12px;
  box-shadow: 0 0 14.25px rgba(0,0,0,.07); overflow-x: auto;
}
.type-system { width: 100%; min-width: 1000px; border-collapse: collapse; color: #191919; }
.type-system caption {
  text-align: left; font-size: 23.94px; line-height: 29.92px; color: #1c2b36; padding-bottom: 8px;
  border-bottom: .75px solid #1c2b36;
}
.type-system th, .type-system td { text-align: left; font-weight: 400; vertical-align: middle; padding: 10px 0; }
.type-system th:nth-child(1), .type-system td:nth-child(1) { width: 24.1%; }
.type-system th:nth-child(n+2):nth-child(-n+5), .type-system td:nth-child(n+2):nth-child(-n+5) { width: 12%; }
.ts-head th { padding: 30px 0 11px; font-size: 10.47px; line-height: 14.96px; border-bottom: .75px solid #1c2b36; }
.ts-head th:first-child { text-transform: uppercase; color: #1c2b36; }
.ts-group + .ts-group .ts-head th { padding-top: 59px; }
.type-system td { font-size: 9.73px; line-height: 13.47px; border-bottom: .75px solid #c1ccd6; }
.type-system td:first-child { color: #1c2b36; }
.type-system td.ts-h1 { font-size: 29.92px; line-height: 38.9px; }
.type-system td.ts-h2 { font-size: 23.94px; line-height: 29.92px; }
.type-system td.ts-h3 { font-size: 17.95px; line-height: 23.94px; }
.type-system td.ts-h4 { font-size: 14.96px; line-height: 20.95px; }
.type-system td.ts-h5, .type-system td.ts-b1 { font-size: 11.97px; line-height: 17.95px; }
.type-system td.ts-h6, .type-system td.ts-b2 { font-size: 10.47px; line-height: 14.96px; }
.type-system td.ts-h7, .type-system td.ts-b3 { font-size: 8.98px; line-height: 11.97px; }
.type-system td.ts-mono { font-size: 11.97px; line-height: 23.94px; }

/* --------------------------------------------------------------------------
   Figma sneak peak board
   -------------------------------------------------------------------------- */
.dp-peek { padding-bottom: 0; }
.peek-board { margin-top: 56px; background: #e9e9e9; }
.peek-stage { position: relative; max-width: 1442px; margin: 0 auto; aspect-ratio: 1442 / 3048; }
.peek-stage img { position: absolute; height: auto; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 1441px) {
  .blob-1 { left: -65px; }
}

@media (max-width: 1199px) {
  .dp-hero { height: auto; }
  .dp-hero-stage { display: flex; flex-direction: column; padding: 100px 40px 170px; }
  .dp-hero-copy { position: relative; left: auto; top: auto; width: 100%; max-width: 697px; }
  .phones { position: relative; inset: auto; display: flex; justify-content: center; gap: 24px; margin-top: 48px; height: 520px; }
  .device { position: relative; right: auto; top: auto; }
  .device-2 { top: 60px; }
  .imac { left: -220px; top: auto; bottom: -120px; opacity: .7; }
  .blob-1 { top: auto; bottom: -120px; }
  .blob-2 { top: auto; bottom: 0; }

  .flow-grid { column-gap: 48px; }
  .flow-grid::before { top: -17px; bottom: -40px; }
  .flow-media { height: auto; aspect-ratio: 584 / 370; }
  .products { column-gap: 48px; }
  .product-media { height: auto; min-height: 0; aspect-ratio: 329 / 262; }
  .qr-card span { font-size: clamp(14px, 1.9vw, 20px); }
  .qr-top { top: 8%; }
  .qr-bottom { top: auto; bottom: 8%; }
  .product + .product::before { left: -24px; }
  .palettes { margin-left: 0; }
}

@media (max-width: 809px) {
  .dp-hero-stage { padding: 76px 20px 150px; }
  .dp-hero-copy h1 { font-size: clamp(24px, 7vw, 32px); }
  .dp-tags { font-size: 18px; }
  .dp-site-btn { height: 44px; }
  .phones { gap: 12px; height: auto; margin-top: 40px; }
  .device { width: min(44vw, 241px); height: auto; aspect-ratio: 241 / 488; }
  .device .frame { width: 100%; height: 100%; }
  .device .screen, .device-2 .screen { left: 5.4%; top: 1.9%; width: 89.2%; height: 96.1%; border-radius: 9% / 4.5%; }
  .device-2 { top: 40px; }
  .imac { display: none; }

  .dp-facts { gap: 8px; padding: 12px; margin-top: -110px; }
  .fact { flex: 1 1 0; min-width: 0; max-width: none; height: auto; padding: 16px 6px 14px; font-size: 13px; }

  .dp-section { padding: 48px 0; margin-top: 8px; }
  .dp-title { font-size: 20px; line-height: 30px; letter-spacing: 3px; padding: 0 20px; }
  .dp-stack .tools { margin-top: 32px; gap: 10px; }
  .page-dippi .tool { padding: 8px 14px 8px 10px; }
  .page-dippi .tool img { width: 38px; height: 38px; border-radius: 9px; }
  .page-dippi .tool h3 { font-size: 16px; line-height: 22px; }

  .flow-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 32px; }
  .flow-grid::before, .flow-grid::after { display: none; }
  .flow-item + .flow-item { padding-top: 48px; border-top: 1px solid #e5e5e5; }
  .flow-media { padding: 12px; }
  .flow-item h3 { font-size: 20px; }
  .flow-rows > div { min-height: 0; padding: 10px 0; }
  .flow-rows dt { width: 84px; padding-left: 4px; font-size: 15px; }
  .flow-rows dd { min-height: 0; padding: 8px 0 8px 16px; font-size: 15px; }

  .products { grid-template-columns: minmax(0, 360px); row-gap: 8px; }
  .product + .product::before { left: 0; right: 0; top: -4px; bottom: auto; width: auto; height: 1px; }
  .qr-card span { font-size: 18px; }

  .brand-board { margin-top: 32px; }
  .ds { margin-top: 40px; }
  .ds-h { font-size: 22px; }
  .ds-note { padding-left: 16px; }
  .palettes { margin-top: 24px; }
  .palette + .palette { margin-top: 24px; }
  .pal-name { font-size: 17px; line-height: 26px; padding-left: 0; }
  .pal-code { font-size: 15px; line-height: 22px; padding-left: 0; }
  .pal-name, .pal-code { position: relative; z-index: 1; width: fit-content; padding-right: 6px; background: #fff; }
  .swatches { height: 52px; border-radius: 10px; margin-top: 8px; }
  .swatches span { font-size: clamp(9px, 2.6vw, 13px); }
  .pal-line { top: 36px; }
  .ds-hr { margin: 40px 0; }

  .peek-board { margin-top: 32px; padding: 20px 16px; }
  .peek-stage { aspect-ratio: auto; display: flex; flex-direction: column; gap: 20px; }
  .peek-stage img { position: static; width: 100% !important; }
}
.ts-group:last-child tr:last-child td { border-bottom: 0; }
