/* =====================================================================
   AZINE STYLESHEET -- shared by every page (auth.html, quiz.html, board.html)

   Quick guide -- where to change what:
     Page background color ........ --bg                 (in :root below)
     Header bar color ............. --card-border        (also the box borders)
     Header bottom border ......... .topbar  border-bottom
     Board box border width ....... --box-border-width   (in :root below)
     Board box inside color ....... --box-bg             (in :root below)
     Other boxes' inside color .... #fffdf8  (written directly in .prompt-wrap,
                                             .auth-wrap, etc.)
     Main text color .............. --navy
     Rounded corners (everywhere) . --radius
     Drop shadow (everywhere) ..... --shadow
     Fonts ........................ --font-main, --font-labels (in :root below)
     Board screens colors & fonts . the BOARD SCREENS settings (in :root below)

   Sections, in order:
     1. Colors & sizes (variables)
     2. Whole page + header bar
     3. Board page (board.html) -- the wall, then vibes, read, listen,
        watch (the "showcases"), sort
     4. Login / sign-up (auth.html)
     5. Intro + taste prompt (auth.html, quiz.html)
     6. Quiz page (quiz.html)
     7. Pop-up dialogs (Settings, Refine)
   ===================================================================== */


/* ---------- 1. Colors & sizes ----------
   These are variables: define a value once here, then use it anywhere as
   var(--name). Change a value here and it changes on every page that uses
   it. Colors are hex codes (#rrggbb). */

