/* Woodward UI tokens + type scale. Not base.css — Tempo keeps its own chrome. */
@import url("../vendor/woodward-ui/css/tokens.css");
@import url("../vendor/woodward-ui/css/typography.css");

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2");
}

/* Roboto stays for the in-phone widget demo (Android UI chrome). */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/roboto-medium.woff2") format("woff2");
}

:root {
  --bg: #000;
  --surface: #0c0c0e;
  --raised: #141315;
  --elevated: #1e1d20;
  --text: #fff;
  --muted: #9b9b9b;
  --fine: #797979;
  --line: rgba(255, 255, 255, 0.12);
  --pink: #ff5c8a;
  --pink-deep: #ec407a;
  --green: #46d08f;
  --gold: #f6b863;
  --serif: "Instrument Serif", "Times New Roman", serif;
  /* Matches woodward-ui/css/base.css Inter stack */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  /* Portfolio LoadReveal / SoftBlurText enter contract */
  --enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --enter-duration: 0.9s;
  /* 8-column layout grid (portfolio/roam pattern; Tempo uses 8 cols) */
  --grid-columns: 8;
  --grid-gutter: 24px;
  --grid-margin: clamp(20px, 4vw, 40px);
  --grid-max-width: 1120px;
  /* Aliases — prefer --grid-* for new rules */
  --pad: var(--grid-margin);
  --max: var(--grid-max-width);
  --nav: 120px;
}

/* ═══════════════════════════════════════════════════════════
   8-column layout grid
   Wrap a section in .grid-container and place children with
   `grid-column: <start> / span <n>`. Toggle .grid-debug to
   visualize the columns.
   ═══════════════════════════════════════════════════════════ */
.grid-container {
  width: 100%;
  max-width: var(--grid-max-width);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
  box-sizing: border-box;
}

.gc-full {
  grid-column: 1 / -1;
}

.gc-body {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .gc-body {
    grid-column: 1 / span 6;
  }
}

/* Debug overlay — render a .grid-debug with 8 .grid-debug-col children */
.grid-debug {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 0 var(--grid-margin);
  box-sizing: border-box;
}

.grid-debug-col {
  background: rgba(255, 92, 138, 0.06);
  border-left: 1px solid rgba(255, 92, 138, 0.18);
  border-right: 1px solid rgba(255, 92, 138, 0.18);
  height: 100%;
}

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

html {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  /* woodward-ui .body */
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Custom reticle cursor (Figma 12:299) — vars set only for fine pointers */
  cursor: var(--cursor, auto);
}

/* Desktop fine pointers only; touch/coarse keep the system cursor.
   Reticle: 24×24, hotspot at center 12 12.
   Pan: 48×24 (reticle + side chevrons), hotspot on reticle center 24 12.
   JS follower (js/cursor.js) upgrades to an animated press-scale cursor
   and sets html.has-js-cursor → cursor: none via the vars below. */
@media (hover: hover) and (pointer: fine) {
  :root {
    --cursor: url("../img/cursor.svg") 12 12, url("../img/cursor.png") 12 12, auto;
    --cursor-click: url("../img/cursor.svg") 12 12, url("../img/cursor.png") 12 12, pointer;
    --cursor-pan: url("../img/cursor-pan.svg") 24 12, url("../img/cursor-pan.png") 24 12, grab;
    --cursor-pan-active: url("../img/cursor-pan.svg") 24 12, url("../img/cursor-pan.png") 24 12, grabbing;
  }

  html.has-js-cursor {
    --cursor: none;
    --cursor-click: none;
    --cursor-pan: none;
    --cursor-pan-active: none;
  }

  /* Catch hardcoded cursors (e.g. phone home indicator) while follower is on */
  html.has-js-cursor,
  html.has-js-cursor * {
    cursor: none !important;
  }

  .site-cursor {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483647;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    pointer-events: none;
    background: url("../img/cursor.svg") center / contain no-repeat;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 150ms ease;
    will-change: transform;
  }

  .site-cursor.is-pan {
    width: 48px;
    height: 24px;
    margin-left: -24px;
    margin-top: -12px;
    background-image: url("../img/cursor-pan.svg");
  }

  .site-cursor.is-pressed {
    transform: scale(0.85);
  }

  .site-cursor.is-instant,
  .site-cursor.is-instant.is-pressed {
    transition: none;
  }
}

/* macOS-style overlay scrollbars — near-invisible until the scrollable
   container is hovered. Class-level `scrollbar-width: none` / `display: none`
   rules (e.g. .ws-pager) still win where scrollbars are intentionally hidden. */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*:hover {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.28);
  border: 2px solid transparent;
  background-clip: content-box;
}

*:hover::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.42);
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--text);
  text-decoration: none;
  cursor: var(--cursor-click, pointer);
}

a:hover {
  color: var(--pink);
}

button,
summary,
[role="button"] {
  cursor: var(--cursor-click, pointer);
}

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--text);
  color: #000;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  corner-shape: var(--corner-shape-squircle);
  z-index: 20;
}

.skip:focus {
  top: 12px;
}

/* iOS-style smart install banner — mobile only (JS clears [hidden]) */
.smart-banner {
  display: none;
  width: 100%;
  box-sizing: border-box;
  background: #f2f2f7;
  color: #000;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
}

.smart-banner-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 8px 12px;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.smart-banner-link:hover,
.smart-banner-link:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}

.smart-banner-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  /* ~22% of size — app-icon squircle, not a circle (xl was 24px ≈ full round) */
  border-radius: 11px;
  corner-shape: var(--corner-shape-squircle);
  object-fit: cover;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.smart-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.smart-banner-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #000;
}

