/* =========================================================
   Crafty Yum — Colors & Type
   Premium, minimal, kawaii-accented. Ivory-dominant, teal-anchored.
   ========================================================= */

/* -------- Fonts -------- */
@font-face {
  font-family: "Autumn Cartoon";
  src: url("fonts/Autumn-Cartoon.woff") format("woff");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montreal";
  src: url("fonts/Montreal-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montreal";
  src: url("fonts/Montreal-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montreal";
  src: url("fonts/Montreal-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montreal";
  src: url("fonts/Montreal-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---------- Brand palette ---------- */
  --cy-espresso:   #18100A;  /* anchor: dark bg, primary text */
  --cy-teal:       #265C58;  /* dominant accent: nav, CTA, tags */
  --cy-teal-700:   #1E4A46;  /* teal pressed / hover dark */
  --cy-teal-300:   #6A8E8A;  /* teal muted for borders/icons */
  --cy-rouge:      #9E1F35;  /* rare accent only — 1 per screen max */
  --cy-creme:      #F5E6C8;  /* Mochi speech bubbles ONLY */
  --cy-sable:      #EDE0CC;  /* cards, alternating surfaces */
  --cy-sable-deep: #E1D1B4;  /* sable border / hover */
  --cy-ivoire:     #FAF5EE;  /* main page bg (>=60% of any page) */

  /* Semantic surfaces */
  --cy-bg:           var(--cy-ivoire);
  --cy-bg-alt:       var(--cy-sable);
  --cy-bg-dark:      var(--cy-espresso);
  --cy-surface:      var(--cy-ivoire);
  --cy-surface-card: var(--cy-sable);
  --cy-mochi-bubble: var(--cy-creme);

  /* Semantic foreground */
  --cy-fg:        var(--cy-espresso);
  --cy-fg-muted:  #5A4A3E;              /* espresso at ~70% warmth */
  --cy-fg-subtle: #8A7A6C;
  --cy-fg-on-dark: var(--cy-ivoire);
  --cy-fg-on-dark-muted: #C9B99E;

  /* Lines & dividers */
  --cy-border:       #D9C9AE;           /* warm hairline on ivory */
  --cy-border-dark:  #3A2E24;           /* hairline on espresso */
  --cy-divider:      rgba(24, 16, 10, 0.08);

  /* Accent mapping */
  --cy-accent:         var(--cy-teal);
  --cy-accent-hover:   var(--cy-teal-700);
  --cy-accent-fg:      var(--cy-ivoire);
  --cy-rare-accent:    var(--cy-rouge);

  /* ---------- Type families ---------- */
  --cy-font-display:    "Autumn Cartoon", "Fraunces", Georgia, serif;
  --cy-font-wordmark:   "Autumn Cartoon", "Dancing Script", cursive;
  --cy-font-body:       "Montreal", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --cy-font-mochi:      "Autumn Cartoon", "Caveat", "Patrick Hand", cursive;
  --cy-font-mono:       ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---------- Type scale (mobile-first, but generous) ---------- */
  --cy-fs-display-xl: clamp(48px, 10vw, 96px);   /* hero kawaii display */
  --cy-fs-display-lg: clamp(40px, 7vw,  72px);
  --cy-fs-display:    clamp(32px, 5vw,  56px);
  --cy-fs-h1:         clamp(28px, 4.2vw, 44px);
  --cy-fs-h2:         clamp(22px, 3.2vw, 32px);
  --cy-fs-h3:         20px;
  --cy-fs-lede:       18px;
  --cy-fs-body:       16px;
  --cy-fs-small:      14px;
  --cy-fs-micro:      12px;
  --cy-fs-overline:   11px;

  /* ---------- Weights ---------- */
  --cy-fw-hair:   100;
  --cy-fw-light:  300;
  --cy-fw-regular: 400;
  --cy-fw-medium: 500;
  --cy-fw-bold:   700;

  /* ---------- Line height / tracking ---------- */
  --cy-lh-tight:   1.05;
  --cy-lh-display: 1.1;
  --cy-lh-heading: 1.2;
  --cy-lh-body:    1.55;
  --cy-lh-loose:   1.7;

  --cy-tr-tight:   -0.02em;
  --cy-tr-normal:  0;
  --cy-tr-wide:     0.04em;
  --cy-tr-overline: 0.18em;

  /* ---------- Spacing scale (4px grid) ---------- */
  --cy-sp-0:  0;
  --cy-sp-1:  4px;
  --cy-sp-2:  8px;
  --cy-sp-3:  12px;
  --cy-sp-4:  16px;
  --cy-sp-5:  24px;
  --cy-sp-6:  32px;
  --cy-sp-7:  48px;
  --cy-sp-8:  64px;
  --cy-sp-9:  96px;
  --cy-sp-10: 128px;

  /* ---------- Radii ---------- */
  --cy-r-xs:   4px;
  --cy-r-sm:   8px;
  --cy-r-md:   12px;
  --cy-r-lg:   18px;   /* default cards */
  --cy-r-xl:   28px;   /* hero panels, boxes */
  --cy-r-pill: 999px;

  /* ---------- Shadows (warm, grounded — no pure black) ---------- */
  --cy-shadow-xs: 0 1px 2px rgba(24, 16, 10, 0.06);
  --cy-shadow-sm: 0 2px 6px rgba(24, 16, 10, 0.08);
  --cy-shadow-md: 0 8px 20px -6px rgba(24, 16, 10, 0.14), 0 2px 4px rgba(24, 16, 10, 0.05);
  --cy-shadow-lg: 0 22px 40px -16px rgba(24, 16, 10, 0.22), 0 4px 10px rgba(24, 16, 10, 0.08);
  --cy-shadow-xl: 0 40px 80px -24px rgba(24, 16, 10, 0.32);
  /* on dark espresso sections: warm rim light */
  --cy-shadow-dark: 0 20px 50px -18px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 230, 200, 0.05);

  /* ---------- Motion ---------- */
  --cy-ease:       cubic-bezier(0.2, 0.7, 0.2, 1);
  --cy-ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --cy-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);   /* Mochi entrances only */
  --cy-t-fast:  120ms;
  --cy-t-med:   220ms;
  --cy-t-slow:  420ms;

  /* ---------- Layers ---------- */
  --cy-z-base:    1;
  --cy-z-sticky:  10;
  --cy-z-overlay: 50;
  --cy-z-mochi:   60;    /* Mochi fixed overlay */
  --cy-z-modal:   80;
  --cy-z-toast:   90;

  /* ---------- Layout ---------- */
  --cy-page-max:     1240px;
  --cy-page-pad:     clamp(20px, 4vw, 48px);
  --cy-page-pad-sm:  16px;
}

/* ======================================================
   Semantic base styles — apply these via class or rely on tags
   ====================================================== */

html, body {
  background: var(--cy-bg);
  color: var(--cy-fg);
  font-family: var(--cy-font-body);
  font-weight: var(--cy-fw-regular);
  font-size: var(--cy-fs-body);
  line-height: var(--cy-lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Display titles — Autumn Cartoon kawaii display */
.cy-display, h1.cy-h1, h2.cy-h2 {
  font-family: var(--cy-font-display);
  font-weight: var(--cy-fw-regular);
  line-height: var(--cy-lh-display);
  letter-spacing: var(--cy-tr-tight);
  color: var(--cy-fg);
}
.cy-display-xl { font-size: var(--cy-fs-display-xl); }
.cy-display-lg { font-size: var(--cy-fs-display-lg); }
.cy-display    { font-size: var(--cy-fs-display); }

h1, .cy-h1 {
  font-family: var(--cy-font-display);
  font-size: var(--cy-fs-h1);
  line-height: var(--cy-lh-heading);
  letter-spacing: var(--cy-tr-tight);
  font-weight: var(--cy-fw-regular);
  margin: 0 0 var(--cy-sp-4);
}
h2, .cy-h2 {
  font-family: var(--cy-font-display);
  font-size: var(--cy-fs-h2);
  line-height: var(--cy-lh-heading);
  letter-spacing: var(--cy-tr-tight);
  font-weight: var(--cy-fw-regular);
  margin: 0 0 var(--cy-sp-3);
}
h3, .cy-h3 {
  font-family: var(--cy-font-body);
  font-size: var(--cy-fs-h3);
  font-weight: var(--cy-fw-medium);
  line-height: var(--cy-lh-heading);
  letter-spacing: var(--cy-tr-tight);
  margin: 0 0 var(--cy-sp-2);
}

.cy-lede, p.cy-lede {
  font-size: var(--cy-fs-lede);
  line-height: var(--cy-lh-body);
  color: var(--cy-fg-muted);
  font-weight: var(--cy-fw-light);
}

p, .cy-p {
  font-size: var(--cy-fs-body);
  line-height: var(--cy-lh-body);
  color: var(--cy-fg);
  margin: 0 0 var(--cy-sp-4);
  text-wrap: pretty;
}

.cy-small  { font-size: var(--cy-fs-small); line-height: 1.5; color: var(--cy-fg-muted); }
.cy-micro  { font-size: var(--cy-fs-micro); color: var(--cy-fg-subtle); }

.cy-overline {
  font-size: var(--cy-fs-overline);
  letter-spacing: var(--cy-tr-overline);
  text-transform: uppercase;
  color: var(--cy-teal);
  font-weight: var(--cy-fw-medium);
}

/* Wordmark — uses the loaded Crafty Yum display font */
.cy-wordmark {
  font-family: var(--cy-font-wordmark);
  font-weight: var(--cy-fw-regular);
  color: var(--cy-fg);
  line-height: 1;
}

/* Mochi speech — uses the loaded Crafty Yum display font */
.cy-mochi-bubble {
  font-family: var(--cy-font-mochi);
  background: var(--cy-creme);
  color: var(--cy-espresso);
  font-size: 20px;
  line-height: 1.3;
  padding: var(--cy-sp-3) var(--cy-sp-4);
  border-radius: var(--cy-r-lg);
  box-shadow: var(--cy-shadow-sm);
  position: relative;
  max-width: 260px;
}

/* Dark section inverse */
.cy-dark {
  background: var(--cy-espresso);
  color: var(--cy-fg-on-dark);
}
.cy-dark h1, .cy-dark h2, .cy-dark h3 { color: var(--cy-fg-on-dark); }
.cy-dark p, .cy-dark .cy-p { color: var(--cy-fg-on-dark-muted); }
.cy-dark .cy-overline { color: var(--cy-creme); }

/* Links */
a, .cy-link {
  color: var(--cy-teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--cy-t-fast) var(--cy-ease),
              color var(--cy-t-fast) var(--cy-ease);
}
a:hover, .cy-link:hover {
  color: var(--cy-teal-700);
  border-bottom-color: currentColor;
}

/* Focus ring — warm teal */
:focus-visible {
  outline: 2px solid var(--cy-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection {
  background: var(--cy-teal);
  color: var(--cy-ivoire);
}