:root {
  --olive: #8A7F35;        /* text boxes, input fields, light text on navy buttons */
  --cream-deep: #e3e3b8;   /* log in / sign up tab strip, selected quiz options */
  --gray: #8f8a80;         /* quiet text: tagline, "renews in", hints */
  --gray-soft: #a09c83;   /* thin borders on buttons, inputs, and the prompt box */
  --navy: #24304a;         /* main text color and the dark buttons */
  --navy-deep: #17203350;  /* (currently unused) */
  --navy-soft: #4d5b7c;    /* dark-button hover color, secondary text */
  --up: #6f9c76;           /* green: a heart you've clicked */
  --down: #b56a5c;         /* red: a broken heart you've clicked, error messages */
  --radius: 0;             /* how rounded the corners of boxes are (0 = square corners) */
  --shadow: 0 6px 18px rgba(36, 48, 74, 0.10); /* soft shadow under boxes: x-offset y-offset blur color */

  /* category colors (not used on the current board) */
  --accent-essay: #1a659e;
  --accent-movie: #de6449;
  --accent-album: #2c5530;
  --accent-novel: #004e89;

  --bg: #FAFAFF;           /* PAGE BACKGROUND -- the color behind everything */
  --link-blue: #f8f9f0;    /* essay headlines on the board */
  --card-border: #FAFAFF; 
  --border-border: #628B48; /* header bar background AND the thin border around board cards */

  /* ----- FONTS: pick your fonts here -----
     The fonts are loaded from Google Fonts by the <link> tags at the top
     of each HTML page (auth.html, quiz.html, board.html). To switch, copy
     one of the options below and paste it as the value.

       "IBM Plex Sans", sans-serif     -- clean, modern sans
       "IBM Plex Mono", monospace      -- typewriter-style, every letter the same width
       "Google Sans", sans-serif       -- rounder, friendlier sans
       "Iowan Old Style", "Palatino Linotype", Georgia, serif   -- the original bookish serif

     Font weight (how thick) is set per element with font-weight:
       100 thin, 200 extra light, 300 light, 400 regular, 500 medium,
       600 semibold, 700 bold. (Google Sans only goes from 400 to 700.)
     Italic: font-style: italic; */
  --font-main: "Google Sans", sans-serif;    /* everything: body text, titles, buttons, text boxes */
  --font-labels: "IBM Plex Mono", monospace;   /* the small labels: "MOVIE #1", "ESSAY #1", "renews in 1d 2h", the tagline/date */

  /* ----- BOARD SCREENS: colors & fonts for the logged-in board (board.html) -----
     Change these to restyle the five board screens. The color blocks on
     the vibes screen are NOT here -- those come from today's images. */

  /* colors */
  --board-bg: var(--bg);            /* background behind every board screen */
  --board-text: var(--olive);       /* other text: buttons, "Open" links, the bookmark icon, sort cards */
  --heading-color: var(--board-text);   /* screen headings: "READ AND LISTEN", "WATCH", "SORT" */
  --title-color: var(--board-text);     /* titles of novels, essays, albums, movies */
  --synopsis-color: var(--board-text);  /* synopses and descriptions */
  --vibe-color: var(--board-text);      /* the stacked mood words (screen 2) */
  --board-muted: var(--gray);       /* quieter text: labels ("NOVEL", "ESSAY 02"), authors/years, the mood words */
  --board-line: var(--border-border); /* thin lines: box borders, the lines between movies, sort piles */
  --box-bg: transparent;            /* inside of the boxes on "Read and listen" (transparent = the background shows through) */
  --sort-card-bg: #202824;          /* inside of the cards in the sort stack (must be solid so cards don't show through each other) */
  --overlay-bg: rgba(10, 12, 11, 0.86); /* dark panel shown when hovering a poster or album cover */
  --overlay-text: #ffffff;          /* text on that panel */
  --save-color: var(--olive);       /* the bookmark icon once something is saved */
  --like-color: var(--up);          /* the "Loved it" pile (left) on the sort screen */
  --dislike-color: var(--down);     /* the "Not for me" pile (right) on the sort screen */

  /* fonts (paste any option from the FONTS list above) */
  --board-heading-font: var(--font-main);   /* screen headings: "READ AND LISTEN", "WATCH", "SORT" */
  --board-title-font: var(--font-main);     /* titles of novels, essays, albums, movies */
  --board-body-font: var(--font-main);      /* synopses and descriptions */
  --board-label-font: var(--font-labels);   /* small uppercase labels, buttons, the date */
  --vibe-font: var(--font-main);            /* the stacked mood words (screen 2) */
  --vibe-size: 12rem;                       /* the LARGEST the mood words can get. They're sized
                                               automatically to fill their column; lower this to
                                               make them smaller (1rem = 16px) */

  /* sizes */
  --heading-size: 1.4rem;   /* section headings: "READ", "LISTEN", "WATCH", "SORT" (1rem = 16px) */
  --box-border-width: 1px;  /* thickness of box borders and divider lines on the board */
  --box-gap: 16px;          /* space between items on the Saved page */
  --palette-gap: 10px;      /* space between the color blocks on the vibes screen (0 = touching) */
  --wall-gap: 10px;         /* space between the images on the opening wall (0 = touching) */

  /* ----- SHOWCASES: read, listen, watch -- the cover in the middle ----- */
  --movie-cover-size: 64%;  /* height of the cover in the middle, as a share of the screen's height */
  --novel-cover-size: 64%;
  --album-cover-size: 54%;
  --essay-card-size: 34%;   /* essays: their lines of text on a see-through card */
  --essay-card-bg: rgba(255, 255, 255, 0.45);   /* the essay card's color and see-through-ness
                                                   (last number: 0 = clear, 1 = solid) */

  /* ----- MENU: the "A" in the header and its glass dropdown (board.html) ----- */
  --a-size: 34px;                              /* height of the "A" */
  --menu-radius: 15px;                         /* corner roundness of each option */
  --menu-gap: 8px;                             /* space between the options */
  --glass-tint: rgba(255, 255, 255, 0.22);     /* the bubble's color and see-through-ness
                                                  (last number: 0 = clear, 1 = solid) */
  --glass-blur: 18px;                          /* how much the bubble blurs what's behind it */
  --glass-edge: rgba(255, 255, 255, 0.55);     /* the thin bright rim around each bubble */
  --glass-text: #1d2320;                       /* the option text (saved, refine, ...) */
  --glass-font: var(--font-main);              /* the option font */
}


/* ---------- 2. Whole page + header bar ---------- */

/* makes width/height include padding and border -- easier sizing */
* { box-sizing: border-box; }

/* the whole page: background color, default text color, and font */
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--olive);
  font-family: var(--font-main);  /* change the font in :root (--font-main), not here */
}

a { color: var(--navy); }  /* link color */

/* the header bar across the top of every page (logo on the left,
   tagline or buttons on the right) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;                          /* height (top/bottom) and side spacing */
  /*background: var(--card-border);              /* header color */
  border-bottom: none;  /* no line under the header. To bring one back: border-bottom: 2px dashed var(--border-border); */
}

