/* AmbyPen site — shared styles. Dark, with the Ambside rainbow as the accent. */

:root {
  --bg: #0d0f15;
  --bg-2: #12151e;
  --card: #161a25;
  --card-2: #1c2130;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eceef5;
  --muted: #9aa3b8;
  --faint: #6b7489;
  --accent: #4f8cff;

  --c1: #00e5c0; --c2: #1ed73c; --c3: #f5c400; --c4: #ff7a00; --c5: #ff1e8c; --c6: #a020f0;
  --rainbow: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6));

  --new: #4f8cff;
  --improved: #14b8a6;
  --fixed: #f97316;
  --announce: #a78bfa;

  --radius: 16px;
  --max: 1160px;
  --font: "Inter", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[data-lang="th"] body { line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
html[data-lang="th"] h1, html[data-lang="th"] h2, html[data-lang="th"] h3 { line-height: 1.35; letter-spacing: 0; }

/* One language at a time: every translatable element carries lang="th" or lang="en". */
html[data-lang="th"] [lang="en"]:not(html) { display: none !important; }
html[data-lang="en"] [lang="th"]:not(html) { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.rainbow-text {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--rainbow); }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(13, 15, 21, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: var(--muted); font-size: 15px; transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px;
  background: var(--bg-2);
}
.lang-toggle button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--card-2); color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  transition: transform .15s, background .15s, border-color .15s; cursor: pointer;
}
.btn:hover { transform: translateY(-1px); background: var(--card-2); border-color: rgba(255,255,255,.22); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary {
  border: 0; color: #0b0d12;
  background: linear-gradient(135deg, #ffffff, #dfe6ff);
  box-shadow: 0 8px 30px rgba(120, 140, 255, 0.25);
}
.btn-primary:hover { background: #fff; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.2; }
.btn-primary small { color: #4b5568; }
.btn .stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }

/* ── Hero ── */
.hero { position: relative; padding: 84px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 820px; height: 820px;
  background:
    radial-gradient(closest-side, rgba(160, 32, 240, .28), transparent 70%) 60% 30% / 70% 70% no-repeat,
    radial-gradient(closest-side, rgba(255, 30, 140, .22), transparent 70%) 20% 60% / 60% 60% no-repeat,
    radial-gradient(closest-side, rgba(0, 229, 192, .18), transparent 70%) 80% 80% / 60% 60% no-repeat;
  filter: blur(10px); pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.2vw, 64px); font-weight: 800; margin: 18px 0 18px; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 33em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--faint); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--c2); }

