/* Backstage Calendar · D1 "Workshop wall blueprint" (Paper, 25 Nov 2026) */

:root {
  --ink: #1D1C1A;
  --red: #E8523F;
  --yellow: #FFD84D;
  --blue: #2C6FB7;
  --white: #FFFFFF;
  --hand: "Nanum Pen Script", "Comic Sans MS", cursive;
  --body: "Nunito", system-ui, sans-serif;
  --gutter: clamp(20px, 3.9vw, 56px);
  --max: 1440px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, p, ol, ul, blockquote { margin: 0; }
em { font-style: normal; color: var(--red); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }

.label {
  font-family: var(--body);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.small { font-size: 14px; line-height: 20px; }

/* page width */
.topbar, .hero, .blueprint, .backstage, .about-cta, .sources, .footer {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-family: var(--hand);
  font-size: 28px;
  line-height: 28px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pill--yellow {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
  padding: 10px 24px;
  font-size: 30px;
  line-height: 30px;
  transform: rotate(-2deg);
}
.pill--yellow:hover { transform: rotate(-3deg) translate(-1px, -2px); box-shadow: 5px 6px 0 var(--ink); }
.pill--yellow:active { transform: rotate(-2deg) translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.pill--big { padding: 12px 26px; transform: rotate(-1.5deg); }
.pill--red { background: var(--red); color: var(--white); padding: 10px 22px; }
.pill--red:hover { transform: rotate(-1.5deg) translateY(-2px); }
.pill--outline { background: var(--white); border: 2px solid var(--ink); padding: 8px 20px; }
.pill--outline:hover { background: var(--yellow); }

.hand-link {
  display: inline-block;
  font-family: var(--hand);
  font-size: 28px;
  line-height: 30px;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  cursor: pointer;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
}
.logo { display: flex; flex-direction: column; text-decoration: none; }
.logo { min-width: 0; }
.logo__name { font-family: var(--hand); font-size: 44px; line-height: 44px; white-space: nowrap; }
.logo__by { font-size: 13px; line-height: 18px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 36px; }
.nav__about { display: flex; flex-direction: column; align-items: center; font-family: var(--hand); font-size: 30px; line-height: 30px; text-decoration: none; }
.nav__about svg { width: 64px; height: 8px; }
.nav__about path { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }

/* ---------- hero ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding-top: 64px;
  padding-bottom: 24px;
}
.hero__title {
  font-family: var(--hand);
  font-weight: 400;
  font-size: clamp(66px, 8.6vw, 124px);
  line-height: 0.84;
  max-width: 860px;
}
.hero__aside { display: flex; flex-direction: column; gap: 10px; width: 340px; flex-shrink: 0; padding-bottom: 10px; }
.hero__aside p { font-size: 18px; line-height: 27px; }

/* ---------- blueprint ---------- */
.blueprint { padding-top: 44px; }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.phase__head {
  position: relative;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hand);
  font-weight: 400;
  font-size: 34px;
  line-height: 34px;
}
.phase__head svg { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); overflow: visible; }
.phase__head path { fill: none; stroke: var(--ink); stroke-width: 2.6; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.phase__head span { position: relative; }

.phase__doors {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 440 / 450;
  margin-top: 40px;
}

/* ---------- doors ---------- */
.door {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--r));
  transition: transform 0.28s cubic-bezier(0.3, 1.6, 0.5, 1);
  -webkit-tap-highlight-color: transparent;
}
.door:hover, .door:focus-visible { transform: rotate(calc(var(--r) * -1 + 2deg)) translateY(-6%) scale(1.04); }
.door[aria-disabled="true"] { cursor: default; }
.door[aria-disabled="true"]:hover { transform: rotate(var(--r)) translateY(-3%); }
.door .doodle { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.doodle__ink path { fill: none; stroke: var(--ink); stroke-width: 2.8; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.doodle__fill { fill: none; }
.doodle--past .doodle__fill { fill: var(--yellow); }
.doodle--today .doodle__fill { fill: var(--red); }
.door__num {
  position: absolute;
  left: var(--nx);
  top: var(--ny);
  width: 2.6em;
  margin-left: -1.3em;
  text-align: center;
  transform: translateY(-56%);
  font-family: var(--hand);
  font-size: var(--fs);
  line-height: 1;
  color: var(--ink);
  pointer-events: none;
}
.door.is-locked { animation: locked 0.45s ease; }
@keyframes locked {
  0%, 100% { transform: rotate(var(--r)); }
  25% { transform: rotate(calc(var(--r) - 6deg)); }
  50% { transform: rotate(calc(var(--r) + 5deg)); }
  75% { transform: rotate(calc(var(--r) - 3deg)); }
}

/* today note */
.note {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  color: var(--red);
  font-family: var(--hand);
  white-space: nowrap;
  pointer-events: none;
  transform: rotate(-4deg);
  transform-origin: 0 0;
}
/* scales with the phase column, so the note keeps its size relative to the doors on smaller laptops */
.note__big { font-size: clamp(24px, 7.7cqw, 34px); line-height: 0.94em; }
.note__small { font-size: clamp(17px, 5.45cqw, 24px); line-height: 1em; padding-left: 10px; }
.note__mini, .note--mini .note__full,
.note--compact .note__small, .note--mini .note__small { display: none; }
.note--mini .note__mini { display: inline; }
.note-arrow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.note-arrow path { fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* legend + line of visibility */
.legend {
  list-style: none;
  padding: 0;
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.legend li { display: flex; align-items: center; gap: 10px; }
.legend svg { width: 26px; height: 22px; flex-shrink: 0; }
.legend path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }

.lov { margin-top: 28px; display: flex; flex-direction: column; gap: 6px; }
.lov svg { width: 100%; height: 16px; }
.lov path { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lov__labels { display: flex; justify-content: space-between; color: var(--blue); font-size: 14px; line-height: 18px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- backstage card ---------- */
.backstage { padding-top: 40px; scroll-margin-top: 16px; }
.card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) minmax(180px, 228px);
  gap: clamp(28px, 3.9vw, 56px);
  padding: 56px clamp(32px, 4.4vw, 64px);
  min-height: 400px;
}
.outline { position: absolute; left: -2px; top: -2px; width: calc(100% + 4px); height: calc(100% + 4px); overflow: visible; pointer-events: none; }
.outline path { fill: var(--white); stroke: var(--ink); stroke-width: 2.6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.card > :not(.outline) { position: relative; }
.card__meta { display: flex; flex-direction: column; gap: 18px; }
.card__door { position: relative; width: 150px; height: 150px; transform: rotate(-10deg); flex-shrink: 0; }
.card__door .doodle { position: absolute; left: 0; top: 0; width: 132px; height: 132px; overflow: visible; }
.card__door .door__num { left: calc(var(--nx) * 0.88); top: calc(var(--ny) * 0.88); font-size: calc(var(--ns) * 66px); }
.card__labels { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 20px; letter-spacing: 0.08em; text-transform: uppercase; }
.card__content { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.card__title { font-family: var(--hand); font-weight: 400; font-size: clamp(52px, 5.3vw, 76px); line-height: 0.9; }
.card__body { font-size: 18px; line-height: 28px; }
.quote {
  font-family: var(--hand);
  font-size: 30px;
  line-height: 32px;
  color: var(--red);
  border-left: 3px solid var(--red);
  padding: 2px 0 2px 18px;
}
.credit { font-size: 15px; line-height: 22px; }
.credit a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.credit a:hover { color: var(--red); }
.card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 4px; }
.card__back { font-size: 26px; color: var(--red); margin-bottom: -8px; }
.hand-note { font-family: var(--hand); font-size: 26px; line-height: 28px; color: var(--red); margin-bottom: -8px; }

.sticky {
  align-self: start;
  background: var(--yellow);
  box-shadow: 3px 5px 0 var(--ink);
  padding: 22px 20px 28px;
  transform: rotate(3deg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticky .label { font-size: 13px; line-height: 18px; }
.sticky p { font-family: var(--hand); font-size: 27px; line-height: 27px; }

.card--soon { grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); }
.card--soon .card__content { max-width: 720px; }

/* ---------- about + CTA ---------- */
.about-cta {
  display: grid;
  grid-template-columns: minmax(0, 560fr) minmax(0, 688fr);
  gap: clamp(40px, 5.6vw, 80px);
  align-items: start;
  padding-top: 96px;
  padding-bottom: 40px;
  scroll-margin-top: 16px;
}
.about { display: flex; flex-direction: column; gap: 22px; }
.h2 { font-family: var(--hand); font-weight: 400; font-size: 64px; line-height: 56px; }
.about p { font-size: 18px; line-height: 28px; }
.cta-box { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 40px 44px 44px; }
.cta-box > :not(.outline) { position: relative; }
.cta-box__title { font-family: var(--hand); font-weight: 400; font-size: 52px; line-height: 48px; }
.cta-box p:not(.label) { font-size: 17px; line-height: 26px; }
.cta-box__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 6px; }
.cta-box .hand-link { align-self: flex-start; font-size: 26px; }

/* ---------- sources ---------- */
.sources { padding-top: 24px; scroll-margin-top: 16px; }
.sources summary { cursor: pointer; font-family: var(--hand); font-size: 30px; line-height: 34px; width: fit-content; }
.sources ol { list-style: none; padding: 14px 0 0; display: grid; gap: 8px; font-size: 15px; line-height: 22px; }
.sources .label { font-size: 12px; margin-right: 6px; }
.sources a:hover { color: var(--red); }

/* ---------- footer ---------- */
.footer { padding-top: 40px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.footer__rule { width: 100%; height: 10px; }
.footer__rule path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; font-size: 15px; line-height: 22px; }
.footer__links { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }
.totop { width: 48px; height: 48px; flex-shrink: 0; }
.totop svg { width: 48px; height: 48px; }
.totop path { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  line-height: 20px;
  padding: 12px 20px;
  border-radius: 999px;
  max-width: calc(100vw - 32px);
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* mobile-only bits are hidden on desktop */
.today-pill, .sheet { display: none; }

/* =================================================================
   Mobile (D1 · Mobile 390)
   ================================================================= */
@media (max-width: 899px) {
  .hide-sm { display: none; }
  .cap-sm::first-letter { text-transform: lowercase; }

  .topbar { padding-top: 16px; }
  .logo__name { font-size: 30px; line-height: 30px; }
  .logo__by { font-size: 10px; line-height: 14px; }
  .topbar .pill--yellow { font-size: 22px; line-height: 22px; padding: 7px 14px; }

  .hero { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 36px; padding-bottom: 8px; }
  .hero__title { font-size: clamp(54px, 17vw, 72px); line-height: 0.88; }
  .hero__aside { width: auto; }
  .hero__aside p { font-size: 16px; line-height: 24px; }

  .blueprint { padding-top: 28px; }
  .phases { grid-template-columns: 1fr; gap: 28px; }
  .phase__head { height: 52px; font-size: 26px; line-height: 26px; }
  .phase__doors { aspect-ratio: 350 / 300; margin-top: 22px; }
  .door { left: var(--mx); top: var(--my); width: var(--ms); transform: rotate(var(--mr)); }
  .door .door__num { font-size: var(--mfs); }
  .door:hover, .door:focus-visible { transform: rotate(calc(var(--mr) * -1 + 2deg)) translateY(-6%) scale(1.04); }
  .door[aria-disabled="true"]:hover { transform: rotate(var(--mr)); }
  @keyframes locked {
    0%, 100% { transform: rotate(var(--mr)); }
    25% { transform: rotate(calc(var(--mr) - 6deg)); }
    50% { transform: rotate(calc(var(--mr) + 5deg)); }
    75% { transform: rotate(calc(var(--mr) - 3deg)); }
  }
  .note__big { font-size: 24px; line-height: 22px; }
  .note__small { font-size: 17px; line-height: 18px; padding-left: 6px; }

  .legend { justify-content: flex-start; font-size: 12px; gap: 10px 22px; margin-top: 24px; }
  .lov__labels { font-size: 12px; }

  .backstage { padding-top: 28px; }
  .card { grid-template-columns: 1fr; gap: 22px; padding: 28px 22px 34px; min-height: 0; }
  .card__meta { flex-direction: row; align-items: center; gap: 14px; }
  .card__door { width: 96px; height: 96px; }
  .card__door .doodle { width: 84px; height: 84px; }
  .card__door .door__num { font-size: calc(var(--ns) * 42px); }
  .card__labels { font-size: 12px; line-height: 18px; }
  .card__title { font-size: 46px; line-height: 0.95; }
  .card__body { font-size: 16px; line-height: 25px; }
  .quote { font-size: 25px; line-height: 27px; }
  .pill { font-size: 24px; line-height: 24px; }
  .sticky { transform: rotate(1.5deg); }
  .sticky p { font-size: 25px; line-height: 26px; }

  .about-cta { grid-template-columns: 1fr; gap: 40px; padding-top: 64px; }
  .h2 { font-size: 48px; line-height: 44px; }
  .about p { font-size: 16px; line-height: 25px; }
  .cta-box { padding: 30px 22px 32px; }
  .cta-box__title { font-size: 38px; line-height: 36px; }
  .cta-box p:not(.label) { font-size: 16px; line-height: 24px; }
  .pill--big { font-size: 24px; line-height: 24px; padding: 11px 18px; white-space: normal; text-align: center; }

  .footer__row { flex-direction: column; align-items: flex-start; }
  .footer__links { gap: 14px 22px; }
  .totop { margin-left: auto; }

  /* floating "Today's door" pill */
  .today-pill {
    display: inline-flex;
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 30;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--white);
    text-decoration: none;
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(29, 28, 26, 0.25);
    transform: translateX(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .today-pill[hidden] { display: none; }
  .today-pill.is-away { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
  .pill-dot { width: 14px; height: 12px; background: var(--red); border: 2px solid var(--white); transform: rotate(-4deg); }

  /* door sheet */
  .sheet { display: block; position: fixed; inset: 0; z-index: 40; }
  .sheet[hidden] { display: none; }
  .sheet__scrim { position: absolute; inset: 0; background: rgba(29, 28, 26, 0.45); opacity: 0; transition: opacity 0.25s ease; }
  .sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--white);
    border: 2.6px solid var(--ink);
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    padding: 14px 22px 0;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .sheet.is-open .sheet__scrim { opacity: 1; }
  .sheet.is-open .sheet__panel { transform: translateY(0); }
  .sheet__grabber { width: 48px; height: 5px; border-radius: 3px; background: var(--ink); margin: 0 auto 14px; }
  .sheet__close { position: absolute; right: 16px; top: 22px; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; }
  .sheet__close path { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
  .sheet__body { display: flex; flex-direction: column; gap: 18px; padding-bottom: 26px; }
  .sheet__head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
  .sticky--inline { transform: rotate(-1deg); margin: 6px 4px 0; }
  .sheet__marco { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 14px; }
  .sheet__rule { width: 100%; height: 10px; margin-bottom: 6px; }
  .sheet__rule path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
  .sheet__marco p { font-size: 16px; line-height: 24px; }
  .sheet__marco .pill--big { margin-top: 4px; }
  .sheet__marco .small { margin-top: -2px; }
  .sheet__marco .hand-link { font-size: 26px; margin-top: 4px; }
  .sheet__nav {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--white);
    border-top: 2px solid var(--ink);
    margin-inline: -22px;
    padding: 12px 22px calc(14px + env(safe-area-inset-bottom));
  }
  .sheet__nav button { background: none; border: 0; padding: 6px 0; font-family: var(--hand); font-size: 28px; line-height: 28px; cursor: pointer; min-width: 92px; }
  .sheet__next { text-align: right; }
  .sheet__nav button:disabled { visibility: hidden; }
  .sheet__nav .label { font-size: 12px; }
}

@media (max-width: 380px) {
  .topbar .pill--yellow { font-size: 19px; padding: 6px 11px; }
  .logo__name { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