.smart-banner-sub {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: rgba(60, 60, 67, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-banner-get {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 4px 0 0;
  border-radius: 10px;
  background: transparent;
  line-height: 1;
}

.smart-banner-play {
  display: block;
  width: 22px;
  height: 25px;
  object-fit: contain;
  flex-shrink: 0;
}

.smart-banner-get-label {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  color: #007aff;
  letter-spacing: -0.01em;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Full-bleed chrome — independent of the 8-col content grid */
  width: 100%;
  padding: 0 var(--pad);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-sizing: border-box;
}

.nav-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 1;
  color: var(--text);
}

.nav-logo:hover,
.nav-logo:focus {
  color: var(--text);
}

.nav-logo-icon {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  corner-shape: var(--corner-shape-squircle);
  background: var(--bg-surface-elevated-primary);
  border: 0.5px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
  transition: background 0.25s var(--ease);
}

.nav-logo:hover .nav-logo-icon,
.nav-logo:focus .nav-logo-icon {
  background: var(--bg-surface-elevated-secondary);
}

.nav-logo-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.nav-logo-track {
  stroke: var(--bg-secondary);
}

.nav-logo-ring {
  stroke: currentColor;
  stroke-dasharray: 0.625 1;
  stroke-dashoffset: 0;
  opacity: 1;
}

.nav-logo-dot {
  fill: currentColor;
}

.nav-logo-wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: no-preference) {
  .nav-logo:hover .nav-logo-ring {
    animation: nav-logo-ring-trim 0.9s linear;
  }
}

@keyframes nav-logo-ring-trim {
  0% {
    opacity: 1;
    stroke-dashoffset: 0;
    animation-timing-function: ease;
  }
  16% {
    opacity: 0;
    stroke-dashoffset: 0;
    animation-timing-function: step-end;
  }
  17% {
    opacity: 0;
    stroke-dashoffset: 0.625;
    animation-timing-function: ease;
  }
  24% {
    opacity: 1;
    stroke-dashoffset: 0.625;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

.nav-play {
  margin-left: auto;
  flex-shrink: 0;
  z-index: 2;
  max-width: calc(50% - 48px);
}

/* Header Play badge: hidden at top, reveals after scroll (JS toggles .is-visible)
   Appear: slide up + fade in; dismiss: slide down + fade out */
.js .nav-play {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.45s var(--enter-ease),
    transform 0.45s var(--enter-ease),
    visibility 0.45s;
}

.js .nav-play.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js .nav-play {
    transform: none;
    transition: none;
  }
}

.play-badge {
  display: block;
  height: 40px;
  width: auto;
}

.play-badge img {
  height: 40px;
  width: auto;
}

.hero {
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 24px var(--grid-margin);
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
  align-items: center;
  min-height: calc(100svh - var(--nav));
  box-sizing: border-box;
}

.hero-phone {
  grid-column: 1 / span 3;
  justify-self: center;
}

.hero-copy {
  grid-column: 4 / span 5;
  min-width: 0;
}

.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.lede,
.lede.headline {
  /* woodward-ui .headline metrics; keep weight 400 (override .headline’s 600) */
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
  color: var(--muted);
  max-width: 38rem;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
}

.play-badge-lg img {
  height: 54px;
  width: auto;
}

.fine {
  color: var(--fine);
  /* between woodward-ui .caption and .subheadline */
  font-size: 13px;
  font-weight: 400;
  max-width: 24rem;
  line-height: 18px;
}

.phone {
  --bezel: 9px;
  /* Phone-like squircle — larger than token --radius-xxl (36px) */
  --phone-radius: 46px;
  width: min(280px, 72vw, calc((100svh - var(--nav) - 48px) * 448 / 997));
  aspect-ratio: 448 / 997;
  position: relative;
  background: #0a0a0b;
  border-radius: var(--phone-radius);
  corner-shape: var(--corner-shape-squircle);
  padding: var(--bezel);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 0 4px #151517,
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(255, 255, 255, 0.05);
}

.phone-screen {
  position: relative;
  height: 100%;
  border-radius: calc(var(--phone-radius) - var(--bezel));
  corner-shape: var(--corner-shape-squircle);
  overflow: hidden;
  background: #070708;
  container-type: size;
  container-name: phone;
}

/* Device wallpaper behind demo UI (translucent card / style scrim) */
.phone-wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  /* Soft-blur when Widget style is open (app StyleWallpaperBlur) */
  transition: filter 0.5s var(--ease);
}

.phone-screen:has(.phone-app[data-mode="style"]) .phone-wallpaper {
  filter: blur(12px);
}

