@charset "UTF-8";
/*
  MyLife advent calendar styles.
  Colours come from the MyLife logo and app (see BRAND.md):
  navy #0d182d (app background), red #961f22 (logo), blue #0d7fd3 (app highlight).
  Doors: two shutters with the MyLife logo open onto the day's graphic. Three across on desktop,
  two on tablets, one on phones.
*/

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0d182d;
  --navy-2: #172033;
  --navy-3: #18253e;
  --red: #961f22;
  --red-dark: #780e15;
  --blue: #0d7fd3;
  --white: #ffffff;
  --muted: #96a1b8;
  --ink: #0d182d;
  --ink-muted: #5b6477;
  --line: #e3e7ef;

  --door: 380px;
  --gap: 28px;
  --radius: 18px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip; /* opening sparkles must not cause sideways scrolling */
  font-family: var(--font);
  color: var(--white);
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(13, 127, 211, 0.22), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(150, 31, 34, 0.25), transparent 70%),
    var(--navy);
  background-attachment: fixed;
  line-height: 1.45;
}

img { max-width: 100%; display: block; }

/* Preview bar: only shown with ?preview or ?date=, so nobody mistakes a test view for the live page */
.preview-bar {
  position: sticky; top: 0; z-index: 30;
  padding: 8px 16px;
  background: #f4c542; color: var(--ink);
  font-size: 14px; font-weight: 600; text-align: center;
}

/* Hero */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 28px;
  text-align: center;
}
/* Logo straight on the page, no white panel (Jo-Anne, 30 November 2026) */
.hero__logo { display: inline-block; }
.hero__logo img { width: 150px; height: auto; }
.hero__kicker {
  margin: 28px 0 6px;
  color: #ff9a9c;
  font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.hero__heading {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.hero__intro { margin: 0 auto; max-width: 560px; color: #d5dbe7; font-size: 17px; }
.hero__welcome {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 22px auto 0;
  padding: 6px 18px 6px 6px;
  border-radius: 999px;
  background: var(--white); color: var(--ink);
  font-weight: 800; font-size: 16px; text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hero__welcome[hidden] { display: none; }
.hero__welcome:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4); }
.hero__welcome:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hero__welcome-img { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; }
.hero__welcome-arrow { color: var(--red); }
.hero__welcome + .hero__status { display: block; width: fit-content; margin-left: auto; margin-right: auto; }
.hero__status {
  display: inline-block;
  margin: 20px 0 0;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px; font-weight: 600;
}
.hero__status:empty { display: none; }

/* Grid: three doors across on desktop, two on tablets, one on phones */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px var(--gap);
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* Door: a frame holding the day's graphic, covered by two shutters with the MyLife logo */
.door { position: relative; }
.door__frame {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  perspective: 1400px;
  overflow: hidden;            /* open shutters fold back inside their own frame, never over a neighbour */
  isolation: isolate;
  background: #0a1324;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
/* Depth: a soft inner shadow around the opening, above the graphic, below the shutters */
.door__frame::after {
  content: "";
  position: absolute; inset: 0; z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 22px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 400ms ease 300ms;
}
.door.is-open .door__frame::after { opacity: 1; }
/* Focus ring on the frame, since the frame clips anything drawn outside it */
.door__frame:has(:focus-visible) { outline: 3px solid var(--white); outline-offset: 4px; }

/* Behind the shutters */
.door__scene {
  position: absolute; inset: 0;
  display: block;
  padding: 0; border: 0; margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-3);
  font: inherit; color: inherit;
}
button.door__scene { cursor: pointer; }
.door__scene img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.door.is-open .door__scene:hover img { transform: scale(1.03); }
/* Linked graphics: on hover, dim slightly and say where the click goes (touch screens rely on the
   graphic's own printed "Open today's door" button) */
a.door__scene::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: rgba(13, 24, 45, 0.35);
  opacity: 0;
  transition: opacity 200ms ease;
}
a.door__scene::after {
  content: attr(data-cta) " ↗";
  position: absolute; left: 50%; top: 50%; z-index: 2;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--white); color: var(--ink);
  font-size: 15px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: translate(-50%, -40%);
  transition: opacity 200ms ease, transform 200ms ease;
}
a.door__scene:hover::before, a.door__scene:focus-visible::before { opacity: 1; }
a.door__scene:hover::after, a.door__scene:focus-visible::after { opacity: 1; transform: translate(-50%, -50%); }
@media (hover: none) { a.door__scene::before, a.door__scene::after { display: none; } }
.door__scene { z-index: 1; }
.door__scene:focus-visible { outline: none; }

/* No graphic yet: a numbered placeholder */
.door__fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.14), transparent 45%), var(--red);
}
.door__fallback span { font-size: 96px; font-weight: 800; color: var(--white); }

/* The shutters */
.door__shutter {
  position: absolute; inset: 0;
  padding: 0; border: 0; margin: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  border-radius: var(--radius);
}
.door__shutter { z-index: 3; }
.door__shutter:focus-visible { outline: none; }
.door.is-locked .door__shutter { cursor: not-allowed; }

.leaf {
  position: absolute; top: 0; bottom: 0;
  width: 50%;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.3, 0.75, 0.2, 1);
}
.leaf--l { left: 0; transform-origin: left center; }
.leaf--r { right: 0; transform-origin: right center; }
.door.is-open .leaf--l { transform: rotateY(-96deg); }
.door.is-open .leaf--r { transform: rotateY(96deg); transition-delay: 60ms; }
.door.no-anim .leaf { transition: none; }

