/*
  Static landing (pre-Flutter). Paints instantly with system fonts so first-time
  visitors and crawlers see real content before the Flutter engine (main.dart.js +
  canvaskit.wasm + fonts, ~20MB) is ever fetched. Brand tokens mirror lib/theme/app_colors.dart.
*/
:root {
  --cream: #FDFBF6;
  --charcoal: #2A2723;
  --charcoal-light: #8A8175;
  --lime: #9BCB5C;
  --lime-light: #EFF6E0;
  --lime-dark: #4D7C0F;
  --outline: #EFE9DF;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Per-locale CJK stack: use each language's own native font (with a real bold) so
   kanji/kana don't render in a mismatched fallback and bold isn't synthesized. */
html[lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    YuGothic, Meiryo, sans-serif;
}
html[lang="ko"] body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", sans-serif;
}

#landing { min-height: 100vh; display: flex; flex-direction: column; }

/* Top nav */
.nav {
  border-bottom: 1px solid var(--outline);
}
.nav-inner {
  max-width: 480px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 4px;
}
.nav-link {
  color: var(--charcoal); font-weight: 700; font-size: 15px;
  text-decoration: none; padding: 8px 10px; border-radius: 8px;
}
.nav-link:hover { background: var(--lime-light); }
.nav-spacer { flex: 1; }

/* Language dropdown (globe + current label + chevron, menu with check on current) */
.lang { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--charcoal); font-size: 13px; font-weight: 600;
  padding: 8px; border-radius: 8px;
}
.lang-btn:hover { background: var(--lime-light); }
.lang-btn .globe { width: 18px; height: 18px; }
.lang-btn .chev { width: 16px; height: 16px; transition: transform .15s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20;
  min-width: 148px; margin: 0; padding: 6px; list-style: none;
  background: var(--white); border: 1px solid var(--outline);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.lang-menu[hidden] { display: none; }
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--charcoal); font-size: 14px; font-weight: 500;
}
.lang-menu a:hover { background: var(--lime-light); }
.lang-menu .check { width: 16px; flex: none; color: var(--lime-dark); font-weight: 700; }
.lang-menu a[aria-current="true"] { font-weight: 700; }

/* Content column */
.col { max-width: 480px; margin: 0 auto; padding: 32px 24px; width: 100%; }
main { flex: 1; }

/* Hero */
.hero { text-align: center; }
.logo {
  width: 200px; height: 200px; object-fit: contain;
}
.brand { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; margin: 20px 0 6px; }
.tagline { color: var(--charcoal-light); font-weight: 500; font-size: 14px; margin: 0 0 28px; }

.login-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; max-width: 320px; min-height: 54px; padding: 0 20px;
  background: var(--white); color: var(--charcoal);
  border: 1.5px solid var(--outline); border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.login-btn:hover { background: #FBF9F3; }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-btn svg { width: 20px; height: 20px; flex: none; }
.login-error { color: var(--coral, #C24A28); font-size: 12px; font-weight: 700; margin-top: 14px; }

/* About */
.about { margin-top: 56px; }
.about h2 {
  text-align: center; font-size: 22px; font-weight: 700; line-height: 1.35;
  letter-spacing: -0.3px; margin: 0 0 12px; white-space: pre-line;
}
.about .sub { text-align: center; color: var(--charcoal-light); font-size: 14px; margin: 0 0 24px; }
.feature {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--white); border: 1px solid var(--outline);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
}
.feature .ico {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: var(--lime-light); display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1;
}
.feature h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.feature p { margin: 0; font-size: 13px; color: var(--charcoal-light); line-height: 1.4; }

/* Footer */
footer { border-top: 1px solid var(--outline); margin-top: 40px; }
.foot-inner { max-width: 480px; margin: 0 auto; padding: 16px 24px 28px; text-align: center; }
.foot-inner a { color: var(--charcoal-light); text-decoration: none; font-size: 13px; padding: 0 8px; }
.foot-inner a:hover { text-decoration: underline; }
.copy { color: var(--charcoal-light); font-size: 12px; margin-top: 8px; }

/* Boot loading overlay. Hidden on the static-landing load; shown only on a boot
   load (html.booting), i.e. when flutter_bootstrap.js is loaded at natural page
   load. dismissLandingLoader() (Flutter, first frame) sets display:none inline. */
#app-loading {
  position: fixed; inset: 0; background: var(--cream);
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  z-index: 10;
  display: none;
}
html.booting #landing { display: none; }
html.booting #app-loading { display: flex; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--outline); border-top-color: var(--lime-dark);
  animation: spin .8s linear infinite;
}
.load-text { color: var(--charcoal-light); font-size: 14px; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
