/* The seasonal home page: one cloister behind the whole page (see home.js). Tokens are in carved.css. */
/* Ink changes glide: the tokens are registered colours, so light to dusk is a transition, not a cut. */
  @property --paper { syntax: '<color>'; inherits: true; initial-value: #F3EAD8; }
  @property --sheet { syntax: '<color>'; inherits: true; initial-value: #FBF7EEF2; }
  @property --sheet-solid { syntax: '<color>'; inherits: true; initial-value: #FBF7EE; }
  @property --ink { syntax: '<color>'; inherits: true; initial-value: #232A44; }
  @property --ochre { syntax: '<color>'; inherits: true; initial-value: #B8862F; }
  @property --ochre-text { syntax: '<color>'; inherits: true; initial-value: #86611F; }
  @property --ochre-fill { syntax: '<color>'; inherits: true; initial-value: #EBD3A0; }
  @property --muted { syntax: '<color>'; inherits: true; initial-value: #5E6274; }
  @property --season { syntax: '<color>'; inherits: true; initial-value: #4D6A45; }
  @property --season-edge { syntax: '<color>'; inherits: true; initial-value: #364A30; }
  @property --on-season { syntax: '<color>'; inherits: true; initial-value: #F7EFDD; }
  html { transition: --paper 1s, --sheet 1s, --sheet-solid 1s, --ink 1s, --ochre 1s, --ochre-text 1s, --ochre-fill 1s,
    --muted 1s, --season 1s, --season-edge 1s, --on-season 1s; }
  body { background: var(--paper); }

  /* The world: one cloister behind the whole page. Sky plates, candlelight, motes, a paper veil, and a
     cut-paper arch in front, like the flats of a paper theatre. */
  .world { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .world .cam { position: absolute; inset: -4%; will-change: transform; }
  .world .cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
  .world .cam img:not(.base) { opacity: 0; }
  .world .glow { position: absolute; inset: 0; opacity: 0;
    background: radial-gradient(60vmax 50vmax at var(--gx, 72%) var(--gy, 58%), rgba(255, 196, 110, .42), rgba(255, 170, 80, .12) 45%, transparent 70%);
    mix-blend-mode: screen; }
  .world canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .world .veil, .world .veil-side { position: absolute; inset: 0; background: var(--paper); opacity: 0; }
  .world .veil-side { background: linear-gradient(90deg, var(--paper) 0 44%, color-mix(in srgb, var(--paper) 70%, transparent) 54%, transparent 72%); }
  @media (max-width: 959px) { .world .veil-side { background: linear-gradient(0deg, var(--paper) 0 46%, color-mix(in srgb, var(--paper) 70%, transparent) 56%, transparent 70%); } }
  .world .arch { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 40px rgba(20, 16, 10, .28)); }

  main { position: relative; z-index: 1; }
  .scene { position: relative; }
  .live .scene { height: calc((var(--hold) + 1) * 100svh); }
  .live .scene > .stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }

  /* 1. Door: the name steps aside and the camera walks through the arch. */
  .door .stage { position: relative; min-height: 100svh; }
  .door .nav { position: absolute; inset: 0 var(--gutter) auto; z-index: 4; }
  .door h1 { position: absolute; inset: 0; z-index: 2; font-size: min(10.4vw, 24svh); perspective: 900px; }
  .door h1 span { position: absolute; top: 50%; translate: 0 -50%; will-change: transform; }
  .door .w1 { right: calc(65vw + 2vw); }
  .door .w2 { left: calc(65vw + 2vw); }
  .door .foot { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 4svh;
    display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
  .door .foot .lede { max-width: 25ch; }
  .kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px; font: 600 14px/1.2 var(--sans); color: var(--ochre-text); }
  .kicker .ico { width: 20px; height: 20px; }
  .door .verse { position: absolute; z-index: 3; left: 50%; top: 50%; width: min(560px, calc(100vw - 2 * var(--gutter)));
    translate: -50% -50%; padding: 34px 32px 28px; opacity: 0; transform-origin: 50% 100%; }
  .door .verse .scripture { font-size: clamp(24px, 2.6vw, 34px); }
  .door .static-arch { display: none; }
  @media (max-width: 760px) {
    .door h1 { font-size: 21vw; }
    .door h1 span { top: auto; translate: none; }
    .door .w1 { left: var(--gutter); right: auto; top: 10svh; }
    .door .w2 { left: auto; right: var(--gutter); bottom: 29svh; }
    .door .foot { bottom: 2.5svh; flex-direction: column; align-items: flex-start; gap: 14px; }
    .door .foot .lede { font-size: 17px; max-width: 30ch; line-height: 1.35; }
    .door .kicker { font-size: 13px; }
  }

  /* Letterpress headings: words set from below, tipping up into place. */
  [data-split] .wd { display: inline-block; perspective: 600px; }
  [data-split] .wi { display: inline-block; transform-origin: 50% 100%; }
  .live [data-split] .wi { opacity: 0; transform: translateY(70%) rotateX(-80deg); }
  .live [data-split].in .wi { opacity: 1; transform: none; transition: opacity 600ms var(--ease), transform 900ms cubic-bezier(.2, .9, .25, 1.15); transition-delay: calc(var(--w) * 55ms); }
  .live [data-split][data-rise] { opacity: 1; transform: none; }

  /* 2. Carry. */
  .carry { padding: clamp(120px, 16vw, 220px) 0; }
  .carry .grid { display: grid; gap: 40px; align-items: start; }
  @media (min-width: 960px) { .carry .grid { grid-template-columns: 1fr 1fr; gap: 64px; } }
  .carry .chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 18px; }
  .carry .compose { padding: 20px 20px 16px; }
  .carry .compose .row { display: flex; justify-content: flex-end; margin-top: 6px; }
  .carry .letter { padding: 36px 34px 32px; min-height: 100%; }
  .carry .letter .prayer + .prayer { margin-top: 14px; }
  .carry .letter .verse { margin-top: 26px; padding-top: 22px; position: relative; }
  .carry .letter .verse::before { content: ""; position: absolute; top: 0; left: 0; width: 72px; height: 3px; background: var(--ochre); border-radius: 2px; }
  [data-tilt] { transform-style: preserve-3d; transition: transform 500ms var(--ease); will-change: transform; }

  /* 3. The season: copy and cards on the left, a set in three dimensions on the right. */
  .season .stage { display: grid; }
  @media (min-width: 960px) { .season .stage { grid-template-columns: 1fr 1fr; } }
  .season .copy { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 96px var(--gutter) 48px; }
  .season .cards { position: relative; min-height: 300px; }
  .season .card { padding: 32px 30px 28px; display: grid; gap: 12px; max-width: 520px; transform-origin: 50% 100%; }
  .season .card .when { font: 600 14px/1.2 var(--sans); color: var(--ochre-text); }
  .season .card .name { font: 700 clamp(26px, 2.6vw, 36px)/1.05 var(--serif); }
  .season .card .scripture { font-size: clamp(20px, 1.9vw, 26px); }
  .season .beat { display: grid; gap: 14px; max-width: 520px; }
  .season .beat .h2 { max-width: 15ch; }
  .live .season .cards > * { position: absolute; inset: 0 0 auto 0; }
  .live .season .cards > :not(:first-child) { opacity: 0; }
  .season .marks { display: flex; gap: 12px; }
  .season .marks svg { width: 22px; height: 22px; display: block; }
  .season .set { position: relative; min-height: 60svh; perspective: 1100px; perspective-origin: 50% 30%; }
  .orbit { position: absolute; left: 50%; top: 70%; width: 0; height: 0; transform-style: preserve-3d; }
  .orbit .floor { position: absolute; width: calc(var(--R) * 2.5); height: calc(var(--R) * 2.5); left: 0; top: 0;
    transform: translate(-50%, -50%) rotateX(90deg); }
  .orbit .floor .inner { position: absolute; inset: 22%; }
  .orbit .post { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transform: rotateY(var(--a)) translateZ(var(--R)); }
  .orbit .post.centre { transform: none; }
  .orbit .bill { position: absolute; left: 0; bottom: 0; display: grid; justify-items: center; gap: 6px;
    transform: translateX(-50%) rotateY(calc(-1 * (var(--a, 0deg) + var(--spin, 0deg)))); transform-origin: 50% 100%; }
  .candle .flame { width: calc(var(--R) * .3); height: calc(var(--R) * .3); transform-origin: 50% 90%; opacity: .14; transition: opacity 400ms; }
  .candle .flame svg { width: 100%; height: 100%; display: block; }
  .candle .wax { display: block; width: calc(var(--R) * .26); height: calc(var(--R) * 1.05); }
  .candle.tall .wax { width: calc(var(--R) * .3); height: calc(var(--R) * 1.4); display: grid; place-items: start center; padding-top: 14px; }
  .candle.lit .flame { opacity: 1; animation: flicker 2.4s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(255, 190, 90, .8)); }
  .candle .date { font: 600 13px/1 var(--sans); color: var(--muted); }
  @keyframes flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 30% { transform: scale(1.06, .96) rotate(1.5deg); } 60% { transform: scale(.97, 1.04) rotate(-.5deg); } }
  .emblem-big { width: calc(var(--R) * 1.1); height: calc(var(--R) * 1.1); padding: calc(var(--R) * .12); border-radius: 50%; }
  @media (max-width: 959px) {
    .live .season .set { order: -1; height: 46svh; min-height: 0; }
    .live .season .copy { padding-top: 8px; justify-content: flex-start; gap: 18px; }
    .season .cards { min-height: 250px; }
    .season .card { padding: 24px 22px 22px; }
  }

  /* 4. The Rosary lifts from the table and is prayed bead by bead. */
  .rosary .stage { display: grid; align-items: center; }
  .rosary .inner { display: grid; gap: 32px; align-items: center; padding-block: 64px; }
  @media (min-width: 960px) { .rosary .inner { grid-template-columns: 1.2fr minmax(320px, 60svh) .8fr; gap: 48px; } }
  .rosary .lift { perspective: 1000px; }
  .rosary .loop { width: min(100%, 60svh); aspect-ratio: 256 / 340; margin: 0 auto; transform-origin: 50% 70%; will-change: transform;
    filter: drop-shadow(0 30px 30px rgba(0, 0, 0, .28)); }
  .rosary .loop svg { width: 100%; height: 100%; display: block; overflow: visible; }
  .rosary .mystery { display: grid; gap: 14px; justify-items: start; }
  .rosary .mystery .ico { width: 88px; height: 88px; }
  .rosary .mystery .name { font: 400 26px/1.2 var(--serif); }
  .rosary .now { display: grid; gap: 6px; justify-items: end; text-align: right; }
  .rosary .now .prayer-name { font: 700 clamp(28px, 3vw, 40px)/1.05 var(--serif); }
  @media (max-width: 959px) { .rosary .now { justify-items: start; text-align: left; } .rosary .loop { width: min(68vw, 40svh); } .rosary .inner { gap: 16px; padding-block: 32px; } .rosary .mystery .ico { width: 56px; height: 56px; } }

  /* 5. The app: one phone, turning from room to room. */
  .rooms .stage { display: grid; }
  @media (min-width: 960px) { .rooms .stage { grid-template-columns: 1fr 1fr; } }
  .rooms .copy { display: flex; flex-direction: column; justify-content: center; gap: 34px; padding: 72px var(--gutter) 40px; }
  .rooms .names { position: relative; min-height: 200px; }
  .rooms .room { display: grid; gap: 14px; }
  .rooms .room .title { font-size: clamp(44px, 5.6vw, 84px); }
  .live .rooms .room { position: absolute; inset: 0 0 auto 0; }
  .live .rooms .room:not(:first-child) { opacity: 0; }
  .rooms .side { position: relative; display: grid; place-items: center; min-height: 70svh; perspective: 1400px; }
  .phone-tilt { transform-style: preserve-3d; transform: rotateY(-14deg) rotateX(4deg); transition: transform 600ms var(--ease); }
  .phone { position: relative; width: var(--pw, 300px); aspect-ratio: 538 / 1125; border-radius: calc(var(--pw, 300px) * .14);
    background: #0E1226; padding: calc(var(--pw, 300px) * .03); transform-style: preserve-3d;
    box-shadow: 30px 40px 60px rgba(10, 12, 30, .35), inset 0 0 0 1.5px rgba(255, 255, 255, .08); }
  .phone .screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--pw, 300px) * .115); overflow: hidden; background: #1D2340; }
  .phone .screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
  .live .phone .screen img:not(:first-child) { opacity: 0; }
  .phone .shine { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, .16), transparent 32%, transparent 70%, rgba(255, 255, 255, .06)); }
  .rooms .phone { --pw: min(340px, 40svh); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 7px; max-width: 460px; }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 9px 4px 8px; font: 600 12px/1.1 var(--sans); color: var(--ink); background: none; border: 0; }
  .tab .ico { width: 22px; height: 22px; }
  .tab.is-selected { color: var(--on-season); }
  .tab.is-selected .cv-holder { animation: inkspread 220ms cubic-bezier(.3, 1.4, .5, 1); }
  @media (max-width: 959px) {
    .live .rooms .side { order: -1; height: 52svh; min-height: 0; }
    .rooms .phone { --pw: min(210px, 22svh); }
    .live .rooms .copy { padding-top: 12px; justify-content: flex-start; gap: 18px; }
    .rooms .names { min-height: 140px; }
  }

  /* 6. Close: the arch draws in around the next morning. */
  .close { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; }
  .live .close { min-height: 140svh; }
  .skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; background: var(--sheet-solid); color: var(--ink); border-radius: 8px; }
  .skip:focus { top: 12px; }
  .block span { white-space: nowrap; }
  html:not(.js) .carry .chips { display: none; }
  html:not(.js) .block { background: var(--season); border-radius: 10px; }
  html:not(.js) .close .mail .box { border: 1.5px solid var(--ink); border-radius: 10px; }
  .close .mail .box:focus-within { outline: 2px solid var(--season); outline-offset: 4px; border-radius: 10px; }
  #daily-email { scroll-margin-top: 18svh; }
  @media (max-width: 959px) { #daily-email { scroll-margin-top: 44svh; } }
  .close .grid { display: grid; gap: 28px; align-items: end; }
  @media (min-width: 960px) { .close .grid { grid-template-columns: 1.2fr 1fr; gap: 64px; } }
  .close .mail { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
  .close .mail .box { flex: 1 1 220px; }
  .close .name { font: 700 min(14.6vw, 196px)/.8 var(--serif); letter-spacing: -.045em; margin: 72px 0 0; white-space: nowrap; }
  .close .name .ch { display: inline-block; }
  .carry .said { font: italic 400 17px/1.45 var(--serif); color: var(--muted); margin: 0 0 18px; }
  .carry .write { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
  .close .note { margin: 12px 0 0; }
  .site-foot .legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 18px 0 96px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); font: 400 13px/1.4 var(--sans); color: var(--muted); }
  .close .daily-email-status { flex-basis: 100%; margin: 4px 0 0; font: 600 15px/1.4 var(--sans); min-height: 1.4em; }
  .close .daily-email-status[data-state="error"] { color: #A33A2F; }
  .dusk .close .daily-email-status[data-state="error"] { color: #F0A08F; }

  /* Footer: the site's other pages, care, Plus and how records work. */
  .site-foot { position: relative; z-index: 1; background: var(--paper); border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
  .site-foot .cols { display: grid; gap: 28px; padding: 48px 0 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .site-foot h3 { font: 600 13px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ochre-text); margin: 0 0 14px; }
  .site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font: 400 15px/1.35 var(--sans); }
  .site-foot a:hover { text-decoration: underline; }
  .site-foot p { margin: 0; font: 400 15px/1.5 var(--sans); }
  .site-foot details { padding: 0 0 28px; font: 400 14px/1.55 var(--sans); color: var(--muted); max-width: 80ch; }
  .site-foot summary { cursor: pointer; font-weight: 600; color: var(--ink); }
  .site-foot details p { margin-top: 10px; font-size: 14px; }
  .close .legal { display: flex; justify-content: space-between; gap: 16px; padding: 22px 0 28px; font: 400 14px var(--sans); color: var(--muted); }

  /* Chapter rail: the app's marks. Done is ink, now is the season with its edge, next is an ochre outline. */
  .rail { position: fixed; z-index: 5; right: 22px; top: 50%; translate: 0 -50%; display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
  .rail a { display: grid; grid-template-columns: auto 14px; align-items: center; gap: 10px; justify-items: end; }
  .rail .lbl { font: 600 12px/1 var(--sans); color: var(--ink); opacity: 0; translate: 6px 0; transition: opacity 240ms, translate 240ms; }
  .rail a:hover .lbl, .rail a:focus-visible .lbl, .rail a.now .lbl { opacity: 1; translate: 0 0; }
  .rail svg { width: 14px; height: 14px; display: block; }
  @media (max-width: 959px) { .rail { display: none; } }


  /* Without the live scenes (no script, or Reduce Motion): one calm page with every finished composition. */
  html:not(.live) .world .veil { opacity: .9; }
  html:not(.live) .world .arch, html:not(.live) .world canvas { display: none; }
  html:not(.live) .door .stage { display: grid; gap: 28px; padding: 0 var(--gutter) 48px; }
  html:not(.live) .door .nav { position: relative; inset: auto; }
  html:not(.live) .door .static-arch { display: block; height: 62svh; border-radius: 40vw 40vw 0 0; overflow: hidden; max-width: 760px; width: 100%; margin: 0 auto; }
  html:not(.live) .door .static-arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
  html:not(.live) .door h1, html:not(.live) .door h1 span, html:not(.live) .door .foot, html:not(.live) .door .verse { position: relative; inset: auto; translate: none; left: auto; top: auto; right: auto; bottom: auto; }
  html:not(.live) .door h1 { text-align: center; }
  html:not(.live) .door .verse { opacity: 1; margin: 0 auto; }
  html:not(.live) .season .cards, html:not(.live) .rooms .names { display: grid; gap: 24px; }
  html:not(.live) .season .stage, html:not(.live) .rooms .stage { padding-block: 64px; }
  html:not(.live) .rooms .phone .screen img:not(:first-child) { display: none; }
  html:not(.live) .season .set { min-height: 420px; }
  @media (prefers-reduced-motion: reduce) { .candle.lit .flame { animation: none; } html { transition: none; } }
