/* Mini Robot Lab — site styles. Direction: light green brand (turtle palette), dark device with white OLED, IBM Plex. */
:root {
  /* light-green brand theme (palette from the Owner's turtle reference) */
  --bg: #f5f8ea;
  --bg-raised: #ffffff;
  --line: #dde5c4;
  --text: #25301a;
  --text-dim: #5f6b49;
  --lime: #bcd142;          /* turtle body — primary brand colour */
  --lime-deep: #8fa52a;
  --olive: #6f7d3b;         /* shell */
  --olive-dark: #46511f;    /* shell outline */
  --sky: #3f9fe6;           /* shell water — small accent */
  --pixel: #ffffff;         /* OLED pixels stay white on the black screen */
  --accent: var(--olive);
  --warn: #c77a0a;
  --max: 1160px;
  --head: 56px;
  --font: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
canvas { display: block; max-width: 100%; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; height: var(--head);
  background: rgb(245 248 234 / .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; height: 100%; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.brand-mark { width: 22px; height: 14px; border: 2px solid var(--olive-dark); background: var(--lime); border-radius: 4px; position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: 3px; width: 4px; height: 4px; background: var(--olive-dark); border-radius: 1px; }
.brand-mark::before { left: 4px; } .brand-mark::after { right: 4px; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--text-dim); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---------- type ---------- */
h1, h2, h3 { color: var(--olive-dark); margin: 0 0 18px; font-weight: 600; line-height: 1.12; letter-spacing: -.015em; }
h1 { font-size: clamp(44px, 8vw, 96px); }
h2 { font-size: clamp(32px, 5vw, 56px); }
h3 { font-size: 22px; }
p { margin: 0 0 16px; }
.lead { font-size: clamp(18px, 2.1vw, 22px); color: var(--text-dim); max-width: 34ch; }
.status { font-family: var(--mono); font-size: 13px; color: var(--olive); }
.status::before { content: "● "; color: var(--lime-deep); }
.note { font-size: 14px; color: var(--text-dim); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: border-color .2s, background .2s;
}
.btn:hover { border-color: var(--text-dim); }
.btn.primary { background: var(--lime); color: var(--olive-dark); border-color: var(--lime); }
.btn.primary:hover { background: var(--lime-deep); border-color: var(--lime-deep); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; translate: 0 24px; transition: opacity .8s var(--ease), translate .8s var(--ease); }
[data-reveal].is-in { opacity: 1; translate: 0 0; }

/* ---------- device illustration ---------- */
.devices { position: relative; display: grid; place-items: center; perspective: 900px; }
.device {
  --rx: 0deg; --ry: 0deg;
  width: min(290px, 70vw); padding: 22px 20px 26px; border-radius: 34px; position: relative;
  background: linear-gradient(160deg, #2a2a2e, #141416 60%, #0c0c0d);
  box-shadow: 0 30px 60px rgb(70 81 31 / .28), inset 0 1px 0 rgb(255 255 255 / .08);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: translate .9s var(--ease), scale .9s var(--ease), opacity .6s;
}
.device::before { /* keyring loop */
  content: ""; position: absolute; top: -26px; left: 50%; translate: -50% 0;
  width: 34px; height: 34px; border: 5px solid var(--olive); border-radius: 50%;
}
.device .screen { background: #000; border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 1px #1d1d20; position: relative; overflow: hidden; }
.device canvas { width: 100%; aspect-ratio: 2 / 1; image-rendering: pixelated; cursor: pointer; transition: filter 1.2s; }
.device .label { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: #5c5c62; }
.device .ripple { /* tap feedback */
  position: absolute; inset: 0; border-radius: 34px; pointer-events: none;
  box-shadow: 0 0 0 0 rgb(255 255 255 / .35); opacity: 0;
}
.device.tapping .ripple { animation: ripple .7s var(--ease); }
.device.wobble { animation: wobble .7s ease-in-out; }
@keyframes ripple { 0% { opacity: 1; box-shadow: 0 0 0 0 rgb(255 255 255 / .35); } 100% { opacity: 0; box-shadow: 0 0 0 26px rgb(255 255 255 / 0); } }
@keyframes wobble { 0%,100% { rotate: 0deg; } 20% { rotate: -9deg; } 40% { rotate: 8deg; } 60% { rotate: -6deg; } 80% { rotate: 3deg; } }

.device.peer { position: absolute; opacity: 0; translate: 40% 0; scale: .7; pointer-events: none; }
[data-mode="pair"] .device.main { translate: -30% 0; scale: .74; }
[data-mode="pair"] .device.peer { opacity: 1; translate: 30% 0; scale: .74; }
[data-mode="sleep"] .device.main canvas { filter: brightness(.35); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 104px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero .stage { padding: 30px 0; }
.hint { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-dim); }

/* ---------- scroll story ---------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; border-bottom: 1px solid var(--line); }
.story-stage { position: sticky; top: var(--head); height: calc(100vh - var(--head)); display: grid; place-items: center; }
.chapters { padding: 20vh 0; }
.chapter { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; opacity: .22; transition: opacity .5s; }
.chapter.is-active { opacity: 1; }
.chapter .step { font-family: var(--mono); font-size: 13px; color: var(--text-dim); margin-bottom: 14px; }
.chapter p { color: var(--text-dim); max-width: 36ch; font-size: 19px; }

/* ---------- pixel moment ---------- */
.pixels {
  padding: 120px 0; border-bottom: 1px solid var(--line);
  background-color: #eaf0d2; background-image: radial-gradient(rgb(70 81 31 / .16) 1px, transparent 1.4px);
  background-size: 14px 14px;
}
.pixels .giant { font-family: var(--mono); font-weight: 600; font-size: clamp(64px, 17vw, 230px); line-height: .9; letter-spacing: -.05em; margin: 0 0 28px; }
.pixels p { max-width: 40ch; color: var(--text-dim); font-size: 19px; }
.pixels b { color: var(--text); font-weight: 500; }

/* ---------- privacy ---------- */
.privacy { padding: 112px 0; border-bottom: 1px solid var(--line); }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.rules { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.rules li:last-child { border-bottom: 1px solid var(--line); }
.rules li::before { content: counter(r, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--text-dim); padding-top: 3px; }

/* ---------- datasheet ---------- */
.sheet { padding: 112px 0; border-bottom: 1px solid var(--line); }
.specs { width: 100%; border-collapse: collapse; font-size: 16px; }
.specs th, .specs td { text-align: left; padding: 15px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { width: 32%; font-weight: 400; font-family: var(--mono); font-size: 13px; color: var(--text-dim); text-transform: lowercase; padding-top: 18px; }
.table-scroll { overflow-x: auto; }

/* ---------- simple section ---------- */
.block { padding: 104px 0; border-bottom: 1px solid var(--line); }

/* ---------- lineup (home) ---------- */
.lineup { list-style: none; margin: 0; padding: 0; }
.lineup li { border-top: 1px solid var(--line); }
.lineup li:last-child { border-bottom: 1px solid var(--line); }
.lineup a, .lineup .row { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center; padding: 28px 0; text-decoration: none; }
.lineup .num { font-family: var(--mono); font-size: clamp(48px, 8vw, 88px); font-weight: 600; line-height: 1; letter-spacing: -.05em; color: #d3dcb0; transition: color .3s; }
.lineup a:hover .num { color: var(--lime-deep); }
.lineup b { display: block; font-size: 24px; font-weight: 600; }
.lineup .meta { color: var(--text-dim); font-size: 15px; }
.lineup .go { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.lineup a .go { color: var(--olive); }

/* ---------- flash center ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--text-dim); }
select { font: inherit; color: var(--text); background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px; padding: 16px 18px; background: var(--bg-raised); }
.callout.ok { border-left-color: var(--accent); }
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
ol.steps { padding-left: 22px; display: grid; gap: 10px; }
ol.steps > li { min-width: 0; }
code, pre { font-family: var(--mono); font-size: 14px; }
pre { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow-x: auto; }

/* ---------- footer ---------- */
footer { padding: 40px 0 56px; color: var(--text-dim); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero-grid, .privacy-grid, .two-col, .form-row { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 72px; }
  .story { grid-template-columns: 1fr; gap: 0; }
  .story-stage { order: -1; height: 46vh; z-index: 2; background: linear-gradient(var(--bg) 85%, transparent); }
  .story-stage .device { width: min(230px, 58vw); }
  .chapters { padding: 0 0 20vh; }
  .chapter { min-height: 60vh; justify-content: flex-start; padding-top: 4vh; }
  .lineup a, .lineup .row { grid-template-columns: 64px 1fr; }
  .lineup .go { grid-column: 2; }
  .pixels, .privacy, .sheet, .block { padding: 72px 0; }
  .nav { gap: 14px; font-size: 14px; }
}
@media (max-width: 420px) { .brand span { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; translate: none; transition: none; }
  .device, .device canvas, .chapter { transition: none; }
}

/* ---------- language switch ---------- */
.lang-toggle {
  font: 500 13px var(--mono); color: var(--olive-dark); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px;
}
.lang-toggle:hover { border-color: var(--olive); }
::selection { background: var(--lime); color: var(--olive-dark); }
a:not(.btn):not(.brand):not(.nav a) { text-decoration-color: var(--lime-deep); }

/* ---------- flash picker ---------- */
.picker {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(20px, 4vw, 36px); display: grid; gap: 26px;
  box-shadow: 0 24px 60px rgb(70 81 31 / .08);
}
.picker-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.picker-title { font-size: 24px; margin: 0; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim);
  background: #eef3da; border-radius: 999px; padding: 6px 12px 6px 10px;
}
.badge::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime-deep); }
.badge.no::before { background: var(--warn); }
.chips-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.chips-group legend { font-size: 14px; color: var(--text-dim); padding: 0; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; font-size: 15px;
  border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.chip span:hover { border-color: var(--olive); }
.chip span:active { transform: scale(.97); }
.chip input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--olive-dark); font-weight: 500; }
.chip input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 2px; }
.chips .none { color: var(--text-dim); font-size: 15px; padding: 10px 0; }
.empty { display: flex; gap: 18px; align-items: center; background: #f1f5e1; border-radius: 18px; padding: 20px 22px; }
.empty b { display: block; color: var(--olive-dark); font-weight: 600; margin-bottom: 2px; }
.empty p { margin: 0; color: var(--text-dim); font-size: 15px; }
.mini-oled { flex: none; width: 112px; padding: 7px; background: #121212; border-radius: 12px; box-shadow: 0 8px 20px rgb(70 81 31 / .2); }
.mini-oled canvas { width: 100%; aspect-ratio: 2 / 1; image-rendering: pixelated; }