/* Pixel-ish status bar image — white glyphs on transparent, over wallpaper + style scrim */
.phone-status {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Gesture home indicator */
.phone-home-indicator {
  --u: calc(100cqi / 360);
  position: absolute;
  left: 50%;
  bottom: calc(8 * var(--u));
  z-index: 2;
  width: calc(108 * var(--u));
  height: calc(4 * var(--u));
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

/* —— Interactive phone app: gallery + widget style (scaled to frame) —— */

.phone-app {
  --u: calc(100cqi / 360);
  --ws-chip: rgba(255, 255, 255, 0.15);
  --ws-title-font: var(--serif);
  --ws-container: rgba(244, 241, 243, 0.8);
  --ws-title: #121212;
  --ws-subtitle: rgba(18, 18, 18, 0.6);
  --ws-label: #3a3a3a;
  --ws-bar-start: #2a2a2a;
  --ws-bar-end: #5c5c5c;
  --ws-bar-track: rgba(0, 0, 0, 0.08);
  --ws-value: #fff;
  --ws-date-bg: rgba(0, 0, 0, 0.08);
  --ws-date-fg: #121212;
  --ws-check: #000;
  position: relative;
  z-index: 1;
  height: 100%;
  color: #fff;
  /* StyleScrim (~30% black) so wallpaper reads through — matches app */
  background: rgba(0, 0, 0, 0.3);
  /* Android stand-in for Inter — keep Roboto inside the phone frame */
  font-family: "Roboto", system-ui, sans-serif;
  /* Clear status-bar.png (396×64 → ~58u) + home indicator (~20) */
  padding-top: calc(58 * var(--u));
  padding-bottom: calc(20 * var(--u));
  user-select: none;
  -webkit-user-select: none;
}

.ws-gallery,
.ws-demo,
.ws-home {
  position: absolute;
  inset: 0;
  padding-top: calc(58 * var(--u));
  padding-bottom: calc(20 * var(--u));
  display: flex;
  flex-direction: column;
}

.ws-gallery {
  z-index: 1;
  justify-content: center;
  gap: calc(14 * var(--u));
}

.ws-demo {
  z-index: 2;
  /* Extra clearance above home indicator (~10u more breathing room for CTA) */
  padding-bottom: calc(30 * var(--u));
}

.ws-home {
  z-index: 3;
  padding-left: calc(18 * var(--u));
  padding-right: calc(18 * var(--u));
  padding-bottom: calc(28 * var(--u));
  gap: calc(12 * var(--u));
  /* Clear wallpaper — real home screen, no gallery scrim */
  background: transparent;
}

/*
  Clean crossfade (no FLIP). Gallery dumps fast; style chrome staggers in.
  Demo layer stays opacity:1 when shown so children aren't double-faded.
  .ws-ready enables motion — without it, mode swap is instant.
*/
.phone-app[data-mode="gallery"] .ws-gallery {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.phone-app[data-mode="gallery"] .ws-demo,
.phone-app[data-mode="gallery"] .ws-home {
  visibility: hidden;
  pointer-events: none;
}

.phone-app[data-mode="style"] .ws-gallery,
.phone-app[data-mode="home"] .ws-gallery {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.phone-app[data-mode="style"] .ws-demo {
  visibility: visible;
  pointer-events: auto;
}

.phone-app[data-mode="style"] .ws-home,
.phone-app[data-mode="home"] .ws-demo {
  visibility: hidden;
  pointer-events: none;
}

.phone-app[data-mode="home"] .ws-home {
  visibility: visible;
  pointer-events: auto;
}

.phone-app[data-mode="home"] {
  background: transparent;
}

.phone-app.ws-ready[data-mode="style"] .ws-gallery,
.phone-app.ws-ready[data-mode="home"] .ws-gallery {
  transition:
    opacity 0.16s cubic-bezier(0.3, 0, 0.8, 0.15),
    visibility 0s linear 0.16s;
}

.phone-app.ws-ready[data-mode="gallery"] .ws-gallery {
  transition:
    opacity 0.28s cubic-bezier(0.05, 0.7, 0.1, 1) 0.06s,
    visibility 0s linear 0s;
}

/* Keep style / home layers painted until chrome fade-out finishes */
.phone-app.ws-ready[data-mode="gallery"] .ws-demo,
.phone-app.ws-ready[data-mode="gallery"] .ws-home {
  transition: visibility 0s linear 0.22s;
}

.phone-app.ws-ready[data-mode="style"] .ws-demo,
.phone-app.ws-ready[data-mode="home"] .ws-home {
  transition: visibility 0s linear 0s;
}

.phone-screen:has(.phone-app[data-mode="home"]) .phone-home-indicator {
  pointer-events: auto;
  cursor: pointer;
}

/* Style chrome + preview: fade + slight rise, staggered like WidgetStyleScreen */
.ws-style-scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  opacity: 0;
}

.ws-demo > *:not(.ws-style-scrim) {
  position: relative;
  z-index: 1;
}

.ws-nav,
.ws-preview,
.ws-controls .ws-section,
.ws-cta {
  opacity: 0;
  transform: translateY(calc(16 * var(--u)));
}

.phone-app.ws-ready .ws-style-scrim,
.phone-app.ws-ready .ws-nav,
.phone-app.ws-ready .ws-preview,
.phone-app.ws-ready .ws-controls .ws-section,
.phone-app.ws-ready .ws-cta {
  transition:
    opacity 0.45s cubic-bezier(0.2, 0, 0, 1),
    transform 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.phone-app[data-mode="style"] .ws-style-scrim {
  opacity: 1;
  transition-delay: 0s;
}

.phone-app[data-mode="style"] .ws-nav {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.phone-app[data-mode="style"] .ws-preview {
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.phone-app[data-mode="style"] .ws-controls .ws-section:nth-child(1) {
  opacity: 1;
  transform: none;
  transition-delay: 0.05s;
}

.phone-app[data-mode="style"] .ws-controls .ws-section:nth-child(2) {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.phone-app[data-mode="style"] .ws-controls .ws-section:nth-child(3) {
  opacity: 1;
  transform: none;
  transition-delay: 0.15s;
}

.phone-app[data-mode="style"] .ws-cta {
  opacity: 1;
  transform: none;
  transition-delay: 0.15s;
}

.phone-app[data-mode="gallery"] .ws-style-scrim,
.phone-app[data-mode="gallery"] .ws-nav,
.phone-app[data-mode="gallery"] .ws-preview,
.phone-app[data-mode="gallery"] .ws-controls .ws-section,
.phone-app[data-mode="gallery"] .ws-cta {
  opacity: 0;
  transform: translateY(calc(10 * var(--u)));
  transition-duration: 0.16s;
  transition-delay: 0s;
  transition-timing-function: cubic-bezier(0.3, 0, 0.8, 0.15);
}

.phone-app[data-mode="gallery"] .ws-style-scrim {
  transform: none;
}

/* Home mock: fade + slight rise */
.ws-home-top,
.ws-home-grid,
.ws-home-dock,
.ws-home-store {
  opacity: 0;
  transform: translateY(calc(12 * var(--u)));
}

.phone-app.ws-ready .ws-home-top,
.phone-app.ws-ready .ws-home-grid,
.phone-app.ws-ready .ws-home-dock,
.phone-app.ws-ready .ws-home-store {
  transition:
    opacity 0.4s cubic-bezier(0.2, 0, 0, 1),
    transform 0.4s cubic-bezier(0.2, 0, 0, 1);
}

.phone-app[data-mode="home"] .ws-home-top {
  opacity: 1;
  transform: none;
  transition-delay: 0.06s;
}

.phone-app[data-mode="home"] .ws-home-grid {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

.phone-app[data-mode="home"] .ws-home-store {
  opacity: 1;
  transform: none;
  transition-delay: 0.14s;
}

.phone-app[data-mode="home"] .ws-home-dock {
  opacity: 1;
  transform: none;
  transition-delay: 0.18s;
}

.phone-app[data-mode="gallery"] .ws-home-top,
.phone-app[data-mode="gallery"] .ws-home-grid,
.phone-app[data-mode="gallery"] .ws-home-dock,
.phone-app[data-mode="gallery"] .ws-home-store,
.phone-app[data-mode="style"] .ws-home-top,
.phone-app[data-mode="style"] .ws-home-grid,
.phone-app[data-mode="style"] .ws-home-dock,
.phone-app[data-mode="style"] .ws-home-store {
  opacity: 0;
  transform: translateY(calc(8 * var(--u)));
  transition-duration: 0.16s;
  transition-delay: 0s;
  transition-timing-function: cubic-bezier(0.3, 0, 0.8, 0.15);
}

/* Reduced-motion / before ready: no staged chrome */
.phone-app:not(.ws-ready)[data-mode="style"] .ws-style-scrim,
.phone-app:not(.ws-ready)[data-mode="style"] .ws-nav,
.phone-app:not(.ws-ready)[data-mode="style"] .ws-preview,
.phone-app:not(.ws-ready)[data-mode="style"] .ws-controls .ws-section,
.phone-app:not(.ws-ready)[data-mode="style"] .ws-cta,
.phone-app:not(.ws-ready)[data-mode="home"] .ws-home-top,
.phone-app:not(.ws-ready)[data-mode="home"] .ws-home-grid,
.phone-app:not(.ws-ready)[data-mode="home"] .ws-home-dock,
.phone-app:not(.ws-ready)[data-mode="home"] .ws-home-store {
  opacity: 1;
  transform: none;
}

.ws-pager.is-auto-scrolling {
  scroll-snap-type: none;
  scroll-behavior: auto;
  pointer-events: none;
}

.ws-pager {
  display: flex;
  gap: calc(12 * var(--u));
  padding: 0 calc(36 * var(--u));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  cursor: var(--cursor-pan, grab);
  touch-action: pan-x;
}

.ws-pager::-webkit-scrollbar {
  display: none;
}

.ws-pager.is-dragging {
  cursor: var(--cursor-pan-active, grabbing);
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.ws-pager.is-dragging * {
  pointer-events: none;
}

.ws-slide {
  flex: 0 0 calc(100cqi - 72 * var(--u));
  width: calc(100cqi - 72 * var(--u));
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.ws-gallery-actions {
  display: flex;
  justify-content: center;
  gap: calc(8 * var(--u));
  flex-shrink: 0;
  padding: 0 calc(18 * var(--u));
}

.ws-pill {
  display: inline-grid;
  place-items: center;
  height: calc(32 * var(--u));
  padding: 0 calc(18 * var(--u));
  border: 0;
  border-radius: var(--radius-full);
  background: var(--ws-chip);
  color: #fff !important;
  font-family: inherit;
  font-size: calc(12 * var(--u));
  font-weight: 500;
  text-decoration: none;
  cursor: var(--cursor-click, pointer);
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.ws-pill:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.22);
}

.ws-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(5 * var(--u));
  flex-shrink: 0;
  padding-bottom: calc(4 * var(--u));
}

.ws-dots span {
  display: block;
  width: calc(5 * var(--u));
  height: calc(5 * var(--u));
  border-radius: var(--radius-full);
  background: #fff;
  opacity: 0.4;
  transition: width 0.25s var(--ease), opacity 0.25s var(--ease);
}

.ws-dots span.is-active {
  width: calc(14 * var(--u));
  opacity: 1;
}

.ws-nav {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(48 * var(--u));
  padding: calc(8 * var(--u)) calc(18 * var(--u)) 0;
  flex-shrink: 0;
}

.ws-dismiss {
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  margin-left: calc(-6 * var(--u));
  border: 0;
  padding: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: var(--cursor-click, pointer);
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.ws-dismiss:hover {
  background: var(--ws-chip);
}

.ws-dismiss svg {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
}

.ws-screen-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(22 * var(--u));
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fff;
}

.ws-preview {
  padding: 8px calc(24 * var(--u)) 0;
  flex-shrink: 0;
}

.ws-card {
  border-radius: var(--radius-xl);
  corner-shape: var(--corner-shape-squircle);
  background: var(--ws-container);
  /* Match Android WidgetCards: horizontal 20.dp, vertical 18.dp */
  padding: calc(18 * var(--u)) calc(20 * var(--u));
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.ws-card-head {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.ws-card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--ws-title-font);
  font-weight: 400;
  font-size: calc(22 * var(--u));
  line-height: 1.15;
  color: var(--ws-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s var(--ease), font-family 0.15s var(--ease);
}

.ws-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: calc(10 * var(--u));
  font-weight: 500;
  line-height: 1.2;
  padding-block: calc(5 * var(--u));
  padding-inline: calc(8 * var(--u));
  border-radius: var(--radius-full);
  background: var(--ws-date-bg);
  color: var(--ws-date-fg);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.ws-status {
  margin: calc(5 * var(--u)) 0 0;
  font-size: calc(11 * var(--u));
  line-height: 1.35;
  color: var(--ws-subtitle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s var(--ease);
}

.ws-metrics {
  list-style: none;
  margin: calc(12 * var(--u)) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: calc(9 * var(--u));
}

.ws-metrics li {
  display: grid;
  grid-template-columns: calc(78 * var(--u)) 1fr;
  align-items: center;
  gap: calc(6 * var(--u));
  height: calc(16 * var(--u));
}

.ws-label {
  font-size: calc(11 * var(--u));
  font-weight: 500;
  color: var(--ws-label);
  line-height: 1;
  transition: color 0.25s var(--ease);
}

.ws-bar {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--ws-bar-track);
  overflow: hidden;
  transition: background 0.25s var(--ease);
}

.ws-fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: max(calc(100% * var(--v) / 4), calc(36 * var(--u)));
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--ws-bar-start), var(--ws-bar-end));
  padding-right: calc(8 * var(--u));
  transition: background 0.25s var(--ease), width 0.35s var(--ease);
}

/* Gallery: grow metric fills when a slide becomes active (re-triggers on return) */
@media (prefers-reduced-motion: no-preference) {
  .ws-pager .ws-slide:not(.is-active) .ws-fill {
    width: 0;
    min-width: 0;
    padding-right: 0;
    transition: background 0.25s var(--ease), width 0s, padding-right 0s;
  }

  .ws-pager .ws-slide.is-active .ws-fill {
    width: max(calc(100% * var(--v) / 4), calc(36 * var(--u)));
    transition:
      background 0.25s var(--ease),
      width 1s var(--ease),
      padding-right 1s var(--ease);
  }

  .ws-pager .ws-slide.is-active .ws-metrics li:nth-child(1) .ws-fill {
    transition-delay: 0ms;
  }
  .ws-pager .ws-slide.is-active .ws-metrics li:nth-child(2) .ws-fill {
    transition-delay: 70ms;
  }
  .ws-pager .ws-slide.is-active .ws-metrics li:nth-child(3) .ws-fill {
    transition-delay: 140ms;
  }
  .ws-pager .ws-slide.is-active .ws-metrics li:nth-child(4) .ws-fill {
    transition-delay: 210ms;
  }
  .ws-pager .ws-slide.is-active .ws-metrics li:nth-child(5) .ws-fill {
    transition-delay: 280ms;
  }

  .ws-pager .ws-slide:not(.is-active) .ws-load-bars span {
    height: 0;
    min-height: 0;
    transition: background 0.25s var(--ease), opacity 0.25s var(--ease), height 0s;
  }

  .ws-pager .ws-slide.is-active .ws-load-bars span {
    height: calc(var(--h, 0.5) * 100%);
    min-height: calc(6 * var(--u));
    transition:
      background 0.25s var(--ease),
      opacity 0.25s var(--ease),
      height 1s var(--ease);
  }
}

.ws-val {
  font-size: calc(9 * var(--u));
  font-weight: 500;
  color: var(--ws-value);
  line-height: 1;
  transition: color 0.25s var(--ease);
}

/* Ring / sleep / load widget layouts */

.ws-ring-stage,
.ws-sleep-stage {
  display: grid;
  place-items: center;
  margin-top: calc(10 * var(--u));
}

.ws-ring {
  position: relative;
  display: grid;
  place-items: center;
}

.ws-ring svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.ws-ring-lg {
  width: calc(132 * var(--u));
  height: calc(132 * var(--u));
}

.ws-ring-sm {
  width: calc(68 * var(--u));
  height: calc(68 * var(--u));
}

.ws-ring-sleep {
  width: calc(124 * var(--u));
  height: calc(124 * var(--u));
}

.ws-ring-track {
  fill: none;
  stroke: var(--ws-bar-track);
  stroke-width: 10;
}

.ws-ring-lg .ws-ring-track {
  stroke-width: 11;
}

.ws-ring-sm .ws-ring-track {
  stroke-width: 9;
}

.ws-ring-progress {
  fill: none;
  stroke: var(--ws-bar-start);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: calc(var(--p, 0) * 100) 100;
  transition: stroke 0.25s var(--ease), stroke-dasharray 0.35s var(--ease);
}

.ws-ring-lg .ws-ring-progress {
  stroke-width: 11;
}

.ws-ring-sm .ws-ring-progress {
  stroke-width: 9;
}

.ws-sleep-arc {
  /* Percent of day (pathLength 100); SVG already rotated -90 so 0 = midnight at top */
  stroke-dasharray: var(--sleep-sweep) 100;
  stroke-dashoffset: calc(var(--sleep-start) * -1);
}

.ws-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.ws-ring-score {
  font-size: calc(34 * var(--u));
  font-weight: 400;
  line-height: 1;
  color: var(--ws-title);
  transition: color 0.25s var(--ease);
}

.ws-ring-sub {
  margin-top: calc(2 * var(--u));
  font-size: calc(10 * var(--u));
  line-height: 1.2;
  color: var(--ws-subtitle);
  transition: color 0.25s var(--ease);
}

.ws-mini-rings {
  display: flex;
  justify-content: space-evenly;
  gap: calc(4 * var(--u));
  margin-top: calc(12 * var(--u));
}

.ws-mini-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(6 * var(--u));
  min-width: 0;
}

.ws-mini-ring .ws-ring {
  position: relative;
}

.ws-mini-val {
  position: absolute;
  font-size: calc(12 * var(--u));
  font-weight: 400;
  color: var(--ws-title);
  line-height: 1;
  transition: color 0.25s var(--ease);
}

.ws-sleep-times {
  gap: calc(1 * var(--u));
}

.ws-sleep-time {
  font-size: calc(14 * var(--u));
  font-weight: 400;
  line-height: 1.15;
  color: var(--ws-title);
  transition: color 0.25s var(--ease);
}

.ws-load-score {
  margin: calc(6 * var(--u)) 0 0;
  font-size: calc(44 * var(--u));
  font-weight: 400;
  line-height: 1;
  color: var(--ws-title);
  transition: color 0.25s var(--ease);
}

.ws-load-bars {
  display: flex;
  align-items: flex-end;
  gap: calc(4 * var(--u));
  height: calc(56 * var(--u));
  margin-top: calc(10 * var(--u));
}

.ws-load-bars span {
  flex: 1;
  height: calc(var(--h, 0.5) * 100%);
  min-height: calc(6 * var(--u));
  border-radius: calc(4 * var(--u));
  corner-shape: var(--corner-shape-squircle);
  background: var(--ws-bar-start);
  opacity: 0.35;
  transition: background 0.25s var(--ease), opacity 0.25s var(--ease);
}

.ws-load-bars span.is-today {
  opacity: 1;
}

.ws-controls {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  padding: calc(16 * var(--u)) 0 calc(10 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(16 * var(--u));
  -webkit-mask-image: linear-gradient(#000 92%, transparent);
  mask-image: linear-gradient(#000 92%, transparent);
}

.ws-controls::-webkit-scrollbar {
  display: none;
}

.ws-section-label {
  display: flex;
  align-items: baseline;
  gap: calc(4 * var(--u));
  padding: 0 calc(18 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
  color: #fff;
  margin-bottom: calc(9 * var(--u));
}

.ws-color-name {
  color: rgba(255, 255, 255, 0.5);
}

.ws-swatches,
.ws-fonts {
  display: flex;
  gap: calc(10 * var(--u));
  padding: 0 calc(18 * var(--u));
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  cursor: var(--cursor-pan, grab);
  touch-action: pan-x;
}

.ws-swatches {
  gap: calc(11 * var(--u));
}

.ws-swatches::-webkit-scrollbar,
.ws-fonts::-webkit-scrollbar {
  display: none;
}

.ws-swatches.is-dragging,
.ws-fonts.is-dragging {
  cursor: var(--cursor-pan-active, grabbing);
  scroll-snap-type: none;
}

.ws-swatches.is-dragging *,
.ws-fonts.is-dragging * {
  cursor: var(--cursor-pan-active, grabbing);
  pointer-events: none;
}

.ws-swatch {
  position: relative;
  flex: 0 0 calc(36 * var(--u));
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  border: 0;
  padding: 0;
  border-radius: var(--radius-full);
  background: transparent;
  cursor: var(--cursor-click, pointer);
  display: grid;
  place-items: center;
  appearance: none;
  -webkit-appearance: none;
  touch-action: pan-x;
}

.ws-swatch-face {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--sw, #fff);
  box-sizing: border-box;
}

/* Auto (mono) — primary overlay disc so the check reads on both halves */
.ws-swatch[data-color="mono"].is-selected .ws-swatch-face::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg-overlay-primary);
  pointer-events: none;
  z-index: 1;
}

.ws-swatch.is-selected .ws-swatch-face {
  /* Underlap the ring slightly so antialias never shows a dark hairline */
  width: calc(100% - 4 * var(--u));
  height: calc(100% - 4 * var(--u));
}

.ws-swatch.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: calc(2.2 * var(--u)) solid #fff;
  pointer-events: none;
  z-index: 1;
}

.ws-swatch.is-selected::before {
  content: "";
  position: absolute;
  width: calc(12 * var(--u));
  height: calc(8 * var(--u));
  border-left: calc(2.2 * var(--u)) solid var(--ws-check, #000);
  border-bottom: calc(2.2 * var(--u)) solid var(--ws-check, #000);
  transform: rotate(-45deg) translateY(calc(-1 * var(--u)));
  z-index: 2;
  pointer-events: none;
}

.ws-swatch-dynamic {
  background: conic-gradient(
    from 210deg,
    #7c4dff,
    #448aff,
    #69f0ae,
    #ffb300,
    #ff6e40,
    #ff5c8a,
    #7c4dff
  );
}

.ws-swatch-lavender {
  background: linear-gradient(135deg, #b388ff, #e1bee7);
}

.ws-swatch-mono {
  background: linear-gradient(90deg, #fff 50%, #000 50%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.ws-swatch-black {
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.ws-font {
  flex: 0 0 calc(56 * var(--u));
  width: calc(56 * var(--u));
  height: calc(52 * var(--u));
  border: 0;
  padding: calc(6 * var(--u)) 0 calc(5 * var(--u));
  border-radius: var(--radius-md);
  corner-shape: var(--corner-shape-squircle);
  background: var(--ws-chip);
  color: #fff;
  cursor: var(--cursor-click, pointer);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(1 * var(--u));
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  appearance: none;
  -webkit-appearance: none;
  touch-action: pan-x;
}

.ws-font.is-selected {
  background: #fff;
  color: #000;
}

.ws-aa {
  font-size: calc(20 * var(--u));
  line-height: 1.1;
  font-weight: 400;
}

.ws-aa-bold {
  font-weight: 700;
}

.ws-font-name {
  font-family: inherit;
  font-size: calc(9 * var(--u));
  line-height: 1;
  font-weight: 400;
  opacity: 0.7;
  color: inherit;
}

.ws-section-bg .ws-section-label {
  padding-left: calc(18 * var(--u));
}

.ws-bgs {
  display: flex;
  flex-wrap: wrap;
  gap: calc(8 * var(--u));
  padding: 0 calc(18 * var(--u));
}

.ws-bg {
  height: calc(32 * var(--u));
  padding: 0 calc(16 * var(--u));
  border: 0;
  border-radius: var(--radius-full);
  background: var(--ws-chip);
  color: #fff;
  font-family: inherit;
  font-size: calc(12 * var(--u));
  font-weight: 500;
  cursor: var(--cursor-click, pointer);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
}

.ws-bg.is-selected {
  background: #fff;
  color: #000;
}

.ws-cta {
  display: grid;
  place-items: center;
  margin: 0 calc(18 * var(--u));
  height: calc(44 * var(--u));
  border: 0;
  border-radius: var(--radius-full);
  background: #fff;
  color: #000 !important;
  font-family: inherit;
  font-size: calc(13 * var(--u));
  font-weight: 500;
  flex-shrink: 0;
  text-decoration: none;
  cursor: var(--cursor-click, pointer);
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.ws-cta:hover {
  color: #000 !important;
  opacity: 0.92;
}

.ws-cta:active {
  transform: scale(0.98);
}

/* —— Mock Android homescreen —— */

.ws-home-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
  min-height: calc(56 * var(--u));
  padding-top: calc(4 * var(--u));
}

.ws-home-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.ws-home-time {
  font-family: var(--serif);
  font-weight: 400;
  font-size: calc(44 * var(--u));
  line-height: 1;
  letter-spacing: -0.03em;
}

.ws-home-date {
  margin-top: calc(4 * var(--u));
  font-size: calc(12 * var(--u));
  font-weight: 500;
  opacity: 0.88;
}

.ws-home-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  padding-top: calc(4 * var(--u));
}

.ws-home-slot {
  width: 100%;
  max-width: 100%;
  cursor: pointer;
}

.ws-home-slot[data-size="2x2"] {
  width: 48%;
  align-self: flex-start;
}

.ws-home-slot[data-size="4x2"] .ws-card,
.ws-home-slot[data-size="2x2"] .ws-card {
  /* Slightly tighter padding so 4×2 / 2×2 read as home widgets */
  padding: calc(14 * var(--u)) calc(16 * var(--u));
}

.ws-home-slot[data-size="2x2"] .ws-card-title {
  font-size: calc(16 * var(--u));
}

.ws-home-slot[data-size="2x2"] .ws-ring-lg {
  width: calc(96 * var(--u));
  height: calc(96 * var(--u));
}

.ws-home-slot[data-size="2x2"] .ws-ring-stage {
  margin-top: calc(6 * var(--u));
}

.ws-home-slot[data-size="4x2"] .ws-ring-sleep {
  width: calc(100 * var(--u));
  height: calc(100 * var(--u));
}

.ws-home-slot[data-size="4x2"] .ws-sleep-stage,
.ws-home-slot[data-size="4x2"] .ws-mini-rings {
  margin-top: calc(6 * var(--u));
}

.ws-home-slot .ws-card {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

/* Pixel/Material home: icons sit on wallpaper — no frosted dock tray */
.ws-home-dock {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  padding: calc(4 * var(--u)) calc(10 * var(--u)) calc(2 * var(--u));
  pointer-events: none;
}

.ws-home-icon {
  width: calc(48 * var(--u));
  height: calc(48 * var(--u));
  flex-shrink: 0;
  border-radius: 50%;
  corner-shape: round;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

.ws-home-icon:nth-child(1) {
  background: linear-gradient(145deg, #5b8cff, #2c5cff);
}
.ws-home-icon:nth-child(2) {
  background: linear-gradient(145deg, #64d2a0, #2aaa6e);
}
.ws-home-icon:nth-child(3) {
  background: linear-gradient(145deg, #ffb347, #f08a24);
}
.ws-home-icon:nth-child(4) {
  background: linear-gradient(145deg, #c9a0ff, #8b5cf6);
}

.ws-home-store {
  align-self: center;
  flex-shrink: 0;
  margin-bottom: calc(6 * var(--u));
}

@media (prefers-reduced-motion: reduce) {
  .phone-wallpaper,
  .ws-gallery,
  .ws-demo,
  .ws-home,
  .ws-style-scrim,
  .ws-preview,
  .ws-gallery-actions,
  .ws-dots,
  .ws-slide:not(.is-active),
  .ws-card,
  .ws-card-title,
  .ws-date,
  .ws-status,
  .ws-label,
  .ws-bar,
  .ws-fill,
  .ws-val,
  .ws-font,
  .ws-bg,
  .ws-cta,
  .ws-nav,
  .ws-section,
  .ws-dots span,
  .ws-ring-progress,
  .ws-ring-score,
  .ws-ring-sub,
  .ws-mini-val,
  .ws-sleep-time,
  .ws-load-score,
  .ws-load-bars span,
  .ws-pager,
  .ws-home-top,
  .ws-home-grid,
  .ws-home-dock,
  .ws-home-store {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
    filter: none !important;
    transform: none !important;
  }

  .phone-screen:has(.phone-app[data-mode="style"]) .phone-wallpaper {
    filter: none;
  }
}

/* Fallback when container queries unavailable */
@supports not (width: 1cqi) {
  .phone-app,
  .phone-home-indicator {
    --u: 0.72px;
  }
}

.band {
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 80px var(--grid-margin) 24px;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  row-gap: 0;
  box-sizing: border-box;
}

.band:last-of-type {
  padding-bottom: 96px;
}

.band > h2,
.band > .features,
.band > .widgets,
.band > .plans,
.band > .note {
  grid-column: 1 / -1;
}

.band h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 28px;
}

.features {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
}

.feature {
  grid-column: span 4;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-xl);
  corner-shape: var(--corner-shape-squircle);
  padding: 22px 22px 20px;
  min-width: 0;
}

.feature h3 {
  margin: 0 0 8px;
  /* woodward-ui .bodyEmphasis */
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  /* woodward-ui .subheadline */
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.widgets {
  display: grid;
  gap: 0;
  border: 0.5px solid var(--line);
  border-radius: var(--radius-xl);
  corner-shape: var(--corner-shape-squircle);
  overflow: hidden;
  background: var(--surface);
}

.widget-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--line);
}

.widget-row:last-child {
  border-bottom: 0;
}

.widget-row strong {
  font-weight: 500;
}

.widget-row span:not(.pill) {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pill-free {
  background: var(--line);
  color: #fff;
}

.pill-pro {
  background: linear-gradient(90deg, #c57e22, #f7b966);
  color: #fff;
}

.plans {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--grid-gutter);
  align-items: stretch;
  overflow: visible;
}

.plan {
  grid-column: span 2;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-xl);
  corner-shape: var(--corner-shape-squircle);
  padding: 22px;
  position: relative;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

/* Featured plan wrap — badge sits outside the clipped glow card */
.plan-featured-wrap {
  grid-column: span 4;
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: visible;
}

.plan-featured-wrap > .badge {
  z-index: 2;
}

/* Bottom-edge Siri glow (roam-siri port) on featured Pro card */
.plan.featured {
  grid-column: 1 / -1;
  background: #fff;
  color: #000;
  border: 0;
  overflow: hidden;
  isolation: isolate;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  height: 100%;
  box-sizing: border-box;
}

.siri-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  corner-shape: inherit;
}

.siri-glow-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

.plan.featured > :not(.siri-glow) {
  position: relative;
  z-index: 1;
}

.plan.featured p,
.plan.featured .fine {
  color: rgba(0, 0, 0, 0.55);
}

.badge {
  position: absolute;
  top: -8px;
  right: 16px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  corner-shape: var(--corner-shape-squircle);
  background-image:
    linear-gradient(
      105deg,
      transparent 42%,
      rgba(255, 255, 255, 0.32) 50%,
      transparent 58%
    ),
    linear-gradient(90deg, #c57e22 0%, #d89745 35%, #f7b966 100%);
  background-size: 220% 100%, 100% 100%;
  background-position: 120% 0, 0 0;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  .badge {
    animation: badge-shimmer 3.2s ease-in-out infinite;
  }
}

@keyframes badge-shimmer {
  0%,
  12% {
    background-position: 120% 0, 0 0;
  }
  88%,
  100% {
    background-position: -20% 0, 0 0;
  }
}

.badge i {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  corner-shape: var(--corner-shape-squircle);
  background: #fff;
  display: inline-block;
}

.plan h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
}

.plan p {
  margin: 0;
  color: var(--muted);
  /* woodward-ui .subheadline */
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.note {
  margin: 16px 0 0;
  color: var(--fine);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  max-width: 46rem;
}

.site-footer {
  /* Full-bleed chrome — independent of the 8-col content grid */
  border-top: 0.5px solid var(--line);
  width: 100%;
  padding: 34px var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 22px;
  justify-content: space-between;
  color: var(--fine);
  /* woodward-ui .caption — one step below prior 13px footer size */
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.footer-logo {
  display: block;
  color: var(--text);
}

.footer-logo-icon {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  corner-shape: var(--corner-shape-squircle);
  background: var(--bg-surface-elevated-primary);
  border: 0.5px solid var(--border);
  box-sizing: border-box;
  overflow: hidden;
}

.footer-logo-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.site-footer a {
  color: var(--muted);
}

.page {
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 48px var(--grid-margin) 96px;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  row-gap: 0;
  box-sizing: border-box;
}

/* Legal / FAQ / Support copy sits on cols 1–6 (~reading measure) */
.page > * {
  grid-column: 1 / -1;
}

@media (min-width: 769px) {
  .page > * {
    grid-column: 1 / span 6;
  }
}

.page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1.08;
  margin: 0 0 12px;
}

.page .lede {
  margin-bottom: 36px;
}

.page h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  margin: 36px 0 12px;
}

.page p,
.page li {
  color: var(--muted);
  /* woodward-ui .body */
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.page p {
  margin: 0 0 14px;
}

.page ul,
.page ol {
  padding-left: 1.2em;
}

.page a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--fine);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  margin-bottom: 28px;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.faq details {
  border-bottom: 0.5px solid var(--line);
  padding: 16px 0;
}

.faq summary {
  cursor: var(--cursor-click, pointer);
  /* woodward-ui .bodyEmphasis */
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 10px 0 4px;
}

.mail {
  font-weight: 500;
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  border: 0.5px solid var(--line);
  border-radius: var(--radius-lg);
  corner-shape: var(--corner-shape-squircle);
}

table {
  width: 100%;
  border-collapse: collapse;
  /* woodward-ui .subheadline */
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 500;
}

tr:last-child td {
  border-bottom: 0;
}

.error {
  width: 100%;
  max-width: var(--grid-max-width);
  margin: 0 auto;
  min-height: calc(100svh - var(--nav) - 120px);
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gutter);
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 48px var(--grid-margin);
  box-sizing: border-box;
}

.error > * {
  grid-column: 1 / -1;
  max-width: 36rem;
}

@media (max-width: 860px) {
  .hero {
    row-gap: 40px;
    min-height: 0;
    padding-top: 32px;
    padding-bottom: 56px;
  }

  .hero-copy {
    grid-column: 1 / -1;
    order: 1;
  }

  .hero-phone {
    grid-column: 1 / -1;
    order: 2;
    justify-self: stretch;
    width: 100%;
  }

  /* Match hero copy width — larger phone, left-aligned with the text */
  .hero-phone .phone {
    width: 100%;
    max-width: none;
    --phone-radius: 56px;
    --bezel: 10px;
  }

  .feature,
  .plan,
  .plan.featured,
  .plan-featured-wrap {
    grid-column: 1 / -1;
  }

  .widget-row {
    grid-template-columns: 1fr auto;
  }

  .widget-row span:not(.pill) {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --grid-columns: 4;
    --grid-gutter: 16px;
  }

  .smart-banner:not([hidden]) {
    display: block;
  }

  /* Install path lives in the smart banner on mobile */
  .nav-play,
  .hero-actions {
    display: none !important;
  }

  /* Nav scrolls away with the page on mobile */
  .nav {
    position: relative;
    top: auto;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .site-footer nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .nav .play-badge,
  .nav .play-badge img {
    height: 32px;
  }
}

@media (max-width: 640px) {
  .hero-copy h1 {
    font-size: 40px;
  }
}

/* —— Page-load appearance (portfolio SoftBlurText + LoadReveal) —— */

@keyframes soft-blur-enter {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: none;
  }
}

@keyframes soft-blur-chrome {
  to {
    opacity: 1;
    filter: none;
  }
}

.enter-word {
  display: inline-block;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .js [data-soft-blur]:not([data-ready]) {
    opacity: 0;
  }

  /* Block reveal — LoadReveal defaults: blur 6, y 16, 0.9s */
  .enter {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
    animation: soft-blur-enter var(--enter-duration) var(--enter-ease) forwards;
    animation-delay: calc(var(--enter-delay, 0) * 1s);
  }

  /* Sticky chrome: opacity + blur only — transform would break position:sticky */
  .enter-chrome {
    opacity: 0;
    filter: blur(6px);
    animation: soft-blur-chrome var(--enter-duration) var(--enter-ease) forwards;
    animation-delay: calc(var(--enter-delay, 0) * 1s);
  }

  /* Per-character reveal — SoftBlurText: blur 12, y 16, stagger 25ms */
  .enter-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(16px);
    filter: blur(12px);
    animation: soft-blur-enter var(--enter-duration) var(--enter-ease) forwards;
    animation-delay: calc((var(--enter-base, 0.1) + var(--i, 0) * 0.025) * 1s);
  }

  .enter.enter-done,
  .enter-chrome.enter-done,
  .enter-char.enter-done {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .enter,
  .enter-chrome,
  .enter-char {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .js [data-soft-blur]:not([data-ready]) {
    opacity: 1;
  }
}
