/*
 * 문어도사 design tokens. Every color, size, space and corner on the site comes from here;
 * page styles never write a raw value that a token covers. Guide: DESIGN-SYSTEM.md.
 * The character (character.js) sets --char-* at runtime; these are the 문어도사 defaults.
 */
:root {
  /* Character colors, overwritten by the active character */
  --char-primary: #c8402c;
  --char-accent: #7a2e22;
  --char-ink: #33211c;
  --char-background: #f4f4f4;   /* = --gray-100; the character's manifest sets the same */

  /* Color: grayscale, neutral black-based grey (no tint).
     Text: 600 and darker. Borders and icons that carry meaning: 500 and darker. Disabled: 300–400. Grey fills: 50–100. */
  --gray-0: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f4;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a8a8a8;
  --gray-500: #8c8c8c;
  --gray-600: #6b6b6b;
  --gray-700: #4d4d4d;
  --gray-800: #2e2e2e;
  --gray-900: #111111;

  /* Color: text (semantic). Every text colour comes from these, and they come from the grey scale.
     Pages and components use only --color-text-*; the grey steps and the old names below are not for text. */
  --color-text-primary: var(--gray-900);      /* titles, body, labels, input values (18.9:1 on white) */
  --color-text-secondary: var(--gray-700);    /* supporting lines that still need reading (8.6:1) */
  --color-text-tertiary: var(--gray-600);     /* captions, hints, unpicked chips, notes (5.3:1) */
  --color-text-placeholder: var(--gray-500);  /* example text inside empty inputs, footer fine print (3.4:1) */
  --color-text-disabled: var(--gray-400);     /* controls that can't be used now */
  --color-text-active: var(--gray-900);       /* the picked item on a light surface (segmented, tabs) */
  --color-text-inverse: var(--gray-0);        /* on the dark button colour or dark photos (picked chips, primary button) */
  --color-text-inverse-subtle: rgba(255, 255, 255, .85);  /* secondary text on dark photos (intro) */
  --color-text-brand: var(--char-accent);     /* text buttons and links (.link) */
  --color-text-accent: var(--char-primary);   /* a word that must stand out (bold only: 4.4:1) */
  --color-text-error: var(--char-primary);    /* input errors, in the character's red */

  /* Color: surfaces and text */
  --color-page: #fff;
  --color-backdrop: #fafafa;    /* PC: outside the page frame */
  --color-soft: var(--gray-50);   /* cards, inputs, list rows */
  --color-line: var(--gray-200);  /* borders, dividers */
  --color-border: #e2e2e2;      /* neutral grey border for info boxes */
  /* Old text names, kept only so nothing breaks (other screens still use them); they point at the semantic tokens above. Don't use for new work. */
  --color-ink: var(--color-text-primary);
  --color-muted: var(--color-text-tertiary);
  --color-brand: var(--char-primary);
  --color-brand-deep: var(--char-accent);
  --color-brand-tint: #fdeee9;    /* selected chip, notice background */
  --color-button: #453330;        /* primary button */
  --color-on-dark: var(--gray-0);   /* fills and marks on dark (check marks); text uses --color-text-inverse */
  --color-scrim: rgba(30, 20, 16, .4);
  --color-toast: rgba(51, 33, 28, .92);
  --color-track: var(--gray-200); /* empty bar, empty glyph */
  --skeleton-base: var(--gray-100);   /* loading skeletons: neutral grey from the grey scale */
  --skeleton-shine: var(--gray-50);   /* highlight that sweeps across them */
  --color-divider: rgba(51, 33, 28, .12);
  --color-hover: rgba(200, 64, 44, .06);
  --color-grid: rgba(51, 33, 28, .08);   /* chart grid lines */
  /* Controls (checkbox, radio, switch, inputs): see the design system's 입력 components */
  --color-control-border: var(--gray-500);  /* empty checkbox/radio, underline input: 3.4:1 on white */
  --color-disabled-bg: var(--gray-100);
  --color-disabled-ink: var(--color-text-disabled);   /* old name */
  --color-pressed: rgba(51, 33, 28, .06);   /* rows, ghost checkboxes and tabs while held */
  --color-error: var(--color-brand);        /* input errors use the character's red, not an alarm red (text: --color-text-error) */

  /* Color: 인생 지도 highlights */
  --peak-fill: rgba(226, 170, 60, .18);  --peak-badge: rgba(226, 170, 60, .25);  --peak-ink: #7a5410;
  --rest-fill: rgba(52, 88, 143, .1);    --rest-badge: rgba(52, 88, 143, .14);

  /* Color: login providers (their own brand colors, never changed) */
  --kakao: #fee500; --kakao-ink: rgba(0, 0, 0, .85);


  /* Color: five elements, used for 명식 glyphs and charts */
  --wood: #3f8f5a;
  --fire: #d0473a;
  --earth: #b8892f;
  --metal: #8a8f99;
  --water: #34588f;
  /* 명식 글자 칸: 검은 글자(양)와 흰 글자(음)가 함께 쓰는 오행색 (중간보다 조금 밝게, 검정 글자 대비 약 5.5·흰 글자 약 3.3) */
  --wood-tile: #5f9d74; --fire-tile: #d96d62; --earth-tile: #ab8b4e; --metal-tile: #b8bcc2; --water-tile: #7c93b7;

  /* Color: home hero, shown under the art while it loads */
  --hero-fallback: linear-gradient(180deg, var(--gray-100) 0%, var(--gray-200) 100%);

  /* Color: home feature cards (top → bottom of the gradient, then the icon glow) */
  --feature-today: #f4e6cc;  --feature-today-end: #efdcc1;  --feature-today-glow: rgba(222, 170, 100, .3);  /* stays beige by choice */
  --feature-map: #daf5ef;    --feature-map-end: #d3f1ea;    --feature-map-glow: rgba(110, 195, 175, .35);
  --feature-compat: #f5e3f2; --feature-compat-end: #f4e0f0; --feature-compat-glow: rgba(215, 140, 200, .3);

  /* Type */
  --font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --text-score: 44px;                                /* one big number: 오늘의 운세 total */
  --text-display: 24px;   --leading-display: 30px;   /* home greeting */
  --text-title-1: 22px;                              /* result name */
  --text-title-2: 20px;   --leading-title-2: 28px;   /* home card title */
  --text-brand: 18px;                                /* 홈·로그인 상단 바 왼쪽 로고 글자(h1.brand) */
  --text-title-3: 17px;                              /* header title, brand, section heading */
  --text-body: 16px;      --leading-body: 1.6;       /* body, buttons */
  --text-body-sm: 15px;                              /* long reading, toast */
  --text-caption: 14px;                              /* secondary lines */
  --text-footnote: 13px;                             /* notes, fine print */
  --text-micro: 12px;                                /* badges, chart labels */
  --weight-regular: 400;
  --weight-medium: 600;
  --weight-bold: 700;

  /* Space (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Corners */
  --radius-sm: 10px;     /* buttons */
  --radius-xs: 6px;      /* checkbox box */
  --radius-md: 12px;     /* inputs, chips in rows */
  --radius-lg: 16px;     /* cards */
  --radius-xl: 20px;     /* hero, speech bubbles */
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card: 0 10px 30px rgba(120, 80, 40, .05);
  --shadow-float: 0 6px 20px rgba(0, 0, 0, .14);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .2);   /* the chosen segment */

  /* Layout */
  --page-max: 480px;
  --gutter: 20px;          /* left and right page padding */
  --header-height: 56px;   /* every screen, home included */
  --tap: 40px;             /* icon buttons */
  --control-height: 52px;  /* inputs, secondary buttons */
  --button-height: 56px;   /* primary buttons */
  --icon: 24px;
  --check-md: 20px;       /* checkbox */
  --check-lg: 24px;

  /* Motion */
  --duration: .2s;
}
