/* =========================================================
   Palsim Design System — colors, type, spacing, motion
   Source of truth for both digital and apparel modes.
   ========================================================= */

/* ---------- Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Slab:wght@500;700;900&family=Nanum+Myeongjo:wght@400;700;800&display=swap");
/* Pretendard via official CDN */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

:root {
  /* ===== Brand color — signature ===== */
  --pat-red: #9b1b1b;             /* 팥 red — the only signature color, identical across modes */
  --pat-red-ink: #7a1414;         /* darker pull for hover on red surfaces */

  /* ===== Digital mode (screens) ===== */
  --digital-bg: #000000;          /* true black */
  --digital-fg: #ffffff;          /* pure white */

  /* ===== Apparel mode (physical goods + bone-cream surfaces) ===== */
  --apparel-bg: #131313;          /* off-black — true black prints muddy */
  --apparel-fg: #f5f2ec;          /* bone cream */

  /* ===== Shared neutrals ===== */
  --charcoal: #3a3a3a;
  --mid-gray: #8a8a8a;

  /* Border / hairline tokens (tuned per surface) */
  --hairline-on-dark: #1f1f1f;
  --hairline-on-bone: #e6e2d9;

  /* ===== Semantic tokens — default to digital mode (dark) ===== */
  --bg: var(--digital-bg);
  --bg-elevated: #0a0a0a;
  --fg-1: var(--digital-fg);             /* primary text */
  --fg-2: rgba(255, 255, 255, 0.72);     /* secondary text */
  --fg-3: rgba(255, 255, 255, 0.48);     /* tertiary / metadata */
  --hairline: var(--hairline-on-dark);
  --accent: var(--pat-red);
  --accent-ink: var(--pat-red-ink);

  /* ===== Type families ===== */
  --font-en-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en-display: "Roboto Slab", "Inter", serif; /* TBD — slab serif stand-in for production cut */
  --font-ko-body: "Pretendard", "Inter", system-ui, sans-serif;
  --font-ko-display: "Nanum Myeongjo", "Pretendard", serif; /* TBD — Myeongjo stand-in */
  --font-mono: ui-monospace, "SFMono-Regular", "Menlo", monospace;

  /* ===== Type scale (px) ===== */
  --fs-display-1: 96px;
  --fs-display-2: 72px;
  --fs-h1: 56px;
  --fs-h2: 40px;
  --fs-h3: 28px;
  --fs-h4: 20px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-micro: 12px;

  /* Line heights */
  --lh-tight: 1.05;
  --lh-display: 1.1;
  --lh-heading: 1.2;
  --lh-body: 1.55;

  /* Tracking */
  --tr-tight: -0.02em;
  --tr-normal: 0em;
  --tr-wide: 0.04em;
  --tr-wordmark: 0.06em;   /* PALSIM wordmark tracking */

  /* ===== Spacing — 4px base ===== */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* ===== Radii ===== */
  --radius-0: 0;          /* editorial blocks, photo frames */
  --radius-1: 2px;        /* default — a hair */
  --radius-pill: 9999px;  /* tags, chips only */

  /* ===== Shadows (use sparingly) ===== */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-elevate: 0 8px 32px rgba(0, 0, 0, 0.12);

  /* ===== Motion ===== */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* Layout */
  --maxw-content: 1200px;
  --maxw-editorial: 880px;
  --maxw-prose: 640px;
}

/* ---------- Apparel / bone-cream surface (light mode) ---------- */
[data-mode="apparel"],
.surface-bone {
  --bg: var(--apparel-fg);
  --bg-elevated: #ffffff;
  --fg-1: var(--apparel-bg);
  --fg-2: rgba(19, 19, 19, 0.72);
  --fg-3: rgba(19, 19, 19, 0.5);
  --hairline: var(--hairline-on-bone);
}

/* ---------- Base elements ---------- */
html, body {
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-en-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, .h1 {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-tight);
}
h2, .h2 {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-tight);
}
h3, .h3 {
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
}
h4, .h4 {
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
}
p { margin: 0 0 var(--s-4); color: var(--fg-1); }
small, .small { font-size: var(--fs-small); color: var(--fg-2); }
code, kbd, pre { font-family: var(--font-mono); }

/* Korean utility classes */
.ko, [lang="ko"] { font-family: var(--font-ko-body); }
.ko-display, .h-ko { font-family: var(--font-ko-display); font-weight: 700; }

/* Wordmarks */
.palsim-wordmark {
  font-family: var(--font-en-display);
  font-weight: 900;
  letter-spacing: var(--tr-wordmark);
  text-transform: uppercase;
}
.palsim-hangul {
  font-family: var(--font-ko-display);
  font-weight: 800;
}

/* Eyebrow / micro label — used for section labels, category tags */
.eyebrow {
  font-family: var(--font-en-body);
  font-weight: 600;
  font-size: var(--fs-micro);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--fg-2);
}

/* Display sizes — for hero moments only */
.display-1 {
  font-family: var(--font-en-display);
  font-weight: 900;
  font-size: var(--fs-display-1);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
}
.display-2 {
  font-family: var(--font-en-display);
  font-weight: 700;
  font-size: var(--fs-display-2);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-tight);
}

/* Hairline divider */
.hairline {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* Buttons — minimal primitives */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 24px;
  font-family: var(--font-en-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  cursor: pointer;
  transition: opacity var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.btn-primary { background: var(--pat-red); color: #fff; }
.btn-primary:hover { background: var(--pat-red-ink); }
.btn-primary:active { transform: translateY(1px); opacity: 0.9; }

.btn-secondary {
  background: transparent;
  color: var(--fg-1);
  border-color: var(--fg-1);
}
.btn-secondary:hover { background: var(--fg-1); color: var(--bg); }

.btn-ghost { background: transparent; color: var(--fg-1); }
.btn-ghost:hover { opacity: 0.85; }

/* Tag / chip */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  color: var(--fg-2);
}
.tag-accent { color: #fff; background: var(--pat-red); border-color: var(--pat-red); }

/* Loading bar */
@keyframes palsim-load {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.loading-bar {
  height: 2px;
  width: 100%;
  background: rgba(155, 27, 27, 0.18);
  overflow: hidden;
  position: relative;
}
.loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pat-red);
  animation: palsim-load 1.4s var(--ease-out) infinite;
}
