/* =========================================================================
   Soft Skills Lab — Communication Resource Pack
   One stylesheet, no build step. Sections in order:
   tokens · base · layout · decoration · header · buttons · hero · cards
   · library · reader · forms · footer · motion
   ========================================================================= */

/* --- tokens ------------------------------------------------------------ */

:root {
  color-scheme: light;

  /* ground & ink */
  --cream: #fdf8ee;
  --cream-deep: #f7eeda;
  --paper: #ffffff;
  --ink: #2e2a26;
  --ink-soft: #5c554c;
  --ink-faint: #8b8378;
  --rule: #e9e0cf;

  /* brand */
  --green: #0e5c2a;
  --green-deep: #094320;
  --green-soft: #e4f0e6;

  /* accents, lifted from the booklet artwork */
  --coral: #f4796b;
  --amber: #f9be55;
  --teal: #5fcbc6;
  --lilac: #b39cd9;

  /* type */
  --font-display: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: clamp(0.86rem, 0.83rem + 0.15vw, 0.94rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.5vw, 2.9rem);
  --step-4: clamp(2.3rem, 1.8rem + 2.4vw, 3.8rem);

  /* shape */
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgb(46 42 38 / 6%);
  --shadow: 0 10px 30px -12px rgb(46 42 38 / 18%);
  --shadow-lg: 0 24px 60px -20px rgb(46 42 38 / 26%);

  --masthead-h: 73px;   /* min-height 72 + 1px border; see .masthead */
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 62ch;
  --wrap: 1180px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- base -------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

/* `hidden` must win over any display an element's own class sets, or a
   .btn (inline-flex) stays on screen when JS hides it. */
[hidden] { display: none !important; }

/* Smooth scrolling is switched on only once the page has settled. During load
   it would animate the browser's jump to a fragment, and that animation carries
   on past our correction to the offset it computed before the library rendered
   — landing the visitor thousands of pixels short. See site.js. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html.smooth-scroll { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--green-deep); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--green);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Anything linked to by a fragment has to clear the sticky masthead,
   otherwise the jump parks its heading underneath the header. */
main [id],
section[id] { scroll-margin-top: calc(var(--masthead-h) + 1.25rem); }

/* --- layout ------------------------------------------------------------ */

.wrap {
  width: min(var(--wrap), 100% - var(--gutter) * 2);
  margin-inline: auto;
}
.wrap--narrow { width: min(760px, 100% - var(--gutter) * 2); }

.section { padding-block: clamp(3rem, 7vw, 6rem); position: relative; }
.section--tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.section--paper { background: var(--paper); }
.section--cream { background: var(--cream-deep); }

.lede {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: var(--measure);
}

.section-head { max-width: var(--measure); margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head--centre { margin-inline: auto; text-align: center; }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 0.75rem;
}

/* --- decoration -------------------------------------------------------- */

/* The original site layered soft "faded shapes" behind its content. */
.shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.shapes svg { position: absolute; opacity: 0.5; }
.shapes .blob-a { top: -14%; right: -8%; width: 46vw; min-width: 320px; }
.shapes .blob-b { bottom: -22%; left: -12%; width: 40vw; min-width: 280px; opacity: 0.38; }

.section > .wrap { position: relative; z-index: 1; }

/* --- header ------------------------------------------------------------ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(253 248 238 / 88%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--green); }
.brand img { width: 38px; height: 38px; flex: none; }
.brand span small {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.nav { display: flex; align-items: center; gap: 0.35rem; }

.nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav a:hover { background: var(--green-soft); color: var(--green-deep); }
.nav a[aria-current="page"] { background: var(--green); color: #fff; }

.nav-toggle {
  display: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.9rem;
  font: 600 0.9rem/1 var(--font-display);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    inset: 100% var(--gutter) auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0.6rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.7rem 0.9rem; }
}

/* --- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--green); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--green-deep); color: #fff; }

.btn--ghost {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--green); color: var(--green-deep); }

.btn--small { padding: 0.62rem 1.1rem; font-size: 0.9rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --- hero -------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/faded-shapes.webp") center / cover no-repeat;
  opacity: 0.55;
  z-index: 0;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

.hero__title { margin-bottom: 0.35em; }
.hero__tagline {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 34ch;
  margin-bottom: 2rem;
}

.hero__art {
  position: relative;
  filter: drop-shadow(0 22px 40px rgb(46 42 38 / 14%));
}
.hero__art img { width: 100%; }

.hero__stats {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.hero__stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--green);
  line-height: 1;
}
.hero__stat span { font-size: var(--step--1); color: var(--ink-faint); }

/* --- cards ------------------------------------------------------------- */

.grid {
  display: grid;
  gap: clamp(1.2rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.card--link { text-decoration: none; color: inherit; display: block; }
.card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: inherit;
}
.card__art {
  width: 96px;
  margin-bottom: 1.2rem;
}
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--ink-soft); font-size: 0.97rem; }

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--green);
}
.card--link:hover .card__more { gap: 0.7rem; }
.card__more svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }

/* alternating illustrated rows */
.feature {
  display: grid;
  gap: clamp(1.8rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}
.feature + .feature { margin-top: clamp(3rem, 6vw, 5rem); }
.feature__art img {
  width: 100%;
  border-radius: var(--radius-lg);
}
.feature--flip .feature__art { order: -1; }
@media (max-width: 760px) {
  .feature--flip .feature__art { order: 0; }
}

/* --- library ----------------------------------------------------------- */

.library {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.booklet {
  --accent: var(--green);
  --accent-ink: var(--green);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.booklet:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.booklet::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--accent);
}

.booklet__cover {
  position: relative;
  padding: 1.4rem 1.4rem 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, #fff), #fff);
}
.booklet__cover img {
  width: 100%;
  /* --cover-aspect comes from the manifest, so the card reserves its full
     height before the lazy image loads. Without it every cover that arrives
     shifts everything below it down, which breaks fragment links. */
  aspect-ratio: var(--cover-aspect, 0.75);
  object-fit: contain;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  box-shadow: 0 -2px 0 var(--rule) inset, var(--shadow);
  transition: transform 0.3s var(--ease);
}
.booklet:hover .booklet__cover img { transform: translateY(-4px); }

.booklet__pages {
  position: absolute;
  top: 1.9rem;
  right: 1.9rem;
  background: var(--accent-ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.booklet__body {
  padding: 1.3rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}
.booklet__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0;
}
.booklet__title a {
  color: inherit;
  text-decoration: none;
}
/* the whole card is the hit area for the title link */
.booklet__title a::after { content: ""; position: absolute; inset: 0; }
.booklet:hover .booklet__title a { color: var(--accent-ink); }

.booklet__summary {
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.booklet__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.booklet__read {
  position: relative;
  z-index: 1;
  background: var(--accent-ink);
  color: #fff;
  border-color: transparent;
}
.booklet__read:hover { background: var(--accent-ink); color: #fff; filter: brightness(0.9); }
.booklet__download {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-faint);
  text-decoration: none;
}
.booklet__download:hover { color: var(--accent-ink); }
.booklet__download svg { width: 15px; height: 15px; }

/* --- reader ------------------------------------------------------------ */

/* The reader fills the viewport exactly and never scrolls: the bar and footer
   are fixed-size, and the stage takes whatever is left. That gives the book a
   definite height to fit itself into. */
.reader {
  --accent: var(--green);
  --accent-ink: var(--green);
  height: 100dvh;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #fffdf8 0%, var(--cream) 55%, var(--cream-deep) 100%);
}

#reader-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#reader-body[hidden] { display: none; }

.reader__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: rgb(255 255 255 / 70%);
  backdrop-filter: blur(8px);
}
.reader__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.reader__back:hover { color: var(--green); }
.reader__back svg { width: 16px; height: 16px; flex: none; }

@media (max-width: 600px) {
  .reader__bar { gap: 0.6rem; padding-inline: 0.9rem; }
  .reader__back span { display: none; }
  .reader__heading { text-align: left; }
}

.reader__heading {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.reader__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader__tools { display: flex; gap: 0.5rem; align-items: center; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
              border-color 0.18s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn[hidden] { display: none; }

.reader__stage {
  flex: 1 1 auto;
  display: flex;
  padding: clamp(1rem, 3vw, 2.4rem) var(--gutter);
  min-height: 0;
  overflow: hidden;
}

.reader__viewport {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.6rem);
}

/* the book itself ------------------------------------------------------- */

/* Sizing: the book is a size container, so the spread can take the smaller of
   the width available and the width implied by the height available. A plain
   `max-height` will not do it — an explicit `width: 100%` wins over it and the
   book spills past the footer. */
.book {
  --aspect: 0.75;          /* page width / height, from the manifest */
  --leaf-ms: 620ms;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  container-type: size;
  display: grid;
  place-items: center;
  perspective: 2600px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.book__spread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform-style: preserve-3d;
  aspect-ratio: calc(var(--aspect) * 2);
  width: 100%;  /* fallback for browsers without container query units */
  width: min(100cqw, 100cqh * var(--aspect) * 2);
  max-width: 100%;
}
.book[data-layout="single"] .book__spread {
  grid-template-columns: 1fr;
  aspect-ratio: var(--aspect);
  width: 100%;
  width: min(100cqw, 100cqh * var(--aspect));
}

.book__half {
  position: relative;
  min-width: 0;
  background: var(--paper);
  overflow: hidden;
}
.book__half img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.book__half--left {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  box-shadow: -6px 8px 26px -10px rgb(46 42 38 / 35%);
}
.book__half--right {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 6px 8px 26px -10px rgb(46 42 38 / 35%);
}
.book[data-layout="single"] .book__half {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.book__half--empty { background: transparent; box-shadow: none; }
.book__half--empty img { visibility: hidden; }

/* the gutter shadow where the two pages meet */
.book__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 46px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    90deg,
    rgb(46 42 38 / 0%) 0%,
    rgb(46 42 38 / 13%) 42%,
    rgb(46 42 38 / 20%) 50%,
    rgb(46 42 38 / 13%) 58%,
    rgb(46 42 38 / 0%) 100%
  );
}
.book[data-layout="single"] .book__spine { display: none; }

/* the turning leaf */
.leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}
.book[data-layout="single"] .leaf { width: 100%; }
.leaf[hidden] { display: none; }

.leaf--forward { right: 0; transform-origin: left center; }
.leaf--back { left: 0; transform-origin: right center; }

.leaf__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  background: var(--paper);
}
.leaf__face img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.leaf--forward .leaf__face--front { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.leaf--forward .leaf__face--back {
  transform: rotateY(180deg);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.leaf--back .leaf__face--front { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.leaf--back .leaf__face--back {
  transform: rotateY(-180deg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.book[data-layout="single"] .leaf__face { border-radius: var(--radius-sm); }

/* a sheen that sweeps the leaf as it turns, so it reads as paper */
.leaf__face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--leaf-ms) var(--ease);
}
.leaf--forward .leaf__face--front::after,
.leaf--back .leaf__face--back::after {
  background: linear-gradient(90deg, rgb(46 42 38 / 26%) 0%, rgb(46 42 38 / 0%) 42%);
}
.leaf--forward .leaf__face--back::after,
.leaf--back .leaf__face--front::after {
  background: linear-gradient(270deg, rgb(46 42 38 / 26%) 0%, rgb(46 42 38 / 0%) 42%);
}
.book[data-turning] .leaf__face::after { opacity: 1; }

/* single-page mode slides rather than turns — a curl has nowhere to go */
.book[data-layout="single"] .book__half--active {
  animation: slide-in 340ms var(--ease);
}
.book[data-layout="single"][data-direction="back"] .book__half--active {
  animation-name: slide-in-back;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-in-back {
  from { opacity: 0; transform: translateX(-28px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* page-turn arrows sitting outside the book */
.reader__arrow {
  width: 54px;
  height: 54px;
  flex: none;
  box-shadow: var(--shadow);
}
.reader__arrow:disabled {
  opacity: 0.32;
  cursor: default;
  transform: none;
  border-color: var(--rule);
  color: var(--ink-faint);
}
@media (max-width: 720px) {
  .reader__arrow { display: none; }
}

/* --- reader footer: counter, scrubber, thumbnails ---------------------- */

.reader__foot {
  flex: none;
  padding: 0 var(--gutter) clamp(0.8rem, 2.5vw, 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

/* on a short window the thumbnail strip is the first thing to go */
@media (max-height: 640px) {
  .thumbs { display: none; }
}

.reader__counter {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.reader__counter .icon-btn { width: 38px; height: 38px; }
@media (min-width: 721px) {
  .reader__counter .icon-btn { display: none; }
}
.reader__counter output { min-width: 6.5ch; text-align: center; }

.thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  max-width: 100%;
  padding: 0.35rem 0.2rem 0.6rem;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.thumbs::-webkit-scrollbar { height: 6px; }
.thumbs::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.thumb {
  flex: none;
  width: 46px;
  aspect-ratio: var(--aspect, 0.75);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.62;
  scroll-snap-align: center;
  transition: opacity 0.18s var(--ease), border-color 0.18s var(--ease),
              transform 0.18s var(--ease);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.thumb:hover { opacity: 1; transform: translateY(-2px); }
.thumb[aria-current="true"] {
  opacity: 1;
  border-color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

/* fullscreen */
.reader:fullscreen { background: #221f1c; }
.reader:fullscreen .reader__bar,
.reader:fullscreen .reader__foot { background: rgb(34 31 28 / 82%); border-color: #3b362f; }
.reader:fullscreen .reader__title,
.reader:fullscreen .reader__back,
.reader:fullscreen .reader__counter { color: #f3ece0; }
.reader:fullscreen .icon-btn { background: #2e2a26; border-color: #46403a; color: #f3ece0; }

.reader__empty {
  display: grid;
  place-items: center;
  gap: 1rem;
  text-align: center;
  padding: 4rem var(--gutter);
}

/* --- contact ----------------------------------------------------------- */

.contact {
  display: grid;
  justify-items: center;
  gap: 1rem;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 5vw, 3rem);
  box-shadow: var(--shadow-sm);
}
.contact p { max-width: 52ch; color: var(--ink-soft); margin: 0; }
.contact__art { width: 96px; margin-bottom: 0.3rem; }
.contact__actions { justify-content: center; margin-top: 0.6rem; }

.contact__address {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink) !important;
  word-break: break-all;
}
.contact__address[hidden] { display: none; }

.form__note {
  margin: 0;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
}
.form__note[hidden] { display: none; }
.form__note--info { background: var(--cream-deep); color: var(--ink-soft); }
.form__note--error { background: #fdecea; color: #a33025; }

/* --- callout / consent ------------------------------------------------- */

.callout {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 3rem);
  box-shadow: var(--shadow-sm);
}
.callout__art img { width: min(280px, 100%); margin-inline: auto; }

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  color: var(--ink-soft);
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- footer ------------------------------------------------------------ */

.footer {
  background: var(--green);
  color: #e8f2e9;
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.footer a { color: #fff; }
.footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}
.footer h4 {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a9cfb2;
  margin-bottom: 0.9rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer__brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.footer__brand img { width: 40px; height: 40px; }
.footer__brand strong { font-family: var(--font-display); font-size: 1.1rem; color: #fff; }
.footer p { color: #c8dfcd; font-size: 0.93rem; }
.footer__base {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 16%);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  justify-content: space-between;
  font-size: 0.86rem;
  color: #a9cfb2;
}

/* --- motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html, html.smooth-scroll { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover, .card--link:hover, .booklet:hover { transform: none; }
  /* the reader swaps the 3D turn for a cross-fade — see flipbook.js */
}
