/* STPZ LAB look: the colours of the STPZMX app icon (paper, ink, ochre). */
:root {
  --paper: #f4f2ee;
  --paper-deep: #e9e5de;
  --card: #fdfcf9;
  --edge: #e3dfd8;
  --ink: #2b2d31;
  --ink-soft: #5d6066;
  --ochre: #c9903a;
  --ochre-deep: #a8742a;
  --bezel: #1f2023;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  --radius: 18px;
  --max: 1120px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Sukhumvit Set", "Thonburi", "Noto Sans Thai", sans-serif;
}
/* Dark: the device's setting, unless the visitor picked a look with the sun / moon button
   (data-theme on <html>, kept in localStorage by site.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f2124;
    --paper-deep: #1a1c1f;
    --card: #26292e;
    --edge: #33363c;
    --ink: #e8e6e1;
    --ink-soft: #a3a6ab;
    --ochre: #d9a24a;
    --ochre-deep: #e6b562;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1f2124;
  --paper-deep: #1a1c1f;
  --card: #26292e;
  --edge: #33363c;
  --ink: #e8e6e1;
  --ink-soft: #a3a6ab;
  --ochre: #d9a24a;
  --ochre-deep: #e6b562;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%) fixed;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--ochre-deep); }
img { max-width: 100%; height: auto; display: block; }   /* height:auto keeps the shape when max-width shrinks it */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: 0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { border-bottom: 3px solid var(--ochre); padding-bottom: 1px; }
.nav { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: flex-end; font-size: 15px; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav .lang { border: 1px solid var(--edge); border-radius: 999px; padding: 0 10px; }
/* Sun / moon: the moon shows on the light look (tap for dark), the sun on the dark look. */
.nav { align-items: center; }
.theme { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.theme:hover { color: var(--ink); }
.theme svg { width: 16px; height: 16px; }
.theme .sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: block; }
  :root:not([data-theme="light"]) .theme .moon { display: none; }
}
:root[data-theme="dark"] .theme .sun { display: block; }
:root[data-theme="dark"] .theme .moon { display: none; }

/* Hero */
.hero { text-align: center; padding: 36px 0 24px; }
.eyebrow { color: var(--ochre); font-weight: 700; letter-spacing: 0.3em; font-size: 13px; }
h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.15; margin: 10px 0 8px; letter-spacing: -0.02em; }
.rule { width: 64px; height: 5px; border-radius: 3px; background: var(--ochre); margin: 18px auto; }
.lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-soft); max-width: 720px; margin: 0 auto; }
.cta { margin: 26px 0 8px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--edge); }
.note { font-size: 14px; color: var(--ink-soft); }

/* Real screenshots in a plain frame */
.device { background: var(--bezel); border-radius: clamp(14px, 3vw, 34px); padding: clamp(6px, 1.4vw, 16px); box-shadow: var(--shadow); margin: 28px auto 0; max-width: 980px; }
.device img { border-radius: clamp(8px, 1.8vw, 20px); width: 100%; height: auto; }
.window { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--edge); }

