/* RATSON COFFEE — shared design tokens (website).
   Mirror of ratson_theme.dart. Change values HERE and in the Dart file only. */

:root {
  /* Brand palette (from brand brief) */
  --rc-gold: #D9A51D;
  --rc-gold-deep: #A96F08;
  --rc-espresso: #17100B;
  --rc-brown: #63351F;
  --rc-emerald: #13833B;
  --rc-forest: #075526;
  --rc-ivory: #F5EBDD;
  --rc-white: #FFFFFF;
  --rc-muted-on-dark: #A69A89;

  /* Accessible alternatives for LIGHT surfaces (verified WCAG AA)
     gold-deep on ivory = 3.59 (fails small text) -> use gold-text
     muted-on-dark on ivory = 2.34 (fails)        -> use muted-on-light
     emerald on ivory = 4.11 (fails small text)   -> use forest for text */
  --rc-gold-text: #7A4F06;        /* 6.04:1 on ivory, 7.12:1 on white */
  --rc-muted-on-light: #6B5E4E;   /* 5.34:1 on ivory, 6.29:1 on white */
  --rc-green-text: var(--rc-forest); /* 7.62:1 on ivory */

  /* Semantic roles */
  --rc-bg-dark: var(--rc-espresso);
  --rc-bg-story: var(--rc-brown);
  --rc-bg-light: var(--rc-ivory);
  --rc-surface-card: var(--rc-white);
  --rc-text-on-dark: var(--rc-ivory);          /* 15.97:1 on espresso */
  --rc-text-on-light: var(--rc-espresso);      /* 15.97:1 on ivory */
  --rc-accent-on-dark: var(--rc-gold);         /* 8.38:1 on espresso, 4.54:1 on brown */
  --rc-accent-on-light: var(--rc-gold-text);
  --rc-btn-primary-bg: var(--rc-gold);
  --rc-btn-primary-text: var(--rc-espresso);   /* 8.38:1 */
  --rc-btn-fresh-bg: var(--rc-forest);         /* secondary/green button */
  --rc-btn-fresh-text: var(--rc-white);        /* 8.99:1 */
  --rc-badge-bg: var(--rc-emerald);
  --rc-badge-text: var(--rc-white);            /* 4.84:1 */
  --rc-focus-ring: var(--rc-gold);

  /* Typography */
  --rc-font-display: "Playfair Display", "Noto Serif Ethiopic", Georgia, "Times New Roman", serif;
  --rc-font-body: "Inter", "Noto Sans Ethiopic", system-ui, -apple-system, "Nyala", "Segoe UI", Roboto, sans-serif;
  --rc-text-xs: 0.75rem;
  --rc-text-sm: 0.875rem;
  --rc-text-md: 1rem;
  --rc-text-lg: clamp(1.05rem, 3.8vw, 1.25rem);
  --rc-text-xl: clamp(1.35rem, 5vw, 1.75rem);
  --rc-text-2xl: clamp(1.75rem, 6.5vw, 2.5rem);
  --rc-text-3xl: clamp(2.5rem, 6vw, 4.5rem);
  --rc-leading-tight: 1.15;
  --rc-leading-body: 1.6;

  /* Spacing (4px base) */
  --rc-space-1: 4px;
  --rc-space-2: 8px;
  --rc-space-3: 12px;
  --rc-space-4: 16px;
  --rc-space-5: 24px;
  --rc-space-6: 32px;
  --rc-space-7: 48px;
  --rc-space-8: 72px;

  /* Radius */
  --rc-radius-sm: 6px;
  --rc-radius-md: 12px;
  --rc-radius-lg: 20px;
  --rc-radius-pill: 999px;

  /* Elevation */
  --rc-shadow-1: 0 1px 3px rgba(23, 16, 11, 0.18);
  --rc-shadow-2: 0 6px 18px rgba(23, 16, 11, 0.22);
  --rc-shadow-3: 0 16px 40px rgba(23, 16, 11, 0.32);

  /* Borders & motion */
  --rc-border-dark: 1px solid rgba(217, 165, 29, 0.35);
  --rc-border-light: 1px solid rgba(99, 53, 31, 0.18);
  --rc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --rc-dur-fast: 150ms;
  --rc-dur: 280ms;
}

