/* Stock Manager intro site. Colours follow the app's "warm clay" theme. */
:root {
  --bg: #f5f1ee;
  --card: #ffffff;
  --ink: #221d1a;
  --muted: #7a6f68;
  --line: #e8e1dc;
  --accent: #c0502e;
  --accent-soft: #f6e4dc;
  --green: #7a8f4e;
  --amber: #d87c2c;
  --violet: #7c6f9b;
  --radius: 22px;
  --max: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1715;
    --card: #26211e;
    --ink: #f3ede8;
    --muted: #b3a79e;
    --line: #3a332e;
    --accent: #e0714d;
    --accent-soft: #3b2820;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: clip; }
img, video { display: block; max-width: 100%; height: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "PingFang SC",
    "Noto Sans JP", "Noto Sans SC", "Segoe UI", sans-serif;
}

p, li, h3, summary { word-break: auto-phrase; }
h1, h2, h3 { text-wrap: balance; }
p, summary { text-wrap: pretty; }
li { text-wrap: balance; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
section { margin-top: 112px; }
h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  word-break: auto-phrase;
}
.sub { color: var(--muted); margin: 0 0 40px; }

/* Header */
header.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 18px; padding-bottom: 18px;
}
.brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 18px;
}
nav.lang { display: flex; gap: 4px; font-size: 14px; }
nav.lang a, nav.lang span { white-space: nowrap; padding: 6px 12px; border-radius: 999px; color: var(--muted); }
nav.lang span { background: var(--card); color: var(--ink); font-weight: 600; }

/* Buttons */
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1.2;
  cursor: pointer; transition: transform 0.2s var(--ease), filter 0.2s;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn span { white-space: nowrap; }
.btn .badge {
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 10;
  width: max-content; max-width: calc(100vw - 40px); padding: 14px 22px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-align: center;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px); transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Hero */
.hero {
  margin-top: 0;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  padding-top: 36px;
}
.eyebrow {
  display: inline-block; margin: 0 0 16px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700;
}
.hero h1 {
  font-size: clamp(36px, 5.6vw, 60px); line-height: 1.12; letter-spacing: -0.02em;
  margin: 0 0 20px; word-break: auto-phrase;
}
.hero h1 em { font-style: normal; color: var(--accent); white-space: nowrap; }
.nb { white-space: nowrap; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 34em; }

.hero-visual { position: relative; display: flex; justify-content: center; padding: 20px 0 40px; }
.device {
  width: 280px; flex: none;
  border-radius: 44px; padding: 8px;
  background: #1d1a18;
  box-shadow: 0 40px 80px -30px rgba(60, 30, 10, 0.45);
}
.device img, .device video { width: 100%; border-radius: 36px; background: #f5f1ee; }
.device video { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Hide the play glyph iOS Safari draws over a clip it will not autoplay. */
.device video::-webkit-media-controls,
.device video::-webkit-media-controls-start-playback-button,
.device video::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
.device.tilt { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(-1deg); }
}

.chips { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 16px;
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: 0 16px 36px -16px rgba(60, 30, 10, 0.4);
  white-space: nowrap;
  animation: chip 9s var(--ease) infinite both;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip.c1 { top: 16%; left: -2%; }
.chip.c1 .dot { background: var(--amber); }
.chip.c2 { top: 48%; right: -4%; animation-delay: 3s; }
.chip.c2 .dot { background: var(--green); }
.chip.c3 { bottom: 14%; left: 2%; animation-delay: 6s; }
.chip.c3 .dot { background: var(--accent); }
@keyframes chip {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); }
  6%, 30% { opacity: 1; transform: none; }
  38%, 100% { opacity: 0; transform: translateY(-8px) scale(0.98); }
}

/* Demo rows */
.demo {
  display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: center;
  background: var(--card); border-radius: 36px; padding: 48px 56px; margin-bottom: 28px;
}
.demo.flip { grid-template-columns: 300px 1fr; }
.demo.flip .device { order: -1; }
.demo .device { width: 300px; box-shadow: 0 30px 60px -30px rgba(60, 30, 10, 0.45); }
.kicker {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.demo h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.25; margin: 0 0 20px; word-break: auto-phrase; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 0 0 0 46px; margin: 0 0 16px; color: var(--muted);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}

/* Feature cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -24px rgba(60, 30, 10, 0.35); }
.card .ico { font-size: 28px; }
.card h3 { margin: 10px 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Self-hosting */
.panel { background: var(--card); border-radius: 36px; padding: 48px 56px; }
.panel > p { color: var(--muted); max-width: 46em; }
.flow {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin: 32px 0;
}
.flow .node {
  background: var(--bg); border-radius: 16px; padding: 14px 18px;
  font-weight: 600; text-align: center; min-width: 120px;
}
.flow .node small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.flow .arrow { color: var(--muted); font-size: 22px; }
.flow .node.opt { border: 2px dashed var(--line); background: transparent; }

/* Coming next */
.next-list {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px;
}
.next-list li {
  background: var(--card); border-radius: 18px; padding: 18px 20px 18px 48px; position: relative;
}
.next-list li::before {
  content: ""; position: absolute; left: 20px; top: 26px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--accent);
}

/* FAQ */
.faq details {
  background: var(--card); border-radius: 18px; margin-top: 12px; padding: 0 24px;
}
.faq details:first-of-type { margin-top: 28px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 32px 20px 0; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%); font-size: 24px; color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding: 0 0 20px; color: var(--muted); }

/* Final call to action */
.final-band {
  text-align: center; border-radius: 36px; padding: 64px 32px 48px;
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
}
.final-band h2 { margin-bottom: 28px; }
.final-band .cta { justify-content: center; }

footer {
  margin-top: 96px; border-top: 1px solid var(--line);
  padding-top: 28px; padding-bottom: 48px;
  color: var(--muted); font-size: 14px;
}
footer p { margin: 6px 0; }

/* Reveal on scroll. Only with JavaScript and when motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .device.tilt, .chip { animation: none; }
  .chip { opacity: 1; }
  .chip.c2, .chip.c3 { display: none; }
}

/* Tablet and phone */
@media (max-width: 900px) {
  section { margin-top: 80px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .chip.c1, .chip.c3 { left: 0; }
  .chip.c2 { right: 0; }
  .demo, .demo.flip { grid-template-columns: 1fr; padding: 28px 24px; gap: 28px; }
  .demo.flip .device { order: 0; }
  .demo .device { width: 260px; margin: 0 auto; }
  .grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 32px 24px; }
}
@media (max-width: 600px) {
  nav.lang a, nav.lang span { padding: 6px 8px; }
  .device { width: 230px; border-radius: 38px; padding: 7px; }
  .device img, .device video { border-radius: 31px; }
  .chip { font-size: 13px; padding: 8px 12px; }
  .chip.c1 { left: 0; }
  .chip.c2 { right: 0; }
  .grid { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; padding: 14px 16px; font-size: 15px; gap: 8px; }
  .final-band { padding: 48px 16px 36px; }
  .flow .arrow { display: none; }
}

/* Very narrow phones: the toast still says "coming soon" on tap. */
@media (max-width: 380px) {
  .btn .badge { display: none; }
}

/* Phones: each sentence of the toast gets its own line. */
@media (max-width: 600px) {
  .toast span { display: block; }
}
