:root {
  --blue-50:  #eef4ff;
  --blue-100: #dbe7ff;
  --blue-200: #c0d4ff;
  --blue-300: #92b4ff;
  --blue-400: #6b95ff;
  --blue-500: #3d6dff;
  --blue-600: #2750e8;
  --blue-700: #1a3bbf;

  --ink-0:   #ffffff;
  --ink-50:  #f7f8fa;
  --ink-100: #eef0f4;
  --ink-200: #e2e5ec;
  --ink-300: #cdd2dd;
  --ink-400: #9aa1b2;
  --ink-500: #6b7180;
  --ink-700: #383d4a;
  --ink-900: #161922;

  --bg:        var(--ink-50);
  --surface:   var(--ink-0);
  --border:    var(--ink-200);
  --text:      var(--ink-900);
  --mute:      var(--ink-500);
  --accent:    var(--blue-500);
  --accent-ink:var(--blue-700);

  --font-sans: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;

  --shadow: 0 24px 60px -16px rgba(22, 25, 34, 0.28), 0 4px 14px rgba(22, 25, 34, 0.08);
}

[data-theme="dark"] {
  --bg:        #0c0f17;
  --surface:   #161a26;
  --border:    #272d3d;
  --text:      #f1f3f8;
  --mute:      #8e94a6;
  --accent:    #6b95ff;
  --accent-ink:#b3c7ff;
  --shadow: 0 24px 60px -16px rgba(0,0,0,0.6), 0 4px 14px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}

.page {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow: hidden;
}
.page::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(61,109,255,0.5), transparent 62%);
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
}
[data-theme="dark"] .page::before { opacity: 0.18; }

.popup {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pop 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* header */
.popup-head {
  padding: clamp(24px, 5vw, 32px) clamp(22px, 5vw, 32px) clamp(20px, 4vw, 24px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(61,109,255,0.14), transparent 60%),
    var(--surface);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text);
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 3px 8px -2px rgba(39,80,232,0.5);
}

/* body / panel */
.popup-body {
  padding: clamp(22px, 4vw, 28px) clamp(22px, 5vw, 32px) clamp(24px, 5vw, 30px);
  overflow-y: auto;
}
.panel { display: none; flex-direction: column; gap: 18px; animation: fade 240ms ease both; }
.panel[data-active="true"] { display: flex; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.eyebrow {
  display: inline-block; align-self: flex-start;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  padding: 5px 10px;
  border-radius: 999px;
}
[data-theme="dark"] .eyebrow {
  background: rgba(107,149,255,0.12);
  border-color: rgba(107,149,255,0.25);
}
.title {
  margin: 0;
  font-size: clamp(21px, 5vw, 25px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
}
.lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mute);
  text-wrap: pretty;
}

/* end-date highlight */
.enddate {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 14px;
}
[data-theme="dark"] .enddate {
  background: rgba(107,149,255,0.1);
  border-color: rgba(107,149,255,0.22);
}
.enddate-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--blue-100);
  display: grid; place-items: center;
  color: var(--accent);
}
[data-theme="dark"] .enddate-icon { border-color: rgba(107,149,255,0.25); }
.enddate-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.enddate-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent-ink);
}
.enddate-value {
  font-size: clamp(16px, 4.2vw, 19px); font-weight: 800;
  color: var(--text); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.outro {
  margin: 0;
  font-size: 13.5px; line-height: 1.7; color: var(--mute);
  text-wrap: pretty;
}
.sign { color: var(--text); font-weight: 600; }

@media (max-width: 380px) {
  .popup { border-radius: 20px; }
  .popup-head { padding: 20px 18px 18px; }
  .popup-body { padding: 20px 18px 22px; }
  .enddate { padding: 14px; gap: 12px; }
  .enddate-icon { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .popup, .panel { animation: none; }
}
