/* Delight Lab: palette taken from the logo. Light mode only. */
:root {
  color-scheme: light;
  --cream: #fdf8ef;
  --paper: #ffffff;
  --ink: #1c1c1e;
  --ink-2: #4e4d4a;
  --ink-3: #7a7873;
  --line: rgba(28, 28, 30, 0.09);
  --blue: #3f5de8;
  --coral: #f2705f;
  /* soft tints for tiles */
  --t-peach: #fde6de;
  --t-sky: #e4e9fd;
  --t-butter: #fff0c7;
  --t-mint: #dcf3e7;
  --radius: 32px;
  --pill: 999px;
  --spring: cubic-bezier(0.24, 1.4, 0.38, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --inset: 24px;
  --display: "Outfit", "Inter", system-ui, sans-serif;
  --body: "DM Sans", "Inter", system-ui, sans-serif;
}
@media (max-width: 760px) { :root { --inset: 16px; } }

* { box-sizing: border-box; }
html { overflow-x: hidden; background: var(--cream); }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--inset); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.logo svg { width: 66px; height: 52px; overflow: visible; }
.logo .word { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.logo .trail { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw .9s var(--ease) .1s forwards; }
.logo .ball { transform-box: fill-box; transform-origin: 50% 100%; animation: boing 1.1s var(--spring) .55s both; }
.logo .spark { transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; animation: spark .5s var(--ease) 1.2s forwards; }
.logo .spark:nth-of-type(2) { animation-delay: 1.28s; }
.logo .spark:nth-of-type(3) { animation-delay: 1.36s; }
.logo:hover .ball { animation: boing .9s var(--spring) both; }
.logo:hover .spark { animation: spark .45s var(--ease) .35s both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes boing {
  0%   { transform: translate(-6px, 14px) scale(.6); opacity: 0; }
  40%  { transform: translate(0, -6px) scale(1.06, .94); opacity: 1; }
  60%  { transform: translate(0, 2px) scale(.94, 1.06); }
  80%  { transform: translate(0, -2px) scale(1.02, .98); }
  100% { transform: none; opacity: 1; }
}
@keyframes spark { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav .wrap { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.count { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: var(--pill); background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink); }
.count i { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.back { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; font-size: 14px; padding: 9px 16px; min-height: 44px; border-radius: var(--pill); background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink); transition: transform .2s var(--spring); }
.back:hover { transform: translateY(-2px) rotate(-1.5deg); }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 72px 0 64px; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 auto 18px; max-width: 13ch; }
.hero h1 em { font-style: normal; color: var(--coral); position: relative; white-space: nowrap; }
.hero p { font-size: 18px; color: var(--ink-2); max-width: 40ch; margin: 0 auto; }
.cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 14px 26px; min-height: 52px; border-radius: var(--pill); background: var(--blue); color: #fff; font-family: var(--display); font-weight: 700; font-size: 16px; box-shadow: 0 6px 0 #2a43b8; transition: transform .2s var(--spring), box-shadow .2s var(--spring); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #2a43b8; }
.cta:active { transform: translateY(5px); box-shadow: 0 1px 0 #2a43b8; }
.cta .b { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: hop 1.4s var(--spring) infinite; animation-delay: 2s; }
@keyframes hop { 0%, 60%, 100% { transform: none; } 20% { transform: translateY(-7px); } 40% { transform: translateY(1px) scale(1.2, .8); } }
/* decorative bounce trail across the hero */
.hero .deco { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero > :not(.deco) { position: relative; z-index: 1; }
.hero .deco svg { position: absolute; }
.hero .deco .d1 { left: 2%; top: 30%; width: 180px; }
.hero .deco .d2 { right: 3%; top: 14%; width: 120px; }
@media (max-width: 760px) { .hero { padding: 40px 0 44px; } .hero .deco .d1 { width: 90px; top: 62%; left: -10px; } .hero .deco .d2 { width: 70px; top: 0; } }
.hero > :not(.deco) { animation: rise .7s var(--ease) both; }
.hero > :nth-child(3) { animation-delay: .08s; }
.hero > :nth-child(4) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Gallery ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-bottom: 96px; scroll-margin-top: 90px; }
@media (max-width: 1060px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; gap: 14px; } }
.tile { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--tint, var(--t-peach)); overflow: hidden; transition: transform .35s var(--spring); }
.tile:nth-child(4n+2) { --tint: var(--t-sky); }
.tile:nth-child(4n+3) { --tint: var(--t-butter); }
.tile:nth-child(4n+4) { --tint: var(--t-mint); }
.tile:hover { transform: translateY(-6px) rotate(-1deg); }
.tile:nth-child(even):hover { transform: translateY(-6px) rotate(1deg); }
.tile:active { transform: scale(.98); }
/* demo renders at phone size and scales to sit centred in the tile */
.screen { position: absolute; left: 50%; top: 50%; width: 390px; height: 820px; transform: translate(-50%, -50%) scale(var(--k, .4)); border-radius: 48px; overflow: hidden; background: #f5f4ef; border: 9px solid var(--ink); box-shadow: 0 34px 50px -30px rgba(28, 28, 30, .45); transition: transform .45s var(--spring); pointer-events: none; }
.screen.bare { width: 366px; height: 738px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.screen iframe, .screen img, .screen video { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.tile:hover .screen { transform: translate(-50%, -50%) scale(calc(var(--k) * 1.04)); }
.name { position: absolute; left: 16px; bottom: 16px; max-width: calc(100% - 32px); font-family: var(--display); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: var(--pill); background: var(--paper); box-shadow: 0 0 0 1.5px var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .18s, transform .3s var(--spring); }
.tile:hover .name, .tile:focus-visible .name { opacity: 1; transform: none; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 60px 0; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(300px, 520px) minmax(0, 1fr); gap: 64px; padding: 24px 0 96px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; } }
.stage { position: sticky; top: 96px; }
@media (max-width: 900px) { .stage { position: static; } }
.stage-box { position: relative; aspect-ratio: 1 / 1.08; border-radius: var(--radius); background: var(--t-sky); overflow: hidden; }
.stage-box .screen { pointer-events: auto; }
.stage-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.chip { border: 0; background: var(--paper); color: var(--ink); padding: 9px 16px; min-height: 42px; border-radius: var(--pill); font-family: var(--display); font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: 0 0 0 1.5px var(--line); transition: transform .25s var(--spring), background .15s; }
.chip:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--ink); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.stage-note { text-align: center; font-size: 14px; color: var(--ink-3); margin-top: 10px; }
.article h1 { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.035em; line-height: 1.05; margin: 12px 0 14px; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; }
.section { padding: 26px 0; border-top: 2px dashed rgba(63, 93, 232, .22); }
.section h2 { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--blue); margin: 0 0 14px; }
.section ul { margin: 0; padding: 0; list-style: none; }
.section li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.section li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 11px; height: 11px; border-radius: 50%; background: var(--coral); }

/* ---------- Footer ---------- */
.foot { border-top: 2px dashed rgba(63, 93, 232, .22); padding: 28px 0 48px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); }
.foot .logo svg { width: 44px; height: 34px; }
.foot .logo .word { font-size: 17px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo .trail { stroke-dashoffset: 0; }
  .logo .spark { opacity: 1; }
}
