/* =========================================================
   스쿨톡톡 디자인 토큰 v2 — 또렷한 파랑 × 리퀴드 글래스
   기준 문서: docs/design-system.md
   1) 원시값 → 2) 의미값 → 3) 조각값. 화면 CSS는 2)·3)만 쓴다.
   ========================================================= */

/* ---------- 브랜드 글꼴 (Cafe24 PRO Slim) — 로고·감성 문장에만 ----------
   그 밖의 글자는 모두 Pretendard Variable (fonts/pretendard/pretendard.css, 우리 서버에서 제공).
   Slim Fit 파일도 static/fonts/에 두지만 화면에서는 쓰지 않는다. */
@font-face {
  font-family: "Cafe24 PRO Slim Air";
  src: url("/static/fonts/Cafe24PROSlimAir.woff2") format("woff2"),
       url("/static/fonts/Cafe24PROSlimAir.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "Cafe24 PRO Slim Max";
  src: url("/static/fonts/Cafe24PROSlimMax.woff2") format("woff2"),
       url("/static/fonts/Cafe24PROSlimMax.woff") format("woff");
  font-display: swap;
}

:root {
  /* ===================== 1. 원시값 ===================== */
  /* 회색 (토스 회색 + 흐린 글자 600만 진하게) */
  --grey-50:  #F9FAFB;
  --grey-100: #F2F4F6;
  --grey-200: #E5E8EB;
  --grey-300: #D1D6DB;
  --grey-400: #B0B8C1;
  --grey-500: #8B95A1;
  --grey-600: #636D7A;
  --grey-700: #4E5968;
  --grey-800: #333D4B;
  --grey-900: #191F28;
  --white: #FFFFFF;

  /* 파랑 (브랜드) — 500 대표색, 600 버튼, 700 글자 */
  --blue-50:  #E8F3FF;
  --blue-100: #C9E2FF;
  --blue-200: #90C2FF;
  --blue-300: #64A8FF;
  --blue-400: #4593FC;
  --blue-500: #3182F6;
  --blue-600: #206FE8;
  --blue-700: #1B64DA;
  --blue-800: #1957C2;
  --blue-900: #194AA6;

  /* 상태 */
  --red-600: #D22030;   --red-50: #FFEEF0;
  --green-700: #027A48; --green-50: #E6F8EF;
  --yellow-800: #8A5A00; --yellow-50: #FFF6D6;

  /* 톤 (기능 색) — bg / strong / ink (ink는 bg 위 4.5:1 이상) */
  --t-blue-bg: #E8F3FF;   --t-blue-strong: #90C2FF;   --t-blue-ink: #1B64DA;
  --t-sky-bg: #E4F6FB;    --t-sky-strong: #7FD3E8;    --t-sky-ink: #0B6680;
  --t-green-bg: #E6F8EF;  --t-green-strong: #6FD8A7;  --t-green-ink: #027A48;
  --t-yellow-bg: #FFF6D6; --t-yellow-strong: #FFD43B; --t-yellow-ink: #8A5A00;
  --t-orange-bg: #FFF1E6; --t-orange-strong: #FFC078; --t-orange-ink: #A94C00;
  --t-red-bg: #FFEEF0;    --t-red-strong: #FFA3B1;    --t-red-ink: #C2182E;
  --t-grey-bg: #F2F4F6;   --t-grey-strong: #D1D6DB;   --t-grey-ink: #4E5968;

  /* 웃음꽃 꽃잎 (색 약속) */
  --petal-mind: #FFA3B1;
  --petal-walk: #6FD8A7;
  --petal-write: #FFC078;
  --petal-photo: #7FD3E8;
  --petal-cheer: #90C2FF;
  --petal-core: #FFD43B;

  /* 간격 (4px 격자) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* 글자 크기 */
  --fs-xs: 13px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 17px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 28px; --fs-hero: 34px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-heavy: 800;

  /* 모서리 (docs 6장 — 동심원 규칙) */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px; --r-2xl: 32px;
  --r-pill: 999px; --r-circle: 50%;

  /* 움직임 */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-bounce: var(--ease-spring);

  /* ===================== 2. 의미값 ===================== */
  --font-body: "Pretendard Variable", Pretendard, Tossface, -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-display: var(--font-body);
  --font-brand: "Cafe24 PRO Slim Max", "Pretendard Variable", Pretendard, sans-serif;
  --font-air: "Cafe24 PRO Slim Air", "Pretendard Variable", Pretendard, sans-serif;
  --font-emoji: Tossface, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Pretendard Variable", Pretendard, sans-serif;

  --color-bg: var(--grey-100);
  --color-surface: var(--white);
  --color-surface-soft: var(--blue-50);
  --color-surface-sunken: var(--grey-50);
  --color-border: var(--grey-200);
  --color-border-strong: var(--grey-300);
  --color-border-input: var(--grey-500);   /* 입력칸 테두리 3:1 */

  --color-text-strong: var(--grey-900);
  --color-text: var(--grey-800);
  --color-text-muted: var(--grey-700);
  --color-text-faint: var(--grey-600);
  --color-text-on-primary: var(--white);

  --color-primary: var(--blue-600);         /* 흰 글자를 올리는 파랑 (4.67:1) */
  --color-primary-hover: var(--blue-700);
  --color-primary-press: var(--blue-800);
  --color-primary-text: var(--blue-700);    /* 흰 바탕 위 파란 글자 (5.41:1) */
  --color-primary-soft: var(--blue-50);
  --color-accent: var(--blue-500);          /* 아이콘·큰 숫자·진행 막대 */
  --color-focus: var(--blue-500);

  --color-danger: var(--red-600);   --color-danger-bg: var(--red-50);
  --color-success: var(--green-700); --color-success-bg: var(--green-50);
  --color-warn: var(--yellow-800);  --color-warn-bg: var(--yellow-50);
  --color-sun: var(--red-600);
  --color-sat: var(--blue-700);

  /* 바탕: 회색 위에 파랑·하늘 빛번짐 (유리가 보이게) */
  --gradient-bg:
    radial-gradient(60% 45% at 0% 0%, rgba(144, 194, 255, .55), transparent 70%),
    radial-gradient(55% 40% at 100% 10%, rgba(127, 211, 232, .35), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(100, 168, 255, .30), transparent 70%);
  --gradient-hero: linear-gradient(135deg, #DCEBFF 0%, #EAF4FF 45%, #E4F6FB 100%);
  --gradient-primary: linear-gradient(180deg, var(--blue-600), var(--blue-600));

  /* ---------- 리퀴드 글래스 (피그마 Light 레시피 → 웹) ---------- */
  --glass-thin-bg: rgba(255, 255, 255, .45);
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .48));
  --glass-thick-bg: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .64));
  /* 아래 메뉴: 어떤 내용 위에서도 이름이 읽히게 regular보다 조금 더 불투명 */
  --glass-nav-bg: linear-gradient(180deg, rgba(255, 255, 255, .84), rgba(255, 255, 255, .74));
  --glass-tinted-bg: linear-gradient(180deg, rgba(49, 130, 246, .92), rgba(32, 111, 232, .92));
  --glass-dark-bg: rgba(25, 31, 40, .78);
  --glass-filter-thin: blur(10px) saturate(160%);
  --glass-filter: blur(20px) saturate(180%);
  --glass-filter-thick: blur(40px) saturate(180%);
  --glass-border: 1px solid rgba(255, 255, 255, .6);
  --glass-rim-thin: inset 1px 1px 1px -1px #fff, inset -1px -1px 1px -1px #fff;
  --glass-rim: inset 2px 2px 2px -2px #fff, inset -2px -2px 2px -2px #fff;
  --glass-rim-thick: inset 2px 2px 10px -2px #fff, inset -2px -2px 10px -2px #fff;

  /* 그림자 */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-2: 0 8px 12px rgba(0, 0, 0, .08);
  --shadow-3: 0 24px 48px rgba(0, 0, 0, .10);
  --shadow-blue: 0 8px 16px rgba(32, 111, 232, .25);
  --shadow-sm: var(--shadow-1); --shadow-md: var(--shadow-2); --shadow-lg: var(--shadow-3);
  --shadow-glow: 0 0 0 4px rgba(49, 130, 246, .18);

  /* 화면 */
  --page-max: 560px;
  --page-x: var(--space-5);
  --nav-h: 64px;
  --nav-gap: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --aside-w: 280px;
  --shell-gap: 48px;
  --shell-shift: 0px;

  /* ===================== 3. 조각값 ===================== */
  --btn-h: 48px; --btn-h-lg: 56px; --btn-h-sm: 40px;
  --btn-radius: var(--r-pill);
  --card-r: var(--r-xl);
  --card-pad: var(--space-5);
  --r-inner: max(var(--r-xs), calc(var(--card-r) - var(--card-pad)));
  --input-h: 52px; --input-r: var(--r-md);
  --icon-sm: 20px; --icon-md: 24px; --icon-lg: 28px; --icon-xl: 40px;
  --z-nav: 50; --z-sheet: 80; --z-toast: 100;

  /* v1 이름 호환 (화면 CSS를 옮기는 동안만) */
  --radius-sm: var(--r-sm); --radius-md: var(--r-md); --radius-card: var(--r-xl);
  --radius-lg: var(--r-2xl); --radius-pill: var(--r-pill);
  --card-radius: var(--card-r); --input-radius: var(--input-r);
}

