/* Firefly Jar website: the app's summer-night palette (ui/theme/Color.kt), dark only.
   No inline styles anywhere (CSP style-src 'self'); RTL pages work through logical properties. */
:root {
  color-scheme: dark;
  --night: #0B1026;        /* NightDeep */
  --night-mid: #141B3D;    /* NightMid */
  --horizon: #26305E;      /* NightHorizon */
  --card: #161D40;
  --card-soft: rgba(22, 29, 64, 0.72);
  --ink: #DCE4FF;          /* Mist */
  --ink-soft: #A9B4DA;     /* MistSoft, lifted for 4.5:1 on --card */
  --line: rgba(220, 228, 255, 0.16);
  --glow: #FFE066;         /* Glow */
  --glow-deep: #FFB84D;    /* GlowDeep */
  --grass: #0A1A1E;
  --radius: 22px;
  --radius-lg: 32px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round";
  --script: system-ui;
  --measure: 66ch;
}
/* Han glyph forms differ by language, so pick the right font family per page. */
:lang(ja) { --script: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP"; }
:lang(zh-Hans) { --script: "PingFang SC", "Microsoft YaHei", "Noto Sans SC"; }
:lang(zh-Hant) { --script: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC"; }
:lang(ko) { --script: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR"; }
:lang(th) { --script: "Thonburi", "Leelawadee UI", "Noto Sans Thai"; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--script), "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
  /* A faint field of stars over the night gradient; pure CSS, so no extra requests. */
  background:
    radial-gradient(1.5px 1.5px at 12% 8%, rgba(255, 233, 168, 0.9), transparent 60%),
    radial-gradient(1px 1px at 27% 22%, rgba(220, 228, 255, 0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 5%, rgba(220, 228, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 63% 17%, rgba(255, 233, 168, 0.8), transparent 60%),
    radial-gradient(2px 2px at 78% 9%, rgba(220, 228, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 91% 26%, rgba(220, 228, 255, 0.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 7% 38%, rgba(220, 228, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 55% 33%, rgba(255, 233, 168, 0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 85% 44%, rgba(220, 228, 255, 0.5), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-mid) 55%, var(--horizon) 100%) fixed;
  background-color: var(--night);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--glow); text-underline-offset: 3px; }
a:hover { color: #FFF4C2; }
h1, h2, h3 {
  font-family: var(--round), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--script), sans-serif;
  line-height: 1.2; margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); font-weight: 800; }
:lang(ja) :is(h1, h2, .lead, figcaption) { word-break: auto-phrase; }
h2 { font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
.lead { color: var(--ink-soft); font-size: 1.12rem; max-width: var(--measure); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 10px; z-index: 30; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; border-radius: 8px; }

/* Header ---------------------------------------------------------------------------------- */
.top {
  position: relative; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 12px 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-inline-end: auto;
  font-family: var(--round), -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 800; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--glow); }
.brand img { border-radius: 12px; box-shadow: 0 0 18px rgba(255, 224, 102, 0.25); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 999px; font-weight: 650; color: var(--ink); text-decoration: none; }
.nav a:hover { background: var(--card-soft); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.tag {
  display: inline-block; margin-inline-start: 2px; padding: 0 5px; border-radius: 6px; vertical-align: 1px;
  font-size: 0.68em; font-weight: 700; line-height: 1.6; color: var(--ink-soft); background: var(--night);
}

@media (max-width: 640px) {
  .lang-menu { order: 1; }
  .nav { order: 2; flex-basis: 100%; }
  .nav a { padding: 6px 10px; }
}

.lang-menu summary {
  list-style: none; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-weight: 700; white-space: nowrap;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { box-shadow: inset 0 0 0 2px var(--glow); }
.lang-menu ul {
  position: absolute; inset-inline-end: 16px; top: calc(100% - 4px); z-index: 20;
  width: min(600px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px;
  margin: 0; padding: 10px; list-style: none;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.lang-menu li a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.lang-menu li a:hover { background: var(--night-mid); }
.lang-menu li a[aria-current="true"] { color: var(--glow); background: var(--night); }

/* Layout ---------------------------------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; }
section { margin: 48px 0; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 24px 0 0; }
.btn {
  display: inline-block; padding: 14px 26px; border-radius: 999px; font-weight: 800; font-size: 1.05rem;
  text-decoration: none; color: var(--night); background: var(--glow); box-shadow: 0 0 28px rgba(255, 224, 102, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { color: var(--night); transform: translateY(-2px); box-shadow: 0 0 36px rgba(255, 224, 102, 0.5); }
.btn-soft { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover { color: var(--glow); box-shadow: inset 0 0 0 1px var(--glow); }
/* Until the app is on Google Play, the store button is a quiet label instead of a link. */
.soon {
  display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 750;
  color: var(--glow); background: var(--card-soft); box-shadow: inset 0 0 0 1px rgba(255, 224, 102, 0.45);
}

/* Hero ------------------------------------------------------------------------------------ */
.hero {
  position: relative; display: grid; gap: 24px; align-items: center; margin-top: 8px; padding: 32px 20px 0; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 60% 45% at 72% 100%, rgba(255, 184, 77, 0.22), transparent 70%),
    radial-gradient(circle at 14% 18%, rgba(255, 244, 194, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(11, 16, 38, 0.2), rgba(38, 48, 94, 0.55));
  box-shadow: inset 0 0 0 1px var(--line);
}
/* The meadow silhouette along the bottom edge. */
.hero::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 64px; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 100%, var(--grass) 60%, transparent 61%);
}
.hero h1 { color: var(--glow); text-shadow: 0 0 24px rgba(255, 224, 102, 0.35); }
.hero .lead { color: var(--ink); font-weight: 600; }
.hero-text { position: relative; z-index: 1; }
.hero-art { position: relative; z-index: 1; display: flex; justify-content: center; }
.phone {
  width: min(250px, 62vw); margin: 0 0 -70px; overflow: hidden;
  border: 8px solid #1E2650; border-radius: 34px; background: var(--night); box-shadow: var(--shadow), 0 0 60px rgba(255, 224, 102, 0.18);
}
.hero-icon { width: min(240px, 60vw); margin: 0 auto 48px; border-radius: 48px; box-shadow: 0 0 60px rgba(255, 224, 102, 0.3); }

@media (min-width: 820px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; padding: 48px 48px 0; }
  .hero-text { padding-bottom: 64px; }
  .phone { width: 270px; }
}

/* Intro ----------------------------------------------------------------------------------- */
.intro { text-align: center; margin-top: 96px; }
.intro .lead { margin-inline: auto; color: var(--ink); }

/* Features -------------------------------------------------------------------------------- */
.features { display: grid; gap: 16px; }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { margin: 0; padding: 22px; background: var(--card-soft); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); }
.feature h2 { font-size: 1.02rem; color: var(--glow); letter-spacing: 0.02em; }
.feature p { margin: 0; color: var(--ink-soft); }
.feature ul { margin: 0; padding: 0; list-style: none; }
.feature li { position: relative; padding-inline-start: 1.25em; margin: 0 0 0.5em; color: var(--ink-soft); }
.feature li::before {
  content: ""; position: absolute; inset-inline-start: 0.15em; top: 0.62em;
  width: 0.45em; height: 0.45em; border-radius: 50%; background: var(--glow); box-shadow: 0 0 6px var(--glow);
}

/* A firefly: a bright core in its species' glow colour (core/Species.kt). */
.glow {
  --c: #FFB84D; --halo: rgba(255, 184, 77, 0.32);
  display: block; width: 56px; height: 56px; margin-bottom: 10px; border-radius: 50%;
  background: radial-gradient(circle, #FFFDF0 0 11%, var(--c) 19% 25%, var(--halo) 42%, transparent 70%);
}
.glow--big { width: 120px; height: 120px; margin: 0 auto 16px; }
.glow--amber { --c: #FFB84D; --halo: rgba(255, 184, 77, 0.32); }
.glow--gold { --c: #FFD700; --halo: rgba(255, 215, 0, 0.3); }
.glow--teal { --c: #5EE6D8; --halo: rgba(94, 230, 216, 0.3); }
.glow--violet { --c: #B58CFF; --halo: rgba(181, 140, 255, 0.32); }
.glow--rain { --c: #9FD8FF; --halo: rgba(159, 216, 255, 0.3); }
.glow--dawn { --c: #FF9EC4; --halo: rgba(255, 158, 196, 0.3); }
.glow--ember { --c: #FF7A59; --halo: rgba(255, 122, 89, 0.3); }
.glow--moon { --c: #FFF4C2; --halo: rgba(255, 244, 194, 0.28); }
@media (prefers-reduced-motion: no-preference) {
  .glow { animation: blink 3.2s ease-in-out infinite; }
  .feature:nth-child(2n) .glow { animation-delay: -1.1s; }
  .feature:nth-child(3n) .glow { animation-delay: -2.2s; }
  @keyframes blink { 50% { opacity: 0.55; transform: scale(0.92); } }
}

/* Screenshots ----------------------------------------------------------------------------- */
.shots h2 { text-align: center; }
.shot-strip {
  display: flex; gap: 16px; margin: 0; padding: 8px 4px 20px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
}
.shot-strip li { flex: 0 0 min(210px, 60vw); scroll-snap-align: center; }
.shot-strip figure { margin: 0; }
.shot { border: 6px solid #1E2650; border-radius: 26px; box-shadow: var(--shadow); background: var(--night); }
.shot-strip figcaption { margin-top: 10px; text-align: center; font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
@media (min-width: 1100px) { .shot-strip { justify-content: center; } .shot-strip li { flex-basis: 160px; } }

/* Outro ----------------------------------------------------------------------------------- */
.outro {
  display: grid; justify-items: center; text-align: center; padding: 32px 20px;
  background: var(--card-soft); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line);
}
.outro-line { margin: 0; font-family: var(--round), -apple-system, "Segoe UI", Roboto, var(--script), sans-serif; font-weight: 800; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); }
.outro .cta { justify-content: center; }

/* Legal pages ----------------------------------------------------------------------------- */
.prose {
  max-width: 820px; margin: 16px auto 0; padding: clamp(20px, 4vw, 44px);
  background: var(--card); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line);
}
.prose h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); color: var(--glow); }
.prose h2 { font-size: 1.3rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; color: var(--glow-deep); }
.prose ul { padding-inline-start: 1.3em; }
.prose li { margin-bottom: 0.35em; }
.updated { color: var(--ink-soft); font-weight: 600; }
.table { overflow-x: auto; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; min-width: 480px; }
th, td { text-align: start; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--night-mid); }
code { font-size: 0.92em; padding: 1px 5px; border-radius: 6px; background: var(--night); }
.notfound { text-align: center; }
.notfound .cta { justify-content: center; }

/* Footer ---------------------------------------------------------------------------------- */
.foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; color: var(--ink-soft); font-size: 0.95rem; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--glow); }
