/* Queer Corner — design draft v2. Brand idea: rainbow arcs radiating from a corner.
   No external fonts or scripts (privacy). */
:root {
  --bg: #fff8ef;
  --surface: #ffffff;
  --ink: #1d1426;
  --muted: #5f5468;
  --line: #eadfd0;
  --night: #1d1426;

  --red: #d9473f;
  --orange: #ee8a3e;
  --yellow: #f2c75c;
  --green: #2e8b62;
  --blue: #3a5bc7;
  --violet: #6e3591;
  --pink: #eeb0bd;
  --sky: #7cc6e8;
  --brown: #784f17;

  --rainbow: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--violet));
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #150f1b; --surface: #211a29; --ink: #f6eff8; --muted: #b9adc0; --line: #352c3e; }
}
:root[data-theme="dark"] { --bg: #150f1b; --surface: #211a29; --ink: #f6eff8; --muted: #b9adc0; --line: #352c3e; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); overflow-x: hidden; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .45em; }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h3 { font-size: 1.3rem; line-height: 1.2; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.rainbow-text { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; margin-bottom: 14px; }
.kicker::before { content: ""; width: 22px; height: 6px; border-radius: 3px; background: var(--rainbow); }
.draft-note { background: var(--yellow); color: #3a2c00; text-align: center; font-size: .8rem; padding: 6px 12px; font-weight: 600; }

/* Logo: five arcs from a corner */
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.logo svg { width: 34px; height: 34px; flex: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.top::after { content: ""; display: block; height: 4px; background: linear-gradient(90deg,var(--red) 0 11%,var(--orange) 0 22%,var(--yellow) 0 33%,var(--green) 0 44%,var(--blue) 0 55%,var(--violet) 0 66%,var(--sky) 0 77%,var(--pink) 0 88%,var(--brown) 0); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 68px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { text-decoration: none; font-size: .95rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; }
.nav a:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.lang { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang a { font-size: .78rem; font-weight: 700; text-decoration: none; padding: 5px 9px; border-radius: 999px; color: var(--muted); }
.lang a.on { background: var(--ink); color: var(--bg); }
.menu-btn { display: none; margin-left: auto; border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 16px; font: 700 .9rem var(--sans); }

/* Quick exit */
.exit { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 12px 18px 12px 14px; font: 700 .9rem var(--sans); box-shadow: 0 10px 30px rgba(20,0,40,.3); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.exit i { width: 22px; height: 22px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-style: normal; color: #fff; font-size: .8rem; }
.exit small { opacity: .6; font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 24px; border-radius: 999px; font-weight: 800; text-decoration: none; transition: transform .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-rainbow { color: var(--ink); border: 3px solid transparent; padding: 12px 21px; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--rainbow) border-box; }

/* HERO */
.hero { position: relative; padding: 70px 0 40px; min-height: 640px; overflow: hidden; }
.hero-arcs { position: absolute; right: -2px; top: 0; width: min(62vw, 720px); height: auto; pointer-events: none; }
.hero-arcs path { fill: none; stroke-width: 34; stroke-linecap: butt; stroke-dasharray: 1200; animation: draw 1.4s cubic-bezier(.2,.7,.2,1) backwards; }
.hero-arcs path:nth-child(2) { animation-delay: .08s; } .hero-arcs path:nth-child(3) { animation-delay: .16s; }
.hero-arcs path:nth-child(4) { animation-delay: .24s; } .hero-arcs path:nth-child(5) { animation-delay: .32s; }
.hero-arcs path:nth-child(6) { animation-delay: .40s; } .hero-arcs path:nth-child(7) { animation-delay: .48s; }
.hero-arcs path:nth-child(8) { animation-delay: .56s; } .hero-arcs path:nth-child(9) { animation-delay: .64s; }
/* Arcs are visible by default; the draw-in only plays when animations run */
@keyframes draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
.hero-inner { position: relative; max-width: 520px; }
main { overflow-x: clip; }
.hero h1 { font-size: clamp(3rem, 9vw, 7rem); margin-bottom: .3em; }
.hero h1 .line2 { display: table; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 32em; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.sticker { position: absolute; z-index: 2; background: var(--surface); border-radius: 18px; padding: 14px 16px; box-shadow: 0 18px 40px -18px rgba(40,10,60,.45); font-size: .9rem; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.sticker b { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1rem; }
.sticker.s1 { right: 9%; top: 330px; transform: rotate(-4deg); }
.sticker.s2 { right: 28%; top: 460px; transform: rotate(3deg); }

/* Marquee */
.marquee { background: var(--night); color: #fff; overflow: hidden; padding: 16px 0; transform: rotate(-1.2deg); margin: 10px -20px 40px; }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: slide 110s linear infinite; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; white-space: nowrap; }
.marquee-track span { display: inline-flex; align-items: center; gap: 40px; }
.marquee-track span::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--rainbow); }
.marquee-track small { font: 600 .75rem var(--sans); opacity: .6; letter-spacing: .1em; text-transform: uppercase; margin-left: 10px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Doors: one pride colour each */
.section { padding: 60px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head a { font-weight: 700; }
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.door { position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 24px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; min-height: 290px; transition: transform .2s, box-shadow .2s; color: #fff; }
.door:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 24px 40px -22px rgba(0,0,0,.45); }
.door.red { background: var(--red); }
.door.yellow { background: var(--yellow); color: #2a1d00; }
.door.green { background: var(--green); }
.door.violet { background: var(--violet); }
.door .num { font-family: var(--serif); font-size: .95rem; opacity: .8; }
.door h3 { font-size: 1.7rem; margin-top: auto; }
.door p { margin: 0; font-size: .95rem; opacity: .92; }
.door .more { margin-top: 10px; font-weight: 800; font-size: .9rem; display: inline-flex; gap: 8px; align-items: center; }
.door .more::after { content: "→"; transition: transform .2s; }
.door:hover .more::after { transform: translateX(4px); }
.door .deco { position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; border: 22px solid rgba(255,255,255,.18); }
.door.yellow .deco { border-color: rgba(0,0,0,.08); }

/* Guide cards */
.guides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.guide-card { position: relative; background: var(--surface); border-radius: var(--radius); padding: 26px 24px 22px; text-decoration: none; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; overflow: hidden; }
.guide-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--c, var(--violet)); }
.guide-card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line), 0 20px 36px -24px rgba(40,10,60,.5); }
.guide-card .tag { align-self: flex-start; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: 10px; }
.guide-card p { color: var(--muted); font-size: .94rem; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .78rem; }
.checked { color: var(--green); font-weight: 700; }
.langs { display: flex; gap: 4px; }
.langs b { font-size: .7rem; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* Big quote band */
.manifesto { background: var(--night); color: #fff; border-radius: 34px; padding: clamp(36px, 6vw, 70px); position: relative; overflow: hidden; }
.manifesto p.big { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 3.2rem); line-height: 1.12; font-weight: 700; max-width: 18em; margin: 0; position: relative; }
.manifesto .stats { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 34px; position: relative; }
.manifesto .stats div { font-size: .9rem; opacity: .8; }
.manifesto .stats strong { display: block; font-family: var(--serif); font-size: 2.4rem; opacity: 1; }
.manifesto svg { position: absolute; right: -30px; bottom: -30px; width: 340px; opacity: .95; }

/* Week + magnet */
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.week { background: var(--surface); border-radius: var(--radius); padding: 30px; box-shadow: inset 0 0 0 1px var(--line); }
.week ol { margin: 0; padding: 0; list-style: none; }
.week li { display: grid; grid-template-columns: 14px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-weight: 700; }
.week li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; margin-top: 6px; background: var(--dot); }
.week li small { display: block; color: var(--muted); font-weight: 400; }
.magnet { position: relative; background: var(--violet); color: #fff; border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
/* Progress Pride chevron */
.magnet::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 70px; background: linear-gradient(90deg, #000 0 14%, var(--brown) 0 28%, var(--sky) 0 42%, var(--pink) 0 56%, #fff 0 70%, transparent 0); clip-path: polygon(0 0, 50% 0, 100% 50%, 50% 100%, 0 100%); opacity: .95; }
.magnet > * { position: relative; margin-left: 56px; }
.magnet h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.magnet ul { margin: 0; padding-left: 1.1em; }
.magnet form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.magnet input { flex: 1 1 200px; padding: 14px 18px; border-radius: 999px; border: 0; font: inherit; }
.magnet button { padding: 14px 22px; border-radius: 999px; border: 0; background: var(--yellow); color: #2a1d00; font: 800 1rem var(--sans); cursor: pointer; }
.magnet .fine { font-size: .8rem; opacity: .8; }

/* Help */
.help { border-radius: var(--radius); padding: 30px; display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: center; background: color-mix(in srgb, var(--sky) 22%, var(--surface)); }
.help-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.help-list div { background: var(--surface); border-radius: 14px; padding: 16px; font-size: .92rem; border-left: 5px solid var(--c); }
.help-list strong { display: block; }

/* Footer */
footer { background: var(--night); color: #d8cde0; margin-top: 60px; padding: 50px 0 100px; font-size: .92rem; position: relative; }
footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rainbow); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
footer .logo { color: #fff; margin-bottom: 10px; }
footer a { color: #fff; }

/* ---------- Guide page ---------- */
.progress { position: fixed; left: 0; top: 0; height: 5px; width: 0; z-index: 60; background: var(--rainbow); }
.guide-hero { background: var(--red); color: #fff; position: relative; overflow: hidden; }
.guide-hero .wrap { position: relative; padding-top: 30px; padding-bottom: 56px; }
.guide-hero .deco { position: absolute; right: -2px; bottom: -2px; width: min(46vw, 460px); }
.crumbs { font-size: .85rem; opacity: .85; }
.crumbs a { color: #fff; }
.guide-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.4rem); max-width: 13em; margin-top: 18px; position: relative; }
.guide-hero .lead { font-size: 1.15rem; max-width: 36em; opacity: .95; position: relative; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; }
.chip { font-size: .82rem; font-weight: 700; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.18); }
.chip.ok { background: #fff; color: var(--green); }
.guide-grid { display: grid; grid-template-columns: 250px 1fr; gap: 54px; align-items: start; padding-top: 44px; }
.toc { position: sticky; top: 92px; font-size: .92rem; }
.toc p { font-weight: 800; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--muted); text-decoration: none; font-weight: 600; }
.toc a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; transition: transform .2s; }
.toc li:nth-child(1) a.on::before { background: var(--red); } .toc li:nth-child(2) a.on::before { background: var(--orange); }
.toc li:nth-child(3) a.on::before { background: var(--yellow); } .toc li:nth-child(4) a.on::before { background: var(--green); }
.toc li:nth-child(5) a.on::before { background: var(--blue); } .toc li:nth-child(6) a.on::before { background: var(--violet); }
.toc a.on { color: var(--ink); } .toc a.on::before { transform: scale(1.4); }
.article { max-width: 720px; }
.article h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: 1.5em; scroll-margin-top: 92px; }
.notice { border-radius: 16px; padding: 18px 20px; margin: 0 0 1.4em; font-size: .96rem; display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.notice .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.notice.warn { background: color-mix(in srgb, var(--orange) 16%, var(--surface)); } .notice.warn .ico { background: var(--orange); }
.notice.info { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); } .notice.info .ico { background: var(--blue); }
.notice strong { display: block; }
.steps { list-style: none; padding: 0; margin: 1.2em 0 1.8em; }
.steps li { position: relative; padding: 4px 0 22px 64px; }
.steps li::before { content: attr(data-n); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 14px; background: var(--c); color: #fff; display: grid; place-items: center; font: 800 1.1rem var(--serif); transform: rotate(-4deg); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 21px; top: 50px; bottom: 2px; width: 3px; border-radius: 2px; background: linear-gradient(var(--c), transparent); }
.steps strong { display: block; font-size: 1.08rem; }
.org { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1em 0 1.6em; }
.org div { background: var(--surface); border-radius: 16px; padding: 18px; font-size: .94rem; box-shadow: inset 0 0 0 1px var(--line); border-top: 5px solid var(--c); }
.org strong { display: block; }
.sources { font-size: .88rem; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 16px; padding: 20px 22px; }
.sources ol { margin: .5em 0 0; padding-left: 1.2em; }
.next-guide { display: block; margin-top: 30px; background: var(--blue); color: #fff; border-radius: var(--radius); padding: 26px; text-decoration: none; }
.next-guide small { opacity: .8; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.next-guide h3 { margin: 6px 0 0; font-size: 1.5rem; }

/* ---------- Premium layer (v3): small refinements on top of v2 ---------- */
/* Soft paper grain, inline SVG noise — no external file */
body::before { content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
::selection { background: color-mix(in srgb, var(--violet) 25%, transparent); }

/* Typography: lighter weight, tighter tracking, italic accent */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.028em; }
.hero h1 { letter-spacing: -0.045em; line-height: .98; }
.hero h1 .rainbow-text { font-style: italic; padding-right: .08em; }
.kicker { font-size: .7rem; letter-spacing: .24em; font-weight: 700; color: var(--muted); }
.kicker::before { width: 30px; height: 2px; border-radius: 1px; }
.lead { letter-spacing: -0.005em; }

/* Finer pride details */
.top::after { height: 3px; }
.top .wrap { height: 72px; }
.hero-arcs path { stroke-width: 27; }
/* Logo v4: dark tile mark + serif wordmark with italic "Corner" */
.logo { gap: 11px; font-weight: 600; font-size: 1.32rem; letter-spacing: -0.035em; }
.logo svg { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 14px -8px rgba(29,20,38,.6); transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.logo:hover svg { transform: rotate(-6deg) scale(1.04); }
.logo .wm em { font-style: italic; font-weight: 500; }
footer .logo svg { box-shadow: none; }

/* Buttons with depth */
.btn { font-weight: 700; letter-spacing: -0.005em; }
.btn-dark { background: linear-gradient(180deg, #2c2036, var(--ink)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px -12px rgba(29,20,38,.7); }
.btn-dark:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 16px 30px -12px rgba(29,20,38,.75); }

/* Glass stickers */
.sticker { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 20px 40px -20px rgba(40,10,60,.4); font-weight: 600; }

/* Marquee: calmer, editorial */
.marquee { transform: rotate(-.6deg); padding: 14px 0; margin-inline: -60px; }
.marquee-track { font-weight: 500; font-style: italic; font-size: 1.35rem; gap: 0; }
.marquee-track span { padding-inline-end: 40px; } /* spacing inside each item, so the -50% loop has no jump */

/* Doors: soft sheen and hairline rings */
.door { box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.door::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(255,255,255,.16), transparent 45%, rgba(0,0,0,.08)); }
.door .deco { border-width: 1.5px; border-color: rgba(255,255,255,.35); width: 170px; height: 170px; box-shadow: 0 0 0 22px rgba(255,255,255,.06), 0 0 0 23.5px rgba(255,255,255,.22); }
.door.yellow .deco { border-color: rgba(0,0,0,.14); box-shadow: 0 0 0 22px rgba(0,0,0,.03), 0 0 0 23.5px rgba(0,0,0,.1); }
.door h3 { font-weight: 600; }
.door > :not(.deco) { position: relative; z-index: 1; }

/* Cards: hairline + layered soft shadow */
.guide-card { box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(40,10,60,.04), 0 12px 30px -22px rgba(40,10,60,.25); }
.guide-card::before { height: 4px; }
.week, .sources, .org div { box-shadow: inset 0 0 0 1px var(--line), 0 12px 30px -24px rgba(40,10,60,.25); }

/* Dark bands: subtle glow */
.manifesto { background: radial-gradient(120% 90% at 0% 0%, #2d2038 0%, var(--night) 60%); box-shadow: 0 30px 60px -40px rgba(29,20,38,.8); }
.manifesto p.big { font-weight: 500; letter-spacing: -0.03em; }
.manifesto .stats strong { font-weight: 500; }
footer { background: radial-gradient(90% 120% at 100% 0%, #2b1f35 0%, var(--night) 60%); }

@media (prefers-reduced-motion: reduce) {
  .hero-arcs path { animation: none; }
  .marquee-track { animation: none; }
  * { transition: none !important; }
}

/* Mobile */
@media (max-width: 980px) {
  .doors { grid-template-columns: repeat(2, 1fr); }
  .guides { grid-template-columns: 1fr 1fr; }
  .split, .help, .guide-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .sticker { display: none; }
  .hero { min-height: 0; padding-top: 300px; }
  .hero-arcs { width: 300px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav, .lang { display: none; }
  .menu-btn { display: block; }
  .hero { padding-top: 200px; }
  .hero-arcs { width: 200px; }
  .doors, .guides, .help-list, .org { grid-template-columns: 1fr; }
  .door { min-height: 210px; }
  .manifesto svg { width: 200px; opacity: .5; }
  .magnet::before { width: 40px; } .magnet > * { margin-left: 30px; }
  .exit small { display: none; }
  .guide-hero .deco { width: 200px; opacity: .55; }
}

/* ======================================================================
   Site layer: classes that replace the draft's inline styles (strict CSP),
   page templates, guide content blocks, mobile menu and right-to-left.
   ====================================================================== */
.bg-red { background: var(--red); } .bg-yellow { background: var(--yellow); color: #2a1d00; }
.bg-green { background: var(--green); } .bg-blue { background: var(--blue); } .bg-violet { background: var(--violet); }
.c-red { --c: var(--red); } .c-orange { --c: var(--orange); } .c-yellow { --c: #d9a520; } .c-green { --c: var(--green); }
.c-blue { --c: var(--blue); } .c-violet { --c: var(--violet); } .c-sky { --c: var(--sky); }
.dot-red { --dot: var(--red); } .dot-yellow { --dot: var(--yellow); } .dot-blue { --dot: var(--blue); }
.kicker.on-dark { color: #fff; }
.section-tight { padding-top: 16px; }
/* Hidden with clip, not a -9999px offset: in right-to-left pages an offset widens the page */
.skip { position: absolute; top: 8px; inset-inline-start: 16px; z-index: 200; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; clip-path: inset(50%); }
.skip:focus { clip-path: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.manifesto-arcs { position: absolute; right: -30px; bottom: -30px; width: 340px; opacity: .95; }
.week li a { color: inherit; text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.form-msg { border-radius: 14px; padding: 12px 16px; font-weight: 600; margin: 0; }
.form-msg.ok { background: rgba(255,255,255,.16); }
.form-msg.err { background: var(--yellow); color: #2a1d00; }
.emergency { margin: 14px 0 0; font-weight: 700; color: var(--red); }
.lang-mobile { display: none; }
.empty { font-size: 1.1rem; color: var(--muted); padding: 40px 0; }
footer p { margin: 8px 0 0; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.guide-card h3 { color: var(--ink); }

/* Simple page header (guides list, about, privacy, 404) */
.page-hero { padding: 40px 0 20px; position: relative; }
.page-hero .crumbs { color: var(--muted); opacity: 1; }
.page-hero .crumbs a { color: var(--muted); }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); margin: 14px 0 .3em; letter-spacing: -0.04em; }
.page-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.page-hero.nf { padding: 90px 0 60px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.filters a { text-decoration: none; font-weight: 700; font-size: .9rem; padding: 9px 16px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.filters a.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.filters a.f-red.on { background: var(--red); color: #fff; } .filters a.f-yellow.on { background: var(--yellow); color: #2a1d00; }
.filters a.f-green.on { background: var(--green); color: #fff; } .filters a.f-violet.on { background: var(--violet); color: #fff; }
.page-prose { max-width: 720px; font-size: 1.08rem; }

/* Guide header colours */
.guide-hero.bg-yellow .crumbs a, .guide-hero.bg-yellow { color: #2a1d00; }
.guide-hero.bg-yellow .chip { background: rgba(0,0,0,.08); }
.guide-hero .chip a { color: inherit; }
.lang-note { margin-top: 24px; }

/* Guide content blocks, written as plain HTML in the admin:
   <div class="notice warn|info"><strong>Title</strong> text</div>
   <ol class="steps"><li><strong>Step</strong> text</li></ol>
   <div class="org"><div><strong>Name</strong> text</div></div> */
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol:not(.steps) { padding-inline-start: 1.3em; }
.prose a { color: var(--blue); }
.notice { display: block; position: relative; padding: 18px 20px; padding-inline-start: 66px; }
.notice::before { content: "!"; position: absolute; inset-inline-start: 18px; top: 18px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--orange); }
.notice.info::before { content: "i"; background: var(--blue); }
.notice strong { display: block; }
.steps { counter-reset: step; }
.steps li { counter-increment: step; padding: 4px 0 22px; padding-inline-start: 64px; }
.steps li::before { content: counter(step); left: auto; inset-inline-start: 0; }
.steps li:not(:last-child)::after { left: auto; inset-inline-start: 21px; }
.steps li:nth-child(6n+1) { --c: var(--red); } .steps li:nth-child(6n+2) { --c: var(--orange); } .steps li:nth-child(6n+3) { --c: #d9a520; }
.steps li:nth-child(6n+4) { --c: var(--green); } .steps li:nth-child(6n+5) { --c: var(--blue); } .steps li:nth-child(6n+6) { --c: var(--violet); }
.org div:nth-child(4n+1) { --c: var(--green); } .org div:nth-child(4n+2) { --c: var(--violet); }
.org div:nth-child(4n+3) { --c: var(--blue); } .org div:nth-child(4n+4) { --c: var(--orange); }
.help-list div { border-left: 0; border-inline-start: 5px solid var(--c); }

/* Mobile menu */
@media (max-width: 640px) {
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 14px 16px 18px; background: var(--bg); box-shadow: 0 20px 30px -20px rgba(29,20,38,.4); }
  .nav-open .nav { display: flex; }
  .nav a { font-size: 1.05rem; padding: 12px 14px; }
  .lang-mobile { display: flex; align-self: flex-start; margin-top: 8px; }
  .top { position: sticky; }
  .top .wrap { position: relative; }
  .page-hero { padding-top: 28px; }
  .manifesto-arcs { width: 200px; opacity: .5; }
}

/* ---------- Right-to-left: Arabic and Persian ---------- */
[dir="rtl"] {
  --serif: "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", serif;
  --sans: "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
}
[dir="rtl"] body { font-size: 18px; line-height: 1.8; }
/* Arabic script joins letters: never track or italicise it */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .kicker, [dir="rtl"] .btn, [dir="rtl"] .lead,
[dir="rtl"] .manifesto p.big, [dir="rtl"] .hero h1 { letter-spacing: 0; }
[dir="rtl"] .hero h1 .rainbow-text { font-style: normal; }
[dir="rtl"] .hero h1 { line-height: 1.25; font-size: clamp(2.6rem, 7.5vw, 5.6rem); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.35; }
[dir="rtl"] .kicker { text-transform: none; font-size: .85rem; }
[dir="rtl"] .rainbow-text { background-image: linear-gradient(270deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--violet)); }
[dir="rtl"] .hero-arcs { right: auto; left: -2px; transform: scaleX(-1); }
[dir="rtl"] .sticker.s1 { right: auto; left: 9%; }
[dir="rtl"] .sticker.s2 { right: auto; left: 28%; }
[dir="rtl"] .manifesto-arcs, [dir="rtl"] .guide-hero .deco { right: auto; left: -30px; transform: scaleX(-1); }
[dir="rtl"] .guide-hero .deco { left: -2px; }
[dir="rtl"] .nav, [dir="rtl"] .menu-btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .exit { right: auto; left: 16px; }
[dir="rtl"] .magnet::before { left: auto; right: 0; transform: scaleX(-1); }
[dir="rtl"] .magnet > * { margin-left: 0; margin-right: 56px; }
[dir="rtl"] .door:hover { transform: translateY(-6px) rotate(.6deg); }
[dir="rtl"] .door .deco { right: auto; left: -40px; }
[dir="rtl"] .door .more::after { content: "←"; }
[dir="rtl"] .door:hover .more::after { transform: translateX(-4px); }
@media (max-width: 640px) {
  [dir="rtl"] .magnet > * { margin-right: 30px; }
}
/* English text inside an Arabic/Persian page (fallback guides, brand) keeps the Latin fonts */
[dir="rtl"] [dir="ltr"] { --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Georgia, serif; --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-family: var(--sans); }
[dir="rtl"] h1[dir="ltr"], [dir="rtl"] h3[dir="ltr"], [dir="rtl"] .logo { font-family: var(--serif); }

.related-guides { margin-top: 56px; }
.related-guides h2 { margin-bottom: 18px; }
.related-guides .guides { grid-template-columns: 1fr; }
@media (min-width: 900px) { .related-guides .guides { grid-template-columns: repeat(2, 1fr); } }

.split.single { grid-template-columns: 1fr; }

/* shorter steps, summary box, quick answers */
.steps ul { list-style: disc; margin: .5em 0 0; padding: 0; padding-inline-start: 1.15em; font-weight: 400; }
.steps ul li { position: static; counter-increment: none; padding: 0 0 .35em; }
.steps ul li::before, .steps ul li::after { content: none; display: none; }
.notice.summary ul { margin: .5em 0 0; padding: 0; padding-inline-start: 1.15em; }
.notice.summary li { margin: 0 0 .4em; }
.faq { margin: 1em 0 2em; }
.faq dt { font-weight: 800; margin-top: 1.1em; }
.faq dd { margin: .3em 0 0; margin-inline-start: 0; }

/* credit line in the footer */
footer .credit { width: 100%; margin: 28px 0 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); text-align: center; font-size: .85rem; color: #c9bdd3; }
footer .credit .heart { color: #ee8a8a; }
footer .credit a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- news ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-row { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.news-row:last-child { border-bottom: 1px solid var(--line); }
.news-row time { color: var(--muted); font-size: .9rem; font-weight: 700; padding-top: 2px; }
.news-row .tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: 6px; }
.news-row h3 { margin: 0 0 .3em; font-size: 1.3rem; }
.news-row h3 a { color: var(--ink); text-decoration: none; }
.news-row h3 a:hover { text-decoration: underline; text-decoration-color: var(--c); }
.news-row p { color: var(--muted); margin: 0; }
.news-article { padding-top: 44px; margin: 0 auto; }
.related-news { margin-top: 56px; }
.related-news h2 { margin-bottom: 8px; }
.more-link { display: inline-block; margin-top: 14px; font-weight: 800; color: var(--ink); }
@media (max-width: 640px) { .news-row { grid-template-columns: 1fr; gap: 6px; } }
