:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:72px}
img{max-width:100%}
[hidden]{display:none!important}
/* Layout: one reading column in a night palette, gold hairlines and gold-numbered sections.
   Page 1 explains the /gstyle skill; each film genre is its own page; each style is a chapter with gold-numbered sections. */
:root {
  --bg: #0e1213; --surface: #151c1e; --raise: #1b2427; --line: #2b3436; --fg: #eee5d5; --muted: #a99b8b;
  --gold: #d1ab62; --gold-soft: rgba(209, 171, 98, .14); --garnet: #d0575a; --garnet-soft: rgba(208, 87, 90, .14);
  --frame: #080a0b; --tile: #1b2326; --focus: #e2c27e;
  --display: "Trirong", "Angsana New", Georgia, serif;
  --caps: "Cormorant SC", "Trirong", Georgia, serif;
  --body: "IBM Plex Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3ece0; --surface: #fbf7f0; --raise: #efe6d6; --line: #d8cab3; --fg: #1d1f1d; --muted: #6a5c4b;
    --gold: #8a6326; --gold-soft: rgba(138, 99, 38, .12); --garnet: #8e1f2c; --garnet-soft: rgba(142, 31, 44, .1);
    --frame: #1d2022; --tile: #2a2f31; --focus: #8a6326; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3ece0; --surface: #fbf7f0; --raise: #efe6d6; --line: #d8cab3; --fg: #1d1f1d; --muted: #6a5c4b;
  --gold: #8a6326; --gold-soft: rgba(138, 99, 38, .12); --garnet: #8e1f2c; --garnet-soft: rgba(142, 31, 44, .1);
  --frame: #1d2022; --tile: #2a2f31; --focus: #8a6326; color-scheme: light;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font: 400 16px/1.75 var(--body); margin: 0; padding-inline: 20px; padding-block: 0 72px; }
.wrap { max-width: 1040px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; margin: 0; line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { button, a { transition: border-color .15s, background .15s, color .15s; } }
.caps { font-family: var(--caps); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: 15px; color: var(--gold); }
.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: 13px; }

/* film grain over everything, very light */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* top navigation: sticky, full width */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; margin-inline: -20px; padding-inline: 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topnav { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 14px; }
.brand { font: 600 20px var(--display); color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); }
.navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.navlinks a { color: var(--muted); text-decoration: none; padding: 4px 8px; border-bottom: 2px solid transparent; font-size: 15px; }
.navlinks a .n { font-family: var(--caps); color: var(--gold); margin-right: 4px; }
.navlinks a:hover { color: var(--fg); }
.navlinks a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--gold); }
.navlinks .sep { width: 1px; height: 18px; background: var(--line); margin-inline: 4px; }
.navlinks .label { font-family: var(--caps); letter-spacing: .16em; color: var(--muted); font-size: 13px; padding-inline: 4px; }
/* below 1080px the menu (with the long "Preview Graphic Photo" item) no longer fits beside the brand: brand and button on top, menu scrolls underneath */
@media (max-width: 1080px) {
  .topnav { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding-block: 10px 6px; }
  #addBtn { grid-column: 2; grid-row: 1; }
  .navlinks { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -10px; padding-inline: 4px; }
  .navlinks::-webkit-scrollbar { display: none; }
  .navlinks a, .navlinks .label { white-space: nowrap; flex: none; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 16px; border: 1px solid var(--line); background: transparent; color: var(--fg); font: 500 14px var(--body); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--gold); }