.topbar h1 { margin: 0; }
.logo { display: block; height: 20px; width: auto; }  /* AZINE logo size in the header */

/* "the best of the internet" (auth.html) / the date (board.html) */
.topbar .tagline {
  font-family: var(--font-labels);
  font-size: 0.85rem;
  color: var(--gray);
  font-style: italic;
}

/* the outlined pill buttons in the header: Settings, Log out */
.icon-btn {
  background: none;
  border: 1px solid var(--border-border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--cream-deep);
  font-family: inherit;
}

/* the header's rightmost button -- filled so it reads as the main action */
.topbar .icon-btn.taste-btn { background: var(--navy); color: var(--olive); font-weight: bold; border-color: var(--navy); }
.topbar .icon-btn.taste-btn:hover { background: var(--navy-soft); }

.icon-btn:hover { background: var(--gray-soft); }

main { padding: 10px; }  /* space around the page content below the header */


/* ---------- 3. Board page (board.html) ----------
   The board opens on the wall (a fixed, full-screen layer); one scroll
   leaves it and the rest of the board scrolls like a normal page. See the
   top of board.html. Colors and fonts for all of it are the BOARD SCREENS
   settings in :root at the top of this file -- change them there, not in
   here. */

body.board-page { background: var(--board-bg); color: var(--board-text); padding-top: var(--topbar-h, 60px); }
/* while the wall is showing, the page underneath doesn't scroll */
body.board-page[data-mode="wall"] { overflow: hidden; }
a.icon-btn { display: inline-block; text-decoration: none; }

/* the header stays put while the page scrolls under it */
.board-page .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: var(--board-bg); }

/* big uppercase heading on each section ("READ", "LISTEN", "WATCH", "SORT") */
.screen-heading {
  font-family: var(--board-heading-font);
  font-weight: 400;
  font-size: var(--heading-size);   /* change the size in :root (--heading-size) */
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin: 0 0 22px;
  color: var(--heading-color);
}
.screen-heading .amp { text-transform: none; letter-spacing: 0.05em; font-style: italic; }

/* small uppercase labels: "NOVEL", "ESSAY 02", "THE VIBE · SEPT 30" */
.screen-label, .box-label {
  font-family: var(--board-label-font);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--board-muted);
}

.screen-loading { color: var(--board-muted); font-family: var(--board-label-font); font-size: 0.8rem; margin: auto; }

/* inner areas that scroll on their own (long synopses) */
.scrolls { overflow-y: auto; min-height: 0; }

/* the dots on the right edge */
.screen-dots {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}
.screen-dots button {
  width: 9px; height: 9px;
  padding: 0;
  border: 1px solid var(--board-muted);
  background: transparent;
  cursor: pointer;
}
.screen-dots button.active { background: var(--board-text); border-color: var(--board-text); }

/* ----- the wall of images (the opening screen) ----- */

.wall-screen {
  position: fixed;
  top: var(--topbar-h, 60px);
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  touch-action: none;      /* on a phone, a swipe here leaves the wall rather than scrolling */
  transition: visibility 0s linear 0s;
}
.wall {
  flex: 1;
  display: grid;
  gap: var(--wall-gap);
  min-height: 0;
}
.wall-tile { position: relative; overflow: hidden; min-height: 0; transition: transform 1.1s cubic-bezier(0.55, 0, 0.3, 1), opacity 0.8s ease; transition-delay: calc(var(--i) * 25ms); }
.wall-tile { background: var(--board-line); }   /* shows only if an image fails to load */
.wall-tile img.failed { display: none; }
/* hovering a wall image shows what it is */
.wall-tile .hover-overlay { justify-content: flex-end; padding: 14px; }
.wall-tile:hover .hover-overlay { opacity: 1; }
.overlay-title { font-family: var(--board-title-font); font-size: 0.95rem; font-weight: 500; line-height: 1.25; }
.wall-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* leaving the wall: today's picks drop down, the rest fade where they are.
   The wall layer goes once they're done. */
body[data-mode="page"] .wall-screen { visibility: hidden; pointer-events: none; transition: visibility 0s linear 1.3s; }
body[data-mode="page"] .wall-tile.picked { transform: translateY(110vh); }
body[data-mode="page"] .wall-tile.considering { opacity: 0; }

