/*
 * cook.css - scene 3: the stove, the card in its stand, the steno pad, the egg
 * timers and the cook-log form.
 *
 * Talks to: js/cook.js builds the elements styled here. card.css styles the card.
 *
 * Say it to a judge: "Cook mode reuses the same card, so the recipe looks identical
 * in the box and at the stove. The colour of the light comes from the real time of
 * day: one class on the scene picks the sky in the window and a soft wash over the room."
 */

.cook-bg {
  position: absolute;
  inset: 0;
  height: 100%;
}

/* ---------- The window and the time of day ---------- */
/* .cook-window covers the whole stage; its children are placed against the painted
   window of bg-kitchen-cook.jpg. If that background is replaced, re-measure these. */
.cook-window {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Exactly the painted pane of glass. */
.cook-glass {
  position: absolute;
  left: 10.9%;
  top: 14.95%;
  width: 19.38%;
  height: 48.75%;
  overflow: hidden;
}
/* A curtain rod across the top of the frame, and a full-length curtain each side. */
.cook-rod {
  position: absolute;
  left: 5%;
  top: 8.6%;
  width: 31.2%;
  height: 0.9%;
  border-radius: calc(var(--u) * 0.3);
  background: linear-gradient(var(--harvest-gold), var(--walnut));
}
.cook-curtain {
  position: absolute;
  top: 7.6%;
  width: 8.8%;
  height: 62%;
  filter: drop-shadow(calc(var(--u) * 0.2) calc(var(--u) * 0.2) calc(var(--u) * 0.3) rgba(23, 17, 13, 0.25));
}
.cook-curtain-left { left: 5.6%; }
.cook-curtain-right { left: 26.7%; transform: scaleX(-1); }
/* WHY "cover": the box is narrower than the picture, so only the middle strip of the
   gathered cloth shows, at its true scale, instead of the whole curtain squashed thin. */
.cook-curtain .asset { height: 100%; aspect-ratio: auto !important; }
.cook-curtain img { object-fit: cover; }
.cook-sky,
.cook-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Night shows the night view; every other time shows the day view, tinted. */
#scene-cook .view-night { opacity: 0; }
#scene-cook.time-night .view-night { opacity: 1; }
#scene-cook.time-night .view-day { opacity: 0; }

/* 5-9 am: peach dawn */
.time-dawn .cook-sky { background: linear-gradient(to top, rgba(255, 176, 138, 0.7), rgba(255, 224, 190, 0.3)); }
.time-dawn .cook-wash { background: rgba(255, 196, 160, 0.14); }
/* 9 am-4 pm: pale gold */
.time-day .cook-sky { background: linear-gradient(to top, rgba(255, 236, 170, 0.3), rgba(255, 248, 220, 0.1)); }
.time-day .cook-wash { background: rgba(255, 236, 170, 0.07); }
/* 4-8 pm: orange-rose dusk */
.time-dusk .cook-sky { background: linear-gradient(to top, rgba(240, 128, 84, 0.7), rgba(206, 116, 140, 0.4)); }
.time-dusk .cook-wash { background: rgba(236, 138, 96, 0.16); }
/* 8 pm-5 am: deep indigo night */
.time-night .cook-sky { background: linear-gradient(to top, rgba(44, 40, 96, 0.35), rgba(20, 22, 60, 0.45)); }
/* At night the whole room dims to match the dark window; the card, pad and timers
   are drawn above this wash, so they stay bright as if under the stove light. */
.time-night .cook-wash { background: rgba(38, 34, 84, 0.52); mix-blend-mode: multiply; }

/* ---------- The card on its rest ---------- */
/* The rest is a long low block standing on the counter; the card stands in the
   groove along its top and leans back against the wall. */
.cook-card {
  position: absolute;
  left: 48.5%;
  top: 26%;
  --card-w: 50;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 1) rgba(23, 17, 13, 0.4));
}
.cook-card .card { --card-w: 50; }

.cook-stand {
  position: absolute;
  left: 51.5%;
  top: 77.3%;
  width: 44%;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 0.5) rgba(23, 17, 13, 0.4));
  pointer-events: none;
}

/* Tool 1: ingredients you can tick off. */
.cook-ingredient {
  display: block;
  width: 100%;
  text-align: left;
  text-indent: 0;
  line-height: inherit;
  transition: opacity 0.4s ease, color 0.4s ease;
}
.cook-ingredient.is-checked {
  color: var(--pencil);
  opacity: 0.55;
}
.cook-ingredient.is-checked::before {
  content: '\2713\00a0';            /* a pencil tick and a space */
  color: var(--ink);
}
.cook-card .card-ingredients li { padding-left: 0; text-indent: 0; }
.cook-card :focus-visible { outline-color: var(--burnt-orange); }

/* Tool 2: the current step is underlined in pencil. */
.card-steps li.is-current {
  text-decoration: underline;
  text-decoration-color: var(--pencil);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

/* Tool 4: "- Makes 4 +" */
.cook-card .card-servings {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.2em;
}
.cook-servings-mark {
  position: relative;
  width: 1.5em;
  height: 1.35em;
  line-height: 1;
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--ink);
  border: 0.08em solid var(--pencil);
  border-radius: 50% 45% 55% 48% / 60% 55% 60% 50%;
}

/* WHY: the minus and plus are drawn small to fit the card, so an invisible pad
   around each makes the area a finger can hit about three times bigger. */
.cook-servings-mark::after {
  content: '';
  position: absolute;
  inset: -0.7em -0.5em;
}

