/* v14-calendar — «Отрывной календарь» */
:root {
  --wall: #33465a;
  --wall-deep: #2a3a4b;
  --paper: #fbfaf7;
  --paper-edge: #d9d5cc;
  --ink: #1b2027;
  --ink-soft: #5b6672;
  --red: #c8372d;
  --red-deep: #a62b22;
  --binding: #2b2f36;
  --rule: #cfcac0;
  --focus: #c8372d;
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --text: 'Commissioner', system-ui, sans-serif;
  --measure: 66ch;
  --gutter: 1rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--red); color: #fff; }
a { color: var(--red-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.75rem; text-wrap: balance; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); margin-top: 0; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

/* ---------- hero: the pad on the wall ---------- */
.hero { padding: clamp(1.5rem, 4vw, 4rem) var(--gutter) clamp(2rem, 5vw, 5rem); }
.hero__inner { max-width: 72rem; margin: 0 auto; display: grid; gap: 2rem; align-items: center; }
@media (min-width: 60rem) {
  .hero__inner { grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); }
}

.pad { position: relative; width: 100%; max-width: 34rem; margin: 0 auto; }
.pad__binding {
  position: relative; z-index: 3;
  height: 1.6rem; margin: 0 0.35rem; border-radius: 4px 4px 0 0;
  background: var(--binding);
}
.pad__hole {
  position: absolute; left: 50%; top: 0.3rem; width: 0.9rem; height: 0.9rem; margin-left: -0.45rem;
  border-radius: 50%; background: var(--wall-deep); box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}
.page {
  position: relative; z-index: 2;
  background: var(--paper);
  padding: 1.25rem 1.1rem 1.5rem;
  box-shadow: 0 1px 0 var(--paper-edge), 0 14px 32px -16px rgba(0,0,0,0.55);
}
@media (min-width: 40rem) { .page { padding: 2.25rem; } }
.pad__edges {
  --stack: 6;
  position: relative; z-index: 1;
  height: calc(var(--stack) * 2px);
  margin: 0 2px;
  background: repeating-linear-gradient(to bottom, var(--paper) 0 1px, var(--paper-edge) 1px 2px);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,0.6);
}