/* ----- the page: every section after the wall ----- */

/* hidden (and slightly lower) while the wall shows; it rises in once the
   wall has cleared */
.page {
  padding: 0;
  transition: opacity 0.6s ease 0.9s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.9s;
}
body[data-mode="wall"] .page { opacity: 0; transform: translateY(60px); visibility: hidden; transition: none; }

.page-section {
  padding: 28px 56px 28px 40px;   /* space around each section's content (top right bottom left) */
  display: flex;
  flex-direction: column;
  scroll-margin-top: var(--topbar-h, 60px);
}
/* vibes and sort each fill exactly one screen */
#screen-vibes, #screen-sort { height: calc(100vh - var(--topbar-h, 60px)); height: calc(100svh - var(--topbar-h, 60px)); }
#screen-sort { min-height: 520px; }

/* ----- vibes ----- */

.vibes { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; min-height: 0; }
.vibes-text { display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; overflow: hidden; }
/* the mood words, one per line (shortest on top, longest at the bottom) */
.vibe-words {
  display: flex;
  flex-direction: column;
  font-family: var(--vibe-font);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--vibe-color);
}
.vibe-words span { white-space: nowrap; width: max-content; }
/* the date, directly under the last word (the small label style) */
.vibes-date { margin-top: 16px; }
.vibes-palette { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: var(--palette-gap); min-height: 0; }
/* one color block. Its color comes from today's images, so it isn't a setting. */
.swatch { position: relative; min-height: 0; }
/* the color code + where it came from, in the block's bottom-left corner (always shown) */
.swatch-label {
  position: absolute; left: 12px; bottom: 10px;
  font-family: var(--board-label-font);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #fff;
  mix-blend-mode: difference;   /* stays readable on light and dark blocks */
}

/* ----- boxes (also used by the Saved page) ----- */

.box {
  background: var(--box-bg);
  border: var(--box-border-width) solid var(--board-line);
  border-radius: var(--radius);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.box-title {
  font-family: var(--board-title-font);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 6px 0 4px;
  color: var(--title-color);
}
.box-meta { font-size: 0.8rem; color: var(--board-muted); }
.box-blurb { font-family: var(--board-body-font); font-size: 0.86rem; line-height: 1.55; color: var(--synopsis-color); margin-top: 12px; flex: 1; }
.box-link { font-family: var(--board-label-font); font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--board-text); margin-top: 10px; }

/* the bookmark (save) button; filled in once saved */
.save-btn { background: none; border: none; padding: 2px; cursor: pointer; color: var(--board-text); flex-shrink: 0; }
.save-btn svg path { fill: transparent; transition: fill 0.2s ease; }
.save-btn.saved svg path { fill: var(--save-color); stroke: var(--save-color); }
.save-btn:hover { opacity: 0.7; }

/* dark panel that appears when you hover a cover or poster */
.hover-overlay {
  position: absolute; inset: 0;
  background: var(--overlay-bg);
  color: var(--overlay-text);
  padding: 16px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  font-size: 0.82rem; line-height: 1.5;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cover:hover .hover-overlay, .poster:hover .hover-overlay,
.cover:focus-within .hover-overlay, .poster:focus-within .hover-overlay { opacity: 1; }
.hover-overlay .box-label { color: var(--overlay-text); opacity: 0.75; }
.cover-missing { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; color: var(--board-muted); border: 1px dashed var(--board-line); }

/* ----- the showcases: read, listen, watch (after huyml.co) -----
   Each showcase pins in place (.sc-frame is sticky) while you scroll through
   it; the script moves the covers and the synopses to match.

     heading        |            | the synopses:
     details, TITLE |   covers   |   label / synopsis / -- / creator · year
     tagline        |            |   (the current one centered and solid)   */

.showcase { position: relative; scroll-margin-top: var(--topbar-h, 60px); }

.sc-frame {
  position: sticky;
  top: var(--topbar-h, 60px);
  height: calc(100vh - var(--topbar-h, 60px));
  height: calc(100svh - var(--topbar-h, 60px));
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.25fr) minmax(240px, 1fr);
  grid-template-rows: auto 1fr auto;
  column-gap: 40px;
  padding: 28px 56px 28px 40px;
  overflow: hidden;
  background: var(--board-bg);
}
.sc-head { grid-column: 1; grid-row: 1; }

