/* ============================
   BASE.CSS — Design Tokens & Reset
   ============================ */

:root {
  /* Brand palette */
  --coral:    #FF6B6B;
  --teal:     #4ECDC4;
  --yellow:   #FFE66D;
  --lavender: #A29BFE;
  --orange:   #FD9644;
  --sky:      #74B9FF;
  --mint:     #55EFC4;
  --pink:     #FD79A8;
  --lime:     #BADC58;

  /* Surfaces */
  --bg:           #FFF8F0;
  --surface:      #FFFFFF;
  --surface-alt:  #FFF3E8;

  /* Text */
  --text:       #2D3436;
  --text-muted: #636E72;
  --text-light: #B2BEC3;

  /* Borders */
  --border:       #F0E6D6;
  --border-mid:   #DDD0C0;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(45,52,54,.07);
  --shadow-md: 0 4px 20px rgba(45,52,54,.11);
  --shadow-lg: 0 8px 40px rgba(45,52,54,.15);

  /* Meal slots */
  --breakfast-color: #FFB347;
  --lunch-color:     #4ECDC4;
  --dinner-color:    #A29BFE;
  --snacks-color:    #FF6B6B;
  --drinks-color:    #74B9FF;

  /* Macro ring colours */
  --macro-kcal:    #FF6B6B;
  --macro-protein: #A29BFE;
  --macro-carbs:   #FFE034;
  --macro-fat:     #FD9644;
  --macro-fibre:   #4ECDC4;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;

  /* Radii */
  --r-sm:   8px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Typography */
  --font-display: 'Fredoka One', cursive;
  --font-body:    'Nunito', sans-serif;

  /* Easing */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);

  /* Durations */
  --t-fast:   150ms;
  --t-normal: 280ms;
  --t-slow:   450ms;

  /* Layout */
  --nav-h:       72px;
  --max-w:       430px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: var(--font-body);
  outline: none;
}

/* === App shell === */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  overflow-x: hidden;
}

.main-content {
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  min-height: 100dvh;
}

/* === Typography helpers === */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { line-height: 1.6; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }
