@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni.woff2) format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Bodoni Moda"; src: url(fonts/bodoni-italic.woff2) format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Reem Kufi"; src: url(fonts/reemkufi-ar.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Reem Kufi"; src: url(fonts/reemkufi-lat.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Vazirmatn"; src: url(fonts/vazir-ar.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Vazirmatn"; src: url(fonts/vazir-lat.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --night: #050a1a;      /* the mansion after lights-out */
  --deep: #0a1533;
  --royal: #1a3683;      /* EM brand blue */
  --royal-hi: #3557b8;
  --moon: #efe9da;       /* ivory moonlight */
  --haze: #8d98ba;
  --lamp: #ffd9a0;       /* torch warmth */
  --blood: #c4122f;      /* mafia side only */
  --brass: #c7a463;      /* independent side only */

  --x: 50vw; --y: 40vh; --torch: 0;
  --r: clamp(150px, 22vmax, 300px);

  --f-latin: "Bodoni Moda", "Didot", serif;
  --f-display: "Reem Kufi", "Vazirmatn", sans-serif;
  --f-body: "Vazirmatn", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--night); color: var(--moon);
  font-family: var(--f-body); font-size: 1rem; line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 4px; border-radius: 4px; }
.is-intro { overflow: hidden; }

/* ---------- atmosphere ---------- */
.atmos, .secret, .torch, .grain { position: fixed; inset: 0; pointer-events: none; }
.atmos { z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 115%, rgba(26,54,131,.55), transparent 60%),
    radial-gradient(90% 60% at 50% -10%, rgba(10,21,51,.9), transparent 70%);
}
.fog { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; filter: blur(60px); opacity: .5; }
.fog-a { background: radial-gradient(closest-side, rgba(53,87,184,.35), transparent); left: -30vmax; top: 10vh; animation: drift-a 38s ease-in-out infinite alternate; }
.fog-b { background: radial-gradient(closest-side, rgba(26,54,131,.4), transparent); right: -35vmax; top: -20vh; animation: drift-b 46s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(25vw, -8vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-20vw, 18vh) scale(.9); } }

/* wallpaper + whispers, visible only inside the torch beam */
.secret { z-index: 1;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
          mask-image: radial-gradient(circle var(--r) at var(--x) var(--y), #000 0%, rgba(0,0,0,.55) 45%, transparent 100%);
  opacity: var(--torch); transition: opacity .8s ease;
}
.damask { position: absolute; inset: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23efe9da' stroke-opacity='.22' stroke-width='.8'%3E%3Cpath d='M48 0 96 48 48 96 0 48Z'/%3E%3Cpath d='M48 18c8 10 8 20 0 30-8-10-8-20 0-30Zm0 60c8-10 8-20 0-30-8 10-8 20 0 30ZM18 48c10-8 20-8 30 0-10 8-20 8-30 0Zm60 0c-10-8-20-8-30 0 10 8 20 8 30 0Z'/%3E%3Ccircle cx='48' cy='48' r='3'/%3E%3Ccircle cx='0' cy='0' r='6'/%3E%3Ccircle cx='96' cy='0' r='6'/%3E%3Ccircle cx='0' cy='96' r='6'/%3E%3Ccircle cx='96' cy='96' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
}
.whisper { position: absolute; top: var(--t); left: var(--l); transform: rotate(var(--r));
  font-family: var(--f-display); font-size: clamp(1rem, 2.2vw, 1.6rem); color: var(--lamp);
  opacity: .75; white-space: nowrap; letter-spacing: 0; text-shadow: 0 0 18px rgba(255,217,160,.35);
}
.torch { z-index: 6; opacity: var(--torch); transition: opacity .8s ease; mix-blend-mode: screen;
  background: radial-gradient(circle calc(var(--r) * .9) at var(--x) var(--y), rgba(255,217,160,.2), rgba(255,217,160,.06) 50%, transparent 100%);
}
.shade { position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: var(--torch); transition: opacity .8s ease;
  background: radial-gradient(circle calc(var(--r) * 2.6) at var(--x) var(--y), transparent 30%, rgba(2,5,14,.5) 100%);
}
.grain { z-index: 7; opacity: .09; mix-blend-mode: overlay;
  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");
}

/* ---------- intro ---------- */
.intro { position: fixed; inset: 0; z-index: 50; background: #02040b;
  display: grid; place-items: center; transition: opacity 1.2s ease, visibility 1.2s;
}
.intro-line { grid-area: 1 / 1; margin: 0; font-family: var(--f-display); font-size: clamp(1.6rem, 5vw, 3rem);
  color: var(--moon); opacity: 0; filter: blur(8px); transform: translateY(6px);
  transition: opacity 1s ease, filter 1s ease, transform 1s ease;
}
.intro-line.on { opacity: 1; filter: blur(0); transform: none; }
.intro-skip { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  font: inherit; font-size: .85rem; color: var(--haze); background: none; border: 0; cursor: pointer; padding: 8px 16px;
}
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- header ---------- */
.bar { position: absolute; z-index: 10; top: 0; inset-inline: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 0;
}
.mini-mono { font-family: var(--f-latin); font-weight: 700; font-size: 1.6rem; line-height: 1; display: inline-flex; }
.mini-mono span + span { margin-left: -.32em; }
.bar-mark { text-decoration: none; color: var(--moon); }
.bar-ig { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--haze);
  font-size: .9rem; padding: 6px 2px; transition: color .2s;
}
.bar-ig:hover { color: var(--moon); }
.bar-ig svg, .cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.bar-ig svg .dot, .cta svg .dot { fill: currentColor; stroke: none; }

/* ---------- hero ---------- */
main { position: relative; z-index: 5; }
.hero { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 96px 16px 72px; position: relative;
}
.lockup { display: flex; flex-direction: column; align-items: center; }
.mono { font-family: var(--f-latin); font-weight: 700; font-variation-settings: "opsz" 96;
  font-size: clamp(8.5rem, 34vw, 22rem); line-height: .8; display: flex; letter-spacing: 0;
  --mx: 50%; --my: 30%;
  background:
    radial-gradient(circle 9rem at var(--mx) var(--my), #fff3d6, rgba(255,243,214,0) 100%),
    linear-gradient(180deg, #f6f1e4 0%, #d9d6d0 40%, #8f9cc4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 40px rgba(53,87,184,.55)) drop-shadow(0 18px 30px rgba(0,0,0,.6));
}
.mono-m { margin-left: -.3em; }
.mono-sub { margin: .9rem 0 0; font-family: var(--f-latin); font-size: clamp(.7rem, 1.4vw, .85rem);
  letter-spacing: .6em; text-transform: uppercase; color: var(--haze); padding-left: .6em;
}
.title { margin: clamp(1.5rem, 4vh, 2.5rem) 0 0; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5.6rem); line-height: 1.15; color: var(--moon);
  text-shadow: 0 0 30px rgba(26,54,131,.9);
}
.lede { margin: 1rem auto 0; max-width: 34em; color: #c5cbe0; font-size: clamp(1rem, 2.1vw, 1.15rem); font-weight: 300; }
.hint { margin: 1.6rem 0 0; font-size: .85rem; color: var(--lamp); opacity: 0; transition: opacity 1s ease 1.4s; }
.lit .hint { opacity: .8; }
.hint.done { opacity: 0 !important; transition-delay: 0s; }
.scroll-cue { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; width: 26px; height: 42px;
  border: 1px solid rgba(239,233,218,.35); border-radius: 14px;
}
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 2px; height: 8px; margin-left: -1px; border-radius: 2px;
  background: var(--moon); animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(14px); } }

/* lamp ignition: the one orchestrated moment */
.lit .mono { animation: ignite 1.6s steps(1, end) both; }
.lit .mono-sub, .lit .title, .lit .lede { animation: rise 1.2s cubic-bezier(.2,.7,.2,1) both; }
.lit .mono-sub { animation-delay: .9s; }
.lit .title { animation-delay: 1.05s; }
.lit .lede { animation-delay: 1.25s; }
@keyframes ignite {
  0% { opacity: 0; } 10% { opacity: .9; } 14% { opacity: .1; } 22% { opacity: 1; } 26% { opacity: .3; }
  34% { opacity: 1; } 60% { opacity: .85; } 62% { opacity: 1; } 100% { opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.is-intro .mono, .is-intro .mono-sub, .is-intro .title, .is-intro .lede { opacity: 0; }

/* ---------- role card ---------- */
.draw { min-height: 100svh; padding: 96px 16px 64px; display: grid; justify-items: center; align-content: center; gap: 40px; text-align: center; }
.draw-copy h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.3; }
.draw-copy p { margin: .6rem auto 0; max-width: 30em; color: #c5cbe0; font-weight: 300; }

.deck { display: grid; justify-items: center; gap: 20px; perspective: 1400px; }
.card { --rx: 0deg; --ry: 0deg;
  width: min(260px, 70vw); aspect-ratio: 5 / 7.4; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; border-radius: 18px;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s ease;
}
.card-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.3,1.3,.4,1);
}
.card.flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: block; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(239,233,218,.12);
}
.back { background:
    repeating-linear-gradient(45deg, rgba(239,233,218,.06) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(-45deg, rgba(239,233,218,.06) 0 1px, transparent 1px 10px),
    linear-gradient(160deg, var(--royal-hi), var(--royal) 45%, #0f2260);
}
.back-frame, .front-frame { position: absolute; inset: 12px; border: 1px solid rgba(239,233,218,.4); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.back-frame::before, .front-frame::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(239,233,218,.18); border-radius: 7px; }
.back-mono { display: inline-flex; font-family: var(--f-latin); font-weight: 700; font-size: 5.2rem; line-height: 1; color: var(--moon); }
.back-mono span + span { margin-left: -.3em; }
.back-cap { margin-top: 1.2rem; font-size: .8rem; color: rgba(239,233,218,.75); }
.card:hover .back-cap { color: var(--moon); }

.front { transform: rotateY(180deg); background: linear-gradient(170deg, #f7f2e6, #e6dcc6); color: #141a2e; }
.front .front-frame { border-color: rgba(20,26,46,.35); padding: 24px 18px; }
.front .front-frame::before { border-color: rgba(20,26,46,.15); }
.role-side { font-size: .8rem; font-weight: 700; color: var(--side, var(--royal)); }
.role-name { margin-top: .5rem; font-family: var(--f-display); font-weight: 700; font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.3; color: #0e1430; }
.role-rule { width: 40px; height: 2px; margin: 1rem 0; background: var(--side, var(--royal)); }
.role-line { font-size: .92rem; line-height: 1.8; color: #3a4060; max-width: 15em; }
.role-foot { position: absolute; bottom: 14px; font-family: var(--f-latin); font-weight: 700; font-size: 1rem; color: rgba(20,26,46,.35); }
.front[data-side="mafia"] { --side: var(--blood); }
.front[data-side="indie"] { --side: #8a6a2c; }

.redraw { font: inherit; font-size: .9rem; color: var(--haze); background: none; border: 0; padding: 8px 14px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 6px; text-decoration-color: rgba(141,152,186,.4);
}
.redraw:hover { color: var(--moon); }

.invite { display: grid; justify-items: center; gap: 18px; }
.invite p { margin: 0; color: #c5cbe0; font-weight: 300; max-width: 28em; }
.cta { display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; color: var(--night);
  background: linear-gradient(180deg, #fffaf0, var(--moon)); box-shadow: 0 0 0 1px rgba(255,255,255,.4) inset, 0 12px 40px -10px rgba(53,87,184,.9);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,.5) inset, 0 18px 50px -10px rgba(53,87,184,1); }

.foot { position: relative; z-index: 5; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px clamp(16px, 4vw, 48px) max(24px, env(safe-area-inset-bottom)); color: var(--haze); font-size: .85rem;
  border-top: 1px solid rgba(141,152,186,.15);
}

@media (max-width: 520px) {
  .mono-sub { letter-spacing: .45em; }
  .bar-ig span { display: none; }
  .mono { font-size: 46vw; }
  .hero { padding-bottom: 110px; }
  .whisper { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fog, .scroll-cue span { animation: none; }
  .lit .mono, .lit .mono-sub, .lit .title, .lit .lede { animation: none; }
  .card-inner { transition: none; }
}