/* the leaf that tears away */
.pad__leaf {
  position: absolute; inset: 1.6rem 0 auto 0; z-index: 4;
  height: calc(100% - 1.6rem);
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform-origin: 8% 0%;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,0.6);
}
.leaf__num { font-family: var(--display); font-weight: 700; font-size: clamp(6rem, 24vw, 11rem); line-height: 1; color: var(--ink); }
.leaf__month { font-size: 1.1rem; letter-spacing: 0.02em; color: var(--ink-soft); margin-top: 0.5rem; }
.pad__leaf.is-torn { animation: tear 1.05s cubic-bezier(0.2, 0.9, 0.25, 1) 0.55s forwards; }
@keyframes tear {
  0%   { transform: none; opacity: 1; }
  30%  { transform: rotate(-4deg) translateY(2%); opacity: 1; }
  100% { transform: rotate(-14deg) translate(-6%, 120%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pad__leaf { display: none; } }

.page__date { display: flex; align-items: flex-end; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.page__num { font-family: var(--display); font-weight: 700; font-size: clamp(6.5rem, 26vw, 11rem); line-height: 0.85; color: var(--red); margin-left: -0.04em; }
.page__meta { display: flex; flex-direction: column; gap: 0.15rem; padding-bottom: 0.4rem; font-size: 1.05rem; line-height: 1.3; }
.page__month { font-weight: 600; font-size: 1.3rem; }
.page__weekday { color: var(--ink-soft); }
.page__year { color: var(--ink-soft); }

.page__note { padding-top: 1.25rem; }
.title { font-size: clamp(1.75rem, 1.2rem + 3.2vw, 2.7rem); margin-bottom: 0.6rem; }
.lede { font-size: 1.15rem; font-weight: 500; line-height: 1.4; }
.support { color: var(--ink-soft); }

.facts { list-style: none; margin: 1.1rem 0 1rem; padding: 0.9rem 0 0; border-top: 1px solid var(--rule); font-size: 0.98rem; line-height: 1.45; }
.facts li { padding: 0.15rem 0; }
.facts li + li { border-top: 1px dotted var(--rule); }

.almanac { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; margin: 0.4rem 0 1.25rem; font-size: 0.92rem; }
.almanac__label { color: var(--ink-soft); margin-right: 0.25rem; }
.almanac__pick {
  font: inherit; font-weight: 500; color: var(--ink);
  background: none; border: 0; padding: 0.15rem 0.1rem; cursor: pointer;
  border-bottom: 1px dotted var(--ink-soft);
}
.almanac__pick:hover { color: var(--red-deep); }
.almanac__pick[aria-pressed="true"] { color: var(--red); border-bottom: 2px solid var(--red); font-weight: 600; }

.button {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 4px; padding: 0.85rem 1.3rem; line-height: 1.3; text-align: center;
  transition: background-color 0.18s ease-out, transform 0.18s ease-out, box-shadow 0.18s ease-out;
}
.button--main { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); width: 100%; box-shadow: 0 6px 14px -8px rgba(0,0,0,0.5); }
.button--main:hover { background: #2a313b; color: #fff; }
.button--main:active { transform: translateY(1px); box-shadow: none; }
.button--main:disabled, .button--main[data-loading] { opacity: 0.6; cursor: progress; transform: none; }
.button--second { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.button--second:hover { background: var(--ink); color: var(--paper); }
.textlink { display: inline-block; margin-top: 0.9rem; font-size: 0.95rem; }

.tear { color: #e9edf1; max-width: 34rem; margin: 0 auto; }
.tear__count { font-size: 1.1rem; line-height: 1.5; margin-bottom: 0.9rem; }
.tear__strong { font-family: var(--display); font-weight: 500; font-size: 1.2rem; color: #fff; }
.tear__date { color: #c5cfd8; }
@media (min-width: 60rem) { .tear { margin: 0; } }

/* ---------- sheets: backs of torn pages ---------- */
main { padding: 0 var(--gutter) 2rem; }
.sheet { max-width: 46rem; margin: 0 auto 1.25rem; padding: 1.5rem 1.1rem; background: var(--paper); border-top: 2px dashed var(--paper-edge); box-shadow: 0 10px 24px -14px rgba(0,0,0,0.55); }
@media (min-width: 40rem) { .sheet { padding: 2.75rem; } }
.sheet__inner { padding: 0; }
.sheet__inner--people { display: grid; gap: 1.5rem; }
@media (min-width: 40rem) { .sheet__inner--people { grid-template-columns: 11rem minmax(0, 1fr); align-items: start; } }

.concepts { margin: 1.25rem 0 0; }
.concepts div { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 0.5rem 1.25rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.concepts div:last-child { border-bottom: 1px solid var(--rule); }
.concepts dt { font-weight: 600; }
.concepts dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 30rem) { .concepts div { grid-template-columns: 1fr; gap: 0.2rem; } }

.steps { padding-left: 1.4rem; margin: 0 0 1.25rem; max-width: var(--measure); }
.steps li { padding: 0.35rem 0; border-top: 1px dotted var(--rule); }
.steps li::marker { font-weight: 600; color: var(--red); }

.photo { aspect-ratio: 4 / 5; padding: 1rem; border: 1px dashed var(--ink-soft); display: grid; place-items: center; color: var(--ink-soft); font-size: 0.95rem; background: #f3f1ea; }
.name { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.4rem; }

/* form */
.preview-note { display: inline-block; font-size: 0.9rem; color: var(--ink-soft); border: 1px dashed var(--ink-soft); padding: 0.35rem 0.6rem; margin-bottom: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 0.5rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--ink-soft); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice input { accent-color: var(--red); margin: 0; }
.field { margin: 0 0 1.25rem; max-width: 34rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 0.6rem 0.2rem;
  caret-color: var(--red);
}
.field input::placeholder, .field textarea::placeholder { color: #66747a; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--red); box-shadow: 0 2px 0 var(--red); }
.field textarea { resize: vertical; }
.consent { display: flex; gap: 0.65rem; align-items: flex-start; max-width: 34rem; margin: 0 0 1.25rem; font-size: 0.98rem; }
.consent input { accent-color: var(--red); margin-top: 0.3rem; flex: none; }
form .button--main { width: auto; min-width: 16rem; margin-bottom: 1rem; }
.done { border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.done h3 { color: var(--red-deep); }

/* where + faq */
.faq { margin: 1.5rem 0 0; }
.faq div { padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.faq dt { font-weight: 600; }
.faq dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* countdown */
.countdown { max-width: 46rem; margin: 2rem auto 0; color: #e9edf1; text-align: center; padding: 1rem var(--gutter); }
.countdown__label { color: #c5cfd8; margin-bottom: 0.5rem; }
.countdown__nums { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin: 0 auto 0.75rem; }
.countdown__nums .n { display: flex; flex-direction: column; align-items: center; min-width: 4rem; }
.countdown__nums b { font-family: var(--display); font-weight: 500; font-size: 2.2rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; }
.countdown__nums i { font-style: normal; font-size: 0.9rem; color: #c5cfd8; }
.countdown__state { display: none; font-family: var(--display); font-size: 1.4rem; margin-bottom: 0.5rem; color: #fff; }
.countdown__date { color: #c5cfd8; margin: 0; }
.countdown[data-state="live"] .countdown__before, .countdown[data-state="ended"] .countdown__before { display: none; }
.countdown[data-state="live"] .countdown__live { display: block; }
.countdown[data-state="ended"] .countdown__ended { display: block; }

/* footer */
.footer { padding: 2rem var(--gutter) 3rem; color: #c5cfd8; font-size: 0.95rem; }
.footer__inner { max-width: 46rem; margin: 0 auto; border-top: 1px solid rgba(255,255,255,0.18); padding-top: 1.25rem; }
.footer a { color: #fff; }
.footer .muted { color: #a9b5c0; }
