/* =====================================================================
   Fellows' pages: shared look (hand-written; the builder never touches it)
   Matches story.html: cream page, system font, the story's theme colour.
   --theme / --theme-ink / --theme-text are set per page by the builder.
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f3efe4;
  color: #2b2b2b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
html.fw-noscroll, html.fw-noscroll body { overflow: hidden; }

/* ---- top buttons ---------------------------------------------------- */
.fw-top {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.fw-pill {
  display: inline-block;
  background: var(--theme); color: var(--theme-ink);
  text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 999px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}
.fw-pill-quiet { background: #fffdf7; color: #2b2b2b; }
.fw-pill:hover { filter: brightness(0.94); }

/* ---- header ---------------------------------------------------------- */
.fw-head { background: #fffdf7; }
/* the theme's repeating banner, same as story.html */
.fw-banner {
  height: 190px;
  background-repeat: repeat-x; background-position: center;
  background-size: 380px 190px;
}
.fw-banner-plain { height: 66px; background: color-mix(in srgb, var(--theme) 14%, #fffdf7); }
.fw-head-in { max-width: 820px; margin: 0 auto; padding: 26px 24px 30px; }
.fw-kicker {
  margin: 0 0 6px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--theme-text);
}
.fw-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 40px); line-height: 1.15; color: #1c1c1c;
  text-wrap: balance;
}
.fw-by { margin: 0 0 12px; font-size: 16px; color: #5d574c; }
.fw-by strong { color: #1c1c1c; }
.fw-lede { margin: 0; font-size: 19px; line-height: 1.5; color: #3a372f; max-width: 40em; }

/* ---- the dark band the film / book sits on ---------------------------- */
.fw-band { background: #1f241c; padding: 30px 16px 24px; overflow-x: clip; }
.fw-under { max-width: 1000px; margin: 12px auto 0; text-align: center; color: #b9b3a2; font-size: 14px; }
.fw-under a { color: #f1e6c8; }

/* film */
.fw-film { max-width: 1000px; margin: 0 auto; }
.fw-film-frame {
  position: relative; aspect-ratio: 16 / 9;
  background: #000; border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.fw-film-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- book reader (see reader.js) -------------------------------------- */
.fw-reader { --maxh: min(76vh, 780px); max-width: 1240px; margin: 0 auto; }
.fw-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
  touch-action: pan-y pinch-zoom;          /* sideways swipes turn pages; up/down still scrolls */
  user-select: none; -webkit-user-select: none;
}
.fw-holder { display: flex; justify-content: center; width: 100%; }

/* the open book: two page slots either side of the spine, plus the leaf that turns */
.fw-book, .fw-single {
  position: relative;
  width: min(100%, calc(var(--maxh) * var(--r)));
  aspect-ratio: var(--r);
  cursor: pointer;
}
.fw-wrap { position: absolute; inset: 0; perspective: 3000px; transform-style: preserve-3d; }
.fw-side { position: absolute; top: 0; width: 50%; height: 100%; overflow: hidden; background: #fff; }
.fw-l { left: 0; border-radius: 3px 0 0 3px; box-shadow: -8px 14px 40px rgba(0, 0, 0, 0.5); }
.fw-r { left: 50%; border-radius: 0 3px 3px 0; box-shadow: 8px 14px 40px rgba(0, 0, 0, 0.5); }
.fw-side.empty { background: transparent; box-shadow: none; }
/* the turning page: thin strips, each hinged to the one before, so it can bend */
.fw-leaf {
  position: absolute; top: 0; left: 50%; z-index: 3;
  width: 50%; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
  pointer-events: none;
}
.fw-leaf-single { left: 0; width: 100%; }
.fw-leaf[hidden] { display: none; }
.fw-slice {
  position: absolute; top: 0; left: 0; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
}
.fw-sf, .fw-sb {
  position: absolute; top: 0; left: 0; height: 100%;
  width: calc(100% + 1px);            /* a hair of overlap hides seams between strips */
  overflow: hidden; background: #fff;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.fw-sb { transform: rotateY(180deg); }
.fw-strip { position: absolute; top: 0; height: 100%; }
.fw-shade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.fw-spine-l::after, .fw-spine-r::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fw-spine-l::after { background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0) 90%); }
.fw-spine-r::after { background: linear-gradient(to left, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0) 90%); }

/* a page picture; a two-page spread image is cut to its left or right half */
.fw-pic { position: absolute; inset: 0; }
.fw-pic img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; max-width: none; object-fit: contain;
  -webkit-user-drag: none;
}
.fw-pic img.h-left, .fw-pic img.h-right { width: 200%; object-fit: fill; }
.fw-pic img.h-right { left: -100%; }

/* soft shadow down the spine, so the pages look bound */
.fw-l::after, .fw-r::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.fw-l::after { background: linear-gradient(to left, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.06) 3%, rgba(0, 0, 0, 0) 9%); }
.fw-r::after { background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.06) 3%, rgba(0, 0, 0, 0) 9%); }
.fw-side.empty::after { display: none; }

/* phones held upright: one page; the turning page swings over to the left */
.fw-single { perspective: 1800px; transform-style: preserve-3d; }
.fw-single .fw-side {
  left: 0; width: 100%; border-radius: 3px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.fw-leaf-single .fw-spine-l::after, .fw-leaf-single .fw-spine-r::after { display: none; }

.fw-nav {
  position: absolute; top: 50%; z-index: 2;
  transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 253, 247, 0.94); color: #1f241c;
  font-size: 30px; line-height: 1; padding: 0 0 4px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.fw-prev { left: 6px; }
.fw-next { right: 6px; }
.fw-nav:hover { background: #fff; }
.fw-nav:disabled { opacity: 0; pointer-events: none; }
.fw-nav:focus-visible, .fw-tool:focus-visible { outline: 3px solid #DC9D21; outline-offset: 2px; }

.fw-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; color: #d8d1bf; font-size: 14px;
}
.fw-count { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: center; }
.fw-progress { flex: 0 1 260px; height: 4px; background: rgba(255, 255, 255, 0.16); border-radius: 4px; overflow: hidden; }
.fw-progress i { display: block; height: 100%; width: 0; background: #DC9D21; transition: width 0.25s; }
.fw-tool {
  background: transparent; color: #f1e6c8;
  border: 1.5px solid rgba(241, 230, 200, 0.5); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.fw-tool:hover { background: rgba(241, 230, 200, 0.12); }
.fw-hint { margin: 10px 0 0; text-align: center; font-size: 13px; color: #9f9988; }

/* Spread books on upright phones: the open book is full width, so the arrows sit below it */
.fw-reader.fw-upright-book .fw-stage { padding-bottom: 62px; }
.fw-reader.fw-upright-book .fw-nav { top: auto; bottom: 4px; transform: none; }
.fw-reader.fw-upright-book .fw-prev { left: calc(50% - 56px); }
.fw-reader.fw-upright-book .fw-next { right: calc(50% - 56px); }
.fw-reader.fw-upright-book .fw-nav:disabled { opacity: 0.25; }

/* "Turn your phone sideways" tip (reader.js): a small floating bar at the bottom of the
   screen, shown after the first page turn of a spread book on an upright phone */
.fw-rotate {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 1000;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 32px);
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: #fffdf7; color: #2b2a26; font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  animation: fw-rise 0.35s ease;
}
.fw-rotate-phone {
  flex: none; width: 13px; height: 21px; border-radius: 3px;
  border: 2px solid var(--theme-text);
  animation: fw-tilt 2.4s ease-in-out infinite;
}
.fw-rotate-ok {
  flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: #ece6d8; color: #2b2a26; font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.fw-rotate-ok:focus-visible { outline: 3px solid #DC9D21; outline-offset: 2px; }
@keyframes fw-rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fw-tilt { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) {
  .fw-rotate { animation: none; }
  .fw-rotate-phone { animation: none; transform: rotate(-90deg); }
}

/* full screen (real full screen where the browser allows it; otherwise this fills the window) */
.fw-reader.is-full {
  position: fixed; inset: 0; z-index: 1000;
  max-width: none; margin: 0; padding: 12px 10px;
  background: #14170f;
  display: flex; flex-direction: column; justify-content: center;
  --maxh: calc(100vh - 100px);
}
@supports (height: 100dvh) { .fw-reader.is-full { --maxh: calc(100dvh - 100px); } }
.fw-reader.is-full .fw-hint { display: none; }

/* ---- text below ---------------------------------------------------- */
.fw-body { max-width: 820px; margin: 0 auto; padding: 34px 24px 40px; }
.fw-body h2 {
  margin: 30px 0 10px;
  font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--theme-text);
}
.fw-body h2:first-child { margin-top: 0; }
.fw-prose p { margin: 0 0 14px; font-size: 17px; }
/* Formatted write-ups (tools\writeups\*.md, 5 Dec 2026) */
.fw-prose { max-width: 40em; }
.fw-prose p.fw-lead { font-size: 19.5px; line-height: 1.55; color: #1f1d18; margin-bottom: 18px; }
.fw-prose strong { color: #1c1c1c; font-weight: 650; }
.fw-prose h3 {
  margin: 30px 0 8px;
  font-size: 21px; line-height: 1.3; color: #1c1c1c;
}
.fw-prose h3:first-child { margin-top: 0; }
.fw-prose h3::after {          /* a short theme-coloured stroke under each subheading */
  content: ""; display: block; width: 34px; height: 3px; margin-top: 7px;
  border-radius: 2px; background: var(--theme);
}
.fw-prose .fw-callout {
  margin: 24px 0; padding: 16px 20px;
  border-left: 4px solid var(--theme); border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--theme) 9%, #fffdf7);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px; line-height: 1.45; color: var(--theme-text);
}
.fw-list { list-style: none; margin: 6px 0 22px; padding: 0; }
.fw-list li { position: relative; margin: 0 0 12px; padding-left: 28px; font-size: 17px; }
.fw-list li::before {          /* a small leaf in the theme colour */
  content: ""; position: absolute; left: 4px; top: 0.5em;
  width: 11px; height: 11px; background: var(--theme);
  border-radius: 0 70% 0 70%;
}
.fw-prose .fw-lines {
  margin: 26px 0; padding: 6px 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: 20px; line-height: 1.5; color: var(--theme-text);
}
.fw-lines span { display: block; margin: 4px 0; }
.fw-credits { margin: 0; font-size: 16px; }

.fw-card {
  background: #fffdf7; border: 1px solid #e6dfcf; border-radius: 14px;
  padding: 20px 22px; margin: 22px 0;
}
.fw-body > .fw-card:first-child { margin-top: 0; }
.fw-card h3 { margin: 0 0 4px; font-size: 19px; color: #1c1c1c; }
.fw-card p { margin: 0 0 14px; color: #5d574c; }
.fw-btn {
  display: inline-block;
  background: var(--theme); color: var(--theme-ink);
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 999px;
}
.fw-btn:hover { filter: brightness(0.94); }
.fw-btn-gold { background: #DC9D21; color: #243915; }
.fw-end { margin: 30px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.fw-link { color: var(--theme-text); font-weight: 600; }

/* ---- share (see page.js) ---------------------------------------------- */
.fw-actions { margin: 18px 0 0; }
.fw-share {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--theme); color: var(--theme-ink);
  border: 0; border-radius: 999px; padding: 10px 18px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.fw-share:hover { filter: brightness(0.94); }
.fw-share-quiet { background: transparent; color: var(--theme-text); border: 1.5px solid currentColor; padding: 9.5px 18px; }
.fw-share:focus-visible { outline: 3px solid #DC9D21; outline-offset: 2px; }
.fw-share-menu {
  position: absolute; z-index: 2000; min-width: 220px;
  background: #fffdf7; border: 1px solid #e6dfcf; border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
  padding: 6px; display: flex; flex-direction: column;
}
.fw-share-menu button, .fw-share-menu a {
  display: block; text-align: left; width: 100%;
  background: none; border: 0; border-radius: 8px;
  padding: 10px 12px; font: inherit; font-size: 15px; color: #2b2b2b;
  text-decoration: none; cursor: pointer;
}
.fw-share-menu button:hover, .fw-share-menu a:hover,
.fw-share-menu button:focus-visible, .fw-share-menu a:focus-visible { background: #f1ebdd; outline: none; }
.fw-sm-url {
  margin: 4px 6px 4px; padding: 8px 6px 2px; border-top: 1px solid #ece5d5;
  font-size: 12px; color: #8a8172; word-break: break-all; user-select: all;
}

/* ---- next fellow's story ------------------------------------------------ */
.fw-next-story {
  display: flex; align-items: center; gap: 18px;
  margin: 28px 0 0; padding: 14px;
  background: #fffdf7; border: 1px solid #e6dfcf; border-radius: 14px;
  text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fw-body > .fw-next-story:first-child { margin-top: 0; }
.fw-next-story:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); }
.fw-next-story img { width: 200px; height: auto; flex: none; border-radius: 8px; }
.fw-next-text { display: flex; flex-direction: column; gap: 2px; }
.fw-next-label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--theme-text); }
.fw-next-text strong { font-size: 19px; line-height: 1.25; color: #1c1c1c; }
.fw-next-text span:last-child { color: #5d574c; font-size: 15px; }
@media (max-width: 560px) {
  .fw-next-story { flex-direction: column; align-items: stretch; gap: 12px; }
  .fw-next-story img { width: 100%; }
}

.fw-foot { text-align: center; color: #8a8172; font-size: 13px; padding: 0 16px 34px; }
.fw-foot a { color: inherit; }

/* ---- the grid page (fellows/index.html) ------------------------------ */
.fw-grid-wrap { max-width: 1120px; margin: 0 auto; padding: 32px 20px 40px; }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 24px; }
.fw-tile {
  display: flex; flex-direction: column;
  background: #fffdf7; border-radius: 14px; overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fw-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.14); }
.fw-tile img { width: 100%; height: auto; aspect-ratio: 1.62; object-fit: cover; }
.fw-tile-noimg { display: block; aspect-ratio: 1.62; background: color-mix(in srgb, var(--theme) 25%, #fffdf7); }
.fw-tile-text { display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 4px; flex: 1; }
.fw-tile-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid #ece5d5; margin-top: auto;
}
.fw-tile-cta { font-weight: 700; font-size: 15px; color: #1c1c1c; }
.fw-tile:hover .fw-tile-cta { text-decoration: underline; }
.fw-chip {
  align-self: flex-start;
  background: var(--theme); color: var(--theme-ink);
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.fw-tile-title { font-size: 19px; line-height: 1.25; color: #1c1c1c; margin-top: 6px; }
.fw-tile-by { color: #5d574c; font-size: 15px; }
.fw-tile-one { color: #3a372f; font-size: 15px; margin-top: 4px; }
.fw-more { text-align: center; color: #8a8172; margin: 34px 0 0; }

/* "Coming soon" note under the grid, while the stories are released a few at a time (3 Dec 2026) */
.fw-coming {
  margin: 32px auto 0; max-width: 640px; text-align: center;
  padding: 28px 24px 30px; border: 2px dashed #cfc6b2; border-radius: 14px;
  background: rgba(255, 253, 247, 0.6); color: #5d564a;
}
.fw-coming-kicker {
  margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--theme-text);
}
.fw-coming h2 { margin: 0 0 8px; font-size: 22px; color: #2b2a26; }
.fw-coming p { margin: 0; line-height: 1.55; }

/* Shown only on "Ready" pages built for previewing; Live pages never have it. */
.fw-preview-note {
  position: sticky; top: 0; z-index: 50; margin: 0; padding: 8px 16px;
  background: #fff3c4; color: #5a4300; font-size: 14px; text-align: center;
  border-bottom: 1px solid #e6d58f;
}

/* ---- phones ---------------------------------------------------------- */
@media (max-width: 560px) {
  .fw-top { top: 12px; left: 12px; right: 12px; }
  .fw-pill { font-size: 12px; padding: 8px 13px; }
  .fw-banner { height: 130px; background-size: 260px 130px; }
  .fw-banner-plain { height: 60px; }
  .fw-head-in { padding: 22px 20px 26px; }
  .fw-lede { font-size: 17.5px; }
  .fw-band { padding: 22px 10px 20px; }
  .fw-nav { width: 40px; height: 40px; font-size: 26px; }
  .fw-prev { left: 2px; }
  .fw-next { right: 2px; }
  .fw-body { padding: 28px 20px 36px; }
  .fw-prose p.fw-lead { font-size: 18.5px; }
  .fw-prose h3 { font-size: 19.5px; }
  .fw-prose .fw-callout { font-size: 19px; padding: 14px 16px; }
  .fw-prose .fw-lines {          /* centred lines wrap awkwardly on phones: left-align them */
    font-size: 18px; text-align: left;
    padding: 2px 0 2px 16px; border-left: 2px solid var(--theme);
  }
  .fw-prose .fw-lines span { margin: 0 0 8px; }
  .fw-prose .fw-lines span:last-child { margin-bottom: 0; }
  .fw-card { padding: 18px; }
}
