/* ============================================================
   Homei — Static styles (loaded by individual modules)
   v2.1 "Fridge-note" redesign — sage + warm paper, hand-drawn
   feel. This file ALSO redefines the design tokens used by
   homei_base.html so any page that loads only homei.css still
   gets the new palette.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Rubik:wght@400;500;600;700&display=swap');

/* ─────────────  v2.1 token override  ─────────────
   These re-bind the existing token names to the warm
   sage palette. homei_base.html loads first, then this
   file overrides — so no template surgery needed.
   ───────────────────────────────────────────────── */
:root {
  /* Paper surfaces — warmer & textured */
  --bg-page:   #faf3e6;   /* kraft cream */
  --bg-card:   #fffaee;   /* note */
  --bg-soft:   #fff5e0;   /* secondary note */
  --bg-muted:  #ece2c8;

  /* Sage / olive replaces navy */
  --accent-primary:       #7a8b5c;
  --accent-primary-hover: #5e6f43;
  --accent-soft:          #d8e0c4;

  /* Warm earth accents (custom — used by v2.1 components) */
  --sage:           #7a8b5c;
  --sage-deep:      #5e6f43;
  --sage-soft:      #d8e0c4;
  --terracotta:     #c87a52;
  --terracotta-soft:#f4d8c5;
  --plum:           #8a6b7d;
  --honey:          #d9a55c;
  --rose:           #d97a86;

  /* Sticky-note tints */
  --note:        #fffaee;
  --note-2:      #fff5e0;
  --note-pink:   #fde8d6;
  --note-mint:   #e6efd9;
  --note-blue:   #dde9ec;
  --note-yellow: #fbeec0;

  /* Warmer ink (replaces slate) */
  --text-primary:   #3a3328;
  --text-secondary: #6b5f4d;
  --text-muted:     #8c7f68;
  --ink:            #3a3328;
  --ink-2:          #6b5f4d;
  --ink-3:          #8c7f68;
  --ink-line:       #c7b89a;

  /* Borders — sketchy feel */
  --border:         #d8c8a8;
  --border-strong:  #b8a37e;

  /* Semantic — re-tinted */
  --success:    #5e6f43;  --success-bg: #e6efd9;
  --warning:    #d9a55c;  --warning-bg: #fbeec0;
  --danger:     #c87a52;  --danger-bg:  #f4d8c5;
  --info:       #7a8b5c;  --info-bg:    #d8e0c4;

  --focus-ring: rgba(122, 139, 92, 0.35);

  /* Shadows — softer, brown-tinted */
  --shadow-sm: 0 2px 0 rgba(58, 51, 40, 0.05),
               0 8px 22px rgba(58, 51, 40, 0.07);
  --shadow-md: 0 3px 0 rgba(58, 51, 40, 0.06),
               0 14px 32px rgba(58, 51, 40, 0.10);
  --shadow-lg: 0 4px 0 rgba(58, 51, 40, 0.07),
               0 22px 48px rgba(58, 51, 40, 0.14);

  /* Sketchy radii */
  --r-note: 18px;
}

/* Subtle paper texture on the page */
body {
  background-color: var(--bg-page);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(184, 163, 126, 0.06) 0, transparent 1px),
    radial-gradient(circle at 75% 60%, rgba(184, 163, 126, 0.05) 0, transparent 1px),
    radial-gradient(circle at 45% 80%, rgba(184, 163, 126, 0.04) 0, transparent 1px);
  background-size: 24px 24px, 32px 32px, 18px 18px;
}

/* Hand-written display class — only for hero/greeting/big numbers.
   Use on greeting <h1>, dashboard stats, or empty-state quotes. */
.hand {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  line-height: 1.1;
}

/* ─────────────  Card → Note  ─────────────
   Existing .card stays; .note is the new fridge-note variant
   (with optional tape strip and slight tilt). Modules can opt
   in by switching class name, or leave .card as-is.  */
