/* =========================================================================
   CodeBasic — design system
   ========================================================================= */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-ink: #0b0e1a;
  --ink: #14161f;
  --ink-soft: #4b5066;
  --ink-faint: #8a8fa6;
  --line: #e6e8f0;
  --brand: #5b4bff;
  --brand-2: #00c2d1;
  --brand-ink: #3a2fd6;
  --accent: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 18, 34, .04), 0 12px 32px rgba(16, 18, 34, .08);
  --shadow-sm: 0 1px 2px rgba(16, 18, 34, .05), 0 6px 16px rgba(16, 18, 34, .06);
  --maxw: 1120px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* ---- i18n: hide content until strings are rendered (no flash of keys) ----- */
html.i18n-pending body { visibility: hidden; }

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand);
}
.muted { color: var(--ink-soft); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(91, 75, 255, .28); }
.btn-primary:hover { background: var(--brand-ink); box-shadow: 0 10px 26px rgba(91, 75, 255, .36); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.22); }
.btn-light:hover { background: rgba(255,255,255,.2); }

/* ---- header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: inline-flex; align-items: center; }
.brand .logo { width: 28px; height: 28px; }
.brand .wordmark { height: 22px; width: auto; display: block; }
.site-footer .brand .wordmark { height: 20px; }
.nav-links { display: flex; gap: 4px; margin-left: 14px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { color: var(--brand); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff;
}
.lang-toggle button {
  border: 0; background: transparent; padding: 7px 13px; font-size: 13px; font-weight: 600;
  color: var(--ink-faint); cursor: pointer; font-family: inherit;
}
.lang-toggle button.active { background: var(--ink); color: #fff; }

.nav-toggle { display: none; }

/* ---- hero ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0,194,209,.35), transparent 60%),
    radial-gradient(900px 500px at 10% 10%, rgba(91,75,255,.45), transparent 55%),
    var(--bg-ink);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(to bottom, black, transparent 80%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; padding-top: 92px; padding-bottom: 96px; }
.hero .eyebrow { color: var(--brand-2); }
.hero h1 { font-size: clamp(34px, 6vw, 62px); font-weight: 800; margin: 18px 0 0; }
.hero h1 .grad {
  background: linear-gradient(100deg, #8b7dff, #00d8c0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { margin-top: 22px; font-size: clamp(16px, 2.2vw, 20px); color: rgba(255,255,255,.78); max-width: 640px; }
.hero-cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }
.triad {
  margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); overflow: hidden;
}
.triad div { background: rgba(11,14,26,.55); padding: 24px 22px; backdrop-filter: blur(4px); }
.triad .k { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2); font-weight: 700; }
.triad .v { margin-top: 8px; font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; }
.triad .d { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.66); }

/* ---- sections ------------------------------------------------------------ */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-top: 12px; }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--ink-soft); }
.bg-soft { background: var(--bg-soft); }

/* ---- cards / grid -------------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d9dcec; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(91,75,255,.12), rgba(0,194,209,.12));
  color: var(--brand); margin-bottom: 18px;
}
.card h3 { font-size: 20px; font-weight: 700; }
.card p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }

/* book / app cards with link */
.linkcard { position: relative; }
.linkcard .meta { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.linkcard .tag {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-soft);
}
.linkcard .arrow { margin-top: auto; padding-top: 18px; font-weight: 600; color: var(--brand); font-size: 15px; }
.linkcard.disabled { opacity: .72; }
.linkcard.disabled:hover { transform: none; box-shadow: var(--shadow-sm); }

.cover {
  height: 120px; border-radius: var(--radius-sm); margin-bottom: 18px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; letter-spacing: -.02em;
}
.cover-1 { background: linear-gradient(135deg, #5b4bff, #8b7dff); }
.cover-2 { background: linear-gradient(135deg, #0ea5b5, #00d8c0); }
.cover-3 { background: linear-gradient(135deg, #f0653e, #ff9a6b); }

/* ---- CTA band ------------------------------------------------------------ */
.cta {
  color: #fff; border-radius: 24px; padding: 56px 48px; text-align: center;
  background:
    radial-gradient(700px 300px at 50% -40%, rgba(0,194,209,.4), transparent 60%),
    linear-gradient(120deg, #4a3bf0, #1a1d33);
}
.cta h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
.cta p { margin-top: 14px; color: rgba(255,255,255,.8); font-size: 17px; }
.cta .hero-cta { justify-content: center; margin-top: 28px; }

/* ---- footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; color: var(--ink-soft); font-size: 14px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.foot-grid .brand { color: var(--ink); font-size: 17px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--ink); }

/* ---- page hero (sub pages) ----------------------------------------------- */
.page-hero { padding: 72px 0 24px; }
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; }
.page-hero p { margin-top: 16px; font-size: 18px; color: var(--ink-soft); max-width: 640px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .triad { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 66px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px; gap: 2px;
  }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; cursor: pointer;
  }
  section { padding: 64px 0; }
  .cta { padding: 40px 24px; }
}