/* left: the current entry's details */
.sc-details { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 20px; min-height: 0; padding-top: 12px; }
.sc-details > * { animation: details-in 0.35s ease both; }
@keyframes details-in { from { opacity: 0; transform: translateY(6px); } }
/* "Director  Federico Fellini" rows */
.sc-facts { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; row-gap: 8px; margin: 0; font-size: 0.85rem; line-height: 1.35; }
.sc-facts dt { color: var(--board-muted); }
.sc-facts dd { margin: 0; color: var(--title-color); }
/* the current entry's title, under its details */
.sc-title {
  font-family: var(--board-title-font);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.1vw, 1.9rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--title-color);
}
.sc-actions { display: flex; align-items: center; gap: 18px; }
.sc-actions { flex-shrink: 0; }
.sc-actions .box-link { margin-top: 0; white-space: nowrap; }

/* middle: the covers, gliding through on a tilted path */
.sc-media { grid-column: 2; grid-row: 1 / 4; position: relative; perspective: 1400px; min-height: 0; }
.sc-media-item {
  position: absolute; left: 50%; top: 50%;
  height: var(--media-h); aspect-ratio: var(--media-ratio); max-width: 100%;
  transform: translate(-50%, -50%);
  display: block; color: inherit; text-decoration: none;
  cursor: pointer;
  will-change: transform, opacity;
  box-shadow: 0 18px 40px rgba(20, 24, 22, 0.18);
}
.sc-media-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-media-item.no-image img { display: none; }
/* the cover's shape per category; sizes are the SHOWCASES settings in :root */
.showcase[data-category="movie"] { --media-ratio: 2 / 3; --media-h: var(--movie-cover-size); }
.showcase[data-category="novel"] { --media-ratio: 2 / 3; --media-h: var(--novel-cover-size); }
.showcase[data-category="album"] { --media-ratio: 1; --media-h: var(--album-cover-size); }
.showcase[data-category="essay"] { --media-ratio: 16 / 10; --media-h: var(--essay-card-size); }
/* an essay: its label, title, author and link, as they were, on a
   see-through card (the cards behind it show through, blurred) */