/* Feature grid */
section { padding: 48px 0; }
h2 { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.card { background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.card .k { color: var(--ochre); font-weight: 800; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding: 0; list-style: none; }
.chips li { background: var(--card); border: 1px solid var(--edge); border-radius: 999px; padding: 4px 12px; font-size: 14.5px; }

/* Text pages */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 0 56px; }
.doc h1 { font-size: clamp(30px, 5vw, 44px); }
.doc h2 { font-size: 24px; margin-top: 36px; }
.doc h3 { font-size: 18px; margin: 22px 0 4px; }
.doc ol, .doc ul { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc .card { margin: 16px 0; }
.updated { color: var(--ink-soft); font-size: 14px; }

footer { border-top: 1px solid var(--edge); padding: 26px 0 40px; color: var(--ink-soft); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer a { color: var(--ink-soft); }

/* Placeholder until the user picks the contact address to publish. */
.todo { background: #ffe9a8; color: #5a4300; padding: 0 6px; border-radius: 4px; }
.card > :first-child { margin-top: 0; }
@media (max-width: 560px) {
  .top { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-start; }
}

/* STPZ LAB home: one card per app */
.grid.apps { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card.app { display: flex; gap: 16px; align-items: flex-start; }
.appicon { width: 72px; height: 72px; border-radius: 17px; flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.appicon.blank { background: var(--paper-deep); border: 1px dashed var(--edge); box-shadow: none; }
.card.app .plat { color: var(--ochre-deep); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; margin: 0 0 6px; }
.card.app p { margin-bottom: 12px; }
.card.app .app-body { display: flex; flex-direction: column; align-self: stretch; flex: 1; }
.card.app h3 a { color: inherit; text-decoration: none; }
.card.app .more { color: var(--ink-soft); font-weight: 700; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.card.app .more:hover { color: var(--ink); }
.btn.small { padding: 7px 16px; font-size: 14.5px; }
.store-badge { display: inline-flex; align-items: center; transition: transform 0.2s ease; }
.store-badge img { display: block; height: 48px; width: auto; }
.store-badge.small img { height: 36px; }
.store-badge:hover { transform: translateY(-2px); }
/* STPZKB: the 10 stages */
.grid.stages { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width: 1000px) { .grid.stages { grid-template-columns: repeat(5, 1fr); } }   /* 2 rows of 5 */
.grid.stages h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 17px; }
.grid.stages p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none;
  border-radius: 999px; background: var(--ochre); color: #fff; font-size: 14px; font-weight: 800; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; padding-top: 4px; }
.card-foot .btn { margin: 0; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--edge); border-radius: 999px; padding: 3px 12px; }

/* Product pages: the app's own links under the site header */
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-bottom: 6px; font-size: 15px; border-bottom: 1px solid var(--edge); }
.subnav b { margin-right: 6px; }
.subnav a { color: var(--ink-soft); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--ochre); }

/* ---- Motion ---------------------------------------------------------- */
/* Blocks fade and lift in as they scroll into view (assets/site.js adds .in). */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal].d1 { transition-delay: 0.08s; }
[data-reveal].d2 { transition-delay: 0.16s; }
[data-reveal].d3 { transition-delay: 0.24s; }

/* The hero comes in on load. */
.hero > * { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero > :nth-child(2) { animation-delay: 0.08s; }
.hero > :nth-child(3) { animation-delay: 0.16s; }
.hero > :nth-child(4) { animation-delay: 0.24s; }
.hero > :nth-child(5) { animation-delay: 0.32s; }
.hero > :nth-child(n+6) { animation-delay: 0.4s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* The ochre rule from the app's title pulses at 128 BPM, like the promo video. */
.rule { animation: pulse 0.46875s ease-out infinite; transform-origin: center; }
@keyframes pulse { 0% { transform: scaleX(1.6); } 60%, 100% { transform: scaleX(1); } }

/* A slow warm glow behind the hero. */
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -10% -20% auto; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(201, 144, 58, 0.18), transparent 70%);
  animation: glow 9s ease-in-out infinite alternate;
}
@keyframes glow { from { transform: translateX(-12%) scale(1); } to { transform: translateX(12%) scale(1.15); } }

/* Cards and screenshots lift a little under the pointer. */
.card, .device, .window { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease; }
.card.app:hover, .grid .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.device:hover, .window:hover { transform: translateY(-4px) scale(1.01); }
.btn { transition: transform 0.2s ease, background 0.2s ease; }
.btn:not([aria-disabled="true"]):hover { transform: translateY(-2px); }
.chips li { transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.chips li:hover { background: var(--ochre); color: #fff; transform: translateY(-2px); }

/* Promo video in the STPZMX hero, with a sound button. */
.promo { position: relative; }
.promo video { display: block; width: 100%; height: auto; border-radius: clamp(8px, 1.8vw, 20px); background: #000; }
.sound {
  position: absolute; right: clamp(12px, 2.4vw, 26px); top: clamp(12px, 2.4vw, 26px);
  border: 0; border-radius: 999px; padding: 10px 18px; font: 700 15px var(--font); cursor: pointer;
  background: var(--ochre); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: nudge 2.4s ease-in-out infinite;
}
.sound.on { background: var(--ink); color: var(--paper); animation: none; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
/* The glow reaches past the edges; never let it widen the page. */
html, body { overflow-x: clip; }
/* Temporary tile for an app whose icon is not made yet. */
.appicon.blank { display: grid; place-items: center; background: linear-gradient(145deg, #2b2d31, #1a1c1f); border: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.appicon.blank span { color: var(--ochre); font-weight: 800; font-size: 15px; letter-spacing: 0.12em; }

/* ---- Home page --------------------------------------------------------- */
.hero.home { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; text-align: left; padding: 56px 0 40px; }
.hero.home h1 { font-size: clamp(36px, 5.2vw, 62px); }
.hero.home .lead { margin: 0; max-width: 560px; }
.rule.left { margin-left: 0; transform-origin: left; }
.cta.left { justify-content: flex-start; }

/* Real screens stacked: the iPad, a Mac window in front, the three app icons floating. */
.stage { position: relative; aspect-ratio: 5 / 4; }
.stage .ipad { position: absolute; right: 0; top: 8%; width: 86%; margin: 0; }
.stage .mac { position: absolute; left: 0; bottom: 2%; width: 58%; border-radius: 10px; }
.stage .float { position: absolute; width: clamp(54px, 7vw, 86px); height: auto; border-radius: 22%; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22); animation: float 6s ease-in-out infinite; }
.stage .f0 { left: 0; top: 2%; animation-delay: -1s; }
.stage .f1 { right: 30%; top: -4%; animation-delay: -3s; }
.stage .f2 { right: -3%; bottom: 4%; animation-delay: -5s; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }

/* First release: STPZMX */
.featured { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; background: var(--card); border: 1px solid var(--edge); border-radius: 28px; padding: clamp(22px, 4vw, 48px); margin: 24px 0; }
.featured .eyebrow { text-align: left; }
.featured h2 { margin-top: 8px; }
.featured .device { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 6px; }
.stat { border-left: 3px solid var(--ochre); padding: 2px 0 2px 12px; }
.stat b { display: block; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; }
.stat span { display: block; font-size: 14px; color: var(--ink-soft); line-height: 1.35; margin-top: 4px; }

/* Contact */
.contact-band { text-align: center; background: linear-gradient(135deg, rgba(201, 144, 58, 0.16), rgba(201, 144, 58, 0.04)); border: 1px solid var(--edge); border-radius: 28px; padding: clamp(28px, 5vw, 56px) 20px; margin: 24px 0 56px; }
.contact-band p { font-size: 19px; margin: 6px 0 0; }

@media (max-width: 860px) {
  .hero.home, .featured { grid-template-columns: 1fr; }
  .hero.home { text-align: center; gap: 28px; }
  .hero.home .lead { margin: 0 auto; }
  .rule.left { margin-left: auto; transform-origin: center; }
  .cta.left { justify-content: center; }
  .stage { max-width: 560px; width: 100%; margin: 0 auto; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
}
