/* Textbooks for Tomorrow — layout modeled on avbotz.com */
:root {
  --brand: #4353e6;        /* T4T royal blue (from Instagram) */
  --brand-hover: #3442c9;
  --navy: #1b2a6b;
  --ink: #111827;
  --gray: #4b5563;
  --line: #d1d5db;
  --tint: #eef1ff;         /* light lavender band, like Avbotz's sky-50 */
  --footer: #0e1530;
  --max: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: "Montserrat", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink); background: #fff; line-height: 1.65;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30; color: #fff;
  background: rgba(10, 16, 40, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
  transition: background .3s;
}
.site-header.scrolled { background: rgba(10, 16, 40, 0.85); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 65px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.3px; white-space: nowrap; }
.logo svg { width: 38px; height: 38px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a { display: block; padding: 6px 14px; border-radius: 6px; font-weight: 500; font-size: 15px; transition: background .2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, .18); }
.nav-links .cta-link { border: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.25); border-radius: 999px; padding: 4px 16px; }
.nav-toggle {
  display: none; color: #fff; background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.5);
  border-radius: 4px; padding: 6px 10px; font-size: 18px; cursor: pointer;
}
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .logo { font-size: 18px; }
  .nav-links {
    position: absolute; top: 65px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10, 16, 40, 0.96); padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .35s, padding .35s;
  }
  .nav-links.open { max-height: 480px; padding: 8px 16px 16px; }
  .nav-links a { padding: 12px; }
  .nav-links .cta-link { text-align: center; margin-top: 8px; }
}

/* ---------- Hero with crossfading photo slideshow ---------- */
.hero { position: relative; isolation: isolate; color: #fff; text-align: center; overflow: hidden; }
.slides { position: absolute; inset: 0; z-index: -2; }
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.5s ease-in-out; transform: scale(1.06);
}
.slides img.on { opacity: 1; animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1); } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom right, rgba(79, 99, 255, .6), rgba(17, 24, 80, .95));
}
.hero-inner { padding: 130px 20px 170px; max-width: 980px; margin: 0 auto; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.hero h2 { font-size: clamp(24px, 3.4vw, 38px); font-weight: 500; line-height: 1.3; margin-top: 10px; }
.hero p.sub { font-size: clamp(16px, 1.8vw, 20px); margin-top: 22px; opacity: .92; }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 38px; }
.hero.page .hero-inner { padding: 120px 20px 140px; }
.hero.page h1 { font-size: clamp(36px, 5vw, 54px); }