.note {
  position: relative;
  background: var(--note);
  border: 1.5px solid var(--border);
  border-radius: var(--r-note);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.note.tilt-l { transform: rotate(-0.6deg); }
.note.tilt-r { transform: rotate(0.5deg); }
.note.tape::before {
  content: '';
  position: absolute;
  top: -10px;
  right: 28px;
  width: 56px; height: 18px;
  background: rgba(217, 165, 92, 0.42);
  border: 1px dashed rgba(120, 95, 60, 0.32);
  border-radius: 2px;
  transform: rotate(-3deg);
  pointer-events: none;
}

/* Sticky note color variants (use as .note.note--mint, etc.) */
.note--mint   { background: var(--note-mint); }
.note--pink   { background: var(--note-pink); }
.note--blue   { background: var(--note-blue); }
.note--yellow { background: var(--note-yellow); }
.note--peach  { background: var(--terracotta-soft); }

/* ─────────────  Buttons — push-button feel  ───────────── */
/* Override .btn-primary so it matches v2.1 sage push-button */
.btn-primary {
  background: var(--sage);
  color: #fff;
  border: 2px solid var(--sage-deep);
  box-shadow: 3px 3px 0 var(--sage-deep);
  border-radius: 9999px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:hover {
  background: var(--sage-deep);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--sage-deep);
  color: #fff;
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--sage-deep);
}

/* Warm/terracotta variant — for destructive-but-friendly actions */
.btn-warm {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 2px solid #a85f3a;
  border-radius: 9999px;
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
  box-shadow: 3px 3px 0 #a85f3a;
  transition: transform .12s ease, box-shadow .12s ease;
  min-height: 44px;
}
.btn-warm:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #a85f3a; color: #fff; }
.btn-warm:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #a85f3a; }

/* Ghost — dashed outline (note-on-paper feel) */
.btn-ghost {
  border: 2px dashed var(--border-strong);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--note);
  border-style: solid;
  border-color: var(--sage);
  color: var(--ink);
}

/* ─────────────  Inputs — dashed outline note feel  ───────────── */
.input-field {
  border: 2px dashed var(--border-strong);
  background: var(--note);
  border-radius: 14px;
  color: var(--ink);
}
.input-field:focus {
  border-style: solid;
  border-color: var(--sage);
  background: #fff;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* ─────────────  Badge → Chip (slight tilt)  ───────────── */
.badge,
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  background: var(--note-yellow);
  color: var(--ink);
  transform: rotate(-1.5deg);
}
.badge-green,  .chip.green { background: var(--note-mint); color: var(--sage-deep); border-color: var(--sage-deep); }
.badge-yellow, .chip.gold  { background: var(--note-yellow); }
.badge-red,    .chip.terr  { background: var(--terracotta-soft); border-color: var(--terracotta); color: #6e3a18; }
.badge-gray                { background: var(--bg-muted); color: var(--ink-2); border-color: var(--border-strong); }

/* ─────────────  Hand-drawn dividers  ─────────────
   Use as <hr class="squiggle"> to break up sections. */
.squiggle {
  border: 0;
  height: 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'><path d='M0 6 Q 10 0 20 6 T 40 6 T 60 6 T 80 6 T 100 6 T 120 6' fill='none' stroke='%23c7b89a' stroke-width='1.5' stroke-linecap='round'/></svg>") repeat-x;
  background-size: 120px 12px;
  margin: 12px 0;
}

/* ─────────────  Lola helpers  ─────────────
   Wrap an <img src="/homei/static/lola.svg"> in .lola-bob to make
   her gently bob, and use .lola-row to lay her next to a speech
   bubble. */
.lola-bob {
  animation: lola-float 4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lola-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-4px) rotate(2deg); }
}

.lola-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.speech-bubble {
  position: relative;
  background: var(--note);
  border: 2px solid var(--ink);
  border-radius: 22px;
  padding: 14px 20px;
  max-width: 420px;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: 'Caveat', cursive;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
}
.speech-bubble::before {
  content: '';
  position: absolute;
  right: -12px;
  bottom: 18px;
  width: 0; height: 0;
  border: 10px solid transparent;
  border-right: 0;
  border-left: 14px solid var(--note);
  filter: drop-shadow(2px 0 0 var(--ink));
}

/* ─────────────  Micro-animations  ───────────── */
@keyframes pop-in {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.pop-in { animation: pop-in .35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.wiggle:hover { animation: wiggle .4s ease-in-out; }

/* Honor user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .lola-bob, .pop-in, .wiggle:hover { animation: none !important; }
}