/* Hero illustration: a fake app window with live-looking annotations + the AmbyPen toolbar. */
.stage { position: relative; }
.mock-window {
  position: relative; border-radius: 14px; overflow: hidden; background: #f6f7fb;
  box-shadow: 0 40px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
}
.mock-bar { height: 34px; background: #e7e9f0; display: flex; align-items: center; gap: 7px; padding: 0 14px; }
.mock-bar i { width: 11px; height: 11px; border-radius: 50%; background: #c9cdd8; display: block; }
.mock-art { display: block; width: 100%; height: auto; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease forwards; }
.draw.d2 { animation-delay: .8s; } .draw.d3 { animation-delay: 1.5s; } .draw.d4 { animation-delay: 2.1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ink-text { opacity: 0; animation: fade-in .4s ease 2.6s forwards; }
@keyframes fade-in { to { opacity: 1; } }

.mock-toolbar {
  position: absolute; right: -22px; top: 50%; transform: translateY(-50%);
  width: 52px; padding: 8px 6px; border-radius: 16px;
  background: rgba(28, 28, 33, 0.96); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.mock-toolbar .grip { width: 18px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); margin: 2px 0 6px; }
.mock-toolbar .swatch { width: 22px; height: 22px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px rgba(255,255,255,.25); margin-bottom: 6px; }
.mock-toolbar .tb { width: 38px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #e9ebf2; }
.mock-toolbar .tb svg { width: 18px; height: 18px; }
.mock-toolbar .tb.on { background: #2f6fdb; }
.mock-toolbar .rec { color: #f87171; }
.mock-toolbar hr { width: 26px; border: 0; border-top: 1px solid rgba(255,255,255,.14); margin: 4px 0; }

/* ── Sections ── */
section { padding: 88px 0; }
.section-head { max-width: 700px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 800; margin: 14px 0 12px; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: border-color .2s, transform .2s;
}
.feature:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; margin: 0; }
.feature ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; }

.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.steps { counter-reset: step; display: grid; gap: 18px; margin-top: 26px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; background: var(--card); border: 1px solid var(--line-2);
}
.step h3 { font-size: 17px; margin: 2px 0 4px; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }
kbd {
  display: inline-block; font-family: "Inter", ui-monospace, monospace; font-size: 13px; font-weight: 600;
  padding: 2px 8px; border-radius: 7px; background: var(--card-2); border: 1px solid var(--line-2);
  border-bottom-width: 2px; color: var(--text); white-space: nowrap;
}
.shot {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
}

.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.key-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.key-row span:first-child { color: var(--muted); }

/* ── Download ── */
.download { background: linear-gradient(180deg, var(--bg), var(--bg-2)); }
.dl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.dl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; }
.dl-card.featured::before {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius); padding: 1px;
  background: var(--rainbow);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.dl-card h3 { font-size: 20px; margin-bottom: 6px; }
.dl-card p { color: var(--muted); font-size: 15px; }
.dl-card .btn { margin-top: 8px; width: 100%; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(30, 215, 60, .14); color: #4ade80; margin-bottom: 14px; }
.reqs { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.reqs b { color: var(--text); font-weight: 600; }
.hash { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--faint); word-break: break-all; margin-top: 12px; }

/* ── FAQ ── */
.faq { max-width: 800px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.site-footer a:hover { color: var(--text); }
.rainbow-rule { height: 3px; background: var(--rainbow); opacity: .9; }

/* ── Changelog ── */
.cl-hero { padding: 64px 0 28px; border-bottom: 1px solid var(--line); }
.cl-hero .wrap { max-width: 860px; }
.cl-hero h1 { font-size: clamp(34px, 4.4vw, 50px); font-weight: 800; margin: 14px 0 10px; }
.cl-stats { color: var(--faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cl-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.chip {
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip[aria-pressed="true"] { background: var(--card-2); color: var(--text); border-color: rgba(255,255,255,.28); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.cl-list { max-width: 860px; margin: 0 auto; padding: 36px 24px 80px; }
.release { display: grid; grid-template-columns: 170px 1fr; gap: 28px; position: relative; padding-bottom: 46px; }
.release::before { content: ""; position: absolute; left: 182px; top: 10px; bottom: 0; width: 1px; background: var(--line-2); }
.release:last-child::before { bottom: 46px; }
.rel-side { text-align: right; padding-top: 2px; }
.rel-version { display: inline-block; font-weight: 800; font-size: 18px; }
.rel-date { color: var(--faint); font-size: 14px; }
.rel-upcoming { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; color: #fbbf24; background: rgba(251,191,36,.12); padding: 2px 9px; border-radius: 999px; }
.rel-body { position: relative; }
.rel-body::before {
  content: ""; position: absolute; left: -21.5px; top: 8px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--c5); box-shadow: 0 0 0 4px var(--bg);
}
.release:first-child .rel-body::before { background: var(--rainbow); border-color: transparent; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; }
.entry h3 { font-size: 18px; margin: 10px 0 6px; }
.entry ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.entry li { margin: 3px 0; }
.entry p { color: var(--muted); font-size: 15px; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.new { color: #8fb4ff; background: rgba(79, 140, 255, .14); }
.badge.improved { color: #5eead4; background: rgba(20, 184, 166, .14); }
.badge.fixed { color: #fdba74; background: rgba(249, 115, 22, .14); }
.badge.announcement { color: #c4b5fd; background: rgba(167, 139, 250, .14); }

/* ── Prose (privacy) ── */
.prose { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.prose h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; margin: 12px 0 8px; }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose p, .prose li { color: #c9cfdd; }
.prose ul { padding-left: 22px; }
.prose a { color: #8fb4ff; }
.prose a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero .wrap, .split { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .mock-toolbar { right: 8px; transform: translateY(-50%) scale(.85); }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  section { padding: 64px 0; }
  .hero { padding: 48px 0 24px; }
  .features, .dl-grid, .keys { grid-template-columns: 1fr; }
  .header-actions .btn { display: none; }
  .release { grid-template-columns: 1fr; gap: 10px; }
  .release::before, .rel-body::before { display: none; }
  .rel-side { text-align: left; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .cl-list { padding: 28px 16px 64px; }
  .mock-toolbar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .draw { animation: none; stroke-dashoffset: 0; }
  .ink-text { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
}
