/* ============================================================
   Janglim — documentation theme & landing page styles
   (Layered on DocFX "modern". Backgrounds/borders/text use the
   Bootstrap theme variables so everything adapts to dark/light;
   only the accent colors are hard-coded — an indigo→violet blend
   that doubles as the Janglim brand color.)
   ============================================================ */

/* ---------- Hero Section ---------- */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
  background: linear-gradient(160deg, rgba(99,102,241,.08) 0%, transparent 60%);
  border-bottom: 1px solid var(--bs-border-color);
  margin: -1rem -1.5rem 0;
}

.hero-content {
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #818cf8;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 999px;
  padding: .25rem .85rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  color: var(--bs-body-color);
  border-bottom: none;
}

.hero-accent {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--bs-secondary-color);
  margin-bottom: 2.2rem;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary-hero {
  display: inline-flex;
  align-items: center;
  padding: .65rem 1.5rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff !important;
  transition: opacity .15s, transform .15s;
  box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

.btn-primary-hero:hover {
  opacity: .9;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary-hero {
  display: inline-flex;
  align-items: center;
  padding: .65rem 1.5rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color) !important;
  border: 1px solid var(--bs-border-color);
  transition: border-color .15s, transform .15s;
}

.btn-secondary-hero:hover {
  border-color: #6366f1;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-ghost-hero {
  display: inline-flex;
  align-items: center;
  padding: .65rem 1.25rem;
  border-radius: .5rem;
  font-weight: 500;
  font-size: .95rem;
  text-decoration: none;
  color: var(--bs-secondary-color) !important;
  transition: color .15s;
}

.btn-ghost-hero:hover {
  color: var(--bs-body-color) !important;
  text-decoration: none;
}

/* ---------- Shared Section Styles ---------- */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: .6rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 2.5rem;
  color: var(--bs-body-color);
  border-bottom: none;
}

/* ---------- Features Section ---------- */
.features-section {
  padding: 4rem 2rem;
  text-align: center;
  margin: 0 -1.5rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
}

.feature-card {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: 1.5rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.feature-card:hover {
  border-color: rgba(99,102,241,.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .5rem;
}

.feature-icon-blue   { background: rgba(99,102,241,.12); }
.feature-icon-purple { background: rgba(139,92,246,.12); }
.feature-icon-green  { background: rgba(34,197,94,.12); }
.feature-icon-orange { background: rgba(249,115,22,.12); }

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
  border-bottom: none;
}

.feature-card p {
  font-size: .88rem;
  line-height: 1.65;
  color: var(--bs-secondary-color);
  margin-bottom: 1rem;
}

.feature-link {
  font-size: .85rem;
  font-weight: 600;
  color: #818cf8;
  text-decoration: none;
}

.feature-link:hover {
  color: #a78bfa;
  text-decoration: underline;
}

/* ---------- Quick Start Section ---------- */
.quickstart-section {
  padding: 4rem 2rem;
  margin: 0 -1.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: linear-gradient(160deg, rgba(139,92,246,.05) 0%, transparent 70%);
}

.quickstart-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 640px) {
  .quickstart-inner { grid-template-columns: 1fr; }
}

.quickstart-text h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .75rem;
  border-bottom: none;
}

.quickstart-text p {
  color: var(--bs-secondary-color);
  line-height: 1.7;
}

.code-block {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  overflow: hidden;
}

.code-header {
  padding: .6rem 1rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  border-bottom: 1px solid var(--bs-border-color);
  background: rgba(0,0,0,.1);
}

.code-block pre {
  margin: 0;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: transparent;
}

.code-block pre:last-child {
  border-bottom: none;
}

.code-block code {
  font-size: .85rem;
  color: #a78bfa;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  background: transparent;
  padding: 0;
}

/* ---------- Learn / cards-as-links Section ---------- */
.learn-section {
  padding: 4rem 2rem 5rem;
  text-align: center;
  margin: 0 -1.5rem;
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
}

/* ---------- Article content: heading spacing ---------- */
article h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bs-border-color);
}

/* the landing page authors its own section headings, so don't add the rule there */
[data-layout="landing"] article h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ---------- Landing layout: hide sidebar / affix / actionbar ---------- */
[data-layout="landing"] .toc-offcanvas,
[data-layout="landing"] .affix {
  display: none !important;
}

[data-layout="landing"] .content {
  max-width: 100% !important;
}

[data-layout="landing"] .actionbar {
  display: none;
}

/* ============================================================
   Docs reading comfort & emphasis
   Body typography itself is the DocFX "modern" default (font-size
   1rem, line-height 1.5) — identical to Mythosia. The rules below
   add a little reading comfort on top, and turn the ">" callouts
   we use throughout into clear emphasis boxes.
   (Scoped away from the landing so the hero is untouched.)
   ============================================================ */

/* a touch more line spacing + size than the tight 1.5 default —
   easier on long Korean paragraphs */
body:not([data-layout="landing"]) .content article {
  line-height: 1.78;
  font-size: 1.02rem;
}