.essay-card {
  background: var(--essay-card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  box-shadow: 0 12px 30px rgba(20, 24, 22, 0.08);
  padding: 22px 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  overflow: hidden;
}
.essay-card .box-title { font-size: clamp(1.1rem, 1.7vw, 1.45rem); margin: 8px 0 2px; }
.essay-card .box-link { margin-top: 12px; }

/* what shows without an image: the title on one of today's palette colors */
.type-card {
  position: absolute; inset: 0;
  background: var(--card-color, var(--board-line));
  padding: 20px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  overflow: hidden;
}
.type-card { color: #fff; }
.type-card.light { color: #1d2320; }   /* dark text on light colors (set by the script) */
.type-card strong { font-family: var(--board-title-font); font-weight: 500; font-size: clamp(1.1rem, 2.2vw, 2rem); line-height: 1.1; }
.type-card span { font-family: var(--board-label-font); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* right: the synopses. The current one is centered and solid; the rest fade */
.sc-list {
  grid-column: 3; grid-row: 1 / 4;
  position: relative; overflow: hidden; min-height: 0;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.sc-list-inner { position: relative; list-style: none; margin: 0; padding: 0; will-change: transform; }
.sc-entry { text-align: center; padding: 30px 0; cursor: pointer; }
.sc-entry.current { cursor: default; }
.sc-synopsis { font-family: var(--board-body-font); font-size: 0.95rem; line-height: 1.6; color: var(--synopsis-color); margin: 10px auto 0; max-width: 34em; }
.sc-dash { display: block; width: 16px; margin: 14px auto; border-top: 1px solid var(--board-text); }
.sc-entry-meta { font-size: 0.85rem; color: var(--board-muted); }

/* bottom left: the small "better for your brain" */
.sc-tagline { grid-column: 1; grid-row: 3; align-self: end; }

/* ----- sort ----- */

.sort-layout { flex: 1; display: grid; grid-template-columns: 1fr minmax(260px, 340px) 1fr; gap: 32px; min-height: 0; }
/* the two piles on either side */
.sort-pile {
  border: var(--box-border-width) dashed var(--board-line);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.sort-pile.like .screen-label { color: var(--like-color); }
.sort-pile.dislike .screen-label { color: var(--dislike-color); text-align: right; }
.sort-pile.like.hot { border-color: var(--like-color); border-style: solid; }       /* a card is being dragged over it */
.sort-pile.dislike.hot { border-color: var(--dislike-color); border-style: solid; }
.pile-items { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; overflow-y: auto; }
.sort-pile.dislike .pile-items { justify-content: flex-end; }
.pile-thumb {
  width: 64px; height: 86px;
  position: relative; overflow: hidden;
  border: 1px solid var(--board-line);
  background: var(--box-bg);
  font-size: 0.6rem; padding: 4px; color: var(--board-text);
  animation: pile-in 0.4s ease;
}
.pile-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@keyframes pile-in { from { transform: scale(0.6); opacity: 0; } }

.sort-center { display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.sort-stack { position: relative; flex: 1; min-height: 0; }
/* one card in the stack; --depth is how far down the stack it is */
.sort-card {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 2 / 3;
  background: var(--sort-card-bg);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translateY(calc(min(var(--depth), 4) * -6px)) rotate(var(--tilt));   /* only the top few step up, so the stack stays in its space */
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: calc(100 - var(--depth));
}
.sort-card.dragging { transition: none; cursor: grabbing; }
.sort-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sort-card-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--sort-card-bg);
  color: var(--board-text);
}
.sort-card-text strong { color: var(--title-color); }
.sort-card:not(.has-image) .sort-card-text { top: 0; justify-content: center; }
.sort-card.to-like { transform: translateX(-70vw) rotate(-20deg) !important; opacity: 0; }
.sort-card.to-dislike { transform: translateX(70vw) rotate(20deg) !important; opacity: 0; }
/* the cards pop up one after another as the section comes into view */
#screen-sort.in-view .sort-card { animation: card-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(0.4s + (10 - var(--depth)) * 60ms); }
@keyframes card-pop { from { transform: translateY(80px) scale(0.8); opacity: 0; } }
.sort-done { position: absolute; inset: 0; margin: auto; height: fit-content; text-align: center; color: var(--board-muted); }

/* the two square outlined buttons under the stack */
.sort-actions { display: flex; gap: 10px; }
.sort-btn {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: 1px solid var(--board-text);
  color: var(--board-text);
  font-family: var(--board-label-font);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.sort-btn:hover { background: var(--board-text); color: var(--board-bg); }

/* ----- phones and narrow windows ----- */
@media (max-width: 860px) {
  .page-section { padding: 18px 36px 18px 16px; }
  #screen-vibes { height: auto; }
  .vibes { grid-template-columns: 1fr; grid-template-rows: 45vh 1fr; gap: 20px; flex: none; }
  .vibes-palette { min-height: 50vh; }

  /* the showcase stacks: heading + tagline, covers, title, then the synopses */
  .sc-frame {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto minmax(0, 36%) auto minmax(0, 1fr);
    column-gap: 12px; row-gap: 8px;
    padding: 14px 36px 14px 16px;
  }
  .sc-head { grid-column: 1; grid-row: 1; margin: 0; align-self: center; }
  .sc-tagline { grid-column: 2; grid-row: 1; align-self: center; font-size: 0.6rem; }
  .sc-media { grid-column: 1 / 3; grid-row: 2; overflow: hidden; }   /* the tilted covers stay out of the list */
  .showcase[data-category] { --media-h: 92%; }
  .showcase[data-category="essay"] { --media-h: 62%; --media-ratio: auto; }
  .essay-card { width: 86%; }
  .sc-details { grid-column: 1 / 3; grid-row: 3; padding-top: 4px; gap: 8px; flex-direction: row; align-items: center; justify-content: space-between; }
  .sc-facts { display: none; }
  .sc-title { font-size: 1.15rem; }
  .sc-list { grid-column: 1 / 3; grid-row: 4; }
  .sc-entry { padding: 14px 0; }
  .sc-synopsis { font-size: 0.88rem; }
  .sc-dash { margin: 8px auto; }

  /* the two piles side by side on top, the stack under them */
  .sort-layout { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 12px; }
  .sort-pile { padding: 10px; min-height: 76px; }
  .sort-pile.like { grid-column: 1; grid-row: 1; }
  .sort-pile.dislike { grid-column: 2; grid-row: 1; }
  .sort-center { grid-column: 1 / 3; grid-row: 2; }
  .pile-thumb { width: 36px; height: 48px; }
  .sort-card { max-width: 260px; }
}


/* ----- the "A" and its glass menu ----- */

.topbar .brand { display: flex; align-items: center; gap: 14px; }
/* the "A": a button with no button look */
.a-button { background: none; border: none; padding: 0; cursor: pointer; display: block; line-height: 0; }
.a-button:focus-visible { outline: 2px solid var(--board-line); outline-offset: 4px; border-radius: 4px; }
.logo-a { height: var(--a-size); width: auto; display: block; transition: transform 0.2s ease; }
.a-button:hover .logo-a, .a-button[aria-expanded="true"] .logo-a { transform: scale(1.08); }

/* the menu floats over the page, just under the "A" */
.glass-menu {
  position: fixed;
  top: calc(var(--topbar-h, 60px) + 6px);
  left: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--menu-gap);
}
.glass-menu[hidden] { display: none; }

/* one option: its own "glass" bubble -- see-through, blurring what's
   behind it, with a bright rim and a soft inner highlight */
.glass-item {
  display: block;
  min-width: 132px;
  padding: 11px 22px;
  border-radius: var(--menu-radius);
  background: var(--glass-tint);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),   /* highlight along the top edge */
    inset 0 -1px 2px rgba(0, 0, 0, 0.06),        /* faint shade along the bottom */
    0 8px 24px rgba(0, 0, 0, 0.16);              /* soft drop shadow */
  color: var(--glass-text);
  font-family: var(--glass-font);
  font-size: 1.05rem;
  text-align: left;
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  /* dropping in one after another when the menu opens */
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease;
}
.glass-menu.open .glass-item { opacity: 1; transform: none; }
.glass-menu.open .glass-item:nth-child(2) { transition-delay: 0.04s; }
.glass-menu.open .glass-item:nth-child(3) { transition-delay: 0.08s; }
.glass-menu.open .glass-item:nth-child(4) { transition-delay: 0.12s; }
.glass-item:hover, .glass-item:focus-visible { background: rgba(255, 255, 255, 0.36); outline: none; }


/* ---------- 3b. Saved page (saved.html) ----------
   Uses the same BOARD SCREENS colors and fonts as the board. */

body.saved-page { background: var(--board-bg); color: var(--board-text); }
.saved-main { padding: 28px 40px 60px; }
/* the saved items: as many columns as fit, each at least 220px wide */
.saved-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--box-gap); }
.saved-item { overflow: hidden; }
.saved-image { position: relative; aspect-ratio: 3 / 4; }
.saved-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.saved-text { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.saved-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.saved-actions .box-link { margin-top: 0; }
.remove-btn { background: none; border: none; padding: 0; cursor: pointer; margin-top: 0; }


/* ---------- 4. Login / sign-up (auth.html) ---------- */

/* the white box holding the Log in / Sign up forms */
.auth-wrap {
  max-width: 380px;
  margin: 8vh auto;
  background: #fffdf8;
  border: 1px solid var(--gray-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

/* the "Log in | Sign up" switcher */
.tabs { display: flex; margin-bottom: 20px; border-radius: 999px; background: var(--cream-deep); padding: 4px; }
.tabs button {
  flex: 1; border: none; background: none; padding: 8px; border-radius: 999px; cursor: pointer;
  font-family: inherit; color: var(--navy-soft);
}
.tabs button.active { background: var(--navy); color: var(--olive); }

form.stack { display: flex; flex-direction: column; gap: 12px; }
/* text fields (email, password) and dropdowns */
input, select {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gray-soft);
  background: var(--cream-deep);
  color: var(--navy);
}

/* the big dark buttons: Continue, Show me the world, Log in, Create account */
button.primary {
  background: var(--navy);
  color: var(--cream-deep);
  border: none;
  padding: 11px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
}
button.primary:hover { background: var(--navy-soft); }

/* red error text under forms */
.error-msg { color: var(--down); font-size: 0.85rem; min-height: 1.2em; }


/* ---------- 5. Intro + taste prompt (auth.html, quiz.html) ---------- */

/* the white rounded box in the middle of the page on the intro page
   and the "What kinds of movies..." question page */
.prompt-wrap {
  max-width: 620px;                    /* how wide the box can get */
  margin: 8vh auto;                    /* space above it; "auto" centers it */
  background: #fffdf8;                 /* box inside color */
  border: 1px solid var(--gray-soft);  /* box border: width, style, color */
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;                  /* space inside the box */
  display: flex;
  flex-direction: column;
  gap: 14px;                           /* space between items in the box */
}
.prompt-question { font-size: 1.05rem; line-height: 1.5; }
.prompt-lead { display: block; font-weight: bold; margin-bottom: 8px; }  /* the bold first sentence */
/* the big text box where people type their answer */
.prompt-wrap textarea {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--gray-soft);
  background: var(--cream-deep);
  color: var(--navy);
  resize: vertical;
}
/* intro page ("This is your Azine.") */
.intro-wrap p { margin: 0; line-height: 1.6; }
.intro-logo { display: block; height: 64px; /* logo size on the intro page */ width: auto; margin: 0 auto 8px; }
.intro-lead { font-size: 1.3rem; font-weight: bold; }
.intro-heading { font-size: 1.1rem; margin: 10px 0 0; }
.word-count { text-align: right; font-size: 0.8rem; color: var(--gray); margin: -6px 0 0; }
.word-count.met { color: var(--up); }
/* the small "I already have an account" link */
.prompt-alt { text-align: center; font-size: 0.82rem; color: var(--gray); margin: 0; }
.prompt-status { text-align: center; color: var(--navy-soft); font-style: italic; font-size: 0.9rem; min-height: 1.2em; margin: 0; }
button.primary:disabled { opacity: 0.6; cursor: wait; }


/* ---------- 6. Quiz page (quiz.html) ---------- */

/* the quiz form has a fixed, comfortable reading width -- on wide screens
   that leaves empty space beside it, filled with a purely decorative
   Pinterest-style masonry of NGA art (staggered vertically, via columns,
   but each column's images still line up in a single horizontal band --
   not staggered horizontally the way a bento grid would be). */
.quiz-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 16px;
}
.quiz-layout main { flex: 0 0 auto; width: 820px; max-width: 100%; padding: 0; }
.quiz-gallery {
  flex: 1 1 auto;
  column-count: 2;
  column-gap: 14px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .quiz-gallery { display: none; }
}
.gallery-item {
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fffdf8;
}
.gallery-item img { width: 100%; display: block; }
.gallery-item figcaption {
  font-size: 0.68rem;
  color: var(--gray);
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the fine-tune questions: pill "chips" and clickable option boxes */
.quiz-section { margin-bottom: 42px; }
.quiz-section h2 { text-transform: uppercase; letter-spacing: 0.1em; font-size: 1rem; color: var(--navy-soft); }
.quiz-section .hint { color: var(--gray); font-size: 0.85rem; margin-top: -6px; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.chip {
  border: 1px solid var(--gray-soft);
  background: #fffdf8;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
}
.chip.selected { background: var(--navy); color: var(--cream-deep); border-color: var(--navy); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.option-card {
  border: 1px solid var(--gray-soft);
  background: #fffdf8;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}
.option-card.selected { border-color: var(--navy); background: var(--cream-deep); }
.option-card .title { font-weight: bold; font-size: 0.95rem; }
.option-card .sub { color: var(--gray); font-size: 0.78rem; }

.quiz-submit { text-align: center; margin-top: 30px; }


/* ---------- 7. Pop-up dialogs (board.html) ---------- */

/* the Settings pop-up */
dialog#settings-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  max-width: 380px;
  width: 90%;
}
/* the "Refine" pop-up */
dialog#taste-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  max-width: 560px;
  width: 92%;
  background: #fffdf8;
}
dialog#taste-dialog h2 { margin-top: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 1rem; }
dialog#taste-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--gray-soft);
  background: var(--olive);
  color: var(--navy);
  resize: vertical;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.dialog-actions button.primary { padding: 9px 18px; }
/* the dimmed page behind an open pop-up */
dialog::backdrop { background: rgba(23, 32, 51, 0.35); }
.setting-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; gap: 12px; }
.setting-row label { font-size: 0.9rem; }
.platform-row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; font-size: 0.85rem; }
