/* =========================================================================
   Théo edu. — Design tokens
   Colors, typography, spacing, radii, shadow, motion.
   Import once at the top of any HTML file:
     <link rel="stylesheet" href="/colors_and_type.css" />
   ========================================================================= */

/* ------------------------------------------------------------------
   Web fonts
     Fraunces           → display Latin (Google Fonts — substitution flagged)
     JinxuanLatte       → display + body CJK (justfont 金萱拿鐵, brand-licensed)
     Inter              → body Latin (Google Fonts — substitution flagged)
     JetBrains Mono     → mono (Google Fonts — substitution flagged)
   ------------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..700,0..100;1,9..144,300..700,0..100&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

@font-face {
  font-family: 'JinxuanLatte';
  src: url('fonts/jf-jinxuanlatte-2.1-book__1_.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JinxuanLatte';
  src: url('fonts/jf-jinxuanlatte-2.1-extrabold__1_.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Colour ---------------------------------------------------- */
  --cream:        #FEEFE5;   /* ground */
  --cream-2:      #FBE4D3;   /* slightly deeper ground, for bands */
  --terracotta:   #D86343;   /* single accent */
  --terracotta-2: #B84E33;   /* hover / pressed */
  --terracotta-3: #8C3A25;   /* extreme deep, rare */

  --ink:          #1A1613;   /* body text, line work */
  --ink-2:        #4A3F38;   /* secondary text */
  --ink-3:        #8A7B70;   /* tertiary / meta */
  --hairline:     #E6D5C7;   /* 1px rules, card borders */
  --surface:      #FFFFFF;   /* card that lifts off the cream */
  --deep:         #2A1F1A;   /* dark sections — footer, covers */

  /* status — used sparingly, tinted warm */
  --positive:     #5F7A4A;
  --caution:      #C48A2E;
  --negative:     #B84E33;   /* same as terracotta-2 — not a new hue */

  --focus-ring:   rgba(216, 99, 67, 0.35);

  /* --- Type ------------------------------------------------------ */
  --font-display:     'Fraunces', 'JinxuanLatte', Georgia, serif;
  --font-display-cjk: 'JinxuanLatte', 'Fraunces', 'PingFang TC', Georgia, serif;
  --font-body:        'Inter', 'JinxuanLatte', -apple-system, system-ui, sans-serif;
  --font-body-cjk:    'JinxuanLatte', 'Inter', 'PingFang TC', -apple-system, system-ui, sans-serif;
  --font-mono:        'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* scale — 1.250 major third, slightly compressed */
  --t-display: 72px;   --lh-display: 1.02;  --tr-display: -0.02em;
  --t-h1:      48px;   --lh-h1:      1.08;  --tr-h1:      -0.015em;
  --t-h2:      32px;   --lh-h2:      1.15;  --tr-h2:      -0.01em;
  --t-h3:      22px;   --lh-h3:      1.30;  --tr-h3:      -0.005em;
  --t-lead:    20px;   --lh-lead:    1.55;
  --t-body:    16px;   --lh-body:    1.65;
  --t-small:   14px;   --lh-small:   1.50;
  --t-micro:   12px;   --lh-micro:   1.40;

  /* --- Spacing (8pt grid) --------------------------------------- */
  --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 ---------------------------------------------------- */
  --r-1:    4px;
  --r-2:    8px;
  --r-3:    12px;
  --r-4:    20px;
  --r-full: 9999px;

  /* --- Shadow (warm-tinted) ------------------------------------- */
  --shadow-1: 0 1px 2px rgba(58, 32, 20, 0.06);
  --shadow-2: 0 10px 30px -12px rgba(58, 32, 20, 0.18);
  --shadow-3: 0 30px 60px -20px rgba(58, 32, 20, 0.22);

  /* --- Motion --------------------------------------------------- */
  --ease:      cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast:  180ms;
  --dur-mid:   320ms;
  --dur-slow:  480ms;

  /* --- Layout --------------------------------------------------- */
  --measure:   68ch;
  --container: 1200px;
}

/* ------------------------------------------------------------------
   Semantic element styles — opt in by setting the class OR by
   inheriting from the body default.
   ------------------------------------------------------------------ */
html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.display, h1.display {
  font-family: var(--font-display);
  font-size: var(--t-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  color: var(--ink);
  text-wrap: balance;
}

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--t-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--tr-h1);
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  color: var(--ink);
  text-wrap: balance;
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--t-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--tr-h2);
  font-weight: 500;
  font-variation-settings: "opsz" 48, "SOFT" 20;
  color: var(--ink);
  text-wrap: balance;
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--tr-h3);
  font-weight: 500;
  color: var(--ink);
}

.lead {
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  color: var(--ink-2);
  max-width: var(--measure);
}

p {
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: var(--measure);
}

small, .small { font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-3); }
.micro       { font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--ink-3);
               text-transform: uppercase; letter-spacing: 0.12em; font-weight: 500; }

.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.cjk-display { font-family: var(--font-display-cjk); }
.cjk-body    { font-family: var(--font-body-cjk); }

/* Links */
a {
  color: var(--terracotta);
  text-decoration: none;
  background-image: linear-gradient(var(--terracotta), var(--terracotta));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size var(--dur-fast) var(--ease);
}
a:hover { background-size: 100% 1px; }

/* Selection */
::selection { background: var(--terracotta); color: var(--cream); }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Dashed brand rule */
.rule-dashed {
  border: none;
  border-top: 1px dashed var(--ink-3);
  opacity: 0.6;
  margin: var(--s-6) 0;
}
.rule-hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: var(--s-6) 0;
}