.btn.gold { background: var(--gold-soft); border-color: var(--gold); }
.btn.solid { background: var(--gold); border-color: var(--gold); color: #17130a; }
.btn.danger { color: var(--garnet); border-color: var(--garnet); }
.btn.small { min-height: 32px; padding: 3px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* genre page hero: a wide still with the title over it (always light text on a dark scrim) */
.ghero { position: relative; isolation: isolate; overflow: hidden; margin-top: 28px; min-height: clamp(320px, 40vw, 460px); display: grid; align-content: end; gap: 12px; padding: 40px clamp(20px, 4vw, 48px); border: 1px solid var(--line); border-bottom: 2px solid var(--gold); color: #f6efe2; background: #0b0d0e; }
/* layer order: photo (0) -> scrim (1) -> text (2); the scrim keeps text readable on any photo */
.ghero > img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center right; }
.ghero::before { content: ""; position: absolute; inset: 0; z-index: 1; background:
  linear-gradient(90deg, rgba(6, 8, 9, .9) 0%, rgba(6, 8, 9, .72) 32%, rgba(6, 8, 9, .25) 62%, rgba(6, 8, 9, 0) 85%),
  linear-gradient(to top, rgba(6, 8, 9, .82) 0%, rgba(6, 8, 9, 0) 55%); }
.ghero > :not(img) { position: relative; z-index: 2; max-width: 640px; }
.ghero .caps { color: #e6c27a; text-shadow: 0 1px 10px rgba(0, 0, 0, .85); }
.ghero h1 { font-size: clamp(48px, 8.5vw, 92px); font-weight: 600; color: #fffaf0; text-shadow: 0 2px 4px rgba(0, 0, 0, .55), 0 6px 28px rgba(0, 0, 0, .7); }
.ghero .lede { max-width: 50ch; font-size: 18px; font-weight: 500; line-height: 1.65; color: #fbf4e8; text-shadow: 0 1px 3px rgba(0, 0, 0, .8), 0 2px 18px rgba(0, 0, 0, .6); }
.ghero .meta { font-size: 14.5px; color: #eadfcd; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.ghero .meta span { padding: 3px 12px; border: 1px solid rgba(230, 194, 122, .55); border-radius: 99px; background: rgba(6, 8, 9, .45); }
.ghero .btn { color: #f1e9db; border-color: rgba(241, 233, 219, .35); }
.ghero .btn:hover { border-color: #d1ab62; }
@media (max-width: 640px) { .ghero::before { background: linear-gradient(to top, rgba(6, 8, 9, .92) 0%, rgba(6, 8, 9, .6) 55%, rgba(6, 8, 9, .2) 100%); } }
/* page change */
@media (prefers-reduced-motion: no-preference) {
  .page { animation: rise .45s ease both; }
  @keyframes rise { from { opacity: .35; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* sections */
section { display: grid; gap: 22px; padding-block: 44px; border-bottom: 1px solid var(--line); }
section > header { display: grid; gap: 6px; }
section > header h2, section > header h3.h { font-size: clamp(22px, 3vw, 28px); display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
section > header .n { font-family: var(--caps); color: var(--gold); font-size: .9em; }
section > header p { max-width: 64ch; }

/* guide */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.two > * { min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.panel h3 { font-size: 19px; }
.panel.gold { border-color: var(--gold); }
.panel ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .shots .zoom img, .ix .thumb img { transition: transform .6s ease, filter .3s ease; }
  .shots .zoom:hover img, .ix:hover .thumb img { transform: scale(1.04); }
}
ul.rules { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 70ch; }

/* index of styles in a genre */
.index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 18px; }
.ix { display: grid; gap: 8px; align-content: start; color: inherit; text-decoration: none; min-width: 0; border-top: 2px solid var(--gold); padding-top: 12px; }
.ix .thumb { aspect-ratio: 3 / 4; background: var(--tile); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.ix .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ix:hover .thumb img { filter: brightness(1.08); }
.ix .code { font-family: var(--caps); letter-spacing: .14em; color: var(--muted); font-size: 14px; }
.ix h3 { font-size: 19px; }
.strip { display: flex; height: 10px; border-radius: 2px; overflow: hidden; max-width: 520px; }
.strip i { display: block; height: 100%; flex: 1; }
.ix .strip { height: 6px; }

/* a style chapter */
.style { padding-top: 56px; }
.style-hero { display: grid; gap: 14px; padding-bottom: 32px; border-bottom: 1px solid var(--gold); }
.style-hero h2 { font-size: clamp(32px, 5.5vw, 50px); }
.style-hero .lede { max-width: 62ch; font-size: 17px; }
.style-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.back:hover { color: var(--gold); border-color: var(--gold); }

.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shots figure { margin: 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.shots .zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--line); background: var(--frame); cursor: zoom-in; overflow: hidden; }
.shots .zoom:hover { border-color: var(--gold); }
.shots img, .shots .noimg { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; }
.shots .zoom:hover img { filter: brightness(1.08); }
.shots .noimg { display: grid; place-items: center; min-width: 0; background: var(--surface); border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.shots figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.shots figcaption span:last-child { font-family: var(--caps); letter-spacing: .14em; color: var(--muted); font-size: 13px; }
.moodfull { white-space: pre-line; max-width: 70ch; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; font: 500 13px var(--body); padding: 2px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.pill.on { border-color: var(--gold); color: var(--gold); }
.pill.off { border-color: var(--garnet); color: var(--garnet); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 18px; }
@media (max-width: 520px) { .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw { display: grid; gap: 8px; align-content: start; min-width: 0; }
.sw .chip-c { height: 88px; border: 1px solid var(--line); }
.sw .name { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sw .name b { font: 600 17px var(--display); }
.sw .en { font-family: var(--caps); letter-spacing: .14em; font-size: 13px; color: var(--muted); }
button.hex { background: none; border: 1px solid var(--line); color: var(--fg); padding: 2px 8px; cursor: pointer; justify-self: start; font-family: var(--mono); font-size: 13px; }
button.hex:hover { border-color: var(--gold); }
.lights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.lr { display: grid; gap: 8px; align-content: start; min-width: 0; }
.lr .grad { height: 56px; border: 1px solid var(--line); }
.lr h3 { font-size: 18px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.specs div { background: var(--surface); padding: 14px 16px; display: grid; gap: 2px; }
.specs b { font: 600 19px/1.3 var(--display); }
.specs span { font-size: 13px; color: var(--muted); }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { font: 600 13px var(--body); color: var(--muted); letter-spacing: .04em; }
td b { font-weight: 600; }
td.k { width: 170px; }
.prompt { display: grid; gap: 10px; }
.prompt .bar2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prompt h3 { font-size: 19px; }
pre { margin: 0; background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; font: 400 13px/1.65 var(--mono); max-height: 460px; overflow-y: auto; }

.status { color: var(--muted); padding: 40px 0; text-align: center; }
.empty { display: grid; gap: 12px; padding-block: 44px; }
footer.page { padding-top: 28px; font-size: 13px; color: var(--muted); }

/* dialogs */
dialog { padding: 0; border: 1px solid var(--line); background: var(--bg); color: var(--fg); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
dialog::backdrop { background: rgba(5, 6, 7, .78); }
dialog#editor { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dlg { display: grid; max-height: calc(100vh - 48px); grid-template-rows: auto minmax(0, 1fr) auto; }
.dlg > header, .dlg > footer { padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.dlg > header { border-bottom: 1px solid var(--gold); }
.dlg > footer { border-top: 1px solid var(--line); background: var(--surface); }
.dlg .body { overflow: auto; padding: 24px; }
.dlg h2 { font-size: clamp(24px, 3vw, 32px); }
.xbtn { width: 38px; height: 38px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 17px; }
.xbtn:hover { border-color: var(--gold); }
.form { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form { grid-template-columns: 1fr; } }
.form .group-title { grid-column: 1 / -1; font-family: var(--caps); letter-spacing: .16em; color: var(--gold); font-size: 15px; padding-top: 10px; border-top: 1px solid var(--line); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); padding: 8px 12px; min-height: 42px; }
.field textarea { font: 13px/1.6 var(--mono); resize: vertical; }
.field textarea.th { font: 15px/1.7 var(--body); }
.field .err { color: var(--garnet); font-size: 13px; }
.field [aria-invalid="true"] { border-color: var(--garnet); }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot { display: grid; gap: 8px; align-content: start; min-width: 0; }
.slot .slabel { font-size: 14px; font-weight: 500; }
.slot img, .slot .noimg { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--frame); display: block; }
.slot .noimg { display: grid; place-items: center; padding: 8px; text-align: center; background: var(--surface); border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
.slot .row { display: flex; flex-wrap: wrap; gap: 6px; }
.formerr { color: var(--garnet); font-size: 14px; margin-top: 12px; }
.confirm { display: grid; gap: 8px; background: var(--garnet-soft); padding: 10px 12px; font-size: 14.5px; }
.confirm .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- guide page ---------- */
:root { --on-gold: #17130a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --on-gold: #fbf7f0; } }
:root[data-theme="light"] { --on-gold: #fbf7f0; }
.btn.solid { color: var(--on-gold); }
.eb { font: 600 13px var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }

/* intro: text left, a strip of four 9:16 frames right */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 56px 52px; border-bottom: 1px solid var(--gold); }
.intro .txt { display: grid; gap: 16px; min-width: 0; }
.intro h1 { font-size: clamp(42px, 6.2vw, 64px); letter-spacing: -.01em; }
.intro .lede { max-width: 50ch; font-size: 17px; }
.intro .cta { display: flex; flex-wrap: wrap; gap: 10px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 0; border-top: 1px solid var(--line); }
.facts > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 14px 12px 0 0; min-width: 0; }
.facts > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.facts dd { margin: 0; font: 600 24px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.facts dt { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; gap: 32px; padding-block: 40px; } }
@media (max-width: 480px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
}
/* the frames sit in a strip of film: dark in both themes, like a screening room */
.reel { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 26px 12px; background: #070809; border: 1px solid #1d2325; }
.reel::before, .reel::after { content: ""; position: absolute; left: 12px; right: 12px; height: 8px; background: repeating-linear-gradient(90deg, rgba(241, 233, 219, .2) 0 12px, transparent 12px 24px); }
.reel::before { top: 9px; }
.reel::after { bottom: 9px; }
.reel .frm { position: relative; aspect-ratio: 9 / 16; max-width: 100%; overflow: hidden; background: #1b2326; }
.reel .frm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel .frm span { position: absolute; left: 0; right: 0; bottom: 0; display: grid; padding: 22px 8px 7px; font: 500 11px/1.35 var(--mono); color: #b9ad9b; background: linear-gradient(to top, rgba(6, 8, 9, .88), rgba(6, 8, 9, 0)); }
.reel .frm b { font: 600 12px/1.3 var(--caps); letter-spacing: .16em; text-transform: uppercase; color: #e8cf98; }

/* sections: one rhythm for all of them */
.gsec { display: grid; gap: 28px; padding-block: 60px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.gsec:last-child { border-bottom: 0; }
.gsec > .sh { display: grid; gap: 8px; max-width: 64ch; }
.sh h2 { font-size: clamp(26px, 3.4vw, 34px); }
.sh p { font-size: 15.5px; color: var(--muted); }
@media (max-width: 640px) { .gsec { gap: 22px; padding-block: 44px; } }

/* why: before and after, row by row */
table.vs { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.vs th, .vs td { width: 50%; text-align: left; vertical-align: top; }
.vs th { padding: 0 22px 10px; font: 600 14px var(--body); letter-spacing: 0; border-bottom: 1px solid var(--line); }
.vs th.was { color: var(--garnet); }
.vs th.now { color: var(--gold); border-bottom-color: var(--gold); }
.vs td { padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.vs td.was { color: var(--muted); }
.vs td.now { background: color-mix(in srgb, var(--gold) 7%, transparent); }
@media (max-width: 640px) {
  .vs thead { display: none; }
  .vs, .vs tbody, .vs tr, .vs td { display: block; width: auto; }
  .vs tr { border-top: 1px solid var(--line); }
  .vs tr:last-child { border-bottom: 1px solid var(--line); }
  .vs td { border-bottom: 0; padding: 12px 16px; }
  .vs td::before { content: attr(data-l); display: block; font: 600 12.5px var(--body); margin-bottom: 2px; }
  .vs td.was::before { color: var(--garnet); }
  .vs td.now::before { color: var(--gold); }
}

/* how: four steps in a row, joined by a line */
.parts { display: grid; gap: 44px; }
.part { display: grid; gap: 18px; }
.part-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font: 600 18px/1.4 var(--display); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.flow .btn { align-self: flex-start; }
.flow li { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.flow li:not(:last-child)::after { content: ""; position: absolute; top: 22px; left: 58px; right: -10px; height: 1px; background: linear-gradient(90deg, var(--gold), var(--line)); }
.flow .dot { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; background: var(--bg); font: 600 21px/1 var(--caps); color: var(--gold); }
.flow .sb { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.flow h3 { font-size: 19px; }
.flow p { font-size: 15px; color: var(--muted); }
.flow .grow { flex: 1; min-height: 6px; }
.chat { align-self: flex-start; max-width: 100%; display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px 12px 12px 2px; }
.chat .who { flex: none; padding: 0 7px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font: 600 11px/1.9 var(--body); }
.chat code { color: var(--fg); line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding-bottom: 28px; }
  .flow li:last-child { padding-bottom: 0; }
  .flow li:not(:last-child)::after { top: 52px; bottom: 6px; left: 22px; right: auto; width: 1px; height: auto; background: linear-gradient(var(--gold), var(--line)); }
  .flow .sb { padding-top: 8px; }
  .flow .grow { display: none; }
}

/* what gets set: two field lists */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.fp { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 18px 22px 6px; background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--gold); }
.fp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fp-h h3 { font-size: 19px; }
.fp-h span { font-size: 13px; color: var(--muted); }
.fl { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.fl > div { display: contents; }
.fl dt, .fl dd { margin: 0; padding-block: 11px; border-top: 1px solid var(--line); }
.fl dt { padding-right: 20px; font-size: 14px; color: var(--gold); }
.fl dt code { color: var(--gold); }
.fl dd { font-size: 15px; }
@media (max-width: 760px) { .fields { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
  .fl { grid-template-columns: minmax(0, 1fr); }
  .fl dt { padding-bottom: 0; }
  .fl dd { padding-top: 2px; border-top: 0; }
}

/* notes */
ul.notes { list-style: none; margin: 0; padding: 0; display: grid; max-width: 72ch; }
ul.notes li { position: relative; padding: 12px 0 12px 26px; border-top: 1px solid var(--line); }
ul.notes li:last-child { border-bottom: 1px solid var(--line); }
ul.notes li::before { content: ""; position: absolute; left: 4px; top: 23px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }

/* library: one poster per genre */
.shelf { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 18px; }
.gen { display: flex; flex-direction: column; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.gen .pv { position: relative; aspect-ratio: 3 / 4; max-width: 100%; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.gen .pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gen .pv::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(8, 10, 11, .6), rgba(8, 10, 11, 0) 38%); }
.gen .pv.none { background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--raise) 12px 24px); }
.gen .pv.none::after { display: none; }
.gen .gn { position: absolute; left: 12px; top: 8px; z-index: 1; font: 600 28px/1 var(--caps); color: #e8cf98; }
.gen .pv.none .gn { color: var(--gold); }
.gen .gi { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.gen h3 { font-size: 20px; }
.gen p { font-size: 13.5px; line-height: 1.65; color: var(--muted); }
.gen .cnt { margin-top: auto; padding-top: 4px; font-size: 13.5px; color: var(--gold); }
.gen .cnt.zero { color: var(--muted); }
.gen:hover .pv { border-color: var(--gold); }
.gen:hover h3 { color: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .gen .pv img { transition: transform .6s ease; }
  .gen:hover .pv img { transform: scale(1.04); }
}
@media (max-width: 900px) {
  .shelf { grid-template-columns: 1fr; gap: 0; }
  .gen { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; padding-block: 14px; border-top: 1px solid var(--line); }
  .gen:last-child { border-bottom: 1px solid var(--line); }
  .gen .gn { left: 8px; top: 6px; font-size: 20px; }
}

/* footer ornament */
footer.page { text-align: center; padding-top: 40px; }
footer.page::before { content: ""; display: block; width: 9px; height: 9px; margin: 0 auto 12px; background: var(--gold); transform: rotate(45deg); }

/* my previews: each viewer's own projects, private to them */
.mhero { display: grid; gap: 12px; padding-block: 48px 36px; border-bottom: 1px solid var(--gold); }
.mhero h1 { font-size: clamp(36px, 5.5vw, 54px); }
.mhero .lede { max-width: 60ch; font-size: 16.5px; color: var(--muted); }
.mhero .lock { justify-self: start; font-size: 13px; color: var(--gold); border: 1px solid var(--gold); border-radius: 99px; padding: 2px 12px; }
.proj { padding-top: 40px; }
.proj + .proj { margin-top: 16px; border-top: 2px solid var(--gold); }
.proj-head { display: grid; gap: 6px; }
.proj-head h2 { font-size: clamp(26px, 3.6vw, 36px); }
.pstyle { justify-self: start; font: 600 13px var(--caps); letter-spacing: .16em; color: var(--gold); text-decoration: none; border-bottom: 1px solid transparent; }
a.pstyle:hover { border-bottom-color: var(--gold); }
.pdate { font-size: 13px; color: var(--muted); }
.pdesc { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { margin: 0; font-size: 13px; line-height: 1.5; color: var(--gold); }
.cast { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.cast b { color: var(--fg); font-weight: 600; }

/* image viewer: always a dark screening surface */
dialog.viewer { width: min(500px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; border: 1px solid rgba(255, 255, 255, .12); background: #0b0d0e; color: #f1e9db; }
.vwrap { display: grid; gap: 12px; padding: 14px 16px 16px; }
.vtop { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; }
.vtop .vcode { color: #d1ab62; font-family: var(--caps); letter-spacing: .14em; }
.vclose { width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #f1e9db; font-size: 17px; cursor: pointer; }
.vstage { position: relative; display: grid; place-items: center; min-height: 0; }
.vstage img { max-width: 100%; max-height: min(68vh, 760px); object-fit: contain; display: block; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .5); color: #f1e9db; font-size: 24px; line-height: 1; cursor: pointer; }
.vnav.prev { left: 4px; }
.vnav.next { right: 4px; }
.vthumbs { display: flex; justify-content: center; gap: 8px; }
.vthumbs button { width: 44px; aspect-ratio: 9 / 16; padding: 0; border: 2px solid transparent; overflow: hidden; background: #000; cursor: pointer; opacity: .55; }
.vthumbs button[aria-current="true"] { border-color: #d1ab62; opacity: 1; }
.vthumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); max-width: min(560px, calc(100vw - 32px)); background: var(--fg); color: var(--bg); padding: 12px 18px; font-size: 15px; z-index: 10; }
/* standalone site additions */
body { padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.bar { margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
.copyrow { display: flex; flex-wrap: wrap; gap: 8px; }
.srcnote { font-size: 13px; color: var(--muted); max-width: 70ch; }
.kv td.k code { color: var(--gold); }
.cast-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
@media (max-width: 760px) { .cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cast-grid figure { margin: 0; display: grid; gap: 6px; align-content: start; min-width: 0; }
.cast-grid img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; border: 1px solid var(--line); }
.cast-grid figcaption { font-size: 14px; }
.cast-grid figcaption b { display: block; font: 600 16px var(--display); }
.cast-grid figcaption span { color: var(--muted); font-size: 13px; }
.mtitle { font: 600 16px/1.4 var(--display); }
.offline { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; }

/* choose-a-style mode (?pick=<id>) */
#pickbar { margin-top: 20px; }
.pickbar { display: grid; gap: 12px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--gold); border-left: 4px solid var(--gold); }
.pickbar.done { background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.pickbar.warn { border-color: var(--garnet); }
.pb-head { display: grid; gap: 2px; }
.pb-head h2 { font-size: clamp(22px, 3vw, 30px); }
.pb-recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pb-recs a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: inherit; text-decoration: none; padding: 8px 12px; border: 1px solid var(--line); background: var(--bg); }
.pb-recs a:hover { border-color: var(--gold); }
.pb-rank { font: 600 12.5px var(--body); color: var(--on-gold); background: var(--gold); padding: 1px 8px; border-radius: 99px; }
.pb-recs b { font: 600 16px var(--display); }
.pb-why { flex-basis: 100%; font-size: 14px; color: var(--muted); }
.pb-status { font-size: 15px; }
.pb-status.ok { color: var(--fg); }
.pb-status.warn { color: var(--garnet); }
.pickslot { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pickslot:empty { display: none; }
.pk-q { font-size: 14.5px; font-weight: 500; }
.btn.chosen { background: var(--gold); border-color: var(--gold); color: var(--on-gold); cursor: default; }
.recbadge { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; background: var(--gold); color: var(--on-gold); font: 600 11px/1.7 var(--body); letter-spacing: 0; text-transform: none; }
