/* barkatlas.app: the explorer's world at night. Forest, brass, field paper, lantern glow.
   Layout: one centred column (max 1180px) of full-bleed bands; cards on paper or leather. */
:root {
  color-scheme: dark;
  --night: #07140f;
  --forest: #0c231b;
  --forest-2: #123a2c;
  --moss: #2f7a55;
  --paper: #f1e3c2;
  --paper-light: #fbf5e6;
  --cream: #f6ecd2;
  --cream-soft: rgba(246, 236, 210, 0.74);
  --ink: #2e2213;
  --ink-soft: #6a5638;
  --brass: #e2b04a;
  --brass-light: #fff0b8;
  --brass-dark: #6e4710;
  --lantern: #ffcf6b;
  --danger: #b23a2e;
  --brass-grad: linear-gradient(160deg, #fff0b8 0%, #e2b04a 38%, #a8721f 78%, #6e4710 100%);
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --hand: 'Caveat', 'Segoe Script', cursive;
  --body: 'Nunito Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--night); color: var(--cream); font-family: var(--body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--lantern); }
a:hover { color: var(--brass-light); }
:focus-visible { outline: 3px solid var(--lantern); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.1; text-wrap: balance; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
.eyebrow { font-family: var(--display); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.78rem; color: var(--brass); }
.hand { font-family: var(--hand); font-weight: 700; color: var(--lantern); }
.lead { font-size: 1.18rem; color: var(--cream-soft); max-width: 60ch; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.gold-text { background: var(--brass-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- nav ---------- */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; backdrop-filter: blur(14px); background: rgba(7, 20, 15, 0.72); border-bottom: 1px solid rgba(226, 176, 74, 0.18); }
.nav .wrap { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand b { font-family: var(--display); font-weight: 900; letter-spacing: 0.06em; font-size: 1.15rem; }
.brand span { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); display: block; margin-top: -3px; }
.nav .spacer { flex: 1; }
.lang { appearance: none; background: rgba(255, 255, 255, 0.06); color: var(--cream); border: 1px solid rgba(226, 176, 74, 0.35); border-radius: 999px; padding: 7px 30px 7px 14px; font: inherit; font-size: 0.9rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
.lang option { color: #111; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; font-family: var(--display); font-weight: 900; letter-spacing: 0.04em;
  font-size: 1.02rem; text-decoration: none; cursor: pointer; border: 0; transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s; }
.btn-brass { background: var(--brass-grad); color: #3a2406; box-shadow: 0 10px 30px rgba(226, 176, 74, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); border: 1px solid #5e3c0c; }
.btn-brass:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(255, 207, 107, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6); color: #3a2406; }
.btn-ghost { background: transparent; color: var(--brass-light); border: 2px solid rgba(226, 176, 74, 0.6); }
.btn-ghost:hover { background: rgba(226, 176, 74, 0.1); color: var(--brass-light); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- bands ---------- */
section { position: relative; padding-block: clamp(64px, 9vw, 120px); }
.band-paper { background: var(--paper) url('/img/paper.jpg') center / 700px; color: var(--ink); }
.band-paper .lead { color: var(--ink-soft); }
.band-paper .eyebrow { color: #8a5a1c; }
.band-leather { background: #2a170b url('/img/leather.jpg') center / 600px; }
.band-leather::before { content: ''; position: absolute; inset: 10px; border: 1.5px dashed rgba(233, 199, 140, 0.45); border-radius: 18px; pointer-events: none; }

/* ---------- reveal on scroll (content is visible without JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
}

/* ---------- cards ---------- */
.card { background: var(--paper-light) url('/img/paper.jpg') center / 600px; color: var(--ink); border-radius: var(--radius); border: 2px solid var(--brass); box-shadow: var(--shadow); padding: 26px; }
.card-dark { background: rgba(12, 35, 27, 0.78); border: 1px solid rgba(226, 176, 74, 0.28); border-radius: var(--radius); padding: 26px; }
.grid { display: grid; gap: 22px; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- phone frame ---------- */
.phone { width: min(300px, 70vw); aspect-ratio: 9 / 19.2; border-radius: 42px; padding: 12px; background: linear-gradient(145deg, #2b2b2e, #0b0b0d); box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 2px rgba(255, 255, 255, 0.08); position: relative; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 32px; }
.phone::after { content: ''; position: absolute; top: 20px; left: 50%; width: 76px; height: 20px; margin-left: -38px; border-radius: 999px; background: #000; }

/* ---------- form ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label, .label { font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.field small { color: var(--ink-soft); font-size: 0.85rem; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 2px solid rgba(106, 86, 56, 0.35); background: #fffdf6; color: var(--ink); font: inherit; font-size: 1rem; }
.input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 4px rgba(226, 176, 74, 0.25); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255, 253, 246, 0.7); border: 1.5px solid rgba(106, 86, 56, 0.25); margin-bottom: 10px; cursor: pointer; color: var(--ink); line-height: 1.45; font-size: 0.97rem; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: #2f7a55; flex-shrink: 0; }
.error { color: #ffd4cc; background: rgba(178, 58, 46, 0.85); padding: 12px 16px; border-radius: 12px; font-weight: 800; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
footer { background: #040b08; color: rgba(246, 236, 210, 0.6); font-size: 0.9rem; padding-block: 48px 36px; border-top: 1px solid rgba(226, 176, 74, 0.2); }
footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
footer a { color: rgba(246, 236, 210, 0.85); text-decoration: none; display: block; margin: 4px 0; }
footer a:hover { color: var(--lantern); }
footer h4 { font-family: var(--display); color: var(--brass); letter-spacing: 0.15em; font-size: 0.78rem; text-transform: uppercase; margin: 0 0 8px; }
footer .fine { margin-top: 30px; font-size: 0.8rem; color: rgba(246, 236, 210, 0.45); }

/* ---------- legal pages ---------- */
.doc { max-width: 820px; margin: 0 auto; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.doc h2 { font-size: 1.35rem; margin: 34px 0 10px; color: #8a5a1c; }
.doc p, .doc li { color: var(--ink); margin: 0 0 12px; }
.doc .note { background: rgba(226, 176, 74, 0.18); border-left: 4px solid var(--brass); padding: 12px 16px; border-radius: 8px; font-size: 0.95rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav .wrap { height: 60px; gap: 8px; }
  .brand span { display: none; }
  .nav .btn { display: none; }
}
/* grid and flex children may shrink below their content (stops long words widening the page) */
.grid > *, .wrap > * { min-width: 0; }
h1, h2, h3, p, li, summary { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .orbit.o1 { left: 0; } .orbit.o2 { right: 0; width: 120px; } .orbit.o3 { left: 4%; width: 96px; }
  .stage { height: 480px; }
}
.band-paper a, .card a, .check a { color: #8a5a1c; font-weight: 800; }
.band-paper a.btn, .card a.btn { color: #3a2406; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(zh) h1, :lang(zh) h2, :lang(ko) h1, :lang(ko) h2 { word-break: auto-phrase; }
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 { word-break: keep-all; }
