/* ============================================================
   Dojo Poker Design Tokens
   Colors, type, spacing, radii, shadows, motion.

   Import this file once at the top of any HTML page:
     <link rel="stylesheet" href="colors_and_type.css">
   ============================================================ */

/* --- Web fonts (Google Fonts) ------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ---------- Color: raw palette ---------- */
  --paper:        #F5F0E6;   /* primary bg — aged washi */
  --paper-dim:    #ECE4D2;   /* slightly recessed surface */
  --paper-warm:   #FBF7EE;   /* slightly raised, near-white */
  --paper-deep:   #DBD0B8;   /* dividers on paper, sunken wells */

  --sumi:         #1F1A16;   /* deepest ink, max contrast */
  --ink:          #3B2E26;   /* default text + pagoda brown */
  --ink-soft:     #6B5847;   /* secondary text */
  --ink-mute:     #948272;   /* tertiary / placeholder */
  --ink-faint:    #BBA994;   /* disabled */

  --ember:        #C4613A;   /* signature accent — the enso */
  --ember-deep:   #A04A28;   /* hover */
  --ember-press:  #823A1F;   /* active */
  --ember-soft:   #E3A582;   /* tint */
  --ember-wash:   #F4D9C6;   /* surface tint */

  --bamboo:       #7A8D5C;   /* positive / correct / equity-up */
  --bamboo-deep:  #5C6E42;
  --bamboo-wash:  #DBE3CB;

  --crimson:      #A33E2E;   /* negative / fold / equity-down */
  --crimson-deep: #842B1F;
  --crimson-wash: #ECCEC7;

  --gold:         #C9A24B;   /* chip / streak / celebrate */
  --gold-deep:    #A8842F;
  --gold-wash:    #F0E3BE;

  --indigo:       #2E3F5B;   /* rare cool counterpoint for charts */
  --indigo-wash:  #CCD3DE;

  /* ---------- Color: semantic (light, default) ---------- */
  --bg:           var(--paper);
  --bg-dim:       var(--paper-dim);
  --bg-raised:    var(--paper-warm);
  --bg-sunken:    var(--paper-deep);

  --surface:      var(--paper-warm);
  --surface-2:    var(--paper);
  --surface-3:    var(--paper-dim);

  --text:         var(--ink);
  --text-soft:    var(--ink-soft);
  --text-mute:    var(--ink-mute);
  --text-faint:   var(--ink-faint);
  --text-on-accent: var(--paper-warm);

  --accent:       var(--ember);
  --accent-hover: var(--ember-deep);
  --accent-press: var(--ember-press);
  --accent-soft:  var(--ember-soft);
  --accent-wash:  var(--ember-wash);

  --positive:     var(--bamboo);
  --positive-wash:var(--bamboo-wash);
  --negative:     var(--crimson);
  --negative-wash:var(--crimson-wash);
  --highlight:    var(--gold);
  --highlight-wash:var(--gold-wash);

  --border:       rgba(59, 46, 38, 0.12);
  --border-strong:rgba(59, 46, 38, 0.24);
  --border-faint: rgba(59, 46, 38, 0.06);

  /* poker-specific suit colors */
  --suit-spade:   var(--ink);
  --suit-club:    var(--ink);
  --suit-heart:   var(--crimson);
  --suit-diamond: var(--ember);

  /* ---------- Typography: families ---------- */
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;     /* carved — ceremonial labels */
  --font-serif:   'Lora', 'Newsreader', Georgia, serif;       /* primary headline serif */
  --font-carved:  'Cinzel', 'Trajan Pro', Georgia, serif;     /* carved small-caps */
  --font-sans:    'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-body:    var(--font-sans);

  /* ---------- Typography: scale ---------- */
  --fs-2xs:  11px;
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-md:   16px;   /* body */
  --fs-lg:   18px;
  --fs-xl:   22px;
  --fs-2xl:  28px;
  --fs-3xl:  36px;
  --fs-4xl:  48px;
  --fs-5xl:  64px;
  --fs-6xl:  84px;
  --fs-7xl:  120px;

  --lh-tight:   1.1;
  --lh-snug:    1.25;
  --lh-normal:  1.5;
  --lh-loose:   1.7;

  --tracking-tight:   -0.02em;
  --tracking-normal:   0;
  --tracking-wide:     0.04em;
  --tracking-caps:     0.14em;   /* for Cinzel small-caps */

  /* ---------- Spacing (4px base) ---------- */
  --space-0:   0;
  --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;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;
  --space-32:  128px;

  /* ---------- Radii ---------- */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* ---------- Shadows ---------- */
  --shadow-1:    0 1px 2px rgba(59, 46, 38, 0.06);
  --shadow-2:    0 4px 16px -4px rgba(59, 46, 38, 0.10), 0 2px 4px -2px rgba(59, 46, 38, 0.06);
  --shadow-3:    0 16px 48px -12px rgba(59, 46, 38, 0.18), 0 4px 12px -4px rgba(59, 46, 38, 0.08);
  --shadow-4:    0 32px 80px -16px rgba(59, 46, 38, 0.24);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --shadow-focus: 0 0 0 3px rgba(196, 97, 58, 0.28);

  /* ---------- Motion ---------- */
  --ease-out:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:    120ms;
  --dur-base:    220ms;
  --dur-slow:    380ms;
  --dur-brush:   600ms;

  /* ---------- Layout ---------- */
  --container-sm:  640px;
  --container-md:  900px;
  --container-lg:  1200px;
  --container-xl:  1440px;
  --nav-height:    64px;
}

