/* Social Skills Program — staff curriculum library
   Palette taken from the program logo. Fonts bundled in assets/fonts so the
   whole site works with no internet. */

@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage.woff2') format('woff2-variations');
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('../fonts/public-sans-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --navy: #003877;
  --navy-deep: #002450;
  --ink: #0d1b2a;
  --teal: #1b919e;
  --teal-deep: #12707c;
  --gold: #efb635;
  --gold-deep: #a9761a;

  --paper: #ffffff;
  --shell: #f4f7fa;
  --wash: #eaf1f8;
  --line: #dde5ee;
  --muted: #5a6b7d;

  --display: 'Bricolage', 'Public Sans', system-ui, sans-serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --accent: var(--navy);
  --accent-deep: var(--navy-deep);
  --accent-wash: var(--wash);

  --shadow-sm: 0 1px 2px rgba(13, 27, 42, .05);
  --shadow: 0 2px 4px rgba(13, 27, 42, .04), 0 12px 32px rgba(13, 27, 42, .07);
  --shadow-lg: 0 4px 8px rgba(13, 27, 42, .05), 0 24px 56px rgba(13, 27, 42, .12);
}

[data-topic="social"]  { --accent: #003877; --accent-deep: #002450; --accent-wash: #e6eefa; }
[data-topic="hygiene"] { --accent: #1b919e; --accent-deep: #12707c; --accent-wash: #e2f2f3; }
[data-topic="anger"]   { --accent: #c8901f; --accent-deep: #8a5f12; --accent-wash: #fdf3e0; }
[data-topic="language"]{ --accent: #574fa3; --accent-deep: #3c3676; --accent-wash: #edecf7; }
[data-topic="table"]   { --accent: #2e7d51; --accent-deep: #1f5a39; --accent-wash: #e7f3ec; }
[data-topic="money"]   { --accent: #1f7a6b; --accent-deep: #145349; --accent-wash: #e4f2ef; }
[data-topic="help"]    { --accent: #2a6fb0; --accent-deep: #1b4b7a; --accent-wash: #e5eef8; }
[data-topic="safety"]  { --accent: #c2562f; --accent-deep: #8c3a1d; --accent-wash: #fbede6; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--shell);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }
.wrap { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* masthead */
.masthead {
  background: rgba(255,255,255,.93);
  backdrop-filter: saturate(1.6) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.masthead__inner { display: flex; align-items: center; gap: .85rem; padding: .8rem 0; }
.masthead__logo { height: 34px; width: auto; display: block; }
.masthead__title {
  font-family: var(--display); font-weight: 700; font-size: 1.06rem;
  letter-spacing: -.02em; color: var(--navy); margin: 0; line-height: 1.15;
}
.masthead__sub {
  font-size: .7rem; font-weight: 600; color: var(--muted);
  letter-spacing: .13em; text-transform: uppercase; margin: 0;
}
.masthead__spacer { flex: 1; }
.btn-plain {
  font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem 1rem; cursor: pointer; transition: color .15s, border-color .15s;
}
.btn-plain:hover { color: var(--navy); border-color: var(--navy); }

/* gate */
.gate {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem;
  background: radial-gradient(900px 420px at 50% -8%, #dfeaf6 0%, transparent 66%), var(--shell);
}
.gate__card {
  width: min(408px, 100%); background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 2.4rem 2rem 1.9rem; text-align: center;
}
.gate__logo { width: 148px; height: auto; margin-bottom: 1rem; }
.gate__card h1 {
  font-family: var(--display); font-size: 1.4rem; font-weight: 700;
  color: var(--navy); margin: 0 0 .3rem; letter-spacing: -.025em;
}
.gate__hint { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.field { text-align: left; margin-bottom: .95rem; }
.field label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .4rem;
}
.field input {
  width: 100%; font: inherit; padding: .72rem .85rem;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe;
}
.field input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.btn {
  display: inline-block; width: 100%; font: inherit; font-weight: 600;
  padding: .78rem 1rem; border: 0; border-radius: 10px; background: var(--navy);
  color: #fff; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--navy-deep); }
.gate__error { display: none; margin: .9rem 0 0; font-size: .87rem; color: #b3261e; }
.gate__error.is-visible { display: block; }

/* Two doors on the front page, side by side on anything wider than a phone. */
.gate__pair { display: grid; gap: 1.1rem; width: 100%; max-width: 62rem;
  grid-template-columns: 1fr; }
/* two doors side by side on a tablet, three across on a wide screen */
@media (min-width: 760px) { .gate__pair { grid-template-columns: 1fr 1fr; } }
/* four doors read best as two rows of two; three across squeezes them */
@media (min-width: 1040px) { .gate__pair { max-width: 68rem; } }
.gate__pair .gate__card { margin: 0; }
.gate__card[data-door="points"] { border-top: 4px solid #B8860B; }
.gate__card[data-door="library"] { border-top: 4px solid #003877; }
.gate__card[data-door="books"] { border-top: 4px solid #1d6b42; }
.gate__card[data-door="attend"] { border-top: 4px solid #6b4ea8; }
.gate__card.is-wanted { box-shadow: 0 0 0 3px rgba(0,56,119,.18); }

/* ------------------------------------------------------------------ the way in
   One sign-in, then a card for each section this person may open. These live
   here rather than in index.html because that page has no style block of its
   own — putting them there did nothing at all, twice. */
.signpanel { width: min(30rem, 100%); margin: 0 auto; background: var(--paper);
  border: 1px solid var(--line); border-top: 4px solid #003877; border-radius: 18px;
  box-shadow: var(--shadow); padding: 2.2rem 2rem; text-align: center; }
.signpanel img { height: 3.4rem; width: auto; margin-bottom: .9rem; }
.signpanel h1 { margin: 0 0 .3rem; font-family: var(--display); font-size: 1.45rem;
  color: var(--navy); }
.signpanel p { margin: 0 0 1.5rem; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.signpanel .btn { display: inline-block; text-decoration: none; font-weight: 700;
  background: #003877; color: #fff; border-radius: 10px; padding: .75rem 2.4rem; }

.doors { display: grid; gap: 1rem; width: min(64rem, 100%); margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.door { display: flex; flex-direction: column; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-top: 4px solid #003877;
  border-radius: 16px; box-shadow: var(--shadow); padding: 1.3rem 1.35rem 1.15rem;
  min-height: 9.5rem; }
.door:hover { border-color: #003877; transform: translateY(-2px); transition: transform .12s; }
.door b { display: block; font-family: var(--display); font-size: 1.15rem;
  color: var(--navy); margin-bottom: .3rem; }
.door em { display: block; font-style: normal; font-size: .86rem; color: var(--muted);
  line-height: 1.55; flex: 1; }
.door span { font-weight: 700; color: var(--navy); font-size: .9rem; margin-top: .9rem; }
.door-none { color: var(--muted); text-align: center; grid-column: 1 / -1; }

.whoLine { text-align: center; color: var(--muted); font-size: .86rem; margin-top: 1.6rem; }

/* going back to the sections from inside the lessons */
.backbar { width: min(64rem, 100%); margin: 0 auto 1.4rem; }
.backbar button { font: inherit; font-weight: 600; font-size: .9rem; color: var(--navy);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: .5rem 1rem; cursor: pointer; box-shadow: var(--shadow-sm); }
.backbar button:hover { border-color: #003877; }

/* The way through to the shop counter. Deliberately not a fourth sign-in box:
   it is a door that opens without a code, and it only leads to the store. */
.gate__store { display: flex; align-items: center; gap: 1rem; text-decoration: none;
  width: min(62rem, 100%); margin: 1.4rem auto 0; padding: 1rem 1.15rem;
  background: var(--paper); border: 1px solid var(--line); border-top: 4px solid #7a3b57;
  border-radius: 16px; box-shadow: var(--shadow); text-align: left; }
.gate__store:hover { border-color: #7a3b57; }
.gate__store b { display: block; font-family: var(--display); font-size: 1.15rem;
  color: var(--navy); }
.gate__store em { display: block; font-style: normal; font-size: .87rem; color: var(--muted);
  line-height: 1.5; margin-top: .15rem; }
.gate__store-go { flex: none; font-weight: 700; color: var(--navy); white-space: nowrap; }
@media (max-width: 34rem) {
  .gate__store { flex-wrap: wrap; }
  .gate__store-go { margin-left: auto; }
}
.gate__foot { max-width: 62rem; margin: 1.1rem auto 0; text-align: center;
  color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* hero */
.hero { padding: 3.4rem 0 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .72rem;
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal-deep); margin: 0 0 .9rem;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--gold); border-radius: 2px; }
.hero h1 {
  font-family: var(--display); font-size: clamp(2.1rem, 5.4vw, 3.5rem); font-weight: 700;
  line-height: 1.02; letter-spacing: -.038em; color: var(--navy); margin: 0 0 1rem; max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--teal); }
.hero__lede { color: var(--muted); max-width: 54ch; margin: 0; font-size: 1.06rem; line-height: 1.62; }

/* filmstrip — the signature: the real printed material, moving past */
.strip { margin: 2.6rem 0 0; overflow: hidden; padding: .4rem 0 1.6rem; }
.strip__row { display: flex; width: max-content; gap: .8rem; margin-bottom: .8rem; }
.strip__row--a { animation: slide-l 78s linear infinite; }
.strip__row--b { animation: slide-r 92s linear infinite; }
.strip:hover .strip__row { animation-play-state: paused; }
@keyframes slide-l { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes slide-r { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.strip__item {
  width: 132px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.strip__item img { width: 100%; height: auto; display: block; aspect-ratio: 17/22; object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
  .strip__row { animation: none; }
  .strip { overflow-x: auto; }
}

/* stats */
.stats {
  display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 3.4rem;
}
.stats > div { flex: 1 1 25%; min-width: 148px; padding: 1.15rem 1.3rem; border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: 0; }
.stats strong {
  display: block; font-family: var(--display); font-size: 1.9rem; font-weight: 700;
  line-height: 1; letter-spacing: -.03em; color: var(--navy);
}
.stats span { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* sections */
.section-head {
  font-family: var(--display); font-size: 1.28rem; font-weight: 700;
  letter-spacing: -.025em; color: var(--navy); margin: 0 0 .4rem;
}
.section-note { color: var(--muted); font-size: .95rem; margin: 0 0 1.5rem; }

/* unit cards */
.units { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; padding-bottom: 2.6rem; }
.wrap > .section-head + .section-note + .units { margin-bottom: 1rem; }
.unit {
  display: flex; flex-direction: column; position: relative; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 1.75rem 1.5rem 1.35rem;
  text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.unit::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--accent); }
.unit:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.unit__label {
  font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 .45rem;
}
.unit h3 {
  font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em;
  color: var(--navy); margin: 0 0 .5rem; line-height: 1.1;
}
.unit__desc { font-size: .93rem; color: var(--muted); margin: 0 0 1.1rem; }
.unit__weeks { list-style: none; margin: 0 0 1.25rem; padding: 0; flex: 1; counter-reset: w; }
.unit__weeks li {
  font-size: .88rem; color: var(--ink); padding: .34rem 0 .34rem 1.6rem;
  border-top: 1px solid var(--line); position: relative;
}
.unit__weeks li:first-child { border-top: 0; }
.unit__weeks li::before {
  content: counter(w); counter-increment: w; position: absolute; left: 0; top: .45rem;
  width: 18px; height: 18px; border-radius: 5px; background: var(--accent-wash);
  color: var(--accent-deep); font-size: .64rem; font-weight: 700; display: grid; place-items: center;
}
.unit__foot { display: flex; align-items: center; gap: .6rem; }
.chip {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .3rem .62rem;
  border-radius: 999px; background: var(--accent-wash); color: var(--accent-deep);
}
.unit__go { margin-left: auto; font-size: .87rem; font-weight: 700; color: var(--accent-deep); }

/* lesson shape */
.shape { padding-bottom: 3.8rem; }
.shape__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .95rem 1rem 1rem; box-shadow: var(--shadow-sm); }
.step b {
  display: block; font-family: var(--display); font-size: .96rem; font-weight: 700;
  letter-spacing: -.015em; color: var(--navy); margin-bottom: .12rem;
}
.step span { font-size: .78rem; font-weight: 600; color: var(--teal-deep); letter-spacing: .04em; }

/* topic page */
.topicbar { background: var(--paper); border-bottom: 1px solid var(--line); padding: 2.5rem 0 2.1rem; position: relative; }
.topicbar::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.crumb { font-size: .84rem; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 1rem; }
.crumb:hover { color: var(--accent-deep); }
.topicbar h1 {
  font-family: var(--display); font-size: clamp(1.95rem, 4.6vw, 2.8rem); font-weight: 700;
  letter-spacing: -.035em; color: var(--navy); margin: 0 0 .6rem; line-height: 1.05;
}
.topicbar p { color: var(--muted); max-width: 62ch; margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.fact strong {
  display: block; font-family: var(--display); font-size: 1.55rem; font-weight: 700;
  letter-spacing: -.03em; color: var(--accent-deep); line-height: 1;
}
.fact span { font-size: .73rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
main .section-head { margin-top: 3rem; margin-bottom: 1.3rem; }
.rail { border-left: 2px solid var(--line); margin: 0 0 3rem 1.15rem; }
.week { position: relative; padding: 0 0 2.1rem 2.1rem; }
.week::before {
  content: attr(data-week); position: absolute; left: -19px; top: 2px; width: 36px; height: 36px;
  border-radius: 11px; background: var(--accent); color: #fff; font-family: var(--display);
  font-weight: 700; font-size: .95rem; display: grid; place-items: center; border: 3px solid var(--shell);
}
.week h3 { font-family: var(--display); font-size: 1.28rem; font-weight: 700; letter-spacing: -.025em; color: var(--ink); margin: .2rem 0 .3rem; }
.week__goal { color: var(--muted); margin: 0 0 1rem; max-width: 62ch; }
.week__kicker { font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent, #B8860B); margin: 0; }
.week__sub { font-family: var(--display); font-size: .98rem; font-weight: 700;
  color: var(--ink); margin: 1.35rem 0 .5rem; padding-bottom: .3rem;
  border-bottom: 1px solid #e6ecf3; }
.week__sub:first-of-type { margin-top: 0; }

/* file rows */
.files { display: grid; gap: .55rem; }
.file {
  display: flex; align-items: center; gap: .9rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: 11px; padding: .78rem 1rem; color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.file:hover { border-color: var(--accent); background: #fcfdff; transform: translateX(2px); }
.file__type { flex: none; font-size: .63rem; font-weight: 800; letter-spacing: .06em; padding: .32rem .5rem; border-radius: 6px; min-width: 50px; text-align: center; }
.file__type--doc { background: #e6eefa; color: #003877; }
.file__type--pdf { background: #fdf3e0; color: #a9761a; }
/* kinds a rebbe might upload that the program never had a tag for. Without
   these they would render as an unstyled lump beside the built-in rows. */
.file__type--film { background: #efeaf5; color: #5b3a8a; }
.file__type--other { background: #eef3f8; color: #44586d; }
.file__type--img { background: #e2f2f3; color: #12707c; }
.file__body { flex: 1; min-width: 0; }
.file__name { font-weight: 600; font-size: .95rem; display: block; }
.file__note { font-size: .82rem; color: var(--muted); display: block; }
.file__acts { flex: none; display: flex; gap: .45rem; }
.act {
  font: inherit; font-size: .8rem; font-weight: 600; padding: .44rem .85rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer;
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center;
  transition: border-color .15s, color .15s, background .15s;
}
.act:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); }
.act--view { background: var(--accent); border-color: var(--accent); color: #fff; }
.act--view:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(9,20,34,.66); backdrop-filter: blur(3px); padding: 2.5vh 2vw; }
.viewer.is-open { display: grid; place-items: center; }
.viewer__panel { width: min(1000px, 100%); height: 95vh; background: var(--paper); border-radius: 16px; box-shadow: 0 30px 70px rgba(6,14,26,.42); display: flex; flex-direction: column; overflow: hidden; }
.viewer__bar { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); flex: none; }
.viewer__title { font-weight: 700; font-size: .97rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__sub { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__spacer { flex: 1; }
.viewer__close { font: inherit; font-size: 1.25rem; line-height: 1; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; }
.viewer__close:hover { color: var(--navy); border-color: var(--navy); }
.viewer__stage { flex: 1; min-height: 0; background: #eef2f7; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pageroll { padding: 1rem; display: grid; gap: 1rem; }
.pageroll__page { margin: 0; text-align: center; }
.pageroll__page img { width: 100%; max-width: 780px; height: auto; display: block; margin: 0 auto; border: 1px solid #d3dbe6; border-radius: 6px; background: #fff; box-shadow: 0 2px 10px rgba(20,32,50,.08); }
.pageroll__page figcaption { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8492a4; margin-top: .45rem; }
.pageroll__empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.viewer__note { padding: .55rem 1rem; font-size: .78rem; color: #a9761a; background: #fdf6e9; border-top: 1px solid #f0dfc0; flex: none; }

/* callout */
.callout { background: var(--accent-wash); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 1.15rem 1.35rem; margin: 0 0 2.8rem; }
.callout h4 { margin: 0 0 .45rem; font-size: .73rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); }
.callout ul { margin: 0; padding-left: 1.15rem; font-size: .93rem; color: var(--ink); }
.callout li { margin-bottom: .3rem; }

/* foot */
.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 2rem 0; margin-top: 2rem; }
.foot__inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot img { height: 30px; width: auto; opacity: .85; }
.foot p { margin: 0; font-size: .82rem; color: var(--muted); }
.foot p + p { margin-left: auto; }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 2rem); }
  .masthead__sub { display: none; }
  .hero { padding-top: 2.4rem; }
  .facts { gap: 1.4rem; }
  .stats > div { flex-basis: 50%; }
  .stats > div:nth-child(2) { border-right: 0; }
  .file { flex-wrap: wrap; }
  .file__body { flex-basis: calc(100% - 62px); }
  .file__acts { flex-basis: 100%; margin-top: .25rem; }
  .act { flex: 1; justify-content: center; }
  .viewer { padding: 0; }
  .viewer__panel { height: 100vh; width: 100%; border-radius: 0; }
  .viewer__bar { gap: .5rem; padding: .65rem .75rem; }
  .viewer__sub { display: none; }
  .viewer__title { font-size: .9rem; }
  .viewer__bar .act { font-size: .74rem; padding: .38rem .6rem; }
  .pageroll { padding: .6rem; gap: .7rem; }
  .foot p + p { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
@media print { .masthead, .foot, .callout, .viewer, .strip { display: none; } body { background: #fff; } }

/* library search */
.search { max-width: 720px; margin: 0 auto 2.4rem; padding: 0 1.1rem; }
.search__box { position: relative; }
.search__box input { width: 100%; padding: .85rem 1rem .85rem 2.6rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  border: 1px solid #cfd8e3; border-radius: 12px; background: #fff; }
.search__box input:focus { outline: none; border-color: var(--accent, #003877);
  box-shadow: 0 0 0 3px rgba(0,56,119,.1); }
.search__box svg { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%);
  width: 1.05rem; height: 1.05rem; stroke: #8a95a5; fill: none; stroke-width: 2; }
.search__results { margin-top: .7rem; }
.search__hit { display: block; padding: .7rem .9rem; margin-bottom: .4rem;
  border: 1px solid #e3e9f0; border-radius: 10px; background: #fff;
  text-decoration: none; }
.search__hit strong { display: block; color: #0d1b2a; font-size: .98rem; }
.search__hit span { color: var(--soft); font-size: .85rem; }
.search__hit em { font-style: normal; color: var(--accent, #003877); font-weight: 600; }
.search__none { color: var(--soft); font-size: .92rem; padding: .5rem .2rem; }

/* logo returns to the hub */
.masthead__home { display: inline-flex; align-items: center; text-decoration: none;
  border-radius: 8px; transition: opacity .15s ease; }
.masthead__home:hover { opacity: .72; }
.masthead__home p { margin: 0; }

/* the preview panel eases open instead of snapping */
.viewer { opacity: 0; transition: opacity .18s ease; }
.viewer.is-open { opacity: 1; }
.viewer__panel { transform: translateY(14px) scale(.985);
  transition: transform .22s cubic-bezier(.2,.7,.3,1); }
.viewer.is-open .viewer__panel { transform: none; }

/* content lifts in as you scroll down the page */
.reveal { opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .viewer, .viewer__panel { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

[data-topic="perspective"]{ --accent: #8e44ad; --accent-deep: #5f2c74; --accent-wash: #f3eaf7; }

/* Building mode (REQUIRE_SIGN_IN = false in auth.js): no sign-in card, and the
   hub is shown straight away rather than waiting for a sign-in that never comes. */
html.ssp-open #gate { display: none !important; }
html.ssp-open #hub  { display: block !important; }
