/* base.css — design tokens + reset + typography + layout
   Connective Corporate System v2 · DataSketchers
   Tone: 카카오·따뜻·둥근 / Coral #FB923C 시그니처 하이라이트
   ============================================================== */

/* ─── 1. Tokens (Light) ─────────────────────────────────────── */
:root {
  /* Brand — Yellow (signature) */
  --ds-brand: #FFD21D;
  --ds-brand-hover: #E8BC00;
  --ds-brand-deep: #B88700;
  --ds-brand-soft: #FFF1A8;
  --ds-brand-bg: #FFFBE8;
  --ds-brand-glow: rgba(255, 210, 29, 0.4);
  --ds-brand-ink: #0a0a0a;

  /* Highlight — 'em' background */
  --ds-highlight: #FFD21D;
  --ds-highlight-soft: #FFF1A8;

  --sh-brand: 0 14px 32px rgba(255, 210, 29, 0.32);
  --sh-focus: 0 0 0 3px rgba(255, 210, 29, 0.28);
  /* Surface — pure white */
  --ds-bg:           #ffffff;
  --ds-bg-subtle:    #f7f7f5;
  --ds-bg-card:      #ffffff;
  --ds-bg-strong:    #0a0a0a;
  --ds-overlay:      rgba(10, 10, 10, 0.55);

  /* Text */
  --ds-text:         #19191a;
  --ds-text-2:       #4d4d4f;
  --ds-text-3:       #7c7c7e;
  --ds-text-on-brand:#0a0a0a;
  --ds-text-on-dark: #fafafa;

  /* Lines — neutral */
  --ds-line:         #e7e5e0;
  --ds-line-strong:  #d4d2cd;
  --ds-line-soft:    #efedea;

  /* Feedback */
  --ds-success: #15a05c;
  --ds-warning: #d97706;
  --ds-error:   #dc2626;

  /* Radius — 카카오 스타일 둥근 */
  --r-xs:    8px;
  --r-sm:    12px;
  --r-md:    20px;
  --r-lg:    28px;
  --r-xl:    36px;
  --r-2xl:   48px;
  --r-pill:  999px;

  /* Shadow — 따뜻한 그림자 */
  --sh-card:       0 2px 8px rgba(20,15,5,.05), 0 1px 2px rgba(20,15,5,.04);
  --sh-card-hover: 0 18px 44px rgba(20,15,5,.09), 0 4px 12px rgba(20,15,5,.05);
  --sh-overlay:    0 28px 80px rgba(20,15,5,.18);
  --sh-brand:      0 14px 32px rgba(217, 179, 28, 0.32);
  --sh-focus:      0 0 0 3px rgba(217, 179, 28, 0.28);

  /* Motion */
  --t-fast:  140ms;
  --t-base:  220ms;
  --t-slow:  380ms;
  --t-page:  640ms;
  --ease-std: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Type */
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
               'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --font-head: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  --font-serif: 'Fraunces', 'Instrument Serif', Georgia, serif;

  /* Container */
  --w-article: 760px;
  --w-content: 1080px;
  --w-wide:    1280px;
  --w-full:    1440px;

  /* Header */
  --header-h: 76px;
}

/* ─── 2. Dark theme ─────────────────────────────────────────── */
/* (dark theme removed — site is light-only) */

/* ─── 3. Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  background: var(--ds-bg);
  color-scheme: light;
}
body {
  margin: 0;
  background: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  font-feature-settings: 'ss03', 'kern';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t-base) var(--ease-std),
              color var(--t-base) var(--ease-std);
}

/* Sticky footer: 콘텐츠가 짧아도 푸터가 뷰포트 하단에 붙도록.
   공개 페이지는 <header(고정)> + <main> + <footer> 가 body 의 in-flow 자식.
   관리자는 별도 shell(사이드바+본문)이라 admin-shell 은 제외. */
html { min-height: 100%; }
body:not(.admin-shell) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body:not(.admin-shell) > main { flex: 1 0 auto; }
body:not(.admin-shell) > footer { flex-shrink: 0; }

img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--ds-brand-soft); color: var(--ds-brand-deep); }
:focus-visible { outline: none; box-shadow: var(--sh-focus); border-radius: var(--r-xs); }

/* ─── 4. Typography scale ──────────────────────────────────── */
.ds-display-1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(48px, 7vw, 92px); line-height: 1.04; letter-spacing: -0.03em; }
.ds-display-2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 5.5vw, 68px); line-height: 1.08; letter-spacing: -0.025em; }
.ds-h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(34px, 4vw, 48px); line-height: 1.15; letter-spacing: -0.02em; }
.ds-h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(28px, 3vw, 36px); line-height: 1.2; letter-spacing: -0.015em; }
.ds-h3 { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; }
.ds-h4 { font-family: var(--font-head); font-weight: 700; font-size: 18px; line-height: 1.35; }
.ds-body-1 { font-size: 18px; line-height: 1.7; }
.ds-body-2 { font-size: 16px; line-height: 1.65; }
.ds-body-3 { font-size: 14px; line-height: 1.6; }
.ds-caption { font-size: 13px; line-height: 1.45; color: var(--ds-text-3); }
.ds-label   { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.ds-mono    { font-family: var(--font-mono); letter-spacing: 0.02em; }
.ds-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ds-text-2); margin-bottom: 24px; }

