/* =============================================================
   base.css — kkmblog 공유 디자인 토큰 & 공통 컴포넌트
   home.css, article.css 양쪽에서 import하여 사용
============================================================= */

/* -------------------------------------------------------
   1. Design Tokens
------------------------------------------------------- */
:root {
  /* Colors */
  --bg:     #0c0e12;
  --bg2:    #0f1218;
  --text:   #e9ecf5;
  --muted:  #a7afc3;
  --faint:  #6d7690;
  --border: rgba(255, 255, 255, .08);
  --accent: #7c5cff;
  --accent2:#32d3ff;

  /* Shadows */
  --shadow:  0 18px 60px rgba(0, 0, 0, .55);
  --shadow2: 0 10px 30px rgba(0, 0, 0, .35);

  /* Shape */
  --radius:  18px;
  --radius2: 14px;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
          "Liberation Mono", monospace;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Light mode overrides */
[data-theme="light"] {
  --bg:     #f6f7fb;
  --bg2:    #eef1f9;
  --text:   #121427;
  --muted:  #4f5b78;
  --faint:  #7b86a6;
  --border: rgba(14, 18, 35, .10);
  --shadow: 0 18px 50px rgba(14, 18, 35, .14);
  --shadow2:0 10px 25px rgba(14, 18, 35, .10);
  --accent: #6a5cff;
  --accent2:#0aa7ff;
}

/* -------------------------------------------------------
   2. Reset & Base
------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }

html {
  scrollbar-gutter: stable; /* 스크롤바 공간 항상 예약 — 페이지 이동 시 topbar 이동 방지 */
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(124, 92, 255, .30), transparent 60%),
    radial-gradient(1000px 600px at 80%    0%, rgba(50, 211, 255, .18), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-color: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(124, 92, 255, .35); }

/* -------------------------------------------------------
   3. Layout
------------------------------------------------------- */
.wrap {
  margin: 0 auto;
  padding: 28px 18px 80px;
}

/* -------------------------------------------------------
   4. Topbar
------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 40px;
}

/* Topbar right-side button group */
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Brand / Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    radial-gradient(16px 16px at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.15) 55%, transparent 70%),
    linear-gradient(135deg, rgba(80,52,210,.95), rgba(124,92,255,.90));
  box-shadow: 0 12px 30px rgba(124, 92, 255, .28);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.logo::before {
  content: "kkm";
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, .92);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  text-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.logo::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.25), transparent);
  transform: rotate(20deg);
  animation: sheen 8s var(--ease) infinite;
}
@keyframes sheen {
  0%  { transform: translateX(-40%) rotate(20deg); opacity: 0; }
  12% { opacity: .7; }
  30% { transform: translateX(40%)  rotate(20deg); opacity: 0; }
  100%{ transform: translateX(40%)  rotate(20deg); opacity: 0; }
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.2;
}
.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* -------------------------------------------------------
   5. Button
------------------------------------------------------- */
.btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .18s var(--ease), border-color .18s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  font-family: var(--font);
}
.btn:hover  { transform: translateY(-1px); border-color: rgba(124,92,255,.35); }
.btn:active { transform: translateY(0) scale(.99); }
.btn svg    { width: 16px; height: 16px; opacity: .85; }

/* -------------------------------------------------------
   6. Footer
------------------------------------------------------- */
footer {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow: var(--shadow2);
  color: var(--faint);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
[data-theme="light"] footer {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.80));
}

/* -------------------------------------------------------
   7. Toast
------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(540px, calc(100vw - 24px));
  z-index: 999;
}
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, .88);
  border-color: rgba(14, 18, 35, .12);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  flex-shrink: 0;
}

/* -------------------------------------------------------
   8. Subscribe Modal
------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}
[data-theme="light"] .modal-backdrop { background: rgba(14, 18, 35, .40); }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal {
  background: linear-gradient(160deg, var(--bg2), var(--bg));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  transform: translateY(16px) scale(.97);
  transition: transform .25s var(--ease);
}
[data-theme="light"] .modal {
  background: linear-gradient(160deg, var(--bg), var(--bg2));
}
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,.08); }
.modal-close svg { width: 18px; height: 18px; }

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(50,211,255,.12));
  border: 1px solid rgba(124,92,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.modal-icon svg { width: 22px; height: 22px; color: var(--accent); }

.modal-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}
.modal-desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.modal-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.modal-field input {
  background: rgba(0, 0, 0, .18);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 13px;
  outline: none;
  transition: border-color .18s var(--ease);
  width: 100%;
  box-sizing: border-box;
}
[data-theme="light"] .modal-field input { background: rgba(255,255,255,.80); }
.modal-field input:focus { border-color: rgba(124,92,255,.55); }
.modal-field input::placeholder { color: var(--faint); }

.modal-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  box-shadow: 0 8px 22px rgba(124,92,255,.28);
}
.modal-submit:hover { opacity: .88; transform: translateY(-1px); }
.modal-submit:active { transform: translateY(0) scale(.98); }

/* -------------------------------------------------------
   8. Accessibility / Motion
------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
