/* Home page motion (js/motion.js): the loader, statements, registration marks, the pinned sarees, parallax panels, tones, the list of
   collections. html.mo-on = moving; html.mo-still = reduced motion, composed and at rest. Layout is settled here, not measured. */
:root {
  --mo-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15'%3E%3Cellipse cx='7.5' cy='3.3' rx='1.6' ry='3.1'/%3E%3Cellipse cx='7.5' cy='11.7' rx='1.6' ry='3.1'/%3E%3Cellipse cx='3.3' cy='7.5' rx='3.1' ry='1.6'/%3E%3Cellipse cx='11.7' cy='7.5' rx='3.1' ry='1.6'/%3E%3C/svg%3E");
  --mo-gut: clamp(20px, 4.4vw, 72px);
  --mo-corners: var(--mo-x) left top / 15px 15px no-repeat, var(--mo-x) right top / 15px 15px no-repeat, var(--mo-x) left bottom / 15px 15px no-repeat, var(--mo-x) right bottom / 15px 15px no-repeat;
}

/* ---- the loader: a thin square, a crosshair at each corner, a count ---- */
#mo-load { display: none; position: fixed; inset: 0; z-index: 200; place-items: center; background: #070c08; color: #e6c98e; transition: opacity 190ms linear; }
html.mo-loading #mo-load { display: grid; animation: mo-load-safe 1ms 3s forwards; }
#mo-load.out { opacity: 0; }
@keyframes mo-load-safe { to { visibility: hidden; } }
.mo-load-box { position: relative; width: 148px; height: 148px; display: grid; place-items: center; border: 1px solid rgba(230, 201, 142, 0.42); }
.mo-load-box::after { content: ""; position: absolute; inset: -8px; background: currentColor; -webkit-mask: var(--mo-corners); mask: var(--mo-corners); }
.mo-load-n { font-family: var(--serif); font-weight: 300; font-size: 46px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: lining-nums tabular-nums; }
.mo-load-bar { position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }

/* ---- the tone: one fixed sheet between the film and the squirrels ---- */
#mo-tone { position: fixed; left: 0; right: 0; top: 0; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none; }
html.mo-still #mo-tone { display: none; }
.mo-tone { --mo-ink: #f3e6c6; --mo-ink2: rgba(243, 230, 198, 0.78); --mo-line: rgba(226, 196, 138, 0.42); color: var(--mo-ink); }
.mo-tone.lit { --mo-ink: #12211a; --mo-ink2: rgba(18, 33, 26, 0.76); --mo-line: rgba(18, 33, 26, 0.34); }
html.mo-still .mo-tone[data-tone="zari"] { background: #e7ddc4; --mo-ink: #12211a; --mo-ink2: rgba(18, 33, 26, 0.76); --mo-line: rgba(18, 33, 26, 0.34); }
html.mo-still .mo-tone[data-tone="deep"] { background: #0b1710; }

/* ---- hairlines and registration marks ---- */
.mo-reg { position: relative; height: 15px; margin: 0 var(--mo-gut); color: var(--mo-line); pointer-events: none; flex: none; }
.mo-reg::before { content: ""; position: absolute; left: 7px; right: 7px; top: 7px; height: 1px; background: currentColor; transform-origin: 0 50%; }
.mo-reg::after { content: ""; position: absolute; inset: 0; background: currentColor; -webkit-mask: var(--mo-x) left / 15px 15px no-repeat, var(--mo-x) right / 15px 15px no-repeat; mask: var(--mo-x) left / 15px 15px no-repeat, var(--mo-x) right / 15px 15px no-repeat; }
html.mo-on .mo-reg::before { transform: scaleX(0); transition: transform 1100ms cubic-bezier(0.2, 0.7, 0.1, 1); }
html.mo-on .mo-reg.in::before { transform: none; }

/* ---- statements: huge, tight, a line at a time ---- */
.mo-st { position: relative; display: flex; flex-direction: column; justify-content: center; gap: clamp(26px, 5vh, 54px); min-height: calc(var(--vh, 1vh) * 70); padding: 14vh 0; }
.mo-say { margin: 0; padding: 0 var(--mo-gut); font-family: var(--serif); font-weight: 300; font-size: clamp(58px, 12.2vw, 208px); line-height: 0.93; letter-spacing: -0.032em; color: var(--mo-ink); font-feature-settings: "lnum"; transition: color 260ms linear; }
.mo-say:empty { min-height: 2em; }
html.mo-on .mo-say:not(.split) { visibility: hidden; }
.mo-say.right { text-align: right; }
.mo-say.small { font-size: clamp(46px, 7vw, 122px); line-height: 0.96; }
.mo-line { display: block; overflow: hidden; padding-bottom: 0.17em; margin-bottom: -0.17em; white-space: nowrap; }
.mo-line > span { display: block; }
html.mo-on .mo-line > span { transform: translateY(116%); transition: transform 1050ms cubic-bezier(0.16, 0.76, 0.14, 1); transition-delay: var(--d, 0ms); }
html.mo-on .mo-line.in > span { transform: none; }
.mo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- the sarees, pinned and sliding sideways on a laptop ---- */
.mo-pin { position: relative; overflow-x: clip; }  /* cards sliding in from the side must not widen a phone's page */
.mo-run { display: none; }
html.mo-on .plate { position: sticky; }               /* animals.js re-measures a sticky panel every frame, so the squirrels ride along */
@media (min-width: 900px) and (min-height: 540px) {
  html.mo-on .mo-pin { height: calc(var(--vh, 1vh) * 100 + var(--mo-pin-run, 320vw)); }
  html.mo-on .mo-pin-stick { position: sticky; top: 0; height: 100vh; height: 100lvh; display: flex; align-items: center; overflow: clip; }
  html.mo-on .mo-pin #between { display: none; }
  html.mo-on .mo-pin .plates { display: flex; align-items: center; gap: clamp(90px, 13vw, 240px); width: max-content; max-width: none; margin: 0; padding: 0 var(--mo-gut) 0 clamp(120px, 26vw, 460px); container-type: normal; will-change: transform; }
  html.mo-on .mo-pin .plates > .plate.card, html.mo-on .mo-pin .plates > .plate.card:first-child { flex: none; margin: 0; --plate-h: clamp(420px, calc(var(--vh, 1vh) * 76), 760px); --phw: calc(var(--plate-h) * 0.62); width: calc(var(--phw) + 430px); }
  .mo-run { display: block; position: absolute; left: var(--mo-gut); right: var(--mo-gut); bottom: 18px; height: 15px; color: rgba(226, 196, 138, 0.46); pointer-events: none; }
  .mo-run::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: currentColor; }
  .mo-run i { position: absolute; left: 0; top: 0; width: 15px; height: 15px; background: #eccf95; -webkit-mask: var(--mo-x) center / 15px 15px no-repeat; mask: var(--mo-x) center / 15px 15px no-repeat; will-change: transform; }
}

/* ---- large saree panels, moving slower than the page ---- */
.mo-panels { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 16px; row-gap: clamp(52px, 10vh, 110px); padding: 0 var(--mo-gut); }
.mo-panel { display: block; color: var(--mo-ink); text-decoration: none; position: relative; }
.mo-frame { position: relative; display: block; overflow: hidden; height: var(--fh); background: rgba(0, 0, 0, 0.16); }
.mo-frame img { position: absolute; left: 0; top: -9%; width: 100%; height: 118%; max-width: none; object-fit: cover; will-change: transform; }
html.mo-on .mo-frame { clip-path: inset(0 0 100% 0); transition: clip-path 1250ms cubic-bezier(0.2, 0.7, 0.1, 1); }
html.mo-on .mo-panel.in .mo-frame { clip-path: inset(0); }
.mo-panel::before { content: ""; position: absolute; left: -8px; right: -8px; top: -8px; height: calc(var(--fh) + 16px); background: var(--mo-line); z-index: 1; pointer-events: none; -webkit-mask: var(--mo-corners); mask: var(--mo-corners); }
.mo-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-top: 12px; }
.mo-cap b { font-family: var(--serif); font-weight: 400; font-size: clamp(23px, 1.9vw, 30px); line-height: 1.1; }
.mo-cap span { font-style: italic; font-size: clamp(18px, 1.3vw, 21px); line-height: 1.25; color: var(--mo-ink2); text-align: right; max-width: 36ch; }
.mo-panel.wide { grid-column: 1 / span 10; --fh: min(calc((100vw - 2 * var(--mo-gut)) * 0.55), calc(var(--vh, 1vh) * 88)); }
.mo-panel.wide.r { grid-column: 3 / span 10; }
.mo-panel.tall { grid-column: 8 / span 5; --fh: min(calc((100vw - 2 * var(--mo-gut)) * 0.62), calc(var(--vh, 1vh) * 92)); }
.mo-beside { grid-column: 1 / span 7; align-self: center; }
.mo-beside .mo-say { padding: 0; }
@media (max-width: 760px) {
  .mo-panels { row-gap: 56px; }
  .mo-panel.wide, .mo-panel.wide.r { grid-column: 1 / -1; --fh: calc((100vw - 2 * var(--mo-gut)) * 0.92); }
  .mo-panel.tall { grid-column: 1 / -1; --fh: calc((100vw - 2 * var(--mo-gut)) * 1.32); }
  .mo-beside { grid-column: 1 / -1; }
  .mo-cap { flex-direction: column; gap: 4px; }
  .mo-cap span { text-align: left; }
}

/* a section in the light tone keeps its words clear of the change */
.mo-tone.band { padding: 16vh 0; display: flex; flex-direction: column; gap: clamp(60px, 12vh, 130px); }
.mo-tone.band .mo-st { min-height: 0; padding: 0; }

/* ---- the collections: a centred stack of huge words ---- */
.mo-words { padding: 30vh 0; }
.mo-words ul { list-style: none; margin: clamp(24px, 5vh, 50px) 0; padding: 0; text-align: center; }
.mo-words li { margin: 0 var(--mo-gut); }
.mo-words li + li { border-top: 1px solid var(--mo-line); }
.mo-words a.w { display: block; padding: clamp(12px, 2.2vh, 26px) 0 clamp(16px, 2.8vh, 32px); color: var(--mo-ink); text-decoration: none; transition: opacity 240ms linear; }
.mo-words .w b { display: block; font-family: var(--serif); font-weight: 300; font-size: clamp(60px, 13.5vw, 232px); line-height: 0.96; letter-spacing: -0.035em; transition: transform 500ms cubic-bezier(0.2, 0.7, 0.1, 1); }
.mo-words .w span { display: block; margin-top: 8px; font-style: italic; font-size: clamp(18px, 1.5vw, 24px); line-height: 1.25; color: var(--mo-ink2); }
.mo-words .all { text-align: center; margin: 22px 0 0; }
.mo-words .all a { color: var(--mo-ink); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mo-words ul:hover a.w:not(:hover) { opacity: 0.34; }
  .mo-words a.w:hover b { transform: translateY(-6px); }
}
.mo-words a.w:focus-visible { outline: 1px solid var(--mo-ink); outline-offset: -6px; }

/* ---- corrections after looking at it ---- */
.mo-tone.lit, .mo-tone.lit *, html.mo-still .mo-tone[data-tone="zari"], html.mo-still .mo-tone[data-tone="zari"] * { text-shadow: none; }
html.mo-on section.mo-first { margin-top: calc(var(--vh, 1vh) * 20); }   /* after the arch has opened, the film alone for a moment (24 Nov: 75vh read as a dead screen) */
@media (max-width: 760px) { .mo-say { font-size: clamp(56px, 17vw, 120px); } .mo-say.small { font-size: clamp(44px, 12.6vw, 90px); } }
.mo-tone.band, .mo-words, .mo-tone.mo-st.mo-gap { padding-top: 16vh; padding-bottom: 16vh; }   /* where two tones meet, a short empty moment for the change (24 Nov: was 38vh, about 24 screens in all) */
@media (max-width: 719px) { .mo-tone.band, .mo-words, .mo-tone.mo-st.mo-gap { padding-top: 14vh; padding-bottom: 14vh; } .mo-tone.band { gap: 48px; } }

/* ---- the feminine pass: the registration marks became small florets (--mo-x above), the straight rules became a scalloped thread, and the
   statements that carry the most feeling are set in italic. Sections whose statement is a direct child: the first, the daughter, the last. ---- */
:root { --mo-scallop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 8'%3E%3Cpath d='M0 7.4A6 6 0 0 1 12 7.4A6 6 0 0 1 24 7.4' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E"); }
.mo-first::after { content: "a"; position: absolute; font: italic 400 1px var(--serif); opacity: 0; pointer-events: none; }   /* asks for the italic face before the lines are measured */
.mo-reg::before { left: 24px; right: 24px; top: 3px; height: 8px; background: currentColor; -webkit-mask: var(--mo-scallop) 0 0 / 24px 8px repeat-x; mask: var(--mo-scallop) 0 0 / 24px 8px repeat-x; }
section.mo-st > .mo-say { font-style: italic; font-weight: 400; letter-spacing: -0.024em; line-height: 0.98; }
section.mo-first > .mo-say { padding-left: calc(var(--mo-gut) + clamp(0px, 3vw, 54px)); }
.mo-words li + li { border-top: 0; }
.mo-words li + li::before { content: ""; display: block; width: clamp(144px, 22vw, 336px); height: 8px; margin: clamp(4px, 1vh, 12px) auto 0; background: var(--mo-line); -webkit-mask: var(--mo-scallop) center / 24px 8px repeat-x; mask: var(--mo-scallop) center / 24px 8px repeat-x; }
.mo-words li:nth-child(even) .w b { font-style: italic; font-weight: 400; letter-spacing: -0.024em; }
.mo-words .w span { font-size: clamp(19px, 1.65vw, 27px); }
.mo-cap b { letter-spacing: 0.002em; }

/* the cream tone wears the arch wall's motifs (assets/art/motifs/cream_tile.svg, built by tools/_shots/wow/touches/make_tile.mjs): it stays with the
   fixed tone sheet while the words pass over it, and comes up only while a cream section holds the screen */
#mo-tone::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 420ms linear; background: url("/assets/art/motifs/cream_tile.svg?v=3") 50% 0 / 300px 480px repeat; }
html:has(.mo-tone.lit) #mo-tone::before { opacity: 0.38; }
html.mo-still .mo-tone[data-tone="zari"] { background-image: linear-gradient(rgba(231, 221, 196, 0.62), rgba(231, 221, 196, 0.62)), url("/assets/art/motifs/cream_tile.svg?v=3"); background-position: 0 0, 50% 0; background-size: auto, 300px 480px; }
@media (max-width: 700px) {
  #mo-tone::before { background-size: 225px 360px; }
  html:has(.mo-tone.lit) #mo-tone::before { opacity: 0.42; }
  html.mo-still .mo-tone[data-tone="zari"] { background-size: auto, 225px 360px; }
}

/* ---- bright pass (11 Nov: "brighten up the background and reduce shadows") ----
   The deep tone sheet goes: the lifted film (site.css .backdrop) is the ground, and the words are deep green on it. The cream
   tone (the collections menu) keeps its cream and motifs. motion.js writes the tone's colour inline, hence !important. The loader
   and the arch stay black and gold. */
#mo-tone { background-color: transparent !important; transition: background-color 420ms linear; }
html:has(.mo-tone.lit) #mo-tone { background-color: rgba(246, 238, 218, 0.94) !important; }
@media (prefers-reduced-motion: reduce) { #mo-tone { transition: none; } }
.mo-tone, .mo-tone.lit { --mo-ink: #12211a; --mo-ink2: rgba(18, 33, 26, 0.78); --mo-line: rgba(122, 87, 22, 0.42); }
html.mo-still .mo-tone[data-tone="deep"] { background: transparent; }
.mo-frame { background: #efe7d6; }
.mo-run { color: rgba(122, 87, 22, 0.5); }
.mo-run i { background: #a07a35; }

/* ---- film visible (11 Nov: "the background needs to be visible") ----
   The home scroll shows the loom film again; the statements on it go back to warm ivory with a soft dark halo so they read on
   the threads. The cream collections menu keeps its own ink. */
#mo-tone, html:has(.mo-tone.lit) #mo-tone { background-color: transparent !important; }
.mo-tone:not([data-tone="zari"]), .mo-tone.lit:not([data-tone="zari"]) { --mo-ink: #fbf3df; --mo-ink2: rgba(251, 243, 223, 0.86); --mo-line: rgba(226, 200, 138, 0.5); }
body .mo-tone:not([data-tone="zari"]) .mo-say { text-shadow: 0 1px 2px rgba(6, 10, 7, 0.7), 0 0 24px rgba(6, 10, 7, 0.55) !important; }

/* ---- 24 Nov, before going live ----
   The collections carry their own cream ground: the fixed tone sheet behind them is transparent now (above), and their dark ink
   was lost on the loom. The "All collections" link at a readable size. Panel captions get the statements' halo, for the busy textile. */
#mo-collections { background: rgba(246, 238, 218, 0.94) url("/assets/art/motifs/cream_tile.svg?v=3") 50% 0 / 225px 360px repeat; }
.mo-words .all a { font-size: max(18px, 1em); }
/* !important and on the b/span too: services.css clears every text-shadow with !important, on each element (like .mo-say above) */
body .mo-tone:not([data-tone="zari"]) .mo-cap, body .mo-tone:not([data-tone="zari"]) .mo-cap * { text-shadow: 0 1px 2px rgba(6, 10, 7, 0.8), 0 0 18px rgba(6, 10, 7, 0.7) !important; }