/* ============================================================
   Element defaults — these set the brand baseline.
   ============================================================ */

html {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }

* { box-sizing: border-box; }

/* Headings — sentence case in copy. Use carved/brush per role. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--fs-5xl); font-weight: 800; }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--text-soft); }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

::selection { background: var(--ember-wash); color: var(--ink); }

/* ============================================================
   Utility classes — direct styling for the brand's named roles.
   ============================================================ */

/* Display brush — the most ceremonial type role. */
.display-brush {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-6xl);
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Carved small-caps — eyebrows, stamps, awards. */
.eyebrow,
.carved {
  font-family: var(--font-carved);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Numeric / data — equity, stack sizes, hand counts. */
.mono,
.numeric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

/* Body roles */
.lead   { font-size: var(--fs-xl); line-height: var(--lh-snug); color: var(--text-soft); text-wrap: pretty; }
.body   { font-size: var(--fs-md); line-height: var(--lh-normal); }
.caption{ font-size: var(--fs-sm); line-height: var(--lh-normal); color: var(--text-soft); }
.micro  { font-size: var(--fs-xs); line-height: var(--lh-snug); color: var(--text-mute); }

/* ============================================================
   Buttons — canonical brand button.
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform 80ms var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--ember);
  color: var(--paper-warm);
  box-shadow: var(--shadow-1), var(--shadow-inset-top);
}
.btn-primary:hover { background: var(--ember-deep); }
.btn-primary:active { background: var(--ember-press); }

.btn-secondary {
  background: var(--ink);
  color: var(--paper-warm);
}
.btn-secondary:hover { background: var(--sumi); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--paper-dim); }

.btn-quiet {
  background: transparent;
  color: var(--text-soft);
  padding: 0 var(--space-3);
}
.btn-quiet:hover { color: var(--text); background: var(--paper-dim); }

.btn-danger {
  background: var(--crimson);
  color: var(--paper-warm);
}
.btn-danger:hover { background: var(--crimson-deep); }

.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: var(--fs-sm); }
.btn-lg { height: 56px; padding: 0 var(--space-8); font-size: var(--fs-lg); border-radius: var(--radius-md); }

/* ============================================================
   Surfaces / cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: var(--space-6);
}
.card-flat   { box-shadow: none; }
.card-raised { box-shadow: var(--shadow-3); }

/* ============================================================
   Form inputs
   ============================================================ */

.input {
  height: 44px;
  width: 100%;
  padding: 0 var(--space-4);
  background: var(--paper-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-mute); }
.input:focus { outline: none; border-color: var(--ember); box-shadow: var(--shadow-focus); }

/* ============================================================
   Badges / chips
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: var(--paper-dim);
  color: var(--text-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}
.badge-accent   { background: var(--ember-wash);   color: var(--ember-deep); }
.badge-positive { background: var(--bamboo-wash);  color: var(--bamboo-deep); }
.badge-negative { background: var(--crimson-wash); color: var(--crimson-deep); }
.badge-gold     { background: var(--gold-wash);    color: var(--gold-deep); }

/* ============================================================
   Suits — colored properly even at small sizes
   ============================================================ */
.suit-s, .suit-c { color: var(--suit-spade); }
.suit-h          { color: var(--suit-heart); }
.suit-d          { color: var(--suit-diamond); }
