/* Aplicații Mobile Ortodoxe — the presentation page.
   The page is set like the apps' own reader ("Tipar și chinovar"): Literata for
   text, Cormorant Garamond for titles, Great Vibes for the red initials, black
   and cinnabar on paper, gold for threads and ornaments, and the family cross
   in a faded taupe. Each app keeps the cloth colour of its icon (--p): on its
   book spine and its ribbon bookmark. */

@font-face { font-family: Cormorant; src: url(fonts/cormorant.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: Literata; src: url(fonts/literata.woff) format("woff"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: Literata; src: url(fonts/literata-italic.woff) format("woff"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url(fonts/great-vibes.woff) format("woff"); font-display: swap; }

:root {
  --hartie: #FBF8F1;
  --hartie-2: #F2ECE0;
  --cerneala: #1E1913;
  --cerneala-2: #594F44;
  --chinovar: #9C2C1A;
  --aur: #9A7A3A;
  --aur-viu: #D9BD7E;
  --fir: #E2D8C5;
  --sigla: #BBAE9F;     /* the family cross: the ink's own brown-grey, faded (tools/brand/build_sigla.py) */
  --filigran: #F6F2EB;  /* the cross as a watermark: text over it keeps 95% of its contrast */
  --text: "Literata", Georgia, serif;
  --titlu: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --col: 34rem;
  --wide: 72rem;
  --pad: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--hartie);
  color: var(--cerneala);
  font: 400 1.0625rem/1.62 var(--text);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
@media (min-width: 48rem) { body { font-size: 1.125rem; } }

img, svg { display: block; max-width: 100%; }
a { color: var(--chinovar); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--chinovar); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--titlu); font-weight: 600; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--cerneala); color: var(--hartie); padding: .5rem 1rem; z-index: 10; }
.skip:focus { top: 1rem; }

.ios-note {
  margin: 0; padding: .8rem var(--pad); text-align: center;
  background: var(--cerneala); color: var(--hartie); font-size: .95rem;
}

/* ------------------------------------------------ the title page */

.title-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  justify-items: center;
  text-align: center;
  padding: clamp(3rem, 9vw, 6.5rem) var(--pad) clamp(2.5rem, 6vw, 4rem);
}
.title-page .watermark {
  position: absolute; z-index: -1;
  /* The whole cross, never cut: its ink (83 of the 96-unit box, 67.7 wide) keeps 1rem of
     paper above, below and at the sides. */
  height: min(54rem, calc((100% - 2rem) * 96 / 83), calc((100vw - 2rem) * 96 / 67.7));
  width: auto; max-width: none; aspect-ratio: 1;
  left: 50%; top: 50%; translate: -50% -50%;
  color: var(--filigran);
}
.title-page .emblem { width: clamp(4rem, 9vw, 5.5rem); color: var(--sigla); margin-bottom: 1.4rem; }
.title-page h1 {
  font-size: clamp(2.5rem, 8.2vw, 5.4rem);
  letter-spacing: .004em;
  max-width: 12em;
}
.knot {
  width: min(20rem, 70%); height: 1.6rem; margin: 1.3rem 0 1.5rem;
  background:
    linear-gradient(var(--aur), var(--aur)) left center / calc(50% - 1.6rem) 1px no-repeat,
    linear-gradient(var(--aur), var(--aur)) right center / calc(50% - 1.6rem) 1px no-repeat;
  position: relative;
}
.knot::after {
  content: ""; position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 2.4rem; height: 1.6rem; background: var(--aur);
  -webkit-mask: url(img/knot.svg) center / contain no-repeat; mask: url(img/knot.svg) center / contain no-repeat;
}
.title-lead { max-width: 36rem; font-size: clamp(1.08rem, 2.3vw, 1.3rem); line-height: 1.55; }
.blessing {
  max-width: 34rem; margin-top: 1.2rem;
  color: var(--chinovar); font-style: italic; font-size: .98rem; line-height: 1.55;
}

/* ------------------------------------------------ the shelf */