/* breathing room between paragraphs / list items — short paragraphs read best */
body:not([data-layout="landing"]) .content article p {
  margin-bottom: 1.2rem;
}
body:not([data-layout="landing"]) .content article li {
  margin-bottom: .4rem;
}
body:not([data-layout="landing"]) .content article li > p {
  margin-bottom: .4rem;
}

/* LR 아이템 점(•) 강조 — 코드블록 모양 박스 + 눈에 띄는 점 */
body:not([data-layout="landing"]) .content article pre.lrbox {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: .92rem;
  line-height: 1.65;
  margin: 1rem 0;
}
body:not([data-layout="landing"]) .content article .lrdot {
  color: #f43f5e;
  font-weight: 800;
  font-size: 1.2em;
}
/* 마커 기호 강조 — 저자의 재귀형 클로저 표기에서 '펼치는 중인 점 뒤 기호' */
body:not([data-layout="landing"]) .content article .lrmark {
  color: #f43f5e;
  font-weight: 700;
}
/* 인라인 코드는 이탤릭 안에서도 늘 똑바로 — 예: *`β`* 의 코드까지 기울던 문제 방지 */
body:not([data-layout="landing"]) .content article code {
  font-style: normal;
}
/* 예제 구획 카드 — 한 섹션(① Factor 등)을 박스로 묶어 한눈에 구분 */
body:not([data-layout="landing"]) .content article .ex-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: .55rem 1.15rem 1rem;
  margin: 1.1rem 0;
  background: var(--bs-secondary-bg);
}
body:not([data-layout="landing"]) .content article .ex-card > p:first-child {
  margin-top: .35rem;
}

/* 집합 { … } 표기 — 서로 또렷이 다른 색 (VS Code 풍).
   브레이스 { } = 파랑, 원소(단말) = 청록, FIRST()/함수 = 보라. 둘러싼 코드색(핑크)과도 대비. */
body:not([data-layout="landing"]) .content article .setb {
  color: #2563eb;
  font-weight: 800;
}
body:not([data-layout="landing"]) .content article .setm {
  color: #0d9488;
  font-weight: 600;
}
[data-bs-theme="dark"] .content article .setb {
  color: #60a5fa;
}
[data-bs-theme="dark"] .content article .setm {
  color: #4ec9b0;
}
body:not([data-layout="landing"]) .content article .setf {
  color: #7c3aed;
  font-weight: 700;
}
[data-bs-theme="dark"] .content article .setf {
  color: #a78bfa;
}

/* 문법 기호 — 비단말 = 보라, 단말 = 청록(.setm). 둘이 또렷이 구분되게. */
body:not([data-layout="landing"]) .content article .nt {
  color: #8250df;
  font-weight: 600;
}
[data-bs-theme="dark"] .content article .nt {
  color: #d2a8ff;
}

body:not([data-layout="landing"]) .content article h3 {
  margin-top: 1.9rem;
  font-weight: 700;
}

/* emphasis: the ">" blockquote callouts we lean on a lot */
.content article blockquote {
  border-left: 3px solid #8b5cf6;
  background: rgba(139, 92, 246, .06);
  border-radius: 0 .5rem .5rem 0;
  padding: .85rem 1.1rem;
  margin: 1.4rem 0;
}

.content article blockquote > :last-child {
  margin-bottom: 0;
}

[data-bs-theme="dark"] .content article blockquote {
  background: rgba(139, 92, 246, .12);
  border-left-color: #a78bfa;
}

/* tables — token→action maps, parse tables, code-mapping tables */
body:not([data-layout="landing"]) .content article table {
  border-collapse: collapse;
  width: auto;
  margin: 1.2rem 0;
  font-size: .95rem;
}
body:not([data-layout="landing"]) .content article table th,
body:not([data-layout="landing"]) .content article table td {
  border: 1px solid var(--bs-border-color);
  padding: .5rem .85rem;
  text-align: left;
  vertical-align: top;
}
body:not([data-layout="landing"]) .content article table thead th {
  background: var(--bs-secondary-bg);
  font-weight: 700;
}
body:not([data-layout="landing"]) .content article table tbody tr:nth-child(even) td {
  background: rgba(139, 92, 246, .045);
}
[data-bs-theme="dark"] .content article table tbody tr:nth-child(even) td {
  background: rgba(139, 92, 246, .09);
}

/* language switcher — top-right of the navbar */
.lang-switcher {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .1rem;
  font-size: .85rem;
  white-space: nowrap;
  padding-left: .5rem;
}
.lang-switcher .lang-link {
  color: var(--bs-secondary-color);
  text-decoration: none;
  padding: .12rem .4rem;
  border-radius: .35rem;
  transition: color .12s, background .12s;
}
.lang-switcher .lang-link:hover {
  color: var(--bs-body-color);
  background: var(--bs-secondary-bg);
}
.lang-switcher .lang-link.active {
  color: #8b5cf6;
  font-weight: 700;
}
[data-bs-theme="dark"] .lang-switcher .lang-link.active { color: #a78bfa; }
.lang-switcher .lang-sep { color: var(--bs-border-color); margin: 0 .05rem; }