/* ---------- The steno pad ---------- */
/* Stands on the counter between the window and the card, leaning back on the wall. */
.cook-steno {
  position: absolute;
  left: 31%;
  top: 48.5%;
  width: 16.5%;
  filter: drop-shadow(0 calc(var(--u) * 0.4) calc(var(--u) * 0.8) rgba(23, 17, 13, 0.4));
}
.steno-page {
  position: absolute;
  inset: 13% 9% 5% 10%;             /* below the spiral, inside the paper */
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.steno-count {
  margin: 0;
  font-family: var(--font-typed);
  font-size: calc(var(--u) * 0.8);
  color: var(--walnut);
}
.steno-step {
  flex: 1;
  margin: 0.3em 0;
  overflow-y: auto;
  font-family: var(--font-hand);
  font-size: calc(var(--u) * 1.45);
  line-height: 1.2;
}
.steno-arrows {
  display: flex;
  justify-content: space-between;
}
.steno-arrow {
  min-height: calc(var(--u) * 3.8);
  padding: 0 0.3em;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: calc(var(--u) * 1.5);
  color: var(--ink);
  transition: opacity 0.3s ease;
}
.steno-arrow:disabled { opacity: 0.25; }
.cook-steno :focus-visible { outline-color: var(--burnt-orange); }

/* ---------- Egg timers ---------- */
/* A row along the counter under the window. The first egg (with the plus) adds a
   timer; each timer you add stands to its right. */
.cook-timers {
  position: absolute;
  left: 4%;
  top: 82.5%;
  display: flex;
  align-items: flex-start;
  gap: calc(var(--u) * 2.2);
}
.timer-row {
  display: flex;
  gap: calc(var(--u) * 2.2);
}
.timer-add,
.timer {
  position: relative;
  width: calc(var(--u) * 4.6);
  flex: none;
}
/* A soft shadow so each egg stands on the counter. */
.timer-add::before,
.timer::before {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -4%;
  height: 14%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(59, 38, 22, 0.45), transparent 70%);
}
.timer-add::after {
  content: '+';
  position: absolute;
  right: -12%;
  top: -8%;
  width: 1.25em;
  line-height: 1.25em;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: calc(var(--u) * 1.4);
  text-align: center;
  color: var(--paper);
  background: var(--burnt-orange);
  border-radius: 50%;
}
.timer {
  touch-action: none;               /* the drag sets the dial; it must not scroll the page */
}
.timer .asset,
.timer-add .asset { position: relative; pointer-events: none; }

/* The dial: a dotted ring round the egg. cook.js turns the whole ring, and the knob
   fixed at its top travels round with it to mark the minutes (top = 0, clockwise). */
.timer-dial {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  aspect-ratio: 1;
  margin: -75% 0 0 -75%;
  border: calc(var(--u) * 0.16) dotted var(--paper);
  border-radius: 50%;
  filter: drop-shadow(0 0 calc(var(--u) * 0.15) rgba(23, 17, 13, 0.7));
  pointer-events: none;
}
.timer-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: calc(var(--u) * 1.1);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--burnt-orange);
  border: calc(var(--u) * 0.14) solid var(--paper);
  border-radius: 50%;
}
.timer-readout {
  position: absolute;
  left: 50%;
  top: 104%;
  transform: translateX(-50%);
  padding: 0 0.4em;
  font-family: var(--font-typed);
  font-size: calc(var(--u) * 1);
  white-space: nowrap;
  color: var(--ink);
  background: var(--paper);
  border-radius: calc(var(--u) * 0.2);
  pointer-events: none;
}
.timer.is-ringing .timer-readout { color: var(--paper); background: var(--burnt-orange); }

/* ---------- Done Cooking and Not today ---------- */
/* Hangs from the brass hook on the front of the card rest. */
.cook-done-tag {
  position: absolute;
  left: 87.6%;
  top: 83%;
  width: 3.8%;
  transform: rotate(3deg);
  transform-origin: 50% 0;
}
.cook-done-text {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 42%;
  bottom: 6%;
  display: grid;
  place-items: center;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: calc(var(--u) * 0.85);
  line-height: 1;
  text-align: center;
  color: var(--ink);
}
.cook-done-tag .asset-label { display: none; }

/* A note pinned to the wall above the card. */
.cook-not-today {
  position: absolute;
  left: 77%;
  top: 7%;
  min-height: calc(var(--u) * 3.4);
  padding: 0.2em 1em;
  transform: rotate(-2deg);
  font-family: var(--font-hand);
  font-size: calc(var(--u) * 1.7);
  color: var(--ink);
  background: var(--paper);
  border-radius: calc(var(--u) * 0.2);
  box-shadow: 0 calc(var(--u) * 0.2) calc(var(--u) * 0.5) rgba(23, 17, 13, 0.4);
}

/* The cook-log form, written on the back of the card. */
.cook-log-form {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  height: 100%;
}
.cook-log-heading {
  margin: 0;
  font-size: calc(1.4em * var(--font-scale));
}
.cook-log-field {
  display: grid;
  grid-template-columns: 9em 1fr;
  align-items: start;
  gap: 0.5em;
}
.cook-log-field span {
  font-family: var(--font-typed);
  font-size: 0.6em;
  color: var(--pencil);
}
.cook-log-field input,
.cook-log-field textarea {
  width: 100%;
  min-height: 1.9em;
  padding: 0 0.3em;
  border: 0;
  border-bottom: 0.08em solid rgba(90, 130, 170, 0.5);
  resize: none;
  background: rgba(250, 243, 224, 0.6);
  font-family: var(--font-hand);
  font-size: 1em;
  color: var(--ink);
}
.cook-log-field input[type='file'] { border: 0; background: none; font-size: 0.75em; }
.cook-log-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1.2em;
  margin-top: auto;
}
.cook-log-buttons .pencil-mark { font-size: 1.15em; min-height: 2em; }