/* ---------- Base ---------- */
body {
  margin: 0;
  font-family: var(--rc-font-body);
  font-size: var(--rc-text-md);
  line-height: var(--rc-leading-body);
  color: var(--rc-text-on-light);
  background: var(--rc-bg-light);
}
h1, h2, h3 { font-family: var(--rc-font-display); line-height: var(--rc-leading-tight); }

/* Section themes */
.rc-section--dark  { background: var(--rc-bg-dark);  color: var(--rc-text-on-dark); }
.rc-section--story { background: var(--rc-bg-story); color: var(--rc-text-on-dark); }
.rc-section--light { background: var(--rc-bg-light); color: var(--rc-text-on-light); }
.rc-section--dark a:not(.rc-btn), .rc-section--story a:not(.rc-btn) { color: var(--rc-accent-on-dark); }
.rc-section--light a:not(.rc-btn) { color: var(--rc-accent-on-light); }
.rc-section--light .rc-muted { color: var(--rc-muted-on-light); }
.rc-section--dark  .rc-muted { color: var(--rc-muted-on-dark); }

/* ---------- Buttons ---------- */
.rc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: var(--rc-space-3) var(--rc-space-5);
  font: 600 var(--rc-text-md) var(--rc-font-body);
  border: 0; border-radius: var(--rc-radius-pill); cursor: pointer;
  text-decoration: none;
  transition: transform var(--rc-dur-fast) var(--rc-ease), box-shadow var(--rc-dur) var(--rc-ease);
}
.rc-btn--primary { background: var(--rc-btn-primary-bg); color: var(--rc-btn-primary-text); box-shadow: var(--rc-shadow-1); }
.rc-btn--primary:hover { transform: translateY(-1px); box-shadow: var(--rc-shadow-2); }
.rc-btn--fresh { background: var(--rc-btn-fresh-bg); color: var(--rc-btn-fresh-text); }
.rc-btn--ghost { background: transparent; color: var(--rc-accent-on-dark); box-shadow: inset 0 0 0 1.5px var(--rc-gold); }
.rc-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--rc-focus-ring); outline-offset: 3px;
}

/* ---------- Cards, badges, forms ---------- */
.rc-card {
  background: var(--rc-surface-card); color: var(--rc-text-on-light);
  border: var(--rc-border-light); border-radius: var(--rc-radius-md);
  box-shadow: var(--rc-shadow-1); overflow: hidden;
  transition: transform var(--rc-dur) var(--rc-ease), box-shadow var(--rc-dur) var(--rc-ease);
}
.rc-card:hover { transform: translateY(-3px); box-shadow: var(--rc-shadow-2); }
.rc-badge {
  display: inline-block; padding: 2px var(--rc-space-3);
  background: var(--rc-badge-bg); color: var(--rc-badge-text);
  border-radius: var(--rc-radius-pill); font-size: var(--rc-text-xs); font-weight: 600;
}
.rc-input {
  width: 100%; min-height: 44px; padding: var(--rc-space-3) var(--rc-space-4);
  font: var(--rc-text-md) var(--rc-font-body); color: var(--rc-text-on-light);
  background: var(--rc-white); border: 1.5px solid var(--rc-muted-on-light);
  border-radius: var(--rc-radius-sm);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}


/* ---------- Responsive base (phones first) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
img, svg, video, canvas { max-width: 100%; }
h1, h2, h3, h4, p, li, td, th, label, a, button { overflow-wrap: break-word; }
.rc-btn { line-height: 1.25; white-space: normal; text-align: center; max-width: 100%; }
@media (max-width: 640px) {
  :root { --rc-space-5: 20px; --rc-space-6: 24px; --rc-space-7: 36px; --rc-space-8: 48px; }
  .rc-btn { padding-left: var(--rc-space-4); padding-right: var(--rc-space-4); }
}
