/* ============================================================
   CHO OS — Global Design Tokens & Base
   라이트 + 파스텔 글래스모피즘 + 모던 트렌디
============================================================ */

:root {
  /* === Surface === */
  --bg-1: #f0f9fb;       /* teal mist */
  --bg-2: #eef5f8;       /* blue-gray mist */
  --bg-3: #f0fffe;       /* cyan mist */
  --bg-deep: #f5fafb;

  --surface: #ffffff;
  --surface-1: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.55);
  --surface-3: rgba(255, 255, 255, 0.92);

  /* === Ink === */
  --ink-100: #0f172a;
  --ink-200: #1e293b;
  --ink-300: #334155;
  --ink-400: #64748b;
  --ink-500: #94a3b8;
  --ink-600: #cbd5e1;

  /* === Lines === */
  --line: rgba(15, 23, 42, 0.06);
  --line-strong: rgba(15, 23, 42, 0.12);
  --line-soft: rgba(255, 255, 255, 0.6);

  --glass: rgba(255, 255, 255, 0.5);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.35);

  /* === Brand gradients (민트/틸/네이비) === */
  --grad-primary: linear-gradient(135deg, #74C0BE 0%, #55ADC5 50%, #7BA3E8 100%);
  --grad-accent: linear-gradient(135deg, #55ADC5 0%, #1C4ADF 60%, #0F2879 100%);
  --grad-aurora: linear-gradient(135deg, #CDF2F0 0%, #55ADC5 50%, #1C4ADF 100%);
  --grad-warm: linear-gradient(135deg, #ADD6EA 0%, #7BA3E8 50%, #1C4ADF 100%);
  --grad-cool: linear-gradient(135deg, #CDF2F0 0%, #74C0BE 50%, #55ADC5 100%);

  /* === Solid accents === */
  --accent: #55ADC5;     /* teal-blue */
  --accent-2: #1C4ADF;   /* deep blue */
  --accent-3: #74C0BE;   /* mint teal */
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* === Radius / Shadow === */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 60px rgba(85, 173, 197, 0.35);
  --shadow-pink: 0 14px 32px rgba(123, 163, 232, 0.28);
  --shadow-violet: 0 14px 32px rgba(28, 74, 223, 0.28);

  --easing: cubic-bezier(0.23, 1, 0.32, 1);
  --wallpaper-image: url('/static/background_light.svg');
  --wallpaper-mesh-opacity: 0.68;
}

html[data-theme='dark'] {
  --bg-1: #111111;
  --bg-2: #161616;
  --bg-3: #1c1c1c;
  --bg-deep: #0a0a0a;

  --surface: #1e1e1e;
  --surface-1: rgba(30, 30, 30, 0.85);
  --surface-2: rgba(30, 30, 30, 0.65);
  --surface-3: rgba(30, 30, 30, 0.97);

  --ink-100: #ffffff;
  --ink-200: #e8e8e8;
  --ink-300: #c0c0c0;
  --ink-400: #888888;
  --ink-500: #555555;
  --ink-600: #333333;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(0, 0, 0, 0.5);

  --glass: rgba(30, 30, 30, 0.6);
  --glass-strong: rgba(30, 30, 30, 0.88);
  --glass-soft: rgba(30, 30, 30, 0.4);

  --wallpaper-image: url('/static/background_dark.svg');
  --wallpaper-mesh-opacity: 0.34;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--ink-200);
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

/* Default: scrolling enabled */
html { overflow-x: hidden; overflow-y: auto; }
body { min-height: 100vh; overflow-x: hidden; overflow-y: auto; }

/* Intro & Desktop behave like fullscreen OS (no page scroll) */
html:has(body.intro-body),
html:has(body.desktop-body),
html.intro-body,
html.desktop-body { overflow: hidden; height: 100%; }
body.intro-body,
body.desktop-body { overflow: hidden; height: 100vh; }

/* Login / 404 / Project / Admin: allow scrolling on small screens */
body.admin-login-body,
body.not-found-body,
body.project-body,
body.admin-body { overflow-x: hidden; overflow-y: auto; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ====== Buttons ====== */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.2s var(--easing);
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--grad-accent);
  color: white;
  box-shadow: var(--shadow-violet), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-secondary {
  background: var(--surface-3);
  color: var(--ink-100);
  border-color: var(--line-strong);
  backdrop-filter: blur(20px);
}
.btn-secondary:hover {
  background: white;
  border-color: rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-300);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--surface-1);
  color: var(--ink-100);
  border-color: rgba(15, 23, 42, 0.18);
}
.btn-ghost.btn-danger { color: #dc2626; border-color: rgba(239, 68, 68, 0.3); }
.btn-ghost.btn-danger:hover { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }

/* ====== Wallpaper (shared) — SVG 기반 민트/틸/네이비 ====== */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--wallpaper-image) center center / cover no-repeat;
}
.wallpaper-mesh {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(circle at 20% 25%, rgba(116, 192, 190, 0.3) 0%, transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(205, 242, 240, 0.35) 0%, transparent 28%),
    radial-gradient(circle at 60% 80%, rgba(28, 74, 223, 0.18) 0%, transparent 32%),
    radial-gradient(circle at 30% 88%, rgba(130, 203, 186, 0.25) 0%, transparent 30%),
    radial-gradient(circle at 80% 55%, rgba(85, 173, 197, 0.22) 0%, transparent 28%);
  filter: blur(70px);
  animation: meshFloat 32s ease-in-out infinite alternate;
  opacity: var(--wallpaper-mesh-opacity);
}
@keyframes meshFloat {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(2%, -2%) rotate(4deg) scale(1.04); }
  100% { transform: translate(-2%, 2%) rotate(-3deg) scale(1); }
}
.wallpaper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.wallpaper-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: orbFloat 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, -30px) scale(1.1); }
}

/* ====== Window Bar (mac style) ====== */
.window-bar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 10;
}
.window-controls { display: flex; align-items: center; gap: 8px; width: 80px; }
.wc {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  transition: filter 0.15s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.wc-close { background: #ff5f57; }
.wc-min { background: #febc2e; }
.wc-max { background: #28c840; }
.wc:hover { filter: brightness(1.1); }

.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-200);
  letter-spacing: -0.01em;
}
.window-spacer {
  width: 80px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.window-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink-300);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}
.window-action:hover { color: var(--ink-100); background: white; }

/* ====== Status Pills / Dots ====== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pill.status-wip { background: rgba(245, 158, 11, 0.14); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.28); }
.status-pill.status-done { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.28); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-pill.status-wip .status-dot { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.status-pill.status-done .status-dot { background: #10b981; box-shadow: 0 0 6px #10b981; }

.dot { color: var(--ink-500); margin: 0 2px; }
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  70% { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.mt-24 { margin-top: 24px; }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.22); background-clip: padding-box; }

::selection { background: rgba(85, 173, 197, 0.35); color: var(--ink-100); }