/* Front of each shutter: white panel with half of the MyLife logo, so the two halves meet in the middle */
.leaf__face, .leaf__back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.leaf__face {
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eef1f6 100%);
  box-shadow: inset 0 0 0 10px #ffffff, inset 0 0 0 11px #d9dee8;
}
/* One logo, centred on the seam: each leaf shows its half */
.leaf__face::before {
  content: "";
  position: absolute; top: 50%;
  width: 116%;                 /* logo = 58% of the whole door */
  aspect-ratio: 474 / 255;
  background: url("../assets/brand/mylife-logo.png") center / contain no-repeat;
  transform: translate(-50%, -50%);
}
.leaf--l .leaf__face { border-radius: var(--radius) 0 0 var(--radius); }
.leaf--l .leaf__face::before { left: 100%; }
.leaf--r .leaf__face {
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: inset 0 0 0 10px #ffffff, inset 0 0 0 11px #d9dee8, inset 1px 0 0 #c9d0dc;
}
.leaf--r .leaf__face::before { left: 0; }
/* Inside of the shutters, seen as they swing open */
.leaf__back { transform: rotateY(180deg); background: linear-gradient(90deg, #dfe4ec, #c7cfdb); }
.leaf--l .leaf__back { border-radius: var(--radius) 0 0 var(--radius); }
.leaf--r .leaf__back { border-radius: 0 var(--radius) var(--radius) 0; }

.leaf__knob {
  position: absolute; top: 72%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f6d77a, #b8892a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.leaf--l .leaf__knob { right: 12px; }
.leaf--r .leaf__knob { left: 12px; }

/* Day number and status sit on the closed doors and fade as they open */
.door__num, .door__flag { transition: opacity 250ms ease; }
.door.is-open .door__num, .door.is-open .door__flag { opacity: 0; }
.door__num {
  position: absolute; top: 16%; left: 50%;
  transform: translateX(-50%);
  min-width: 52px; height: 52px; padding: 0 12px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--red); color: var(--white);
  font-size: 24px; font-weight: 800;
  box-shadow: 0 0 0 4px #ffffff, 0 4px 12px rgba(150, 31, 34, 0.35);
}
.door__flag {
  position: absolute; bottom: 12%; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--navy); color: var(--white);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.door__flag svg { width: 14px; height: 14px; }
.door.is-today .door__flag { background: var(--blue); }
.door.is-locked .leaf__face { filter: saturate(0.6) brightness(0.86); }
.door.is-today .door__frame { box-shadow: 0 0 0 4px var(--blue), 0 0 44px rgba(13, 127, 211, 0.6); }

/* Closed doors invite a knock; locked ones shake */
.door:not(.is-open):not(.is-locked) .door__shutter:hover .leaf--l { transform: rotateY(-8deg); }
.door:not(.is-open):not(.is-locked) .door__shutter:hover .leaf--r { transform: rotateY(8deg); }
.door.is-shaking .door__frame { animation: shake 420ms ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
/* Once open, the shutters must not catch clicks meant for the graphic */
.door.is-open .door__shutter { pointer-events: none; }

/* Caption under each door */
.door__caption { padding: 12px 4px 0; min-height: 22px; }
.door__when { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.door.is-today .door__when { color: #7cc0f5; }
.door__what { display: none; }
.door.is-open .door__when { display: none; }
.door.is-open .door__what { display: block; animation: fade-in 500ms ease 400ms both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.door__cat { margin: 0 0 2px; color: #ff9a9c; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.door__title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.door__teaser { margin: 4px 0 0; color: #c3cbda; font-size: 14px; line-height: 1.4; }
.door__coupons { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: #d5dbe7; font-size: 13px; font-weight: 600; }
.door__coupons svg { width: 16px; height: 16px; flex: none; }
.door__thumbs { display: inline-flex; flex: none; }
.door__thumb {
  width: 28px; height: 28px;
  border-radius: 999px;
  border: 2px solid var(--white);
  background: var(--white);
  object-fit: contain;
}
.door__thumb + .door__thumb { margin-left: -8px; }

@media (prefers-reduced-motion: reduce) {
  .leaf { transition: opacity 200ms ease; }
  .door.is-open .leaf--l, .door.is-open .leaf--r { transform: none; opacity: 0; }
  .door:not(.is-open) .door__shutter:hover .leaf { transform: none; }
  .door.is-shaking .door__frame { animation: none; }
  .door.is-open .door__what { animation: none; }
  .spark { display: none; }
}

/* Sparkles when a door opens for the first time */
.spark {
  position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px;
  border-radius: 2px;
  pointer-events: none; z-index: 5;
  animation: spark 900ms cubic-bezier(0.15, 0.6, 0.3, 1) forwards;
}
@keyframes spark {
  from { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--white); color: var(--ink);
  font-size: 15px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.footer { padding: 8px 20px 40px; text-align: center; color: var(--muted); font-size: 13px; }
.noscript { text-align: center; padding: 20px; }

/* ---------- added for the 31-day scope ---------- */

.week { max-width: calc(var(--door) * 3 + var(--gap) * 2 + 40px); margin: 0 auto; padding: 8px 20px 36px; }
.week__head { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.week__title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.week__meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
@media (max-width: 700px) {
  .week { padding: 4px 16px 28px; }
  .week__head { text-align: center; }
}



