/* Weather – But Fun, on the case study system: layout grammar only
   (DESIGN.md register exception). No climax band, no evidence ledger;
   numbers stay at honest scale. The page's own world is the product's
   weather: a clear-sky hero and a clear-night close, both painted from the
   app's own mood screens (sampled: #3cd7dc / #27bfd2 day, #1b4657 / #193e54
   night). These panels are artifacts, so their colours stay fixed when the
   room light changes, and their text is pinned to them.

   weather-but-fun.css stays for weather-but-fun/index.html. */

/* ---------- hero: the final interface in one clear sky ---------- */

.w-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }

.w-sky {
  position: relative;
  overflow: hidden;
  min-height: 0;
  align-self: center;
  aspect-ratio: 1.12;
  max-height: calc(var(--cs-visual-h) * 1.05);
  width: 100%;
  border-radius: 36px;
  background: #27bfd2;
  isolation: isolate;
}
/* the air: an oversized sky that drifts slowly; grain sits on the sky, under the app */
.w-sky__air {
  position: absolute;
  inset: -30% -10%;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 30% 18%, rgba(255, 252, 230, 0.55), rgba(255, 252, 230, 0) 70%),
    linear-gradient(170deg, #3cd7dc 0%, #2fcad7 45%, #27bfd2 100%);
}
.w-sky__air::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* the page's one motion: the sky shifts slowly, as weather does */
@media (prefers-reduced-motion: no-preference) {
  .w-sky__air { animation: w-drift 22s ease-in-out infinite alternate; }
}
@keyframes w-drift {
  from { transform: translate3d(-4%, -6%, 0); }
  to   { transform: translate3d(4%, 6%, 0); }
}
/* landscape phone, framed to its measured alpha box (x 11-88%, y 34-69%) */
.w-sky .w-sky__app {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118%;
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
}

/* ---------- so what? translation cards ---------- */

.w-translate {
  list-style: none;
  margin: 40px 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.w-translate li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  border-radius: var(--cs-radius);
  overflow: hidden;
  background: var(--cs-surface);
}
.cs-chapter .w-translate p { margin: 0; padding: 22px 26px; }
.cs-chapter .w-translate__data {
  font-size: var(--cs-type-card);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
.cs-chapter .w-translate .w-translate__means {
  position: relative;
  padding-left: 58px;
  font-size: var(--cs-type-card);
  font-weight: 700;
  color: var(--ink);
  background: var(--cs-surface-deep);
}
.w-translate__means::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
}

.w-questions, .w-list { margin: 0 0 24px; padding-left: 22px; max-width: var(--cs-measure); }
.w-questions li, .w-list li { margin-bottom: 6px; }

/* ---------- competitors ---------- */
.w-comp { --cs-screen-h: 380px; }
.w-comp .cs-frame img { width: auto; max-width: 100%; height: 380px; margin: 0 auto; object-fit: contain; }
.w-comp figcaption strong { color: var(--ink); }
.w-tradeoff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cs-grid-gap); margin: 0 0 8px; }
.cs-chapter .w-tradeoff p { margin: 0; padding: 20px 22px; border-radius: 18px; background: var(--cs-surface); font-size: var(--cs-type-small); line-height: 1.6; }

