/* The weekly mood card of Bellwort: a soft white card on a warm grey, one violet accent. The chart is an SVG drawn
   in pixels by script.js; the tooltip and the finger are placed by GSAP (the element), their look is in the child. */
:root {
  --bg: #eeece7;            /* the room around the card */
  --bg-deep: #e2dfd8;       /* the room in the corners */
  --card: #fbfaf7;          /* the card */
  --ink: #17161a;           /* the words */
  --muted: #8d8a93;         /* the small words */
  --line: rgba(23, 22, 26, 0.08); /* hairlines */
  --accent: #5b4cf0;        /* the one colour: a violet for the line, today and the logged mood */
  --accent-soft: rgba(91, 76, 240, 0.1); /* the accent as a tint */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(120% 90% at 50% 30%, var(--bg) 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 32px) 12px;
}

.card {
  position: relative;
  width: min(420px, 100%);
  padding: clamp(14px, 3.6vh, 24px) clamp(16px, 4.5vw, 24px) clamp(12px, 3vh, 20px);
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(23, 22, 26, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(23, 22, 26, 0.04),
    0 8px 18px -6px rgba(23, 22, 26, 0.08),
    0 28px 56px -18px rgba(40, 30, 90, 0.16);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.card__sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 50% at 85% 0%, rgba(91, 76, 240, 0.07), transparent 70%);
}

.head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(160deg, #6f62ff, var(--accent) 55%, #4536d6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px -4px rgba(91, 76, 240, 0.6);
}
.mark svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.who { display: grid; line-height: 1.15; }
.who__name { font-weight: 650; font-size: 14px; letter-spacing: -0.01em; }
.who__what { font-size: 12px; color: var(--muted); }

.range {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 550;
  background: #f2f0ec;
  box-shadow: inset 0 0 0 1px var(--line);
}
.range svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.stat {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: clamp(10px, 2.6vh, 18px);
}
.stat__big { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.stat__num {
  font-size: clamp(36px, 8vh, 48px);
  font-weight: 620;
  font-stretch: 92%;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__of { font-size: 13px; color: var(--muted); }
.stat__side { display: grid; justify-items: end; gap: 5px; padding-bottom: 4px; }
.stat__word { font-size: 13px; font-weight: 600; }
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 6px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 560;
  color: var(--accent);
  background: var(--accent-soft);
  font-variant-numeric: tabular-nums;
}
.delta svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.chart {
  position: relative;
  height: clamp(130px, 30vh, 190px);
  margin: clamp(8px, 2vh, 14px) -6px 0;
  cursor: grab;
}
.chart.is-holding { cursor: grabbing; }

.plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; transition: stroke 0.3s; }
.guide.is-near { stroke: rgba(91, 76, 240, 0.35); }
.level { font-size: 10px; fill: var(--muted); transition: fill 0.3s; }
.level.is-near { fill: var(--accent); }
.day { font-size: 10.5px; fill: var(--muted); text-anchor: middle; font-weight: 520; }
.day.is-today { fill: var(--accent); font-weight: 650; }
.day.is-near { fill: var(--ink); }

.line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.line--open { stroke-dasharray: 3 5; stroke-width: 1.8; opacity: 0.75; }
.shadow { fill: none; stroke: var(--accent); stroke-width: 3; opacity: 0.22; }
.area { pointer-events: none; }

.dot { fill: var(--card); stroke: var(--accent); stroke-width: 1.6; }
.dot--today { stroke-dasharray: 2.2 2.2; }
.dot--today.is-logged { fill: var(--accent); stroke-dasharray: none; }

.tip {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.tip__in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 11.5px;
  white-space: nowrap;
  color: #fff;
  background: rgba(23, 22, 26, 0.92);
  box-shadow: 0 6px 16px -6px rgba(23, 22, 26, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translate(-50%, calc(-100% - 14px));
}
.tip__in b { font-weight: 650; }
.tip__in i { font-style: normal; opacity: 0.6; font-variant-numeric: tabular-nums; }

.finger {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
}
.finger__in {
  display: block;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.7), rgba(23, 22, 26, 0.14) 70%);
  box-shadow: 0 6px 14px -4px rgba(23, 22, 26, 0.25);
  backdrop-filter: blur(2px);
}

.foot {
  position: relative;
  height: 22px;
  margin-top: clamp(6px, 1.6vh, 12px);
  font-size: 12px;
  color: var(--muted);
}
.foot p {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.foot svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.done { color: var(--ink); opacity: 0; }
.done svg { stroke: var(--accent); stroke-width: 1.8; }
.done b { color: var(--accent); font-weight: 650; }

@media (hover: hover) {
  .chart:hover .line { stroke-width: 2.7; }
}
