/* ──────────────────────────────────────────────────────────────────
   UrbanPixel Design System — Foundations
   Colors, type, spacing, radius, elevation, motion.
   Brand sans: SUIT (local TTF, 100–900). Single-typeface system —
   `--font-mono` is also SUIT, with tabular-nums via `.up-mono`.
   ────────────────────────────────────────────────────────────────── */

/* SUIT — official brand sans (Korean-friendly, geometric humanist).
   Self-hosted from /fonts (TTF, 9 weights: Thin 100 → Heavy 900).
   Drop-in CDN alternative if you need to host externally:
     https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_suit@1.0/SUIT-{Weight}.woff2
*/
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Thin.ttf") format("truetype");
  font-weight: 100; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-ExtraLight.ttf") format("truetype");
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-SemiBold.ttf") format("truetype");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-ExtraBold.ttf") format("truetype");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Suit";
  src: url("fonts/SUIT-Heavy.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap;
}
/* Mono token now points to SUIT — single-typeface system. Tabular numerals
   are still possible via `font-feature-settings: "tnum" 1`. The previous
   external mono import was removed; .up-mono is kept as a class for
   tabular-nums readouts. */

:root {
  /* ── Brand palette ────────────────────────────────────────────── */
  /* Backgrounds: clear, ivory, mist */
  --up-clear:        #FFFFFF;
  --up-ivory:        #FBF9F4;   /* soft ivory base */
  --up-mist:         #F2F5F8;   /* cool mist for sections */
  --up-fog:          #E6ECF1;   /* subtle dividers / chips */

  /* Electric Violet — brand primary (UrbanPixel signal color) */
  --up-glass-50:     #F5EFFF;
  --up-glass-100:    #E7DAFF;
  --up-glass-200:    #CDB1FF;
  --up-glass-300:    #B286FF;
  --up-glass-400:    #9754FF;   /* brand primary — #9754FF */
  --up-glass-500:    #9754FF;   /* alias — same as 400 for compatibility */
  --up-glass-600:    #7A2EE6;
  --up-glass-700:    #5A1AB8;

  /* Civic Blue — secondary brand (#356CFE) */
  --up-cyan-100:     #DEE5FE;
  --up-cyan-300:     #8AA1FF;
  --up-cyan-500:     #356CFE;   /* secondary brand — #356CFE */
  --up-cyan-700:     #1E47C9;

  /* Civic Green — secondary brand (#2FB978) */
  --up-green-100:    #D4F2E1;
  --up-green-300:    #7BD9A8;
  --up-green-500:    #2FB978;   /* secondary brand — #2FB978 */
  --up-green-700:    #1B7E51;

  /* Soft Coral — local commerce / attention (use sparingly) */
  --up-coral-100:    #FCE6DF;
  --up-coral-300:    #F5B5A1;
  --up-coral-500:    #EC7A5A;
  --up-coral-700:    #B84F32;

  /* Warm Yellow — highlight / event */
  --up-yellow-100:   #FBF1CF;
  --up-yellow-300:   #F2D777;
  --up-yellow-500:   #E5B834;
  --up-yellow-700:   #A88318;

  /* Charcoal / Navy — text + premium ink */
  --up-charcoal:     #1F2A33;
  --up-navy:         #0E2545;
  --up-navy-700:     #1A3A66;
  --up-ink:          #0B1620;

  /* Neutrals */
  --up-n-0:          #FFFFFF;
  --up-n-50:         #F7F8FA;
  --up-n-100:        #EEF1F4;
  --up-n-200:        #DDE3E9;
  --up-n-300:        #C2CBD3;
  --up-n-400:        #94A1AC;
  --up-n-500:        #6B7884;
  --up-n-600:        #4A5660;
  --up-n-700:        #2F3A44;
  --up-n-800:        #1B232B;

  /* ── Semantic surface tokens ──────────────────────────────────── */
  --bg-page:         var(--up-ivory);
  --bg-section:      var(--up-clear);
  --bg-mist:         var(--up-mist);
  --bg-elevated:     #FFFFFF;
  --bg-night:        var(--up-navy);            /* night-scene examples only */

  --fg-primary:      var(--up-charcoal);
  --fg-secondary:    var(--up-n-600);
  --fg-muted:        var(--up-n-500);
  --fg-on-dark:      #F5F8FB;
  --fg-on-dark-mute: rgba(245,248,251,0.65);

  --brand-primary:   var(--up-glass-400);
  --brand-primary-hover: var(--up-glass-600);
  --brand-press:     var(--up-glass-700);
  --brand-soft:      var(--up-glass-50);

  --accent-public:   var(--up-green-500);   /* secondary · #2FB978 */
  --accent-tech:     var(--up-cyan-500);    /* secondary · #356CFE */
  --accent-local:    var(--up-cyan-500);    /* local commerce → civic blue */
  --accent-alert:    var(--up-green-500);   /* events → civic green */
  --accent-emergency:#EC4455;               /* emergency only — outside brand triad */

  --border-hairline: rgba(15,40,70,0.08);
  --border-thin:     rgba(15,40,70,0.14);
  --border-strong:   rgba(15,40,70,0.24);
  --border-onglass:  rgba(255,255,255,0.55);

  /* ── Glass surfaces ───────────────────────────────────────────── */
  --glass-light:        rgba(255,255,255,0.62);
  --glass-light-strong: rgba(255,255,255,0.82);
  --glass-blue:         rgba(207,227,242,0.55);
  --glass-dark:         rgba(14,37,69,0.55);
  --glass-blur:         saturate(140%) blur(18px);

  /* ── Type ─────────────────────────────────────────────────────── */
  --font-sans:    "Suit", -apple-system, "Apple SD Gothic Neo",
                  "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-display: "Suit", -apple-system, "Apple SD Gothic Neo",
                  "Noto Sans KR", system-ui, sans-serif;
  --font-mono:    "Suit", -apple-system, "Apple SD Gothic Neo",
                  "Noto Sans KR", system-ui, sans-serif;

  /* Type scale — proposal / civic-reading optimized */
  --t-display:    clamp(48px, 6.4vw, 88px);
  --t-h1:         clamp(36px, 4vw, 56px);
  --t-h2:         clamp(28px, 3vw, 40px);
  --t-h3:         22px;
  --t-h4:         18px;
  --t-body-lg:    18px;
  --t-body:       16px;
  --t-body-sm:    14px;
  --t-caption:    13px;
  --t-eyebrow:    12px;

  --lh-tight:     1.08;
  --lh-snug:      1.22;
  --lh-normal:    1.5;
  --lh-relaxed:   1.65;

  --tr-tight:     -0.02em;
  --tr-snug:      -0.012em;
  --tr-wide:      0.06em;
  --tr-eyebrow:   0.14em;

  /* ── Spacing — 4pt base ────────────────────────────────────── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* ── Radii ─────────────────────────────────────────────────── */
  --r-xs:  4px;
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* ── Elevation — soft, civic, never theatrical ─────────────── */
  --shadow-1: 0 1px 2px rgba(14,37,69,0.06);
  --shadow-2: 0 2px 8px rgba(14,37,69,0.06), 0 1px 2px rgba(14,37,69,0.04);
  --shadow-3: 0 8px 24px rgba(14,37,69,0.08), 0 2px 6px rgba(14,37,69,0.04);
  --shadow-4: 0 18px 48px rgba(14,37,69,0.10), 0 4px 12px rgba(14,37,69,0.05);
  --shadow-glass: 0 12px 40px rgba(20,60,100,0.12), inset 0 1px 0 rgba(255,255,255,0.7);

  /* ── Motion ────────────────────────────────────────────────── */
  --ease-civic:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:    140ms;
  --dur-base:    220ms;
  --dur-slow:    420ms;

  /* ── Layout ────────────────────────────────────────────────── */
  --container:      1200px;
  --container-wide: 1320px;
  --gutter:         24px;
}