.shelf { padding: 0 var(--pad) clamp(3rem, 8vw, 5rem); display: grid; justify-items: center; }
.shelf-books {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(2px, .5vw, 5px);
  height: clamp(15rem, 40vw, 23rem);
}
.shelf-books li { height: var(--h); display: flex; }
.spine {
  --w: clamp(2.35rem, 9.4vw, 4.4rem);
  width: var(--w);
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  padding: clamp(.7rem, 2vw, 1.1rem) 0 1.2rem;
  border-radius: 3px 3px 1px 1px;
  color: var(--aur-viu);
  text-decoration: none;
  background-color: var(--p);
  background-image:
    linear-gradient(90deg, rgb(0 0 0 / .28), rgb(255 255 255 / .07) 22%, rgb(255 255 255 / 0) 45%, rgb(0 0 0 / .1) 80%, rgb(0 0 0 / .32)),
    linear-gradient(var(--aur-viu), var(--aur-viu)), linear-gradient(var(--aur-viu), var(--aur-viu)),
    linear-gradient(var(--aur-viu), var(--aur-viu)), linear-gradient(var(--aur-viu), var(--aur-viu)),
    repeating-linear-gradient(0deg, rgb(255 255 255 / .035) 0 1px, transparent 1px 3px);
  background-size: 100% 100%, 76% 1px, 76% 1px, 76% 1px, 76% 1px, 100% 100%;
  background-position: 0 0, 50% 3.2rem, 50% 3.45rem, 50% calc(100% - .55rem), 50% calc(100% - .8rem), 0 0;
  background-repeat: no-repeat;
  box-shadow: 0 1px 0 rgb(0 0 0 / .25);
  transition: translate .25s cubic-bezier(.2, .7, .3, 1);
}
.spine:hover, .spine:focus-visible { translate: 0 -.8rem; }
.spine:focus-visible { outline-color: var(--cerneala); outline-offset: 2px; }
/* Eight spines and the page margins in 320px. */
@media (max-width: 22.4rem) { .spine { --w: 2rem; } }
.spine-glyph { width: 62%; flex: none; }
.spine-title {
  writing-mode: vertical-rl; rotate: 180deg;
  font-family: var(--titlu); font-weight: 600;
  font-size: clamp(.86rem, 2.5vw, 1.25rem);
  line-height: 1; letter-spacing: .02em; white-space: nowrap;
  margin-top: .9rem;
}
.shelf-board {
  width: min(100%, 44rem); height: .7rem;
  background: linear-gradient(#B8955A 0 2px, #8A6A2E 2px 100%);
  border-radius: 1px;
  box-shadow: 0 .6rem 1rem -.6rem rgb(60 40 10 / .5);
}
.shelf-hint { margin-top: 1rem; color: var(--cerneala-2); font-size: .95rem; text-align: center; }

/* ------------------------------------------------ an app */

.app {
  position: relative;
  max-width: var(--wide); margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--pad) clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hp" "head" "media" "text" "install" "end";
  column-gap: clamp(2rem, 6vw, 5rem);
}
/* the ribbon bookmark, in the app's cloth colour */
.app::before {
  content: ""; position: absolute; top: 0; left: max(.4rem, calc(var(--pad) - 1.4rem));
  width: .8rem; height: clamp(5rem, 12vw, 8rem);
  background: var(--p);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - .55rem), 0 100%);
}
@media (min-width: 60rem) {
  .app {
    grid-template-columns: minmax(0, 30rem) minmax(0, 1fr);
    grid-template-areas: "hp hp" "head media" "text media" "install media" "end end";
    align-items: start;
  }
  .app-media { position: sticky; top: 1.5rem; }
}

.headpiece {
  grid-area: hp;
  width: min(100%, 40rem); justify-self: center;
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
  background: var(--chinovar);
  -webkit-mask: var(--hp) center / contain no-repeat; mask: var(--hp) center / contain no-repeat;
}
.headpiece-knot {
  --hp: url(img/knot.svg);
  width: 4.4rem; aspect-ratio: 136 / 60; background: var(--aur);
}