/* ---------- four bets ---------- */
.w-bets { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.w-bets img { display: block; width: 40px; height: 40px; margin-bottom: 14px; }
.w-bets h3 { margin: 0 0 8px; font-size: var(--cs-type-card); letter-spacing: -0.01em; color: var(--ink); }
.cs-chapter .w-bets p { margin: 0; font-size: var(--cs-type-small); line-height: 1.65; }

/* ---------- exploration ---------- */
.w-explore-hero { max-width: 560px; margin: 40px 0 0; }

.w-mood { margin: 28px 0 32px; }
.w-mood__set { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; border-radius: var(--cs-radius); background: var(--cs-surface); }
.w-mood__item { margin: 0; }
.w-mood__item img { display: block; width: 100%; aspect-ratio: 388 / 348; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.w-mood__item figcaption { margin-top: 8px; font-size: var(--cs-type-caption); font-weight: 700; text-align: center; color: var(--ink); }
.w-mood > figcaption { margin-top: 12px; font-size: var(--cs-type-caption); color: var(--ink-muted); }

.w-hier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.7fr); gap: var(--cs-grid-gap); align-items: center; margin: 32px 0; }
.w-hier__shot img { border-radius: var(--cs-radius-inner); }
.w-hier__stack { margin: 0; }
.w-hier__stack ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.w-hier__stack li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--cs-surface);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
/* each level a step quieter: the reading order made visible */
.w-hier__stack li:nth-child(1) { padding: 22px 16px; font-size: 18px; }
.w-hier__stack li:nth-child(2) { padding: 18px 16px; }
.w-hier__stack li:nth-child(4) { color: var(--ink-muted); }
.w-hier__stack li span { flex: none; width: 0.6em; font-family: "Tanker", "Plus Jakarta Sans", sans-serif; font-size: var(--cs-type-seq); font-weight: 400; line-height: 1; color: var(--ink-faint); }
.w-hier__stack figcaption { margin-top: 10px; font-size: var(--cs-type-caption); color: var(--ink-muted); }

.w-widgets__set { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: auto; gap: 12px; align-items: center; }
.w-widgets__set img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.w-widgets__1, .w-widgets__2, .w-widgets__3 { grid-column: span 2; }
.w-widgets__4 { grid-column: span 1; }
.w-widgets__5 { grid-column: span 3; }
.w-widgets__6 { grid-column: span 2; }