/* ── Base ──────────────────────────────────────────────────────── */
html, body {
  background: var(--bg-page);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Korean-friendly wrapping: never break mid-syllable. Latin words still
     break at spaces; long unbroken runs (URLs) fall back to char break. */
  word-break: keep-all;
  overflow-wrap: break-word;
}
.up-btn, .up-chip, .up-nav__link, .up-eyebrow,
.up-display, .up-h1, .up-h2, .up-h3, .up-h4, .up-body, .up-body-lg, .up-body-sm, .up-caption {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Semantic type ─────────────────────────────────────────────── */
.up-eyebrow {
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--brand-primary);
}
.up-display {
  font-family: var(--font-display);
  font-size: var(--t-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  color: var(--up-navy);
  text-wrap: balance;
}
.up-h1 {
  font-size: var(--t-h1); font-weight: 700; line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight); color: var(--up-navy); text-wrap: balance;
}
.up-h2 {
  font-size: var(--t-h2); font-weight: 700; line-height: var(--lh-snug);
  letter-spacing: var(--tr-snug); color: var(--up-navy);
}
.up-h3 {
  font-size: var(--t-h3); font-weight: 600; line-height: var(--lh-snug);
  color: var(--up-charcoal);
}
.up-h4 {
  font-size: var(--t-h4); font-weight: 600; line-height: var(--lh-snug);
  color: var(--up-charcoal);
}
.up-body {
  font-size: var(--t-body); line-height: var(--lh-relaxed);
  color: var(--fg-primary); text-wrap: pretty;
}
.up-body-lg { font-size: var(--t-body-lg); line-height: var(--lh-relaxed); }
.up-body-sm { font-size: var(--t-body-sm); line-height: var(--lh-normal); color: var(--fg-secondary); }
.up-caption { font-size: var(--t-caption); color: var(--fg-muted); }
.up-mono    { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "lnum" 1, "ss06" 1; letter-spacing: 0.01em; }