.ds-text-soft { color: var(--ds-text-2); }
.ds-text-dim  { color: var(--ds-text-3); }

/* ─── 4a. Mobile typography — 360px~ 스몰 스크린(스마트폰) 폰트 최적화 ──
   데스크톱 clamp() 최솟값(display-2:40 / h1:34 / h2:28)이 360px 폭 화면에선
   지나치게 크므로, 좁은 화면 구간에서 스케일을 내린다. */
@media (max-width: 640px) {
  .ds-display-1 { font-size: clamp(32px, 9vw, 46px); line-height: 1.1; }
  .ds-display-2 { font-size: clamp(28px, 8.5vw, 40px); line-height: 1.12; letter-spacing: -0.02em; }
  .ds-h1 { font-size: clamp(24px, 7vw, 32px); line-height: 1.2; letter-spacing: -0.015em; }
  .ds-h2 { font-size: clamp(21px, 6.2vw, 27px); line-height: 1.25; }
  .ds-h3 { font-size: 19px; line-height: 1.3; }
  .ds-h4 { font-size: 17px; line-height: 1.35; }
  .ds-body-1 { font-size: 16px; line-height: 1.7; }
  .ds-body-2 { font-size: 15px; line-height: 1.65; }
  .ds-body-3 { font-size: 13px; line-height: 1.6; }
  .ds-eyebrow { font-size: 11px; letter-spacing: 0.16em; margin-bottom: 16px; }
}

/* Em highlight — brand color emphasis (uses heading's own font/weight) */
em.em, .em, h1 em, h2 em, h3 em, h4 em,
.ds-display-1 em, .ds-display-2 em, .ds-h1 em, .ds-h2 em, .ds-h3 em {
  font-style: normal;
  font-weight: inherit;
  font-family: inherit;
  color: var(--ds-brand);
  background: transparent;
  padding: 0;
  border-radius: 0;
}
em.em-no-bg, .em-no-bg {
  font-style: normal;
  font-weight: inherit;
  font-family: inherit;
  color: var(--ds-brand);
  background: transparent;
  padding: 0;
}

/* preserve newlines */
.ds-pre { white-space: pre-line; }

/* ─── 5. Layout ────────────────────────────────────────────── */
.ds-container { max-width: var(--w-wide); margin: 0 auto; padding: 0 32px; position: relative; }
.ds-container--article { max-width: var(--w-article); }
.ds-container--content { max-width: var(--w-content); }
.ds-container--full    { max-width: var(--w-full); }
@media (max-width: 768px) { .ds-container { padding: 0 20px; } }

.ds-section { padding: 120px 0; position: relative; }
.ds-section--sm { padding: 80px 0; }
.ds-section--lg { padding: 160px 0; }
.ds-section--bleed { padding: 0; }
.ds-section--subtle { background: var(--ds-bg-subtle); }
.ds-section--ink {
  background: #1f1f1f;
  color: #fafafa;
}
.ds-section--ink .ds-text-soft { color: rgba(255,255,255,0.6); }
.ds-section--ink .ds-eyebrow { color: var(--ds-brand); }
@media (max-width: 768px) {
  .ds-section { padding: 80px 0; }
  .ds-section--sm { padding: 56px 0; }
  .ds-section--lg { padding: 96px 0; }
}

/* Grid helpers */
.ds-grid { display: grid; gap: 24px; }
.ds-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ds-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ds-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ds-grid--5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) {
  .ds-grid--4, .ds-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .ds-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ds-grid--2, .ds-grid--3, .ds-grid--4, .ds-grid--5 { grid-template-columns: 1fr; }
}
/* Collapse inline 2~3-column "split" grids to a single column on mobile.
   Desktop column ratios stay in the element's inline style; this only overrides
   them below 900px (!important beats the non-important inline declaration). */
@media (max-width: 900px) {
  .ds-split { grid-template-columns: 1fr !important; }
  /* 접힌 세로 배치에서 인라인 80px gap이 지나치게 크므로 좁힌다 */
  .ds-split { gap: 28px !important; }
  /* Un-stick a sticky sidebar once its split has stacked (else it floats over content). */
  .ds-sticky-col { position: static !important; }
}

.ds-stack { display: flex; flex-direction: column; }
.ds-row { display: flex; align-items: center; }
.ds-row--gap-12 { gap: 12px; }
.ds-row--gap-16 { gap: 16px; }
.ds-row--gap-24 { gap: 24px; }
.ds-row--wrap { flex-wrap: wrap; }
.ds-row--between { justify-content: space-between; }
.ds-row--baseline { align-items: baseline; }

/* ─── 6. Accessibility ─────────────────────────────────────── */
.ds-skip-link {
  position: absolute; top: -40px; left: 8px;
  padding: 8px 16px; background: var(--ds-text); color: var(--ds-bg);
  border-radius: var(--r-sm); font-weight: 600; z-index: 10000;
  transition: top var(--t-fast);
}
.ds-skip-link:focus { top: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── 7. Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