/* Buttons (Avbotz: rounded-md, shadow, slight scale on hover) */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 6px; font-size: 17px; font-weight: 500; text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); transition: transform .2s, box-shadow .2s, background .2s; cursor: pointer; border: 0; font-family: inherit;
}
.btn:hover { transform: scale(1.025); box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.btn-white { background: #fff; color: #000; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-hover); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-stack { display: grid; gap: 12px; margin-top: 26px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
@media (max-width: 640px) {
  .hero-btns { flex-direction: column; align-items: stretch; }
  .btn-row { flex-direction: column; }
}


/* ---------- Feature cards (photo on top) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 40px 0 70px; }
.card {
  background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.03);
  display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.14); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card .body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card h2, .card h3 { font-size: 22px; font-weight: 700; color: #1f2937; margin-bottom: 10px; }
.card p { color: var(--gray); font-size: 15px; flex: 1; }
.card .more { margin-top: 18px; font-weight: 600; font-size: 18px; color: #1f2937; }
.card .more span { display: inline-block; transition: transform .2s; }
.card:hover .more span { transform: translateX(5px); }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Generic sections ---------- */
.section { padding: 70px 0; }
.rule { border: 0; border-top: 1px solid var(--line); }
.kicker { font-size: 15px; color: var(--gray); margin-bottom: 2px; }
.h-xl { font-size: clamp(32px, 4.2vw, 44px); font-weight: 800; line-height: 1.15; color: #111827; letter-spacing: -.4px; margin-bottom: 18px; }
.h-lg { font-size: 26px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.prose p { color: #374151; font-size: 17px; }
.prose p + p { margin-top: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 28px; } .split.flip > :first-child { order: 0; } }

.media-frame { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.15); aspect-ratio: 16 / 9; background: #000; }
.media-frame img, .media-frame video { width: 100%; height: 100%; object-fit: cover; }
.media-frame.tall { aspect-ratio: 3 / 2; }

/* Crossfade carousel inside a frame (like Avbotz "What We Do") */
.fader img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
.fader img.on { opacity: 1; }
.fader .dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; z-index: 2; }
.fader .dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); cursor: pointer; }
.fader .dots button.on { background: #fff; }

/* Video with big play button (Avbotz "We are AVBotz") */
.play {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: transform .2s;
}
.play:hover { transform: scale(1.08); }
.play svg { width: 34px; height: 34px; margin-left: 5px; }
.media-frame.playing .play { display: none; }

/* ---------- Tinted band with stats (Avbotz "Team Overview") ---------- */
.band { position: relative; background: var(--tint); padding: 130px 0 80px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.stat { background: #fff; border-radius: 8px; padding: 26px 22px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.stat .ic { width: 34px; height: 34px; color: var(--brand); margin-bottom: 10px; }
.stat .num { font-size: clamp(34px, 4vw, 44px); font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .label { margin-top: 4px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }
.panel { background: #fff; border-radius: 8px; padding: 28px; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-top: 22px; }
.panel h3.h-lg { margin-bottom: 18px; }
.groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 40px; }
.group h4 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.group h4 svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.group p { color: #374151; font-size: 15px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .groups { grid-template-columns: 1fr; } }

/* ---------- Reels / outreach ---------- */
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.reel { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.reel .media-frame { border-radius: 0; box-shadow: none; }
.reel .play { width: 64px; height: 64px; }
.reel .play svg { width: 26px; height: 26px; }
.reel .body { padding: 18px 20px 22px; }
.reel .date { font-size: 13px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: 1px; }
.reel h3 { font-size: 19px; margin: 4px 0 6px; }
.reel p { font-size: 15px; color: var(--gray); }
@media (max-width: 900px) { .reels { grid-template-columns: 1fr; } }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 30px; }
.gallery figure { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { position: absolute; inset: auto 0 0 0; padding: 22px 12px 10px; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.gallery .wide { grid-column: span 2; aspect-ratio: auto; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Events list */
.events { list-style: none; margin-top: 10px; }
.events li { padding: 22px 0; border-top: 1px solid var(--line); }
.events li:last-child { border-bottom: 1px solid var(--line); }
.events h3 { font-size: 21px; font-weight: 700; }
.events p { color: #374151; }

/* ---------- Full-bleed closing section (Avbotz "Sponsors") ---------- */
.closing { position: relative; isolation: isolate; color: #fff; overflow: hidden; padding: 150px 0 90px; }
.closing::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom right, rgba(79, 99, 255, .55), rgba(17, 24, 80, .95)); }
.closing h2 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; }
.closing p { font-size: 18px; max-width: 760px; margin-top: 14px; opacity: .92; }
.closing .btn-stack { max-width: 520px; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 26px; }
.member { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08); text-align: center; }
.member .avatar { aspect-ratio: 1; display: grid; place-items: center; font-size: 52px; font-weight: 800; color: #fff; background: linear-gradient(to bottom right, #6e7cff, var(--navy)); }
.member .avatar img { width: 100%; height: 100%; object-fit: cover; }
.member .info { padding: 16px 16px 20px; }
.member h3 { font-size: 18px; }
.member .role { font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--brand); }
.member p { font-size: 14px; color: var(--gray); margin-top: 8px; }

/* ---------- Contact ---------- */
.contact-list { list-style: none; }
.contact-list li { padding: 16px 0; border-top: 1px solid var(--line); }
.contact-list strong { display: block; color: var(--navy); }
form.contact { display: grid; gap: 12px; }
form.contact input, form.contact textarea { width: 100%; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--line); font: inherit; }
form.contact textarea { min-height: 150px; resize: vertical; }
.subscribe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; max-width: 560px; }
.subscribe input { flex: 1 1 240px; padding: 12px 16px; border-radius: 6px; border: 0; font: inherit; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: rgba(255,255,255,.75); padding: 50px 0 40px; }
.site-footer .top { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .logo { color: #fff; font-size: 20px; }
.site-footer small { display: block; margin-top: 10px; font-size: 14px; }
.site-footer h4 { color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.site-footer ul { list-style: none; }
.site-footer li { margin: 6px 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.socials { display: flex; gap: 14px; margin-top: 10px; }
.socials svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .site-footer .top { grid-template-columns: 1fr 1fr; } .site-footer .top > :first-child { grid-column: 1 / -1; } }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.left { transform: translateX(-50px); }
.reveal.right { transform: translateX(50px); }
.reveal.zoom { transform: scale(.94); }
.reveal.in { opacity: 1; transform: none; }
.stagger > * { transition-delay: calc(var(--i, 0) * 110ms); }
@media (max-width: 900px) { .reveal.left, .reveal.right { transform: translateY(36px); } .reveal.in { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .slides img.on { animation: none; }
  .shelf-track, .shelf .book { animation: none !important; }
}

/* Keep long logo text from widening the page on phones */
.site-footer .top > * { min-width: 0; }
.site-footer .logo { white-space: normal; }
@media (max-width: 400px) { .site-header .logo { font-size: 16px; } .site-header .logo svg { width: 32px; height: 32px; } }

/* ---------- Moving line of books (replaces the waves) ---------- */
.shelf { position: absolute; left: 0; right: 0; height: 92px; pointer-events: none; overflow: hidden; z-index: 1; }
.shelf.bottom { bottom: 0; }
.shelf.bottom::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: #fff; }
.shelf.top { top: 0; background: #fff; }
.shelf-track {
  position: absolute; left: 0; bottom: 0; display: flex; align-items: flex-end; gap: 3px; width: max-content;
  animation: shelf-move 70s linear infinite;
}
.shelf.bottom .shelf-track { bottom: 12px; }
@keyframes shelf-move { to { transform: translateX(-50%); } }
.book {
  flex: none; border-radius: 3px 3px 1px 1px;
  background:
    linear-gradient(transparent 12%, rgba(255,255,255,.55) 12% 16%, transparent 16% 78%, rgba(255,255,255,.45) 78% 82%, transparent 82%),
    var(--c);
  box-shadow: inset -3px 0 rgba(0,0,0,.18), inset 2px 0 rgba(255,255,255,.22);
  rotate: var(--r, 0deg); transform-origin: bottom center;
  animation: book-drop .9s cubic-bezier(.3, 1.35, .5, 1) both; animation-delay: var(--d, 0s);
}
.book-stack { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 0 4px; animation: book-drop .9s cubic-bezier(.3, 1.35, .5, 1) both; animation-delay: var(--d, 0s); }
.book-stack span { display: block; height: 9px; border-radius: 2px; background: var(--c); box-shadow: inset 0 -2px rgba(0,0,0,.15); }
@keyframes book-drop { from { translate: 0 -240px; opacity: 0; } 50% { opacity: 1; } to { translate: 0 0; } }
.band { padding-top: 130px; }
.closing { padding-top: 160px; }

/* ---------- Alumni strip (same pattern as reviveinvestments.org) ---------- */
.alumni { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; background: #fff; }
.pill {
  display: inline-block; border-radius: 999px; background: var(--footer); color: #f3f5ff;
  padding: 6px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 24px;
}
.marquee { display: flex; width: max-content; align-items: center; gap: 56px; animation: marquee 32s linear infinite; }
.marquee img { height: 40px; width: auto; max-width: 140px; object-fit: contain; opacity: .8; transition: opacity .3s; }
.marquee img:hover { opacity: 1; }
@media (min-width: 768px) { .marquee img { height: 48px; } }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Six stats ---------- */
.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- What we do: four photo cards ---------- */
.cards.four { grid-template-columns: repeat(4, 1fr); padding: 26px 0 0; }
@media (max-width: 1100px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards.four { grid-template-columns: 1fr; } }

/* ---------- Organizations ---------- */
.partners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.partner { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; background: #fff; transition: border-color .2s, transform .2s; }
.partner:hover { border-color: var(--brand); transform: translateY(-2px); }
.partner h4 { font-size: 17px; font-weight: 700; color: var(--navy); }
.partner p { font-size: 14px; color: var(--gray); margin-top: 2px; display: flex; gap: 6px; align-items: flex-start; }
.partner p svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--brand); }
@media (max-width: 900px) { .partners { grid-template-columns: 1fr; } }

/* Static (non-slideshow) hero photo */
.slides img.static { opacity: 1; transform: none; }

/* Book line only at the top of each page: sections below no longer need room for it */
.band { padding-top: 80px; }
.closing { padding-top: 90px; background: var(--navy); }
.hero { background: var(--navy); }
/* Icon cards (no photo) */
.card .card-ic { width: 40px; height: 40px; color: var(--brand); margin: 26px 24px 0; }
.card .card-ic + .body { padding-top: 12px; }

/* Sub-headings between photo galleries */
.sub-title { margin-top: 56px; }
.sub-title + .gallery { margin-top: 18px; }

/* Small food pop-up beside the Richwoods drive photos */
.media-wrap { position: relative; margin-bottom: 40px; }
.food-pop { position: absolute; right: -14px; bottom: -40px; width: 240px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 12px 34px rgba(0,0,0,.3); z-index: 3; }
.food-fader { position: relative; height: 135px; overflow: hidden; }
.food-fader .dots { bottom: 6px; }
.food-pop .cap { padding: 10px 14px 12px; font-size: 13px; line-height: 1.4; color: var(--gray); }
.food-pop .cap strong { display: block; color: var(--navy); font-size: 14px; }
@media (max-width: 900px) { .food-pop { position: relative; right: auto; bottom: auto; width: 100%; margin-top: 14px; } .media-wrap { margin-bottom: 0; } }