/* 톤 고르기 — data-tone="blue|sky|green|yellow|orange|red|grey" */
[data-tone="blue"]   { --tone-bg: var(--t-blue-bg);   --tone-strong: var(--t-blue-strong);   --tone-ink: var(--t-blue-ink); }
[data-tone="sky"]    { --tone-bg: var(--t-sky-bg);    --tone-strong: var(--t-sky-strong);    --tone-ink: var(--t-sky-ink); }
[data-tone="green"]  { --tone-bg: var(--t-green-bg);  --tone-strong: var(--t-green-strong);  --tone-ink: var(--t-green-ink); }
[data-tone="yellow"] { --tone-bg: var(--t-yellow-bg); --tone-strong: var(--t-yellow-strong); --tone-ink: var(--t-yellow-ink); }
[data-tone="orange"] { --tone-bg: var(--t-orange-bg); --tone-strong: var(--t-orange-strong); --tone-ink: var(--t-orange-ink); }
[data-tone="red"]    { --tone-bg: var(--t-red-bg);    --tone-strong: var(--t-red-strong);    --tone-ink: var(--t-red-ink); }
[data-tone="grey"]   { --tone-bg: var(--t-grey-bg);   --tone-strong: var(--t-grey-strong);   --tone-ink: var(--t-grey-ink); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