.app-head { grid-area: head; display: flex; gap: 1rem; align-items: center; margin-bottom: 1.6rem; }
.app-icon { width: clamp(3.4rem, 7vw, 4rem); height: auto; border-radius: 22%; flex: none; box-shadow: 0 1px 2px rgb(30 25 19 / .25); }
.app h2 { font-size: clamp(2.1rem, 5vw, 3.15rem); }
.app-lead { margin-top: .3rem; font-style: italic; color: var(--cerneala-2); font-size: 1.05em; line-height: 1.4; }

.app-text { grid-area: text; max-width: var(--col); }
.initial::first-letter {
  float: left;
  font-family: "Great Vibes", var(--titlu); font-size: 4.1em; line-height: .78;
  font-feature-settings: "ss01";
  color: var(--chinovar);
  margin: .08em .1em -.05em -.02em;
}
.points { margin: 1.3rem 0 0; padding: 0; list-style: none; }
.points li { position: relative; padding-left: 1.4rem; margin-top: .45rem; }
.points li::before {
  content: ""; position: absolute; left: .15rem; top: .62em;
  width: .42rem; height: .42rem; rotate: 45deg; background: var(--chinovar);
}
.app-site { margin-top: 1.1rem; }

.app-install {
  grid-area: install;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 1.6rem;
  margin-top: 2rem;
}
.play { display: inline-block; border-radius: 10px; }
.play img { width: 12.5rem; height: auto; }
.qr { display: none; margin: 0; align-items: center; gap: .8rem; max-width: 15rem; }
.qr-code { width: 5.2rem; flex: none; fill: var(--cerneala); border: 1px solid var(--fir); }
.qr figcaption { font-size: .82rem; line-height: 1.4; color: var(--cerneala-2); }
@media (hover: hover) and (pointer: fine) and (min-width: 48rem) { .qr { display: flex; } }

.vignette {
  grid-area: end; justify-self: center;
  width: 9rem; aspect-ratio: 494 / 63; margin-top: clamp(3rem, 7vw, 4.5rem);
  background: var(--aur);
  -webkit-mask: url(img/end_vignette.svg) center / contain no-repeat; mask: url(img/end_vignette.svg) center / contain no-repeat;
}

/* screenshots */
.app-media { grid-area: media; min-width: 0; margin: 0 calc(-1 * var(--pad)) 2rem; }
@media (min-width: 60rem) { .app-media { margin: 0; } }
.shots { position: relative; }
.shots-strip {
  list-style: none; margin: 0; padding: .5rem var(--pad) 1.5rem;
  display: flex; gap: clamp(.8rem, 2vw, 1.25rem);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  scrollbar-width: thin; scrollbar-color: var(--fir) transparent;
}
@media (min-width: 60rem) { .shots-strip { padding-inline: .25rem; scroll-padding-inline: .25rem; } }
.shots-strip li { flex: none; scroll-snap-align: start; }
/* With the script: a page of phones that fits, changed in place by the arrows (no scrollbar). */
.shots.paged .shots-strip { overflow: hidden; scroll-snap-type: none; }
.shots.paged .shots-strip li:not([hidden]) { animation: shot-in .3s ease both; }
@keyframes shot-in { from { opacity: 0; } }
.shot {
  display: block; padding: 0; border: 0; cursor: zoom-in; background: none;
  width: clamp(10.5rem, 42vw, 14rem);
  border-radius: 1.35rem;
}
.shot img {
  width: 100%; height: auto;
  border: .32rem solid var(--cerneala); border-radius: 1.35rem;
  background: var(--hartie-2);
  box-shadow: 0 1.2rem 2rem -1.4rem rgb(30 25 19 / .55);
  transition: translate .2s ease;
}
.shot:hover img { translate: 0 -.25rem; }
.shots-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0 var(--pad); }
.shots-nav[hidden] { display: none; }
@media (min-width: 60rem) { .shots-nav { justify-content: flex-start; padding: 0 .25rem; } }
.shots-nav button {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--fir); background: var(--hartie);
  color: var(--cerneala); cursor: pointer; display: grid; place-items: center;
}
.shots-nav button:hover { border-color: var(--aur); }
.shots-nav button:disabled { opacity: .35; cursor: default; border-color: var(--fir); }
.shots-nav svg { width: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shots-count { min-width: 5.5em; text-align: center; color: var(--cerneala-2); font-size: .95rem; font-variant-numeric: tabular-nums; }

.photo { margin: 0; padding: 0 var(--pad); }
@media (min-width: 60rem) { .photo { padding: 0; } }
.photo img { width: 100%; height: auto; border-radius: .4rem; }
.photo figcaption { margin-top: .6rem; font-size: .85rem; color: var(--cerneala-2); font-style: italic; }

/* ------------------------------------------------ how the books read */

.common, .install {
  max-width: var(--wide); margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--pad);
  display: grid; justify-items: center; text-align: center;
}
.common { border-top: 1px solid var(--fir); }
.common .headpiece-knot { grid-area: auto; margin-bottom: 1.6rem; }
.common h2, .install h2 { font-size: clamp(2.1rem, 5vw, 3.15rem); }
.common-lead { max-width: 36rem; margin-top: 1rem; color: var(--cerneala-2); }
.common-grid {
  margin-top: clamp(2.5rem, 6vw, 4rem); width: 100%;
  display: grid; gap: clamp(2.5rem, 6vw, 5rem); text-align: left;
}
@media (min-width: 60rem) { .common-grid { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); align-items: start; } }

