/* ============================================================================
   Cameo Image Studio — cameoimage.com
   Dark industrial theme. One stylesheet, no framework.
   ========================================================================== */

:root {
  --bg:            #0b0f1a;
  --bg-alt:        #0e1424;
  --surface:       #131a2b;
  --surface-2:     #182034;
  --border:        #253049;
  --border-soft:   #1c2438;

  --text:          #e8ecf5;
  --text-2:        #a4b0c8;
  --text-dim:      #74809a;

  --accent:        #3ba7c4;
  --accent-strong: #4fc3e0;
  --accent-ink:    #06212b;
  --accent-soft:   rgba(59, 167, 196, 0.14);

  --warn:          #e0a33b;
  --warn-soft:     rgba(224, 163, 59, 0.12);
  --ok:            #4ba86b;
  --danger:        #d4645f;

  --font:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 18px 44px rgba(0, 0, 0, 0.42);
  --maxw:      1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Language scripts that need a little more room to breathe */
html[lang="th"] body { line-height: 1.9; }
html[lang="ja"] body,
html[lang="ko"] body,
html[lang="zh"] body { line-height: 1.8; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 800px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 16px; }

:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ─────────────────────────── header ─────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 15, 26, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-row { display: flex; align-items: center; gap: 24px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; }

.nav-menu { display: flex; gap: 20px; margin-left: auto; }
/* nowrap + no shrinking: a bar that does not fit must OVERFLOW, because that is what
   app.js fitNav() measures. Let the links wrap or shrink and the overflow disappears —
   along with the only signal that the language needs the hamburger. */
.nav-menu a {
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  white-space: nowrap; flex: 0 0 auto;
}
.nav-menu a:hover { color: var(--text); text-decoration: none; }

/* Set by fitNav() when the labels no longer fit — any language, any width. */
.site-header.compact .nav-menu {
  display: none;
  position: absolute; top: 68px; left: 0; right: 0;
  flex-direction: column; gap: 0;
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  padding: 8px 24px 16px;
}
.site-header.compact .nav-menu.open { display: flex; }
.site-header.compact .nav-menu a { padding: 11px 0; border-top: 1px solid var(--border-soft); }
.site-header.compact .nav-toggle { display: block; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.lang-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  max-width: 165px;
}
.lang-select option { background: var(--surface); color: var(--text); }

.nav-toggle {
  display: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1.1rem; padding: 5px 11px; cursor: pointer;
}

/* ─────────────────────────── buttons ─────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.94rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }

.btn-accent { background: var(--accent-soft); color: var(--accent-strong); border-color: rgba(59, 167, 196, 0.4); }
.btn-accent:hover { background: rgba(59, 167, 196, 0.24); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent); }

.btn-sm { padding: 8px 14px; font-size: 0.87rem; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.win-icon { width: 21px; height: 21px; flex-shrink: 0; }
.btn-line1 { display: block; }
.btn-line2 { display: block; font-size: 0.78rem; font-weight: 400; opacity: 0.82; margin-top: 1px; }

/* ─────────────────────────── hero ─────────────────────────── */

.hero {
  padding: 86px 0 72px;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(59, 167, 196, 0.15), transparent 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 16px;
  font-size: 0.84rem; color: var(--text-2);
  margin: 0 0 26px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }

.hero-title {
  font-size: clamp(2rem, 5.2vw, 3.35rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 22px;
}
.hero-title .accent { color: var(--accent-strong); display: block; }

.hero-sub {
  max-width: 760px; margin: 0 auto 34px;
  font-size: 1.06rem; color: var(--text-2);
}

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }

.hero-note {
  max-width: 640px; margin: 0 auto;
  font-size: 0.86rem; color: var(--text-dim);
}

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 56px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 16px;
}
.stat b { display: block; font-size: 1.75rem; font-weight: 800; color: var(--accent-strong); letter-spacing: -0.02em; }
.stat span { display: block; font-size: 0.82rem; color: var(--text-2); margin-top: 5px; }

/* ─────────────────────────── sections ─────────────────────────── */

.section { padding: 84px 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }

.section-head { max-width: 720px; margin: 0 auto 54px; text-align: center; }
.section-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  letter-spacing: -0.02em; font-weight: 700; margin: 0 0 12px;
}
.section-head p { color: var(--text-2); margin: 0; font-size: 1rem; }

/* ─────────────────────────── pillars ─────────────────────────── */

.pillar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center;
  padding: 44px 0;
  border-top: 1px solid var(--border-soft);
}
.pillar:first-of-type { border-top: 0; padding-top: 0; }
.pillar.reverse .pillar-text { order: 2; }

.tag {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid rgba(59, 167, 196, 0.32);
  border-radius: 99px; padding: 3px 12px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.pillar h3 { font-size: 1.42rem; margin: 0 0 14px; letter-spacing: -0.015em; }
.pillar p { color: var(--text-2); margin: 0 0 18px; }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li {
  position: relative; padding-left: 27px; margin-bottom: 10px;
  font-size: 0.92rem; color: var(--text-2);
}
.checks li::before {
  content: ''; position: absolute; left: 4px; top: 0.62em;
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); opacity: 0.85;
}

.pillar-shot {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
}