/* ---------- the shipped tour: labels on the actual screen ---------- */
.w-tour { margin: 40px 0 0; }
.w-tour__stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
}
/* portrait phone framed to its measured alpha box (x 30-69%, y 12-92%) */
.w-tour__phone {
  grid-column: 2;
  position: relative;
  height: 640px;
  aspect-ratio: 940.8 / 1660;
  overflow: hidden;
}
.w-tour__phone img { position: absolute; left: -69.05%; top: -12.65%; width: 238.1%; height: 120.48%; max-width: none; }
.w-tour__notes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.w-tour__note {
  position: absolute;
  top: var(--y);
  width: calc(50% - 200px);
  transform: translateY(-50%);
}
.w-tour__note strong { display: block; margin-bottom: 4px; font-size: 16px; color: var(--ink); }
.w-tour__note span { display: block; font-size: 14.5px; line-height: 1.5; color: var(--ink-muted); }
/* a rounded leader from the note to the screen, ending in a dot */
.w-tour__note::before { content: ""; position: absolute; top: 9px; width: 40px; height: 2px; border-radius: 2px; background: var(--ink); }
.w-tour__note::after { content: ""; position: absolute; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.w-tour__note--l { left: 0; padding-right: 54px; text-align: right; }
.w-tour__note--l::before { right: 4px; }
.w-tour__note--l::after { right: 0; }
.w-tour__note--r { right: 0; padding-left: 54px; }
.w-tour__note--r::before { left: 4px; }
.w-tour__note--r::after { left: 0; }
.cs-chapter .w-tour__extra { max-width: 34rem; margin: 28px auto 0; font-size: var(--cs-type-small); text-align: center; color: var(--ink-muted); }
.w-tour__extra strong { display: block; color: var(--ink); }

/* ---------- testers, at honest scale ---------- */
.w-facts { margin: 8px 0 28px; display: flex; flex-wrap: wrap; gap: 10px 32px; }
.w-facts div { display: grid; gap: 2px; }
.w-facts dt { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.w-facts dd { margin: 0; font-size: var(--cs-type-label); font-weight: 700; color: var(--ink); }

.w-check { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 10px; max-width: 40rem; }
.w-check li { position: relative; padding: 14px 18px 14px 50px; border-radius: 14px; background: var(--cs-surface); font-size: var(--cs-type-small); line-height: 1.55; color: var(--ink); }
/* a drawn tick in a rounded box: a fixed state */
.w-check li::before { content: ""; position: absolute; left: 18px; top: 16px; width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--ink); }
.w-check li::after { content: ""; position: absolute; left: 24.5px; top: 19px; width: 5px; height: 9px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.w-feedback__wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.w-feedback__summary { display: block; width: 100%; height: auto; border-radius: var(--cs-radius-inner); cursor: zoom-in; }
.w-feedback__notes { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 8px; }
.w-feedback__notes li { break-inside: avoid; margin-bottom: 8px; }
.w-feedback__notes img { display: block; width: 100%; height: auto; border-radius: 10px; cursor: zoom-in; }

.w-lessons { margin: 24px 0; padding-left: 22px; max-width: 36rem; }
.w-lessons li { margin-bottom: 14px; }

/* ---------- close: the clear-night sky ---------- */
.w-close { position: relative; z-index: 1; width: min(1240px, calc(100% - 32px)); margin: clamp(120px, 13vw, 176px) auto 0; }
.w-close__sky {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 120px) clamp(28px, 8vw, 120px);
  border-radius: 36px;
  background:
    radial-gradient(50% 60% at 78% 20%, rgba(150, 220, 230, 0.22), rgba(150, 220, 230, 0) 70%),
    linear-gradient(175deg, #1b4657 0%, #193e54 100%);
  background-color: #1b4657;
  color: #f2e7d8;
}
.w-close__sky::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.w-close__lead { position: relative; z-index: 1; max-width: 34rem; margin: 0 0 24px; font-size: 19px; line-height: 1.6; color: #cfe3e6; }
.w-close__q {
  position: relative;
  z-index: 1;
  max-width: 16em;
  margin: 0;
  font-family: "Tanker", "Plus Jakarta Sans", system-ui, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.012em;
  font-size: var(--cs-type-h2);
  line-height: 0.92;
  color: #fff;
}

/* view transition: title only; the home card's art carries the tour */
@media (prefers-reduced-motion: no-preference) {
  .weather-but-fun-page .cs-facts__project { view-transition-name: vt-title-weather; }
  .weather-but-fun-page .cs-hero__pitch { view-transition-name: vt-sub-weather; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .w-tour__note { width: calc(50% - 180px); }
}
@media (max-width: 1023px) {
  .w-hero { grid-template-columns: minmax(0, 1fr); }
  .w-sky { max-height: none; }
  .w-hier { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-hier__stack { grid-column: 1 / -1; order: 3; }
  .w-tour__stage { grid-template-columns: 1fr; justify-items: center; }
  .w-tour__phone { grid-column: 1; height: 520px; }
  .w-tour__notes { position: static; display: grid; gap: 16px; margin-top: 24px; width: 100%; max-width: 34rem; }
  .w-tour__note { position: relative; top: auto; width: auto; transform: none; padding: 0 0 0 54px; text-align: left; }
  .w-tour__note--l::before, .w-tour__note--r::before { left: 4px; right: auto; }
  .w-tour__note--l::after, .w-tour__note--r::after { left: 0; right: auto; }
}
@media (max-width: 760px) {
  .w-sky { border-radius: var(--cs-radius); }
  .w-translate li { grid-template-columns: 1fr; }
  .cs-chapter .w-translate p { padding: 16px 18px; font-size: 18px; }
  .cs-chapter .w-translate .w-translate__means { padding-left: 46px; }
  .w-translate__means::before { left: 18px; }
  .w-comp { --cs-cols: 2; }
  .w-comp .cs-frame img { height: 280px; }
  .w-tradeoff { grid-template-columns: 1fr; }
  .w-bets { grid-template-columns: 1fr; gap: 28px; }
  .w-mood__set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-mood__set li:last-child { grid-column: 1 / -1; }
  .w-widgets__set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-widgets__1, .w-widgets__2, .w-widgets__3, .w-widgets__4, .w-widgets__6 { grid-column: span 1; }
  .w-widgets__5 { grid-column: 1 / -1; }
  .w-tour__phone { height: 440px; }
  .w-feedback__wrap { grid-template-columns: 1fr; }
  .w-feedback__notes { columns: 1; }
  .w-close__q { font-size: clamp(32px, 8.9vw, 44px); }
}