.specimen { margin: 0; justify-self: center; width: min(100%, 25rem); }
.spec-controls { display: flex; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; flex-wrap: wrap; }
.spec-controls [role="group"] { display: flex; border: 1px solid var(--fir); border-radius: 999px; padding: 3px; background: #FFFDF8; }
.spec-controls button {
  font: 500 .92rem/1 var(--text); color: var(--cerneala-2);
  border: 0; background: none; border-radius: 999px; padding: .55rem .95rem; min-height: 2.5rem; cursor: pointer;
}
.spec-controls button[aria-pressed="true"] { background: var(--cerneala); color: var(--hartie); }
.spec-controls button:hover:not([aria-pressed="true"]) { color: var(--cerneala); }

.spec-page {
  --s: 1;
  --bg: #FBF8F1; --ink: #1E1913; --rub: #9C2C1A; --gold: #9A7A3A;
  background: var(--bg); color: var(--ink);
  border: .4rem solid var(--cerneala); border-radius: 1.6rem;
  padding: 1.6rem 1.4rem 1.8rem;
  height: 34rem; overflow: hidden;
  font-size: calc(1rem * var(--s)); line-height: 1.55;
  -webkit-mask: linear-gradient(#000 85%, transparent);
  mask: linear-gradient(#000 85%, transparent);
  transition: background-color .35s ease, color .35s ease;
}
.specimen[data-theme="sepia"] .spec-page { --bg: #F2E7D2; --ink: #2A2017; --rub: #8C2715; --gold: #8A6A2E; }
.specimen[data-theme="noapte"] .spec-page { --bg: #12100D; --ink: #D6C9B1; --rub: #E68769; --gold: #C6A35E; --head: #A88C52; }
.spec-head {
  width: 78%; margin: 0 auto 1.1rem; aspect-ratio: 900 / 251;
  background: var(--head, var(--rub));
  -webkit-mask: url(img/carte-de-rugaciuni/headpiece.webp) center / contain no-repeat;
  mask: url(img/carte-de-rugaciuni/headpiece.webp) center / contain no-repeat;
  transition: background-color .35s ease;
}
.spec-page .spec-title { font-size: 1.65em; text-align: center; margin-bottom: .8em; color: var(--ink); }
.spec-page p { margin-top: .55em; }
.spec-page .spec-drop + p { clear: left; }
.spec-page .spec-rubric { color: var(--rub); font-style: italic; }
.spec-page .r { color: var(--rub); }
.spec-page .spec-drop::first-letter {
  float: left; font-family: "Great Vibes", var(--titlu); font-feature-settings: "ss01";
  font-size: 3.4em; line-height: .8; color: var(--rub); margin: .06em .08em 0 0;
}
.specimen figcaption { margin-top: .8rem; text-align: center; font-size: .85rem; color: var(--cerneala-2); font-style: italic; }

.features { margin: 0; display: grid; gap: 1.5rem 2.5rem; }
@media (min-width: 40rem) { .features { grid-template-columns: 1fr 1fr; } }
.features dt { font-family: var(--titlu); font-size: 1.5rem; line-height: 1.15; }
.features dd { margin: .35rem 0 0; color: var(--cerneala-2); }

/* ------------------------------------------------ installing */

.install { border-top: 1px solid var(--fir); }
.steps {
  list-style: none; counter-reset: pas; margin: clamp(2rem, 5vw, 3rem) 0 0; padding: 0;
  display: grid; gap: 1.6rem; max-width: 52rem; text-align: left;
}
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: pas; position: relative; padding-top: 3.4rem; }
.steps li::before {
  content: counter(pas); position: absolute; top: 0; left: 0;
  font: 600 3rem/1 var(--titlu); color: var(--chinovar);
}
.steps strong { font-weight: 600; }
.install-note { margin-top: 2rem; max-width: 36rem; color: var(--cerneala-2); }
.share-row { margin-top: 1.8rem; display: grid; justify-items: center; gap: .6rem; }
.share {
  font: 500 1rem/1 var(--text); color: var(--hartie); background: var(--chinovar);
  border: 0; border-radius: 999px; padding: .95rem 1.6rem; min-height: 3rem; cursor: pointer;
}
.share:hover { background: #82230F; }
.share-done { font-size: .9rem; color: var(--cerneala-2); min-height: 1.4em; }

/* ------------------------------------------------ colophon */

.colophon {
  border-top: 1px solid var(--fir);
  padding: clamp(3rem, 7vw, 4.5rem) var(--pad) 3rem;
  display: grid; justify-items: center; gap: .7rem; text-align: center;
  background: var(--hartie-2);
}
.colophon .emblem { width: 3rem; color: var(--sigla); margin-bottom: .6rem; }
.colophon .rubric { color: var(--chinovar); font-style: italic; }
.colophon .fine { margin-top: 1.4rem; max-width: 40rem; font-size: .85rem; color: var(--cerneala-2); }

/* ------------------------------------------------ back to the shelf */

.to-shelf {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 5;
  background: var(--cerneala); color: var(--hartie); text-decoration: none;
  font-size: .9rem; padding: .7rem 1.1rem; border-radius: 999px;
  box-shadow: 0 .4rem 1rem -.4rem rgb(30 25 19 / .6);
  opacity: 0; translate: 0 1rem; pointer-events: none;
  transition: opacity .25s ease, translate .25s ease;
}
.to-shelf.on { opacity: 1; translate: 0 0; pointer-events: auto; }

/* ------------------------------------------------ lightbox */

.lightbox {
  border: 0; padding: 0; background: none; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgb(18 16 13 / .9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: .9rem; padding: 3.5rem 1rem 1.5rem; }
.lightbox img {
  max-height: calc(100dvh - 9.5rem); width: auto; max-width: min(92vw, 30rem);
  border-radius: 1.4rem; border: .35rem solid #000;
}
.lightbox figcaption { color: #E8DCC2; font-style: italic; text-align: center; max-width: 30rem; }
.lightbox button {
  position: fixed; width: 3rem; height: 3rem; border-radius: 50%; border: 0;
  background: rgb(255 253 248 / .12); color: #FBF8F1; cursor: pointer; display: grid; place-items: center;
}
.lightbox button:hover { background: rgb(255 253 248 / .24); }
.lightbox svg { width: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lb-next { right: 1rem; top: 50%; translate: 0 -50%; }

@media print {
  .shelf, .to-shelf, .shots-nav, .share-row, .lightbox { display: none !important; }
}