/* ── Surfaces ──────────────────────────────────────────────────── */
.up-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.up-card-strong {
  background: var(--bg-elevated);
  border: 1px solid var(--border-thin);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
}
.up-glass {
  background: var(--glass-light);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-onglass);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-glass);
}

/* ── Chips / Tags ──────────────────────────────────────────────── */
.up-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: var(--t-caption); font-weight: 500;
  background: var(--up-glass-50); color: var(--up-glass-700);
  border: 1px solid var(--up-glass-100);
  white-space: nowrap;
}
.up-chip--public  { background: var(--up-green-100);  color: var(--up-green-700);  border-color: #BCE5CF; }
.up-chip--local   { background: var(--up-cyan-100);   color: var(--up-cyan-700);   border-color: #C8D5FE; }
.up-chip--alert   { background: var(--up-green-100);  color: var(--up-green-700);  border-color: #BCE5CF; }
.up-chip--tech    { background: var(--up-cyan-100);   color: var(--up-cyan-700);   border-color: #C8D5FE; }
.up-chip--neutral { background: var(--up-n-100);      color: var(--up-n-700);      border-color: var(--up-n-200); }

/* ── Buttons ───────────────────────────────────────────────────── */
.up-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  letter-spacing: -0.005em; cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-civic),
              color var(--dur-base) var(--ease-civic),
              border-color var(--dur-base) var(--ease-civic),
              transform var(--dur-fast) var(--ease-civic),
              box-shadow var(--dur-base) var(--ease-civic);
}
.up-btn:active { transform: translateY(1px); }
.up-btn--primary {
  background: var(--brand-primary); color: var(--up-clear);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, var(--shadow-1);
}
.up-btn--primary:hover { background: var(--brand-primary-hover); }
.up-btn--primary:active { background: var(--brand-press); }
.up-btn--secondary {
  background: var(--up-clear); color: var(--up-navy);
  border-color: var(--border-thin);
}
.up-btn--secondary:hover { background: var(--up-mist); border-color: var(--border-strong); }
.up-btn--ghost {
  background: transparent; color: var(--up-navy);
}
.up-btn--ghost:hover { background: var(--up-mist); }
.up-btn--public {
  background: var(--accent-public); color: white;
}
.up-btn--public:hover { background: var(--up-green-700); }
.up-btn--lg { height: 52px; padding: 0 24px; font-size: 16px; }
.up-btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }

/* ── Inputs ────────────────────────────────────────────────────── */
.up-input {
  height: 44px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-thin);
  background: var(--up-clear); color: var(--fg-primary);
  font-family: var(--font-sans); font-size: 15px;
  transition: border-color var(--dur-base) var(--ease-civic),
              box-shadow var(--dur-base) var(--ease-civic);
}
.up-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(151,84,255,0.18);
}

/* ── Divider ───────────────────────────────────────────────────── */
.up-divider { height: 1px; background: var(--border-hairline); border: 0; }

/* ── Focus ring ────────────────────────────────────────────────── */
:where(a, button, [role="button"]):focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