/* ─────────────────────────── support matrix ─────────────────────────── */

.matrix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.matrix-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.matrix-card h3 { font-size: 1.06rem; margin: 0 0 16px; }
.matrix-card ul { list-style: none; padding: 0; margin: 0; }
.matrix-card li {
  padding: 8px 0; border-top: 1px solid var(--border-soft);
  font-size: 0.9rem; color: var(--text-2);
}
.matrix-card li:first-child { border-top: 0; }

/* ─────────────────────────── download ─────────────────────────── */

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.dl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
}
.dl-card.featured { border-color: rgba(59, 167, 196, 0.44); box-shadow: var(--shadow); }

.dl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.dl-card-head h3 { font-size: 1.18rem; margin: 0; }

.badge {
  background: var(--accent-soft); color: var(--accent-strong);
  border: 1px solid rgba(59, 167, 196, 0.34);
  border-radius: 99px; padding: 3px 12px;
  font-size: 0.78rem; font-weight: 600; font-family: var(--mono);
  white-space: nowrap;
}
.badge.alt { background: rgba(255, 255, 255, 0.05); color: var(--text-2); border-color: var(--border); }

.dl-card > p { color: var(--text-2); font-size: 0.93rem; margin: 0 0 20px; }

.dl-meta { display: flex; gap: 34px; margin: 0 0 22px; }
.dl-meta div { margin: 0; }
.dl-meta dt { font-size: 0.76rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.dl-meta dd { margin: 0; font-size: 1.04rem; font-weight: 600; font-family: var(--mono); }

.hash-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft);
  font-size: 0.78rem; color: var(--text-dim);
}
.hash-row code {
  flex: 1 1 240px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.74rem; color: var(--text-2);
}
.copy-btn {
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 11px; font-size: 0.76rem; font-family: inherit; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

.hash-hint { font-size: 0.79rem; color: var(--text-dim); margin: 10px 0 0; }

.notice {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.notice.warn { background: var(--warn-soft); border-color: rgba(224, 163, 59, 0.35); color: #f0cf95; margin-top: 26px; }
.notice.warn b { color: var(--warn); }
.notice.ok { background: rgba(75, 168, 107, 0.12); border-color: rgba(75, 168, 107, 0.4); color: #b7e3c5; }
.notice.err { background: rgba(212, 100, 95, 0.12); border-color: rgba(212, 100, 95, 0.4); color: #f0b5b2; }
.notice code { white-space: normal; word-break: break-all; }

/* ─────────────────────────── form ─────────────────────────── */

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.span2 { grid-column: 1 / -1; }

.field label { font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.field input, .field textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; font-family: inherit; font-size: 0.94rem;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field small { font-size: 0.79rem; color: var(--text-dim); }

.form-foot { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.privacy { font-size: 0.79rem; color: var(--text-dim); margin: 0; flex: 1 1 260px; }

/* Honeypot — off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* A download whose URL is not published yet must not look like a live link. */
.btn.is-pending {
  background: var(--surface-2); color: var(--text-dim);
  border-color: var(--border); cursor: default;
}
.btn.is-pending:hover { transform: none; background: var(--surface-2); }

#key-result { margin-top: 22px; }

/* ─────────────────────────── tables ─────────────────────────── */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.specs { width: 100%; border-collapse: collapse; min-width: 640px; }
.specs th, .specs td { padding: 15px 20px; text-align: left; font-size: 0.92rem; border-top: 1px solid var(--border-soft); }
.specs thead th {
  border-top: 0; background: var(--surface-2);
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim);
}
.specs tbody th { font-weight: 600; color: var(--text); width: 210px; }
.specs td { color: var(--text-2); }

/* ─────────────────────────── faq ─────────────────────────── */

.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.faq summary {
  padding: 18px 22px; cursor: pointer; font-weight: 600; font-size: 0.98rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent-strong); font-size: 1.3rem; font-weight: 400; flex-shrink: 0; }
.faq details[open] summary::after { content: '−'; }
.faq summary:hover { color: var(--accent-strong); }
.faq p { margin: 0; padding: 0 22px 20px; color: var(--text-2); font-size: 0.93rem; }

/* ─────────────────────────── footer ─────────────────────────── */

.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border-soft); padding: 48px 0 28px; }
.footer-row { display: flex; justify-content: space-between; gap: 36px; flex-wrap: wrap; }
.footer-note { color: var(--text-dim); font-size: 0.88rem; margin: 12px 0 0; max-width: 380px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--text-2); font-size: 0.9rem; }
.footer-legal {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-soft);
  font-size: 0.82rem; color: var(--text-dim);
}

/* ─────────────────────────── responsive ─────────────────────────── */

@media (max-width: 940px) {
  .nav-menu {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 11px 0; border-top: 1px solid var(--border-soft); }
  .nav-toggle { display: block; }

  .pillar { grid-template-columns: 1fr; gap: 28px; }
  .pillar.reverse .pillar-text { order: 0; }
  .matrix { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .hero { padding: 58px 0 52px; }
  .section { padding: 60px 0; }
  .form { grid-template-columns: 1fr; }
  .btn-lg { width: 100%; }
  .hero-actions { flex-direction: column; }
  .brand-name { display: none; }
  .dl-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
