/* norm. — the film is nice. the flyers were made at a library photocopier. */

:root {
  --ink: #07080b;
  --night: #0d1016;
  --lamp: #ffb871;
  --lamp-2: #ffd9a8;
  --fog: rgba(230, 236, 245, 0.62);
  --line: rgba(230, 236, 245, 0.14);
  --paper: #efece4;
  --marker: #121212;
  --stamp: #c8231b;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --serif: "Bodoni Moda", "Didot", Georgia, serif;
  --type: "Special Elite", "Courier New", monospace;
  --hand: "Permanent Marker", "Comic Sans MS", cursive;
  --anton: "Anton", Impact, "Arial Narrow", sans-serif;
  --cc: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: #e9ecf1; }
body { font-family: var(--mono); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); }

#c { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; cursor: crosshair; }

/* ---------------- clean overlay ---------------- */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#ui > * { pointer-events: auto; }
.top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 18px;
  padding: max(18px, env(safe-area-inset-top)) clamp(16px, 2.6vw, 36px) 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--lamp-2); }
.logo svg { width: 34px; height: 40px; color: var(--lamp-2); filter: drop-shadow(0 0 10px rgba(255, 184, 113, 0.35)); }
.wm { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 38px; letter-spacing: -0.02em; line-height: 1; text-shadow: 0 0 24px rgba(255, 184, 113, 0.3); }
.tag { margin: 4px 0 0; font-size: 11px; letter-spacing: 0.18em; color: var(--fog); }
.tag i { font-style: normal; opacity: 0.5; padding: 0 4px; }
.right { margin-left: auto; display: flex; gap: 8px; }
.chip {
  height: 36px; min-width: 36px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(13, 16, 22, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12px; letter-spacing: 0.08em; text-decoration: none; color: #e9ecf1;
  transition: border-color .2s, background .2s;
}
.chip:hover { border-color: rgba(255, 184, 113, 0.6); }
.chip.ico { padding: 0; width: 36px; }
.chip svg { width: 16px; height: 16px; fill: currentColor; }
.chip .k { color: var(--lamp); }
.chip.ok { border-color: var(--lamp); color: var(--lamp); }
#snd .w, #snd .x { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#snd .x { display: none; }
#snd[aria-pressed="false"] .w { display: none; }
#snd[aria-pressed="false"] .x { display: inline; }

/* closed captions */
.cc {
  position: absolute; left: 50%; bottom: clamp(96px, 13vh, 130px); transform: translateX(-50%);
  max-width: min(86vw, 760px); text-align: center; pointer-events: none;
}
.cc span {
  display: inline-block; padding: 6px 12px 7px; background: rgba(0, 0, 0, 0.78); color: #fff;
  font: 500 clamp(17px, 1.6vw, 23px)/1.3 var(--cc); letter-spacing: 0.01em;
  animation: ccin .12s steps(2) both;
}
@keyframes ccin { from { transform: translateY(4px); } }

.stats {
  position: absolute; left: clamp(16px, 2.6vw, 36px); bottom: max(22px, env(safe-area-inset-bottom));
  display: flex; gap: 26px; font-size: 11px; letter-spacing: 0.14em; color: var(--fog); pointer-events: none;
}
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats b { font-size: 26px; font-weight: 500; letter-spacing: 0.04em; color: #f4f6f8; font-variant-numeric: tabular-nums; }

.actions { position: absolute; right: clamp(16px, 2.6vw, 36px); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.cta {
  height: 48px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(255, 184, 113, 0.55); background: rgba(255, 184, 113, 0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: 500 14px var(--mono); letter-spacing: 0.04em; color: var(--lamp-2);
  box-shadow: 0 0 40px -10px rgba(255, 184, 113, 0.5); transition: background .2s, transform .15s;
}
.cta:hover { background: rgba(255, 184, 113, 0.22); }
.cta:active { transform: scale(0.97); }
.cta:disabled { opacity: 0.6; cursor: default; }
.cta.ghost { border-color: var(--line); background: rgba(13, 16, 22, 0.55); color: #e9ecf1; box-shadow: none; }
.cta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 12px var(--lamp); animation: hum 3.3s infinite; }
@keyframes hum { 0%, 92%, 100% { opacity: 1; } 94% { opacity: 0.2; } 96% { opacity: 0.9; } }

/* ---------------- the sharpie layer ---------------- */
#ink { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2; pointer-events: none; overflow: visible; }
.mk { font-family: var(--hand); font-size: 26px; fill: #f5f1e8; paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 3px; }
.mk.sm { font-size: 17px; }
.mk.red { fill: #ff3b2f; font-size: 24px; }
.mk-line { fill: none; stroke: #f5f1e8; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.mk-line.thin { stroke-width: 2.2; }
#inkHitCircle { stroke: #ff3b2f; stroke-width: 3.5; }

/* ---------------- the flyers (bad half) ---------------- */
.flyers { position: absolute; left: clamp(12px, 2vw, 28px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; }
.flyer-mini {
  position: relative; width: 112px; padding: 12px 10px 14px; border: 0; text-align: center;
  background: var(--paper); color: var(--marker); font-family: var(--type); font-size: 11px; line-height: 1.15;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.55); filter: grayscale(1) contrast(1.15);
  transition: transform .15s;
}
.flyer-mini::before { /* staple */
  content: ""; position: absolute; top: 5px; left: 50%; width: 16px; height: 3px; margin-left: -8px;
  background: linear-gradient(#cfd3d8, #7d838a); border-radius: 1px;
}
.flyer-mini b { display: block; font: 30px/0.95 var(--anton); letter-spacing: 0.01em; margin: 6px 0 4px; }
.fm-1 { transform: rotate(-4deg); }
.fm-2 { transform: rotate(3deg); }
.fm-2 b { font: 24px/1 var(--hand); }
.fm-3 { transform: rotate(-2deg); }
.fm-3 b { font-size: 22px; }
.flyer-mini:hover { transform: rotate(0) scale(1.06); }

#modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; }
#modal[hidden] { display: none; }
.backdrop { position: absolute; inset: 0; background: rgba(4, 5, 7, 0.72); backdrop-filter: blur(3px); }
.flyer {
  position: relative; display: none; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 26px 26px 0; background: var(--paper); color: var(--marker);
  font-family: var(--type); font-size: 15px; line-height: 1.35;
  transform: rotate(-1.5deg); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  background-image:
    radial-gradient(rgba(0, 0, 0, 0.09) 1px, transparent 1.2px),
    radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1.4px),
    linear-gradient(100deg, rgba(0, 0, 0, 0.04), transparent 30%, rgba(0, 0, 0, 0.06));
  background-size: 7px 9px, 13px 11px, 100% 100%;
  scrollbar-width: none;
}
.flyer.on { display: block; animation: slap .22s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slap { from { transform: rotate(-9deg) scale(1.12); } }
.flyer[data-flyer="buy"] { transform: rotate(1.2deg); }
.flyer p { margin: 8px 0; }
.anton { font-family: var(--anton); font-weight: 400; text-transform: uppercase; letter-spacing: 0.005em; line-height: 0.9; margin: 0; text-align: center; }
h2.anton { font-size: clamp(72px, 20vw, 104px); }
h2.anton.md { font-size: 58px; }
h3.anton.sm { font-size: 30px; margin: 12px 0 4px; }
.hand { font-family: var(--hand); }
h2.hand.big { font-size: 40px; margin: 0 0 8px; transform: rotate(-2deg); line-height: 1; }
.hand.sm { font-size: 16px; text-align: center; }
.xerox { position: relative; margin: 12px 0 0; border: 2px solid var(--marker); overflow: hidden; background: #fff; }
.xerox img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) brightness(2) contrast(1.7); mix-blend-mode: multiply; }
.xerox::after { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(0, 0, 0, 0.35) 0.8px, transparent 1px) 0 0 / 4px 4px; mix-blend-mode: multiply; opacity: 0.6; }
.type { font-family: var(--type); }
ol.type { padding-left: 22px; font-size: 16px; }
ol.type li { margin: 6px 0; }
.nomics { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 14px; }
.nomics td { border-bottom: 1px dashed rgba(0, 0, 0, 0.4); padding: 5px 2px; }
.nomics td:last-child { text-align: right; font-weight: bold; }
.close { position: absolute; top: 6px; right: 10px; background: none; border: 0; font: 30px var(--hand); color: var(--stamp); }
.tape { position: absolute; width: 96px; height: 26px; background: rgba(232, 220, 181, 0.72); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); z-index: 2; }
.tape.t1 { top: -10px; left: -18px; transform: rotate(-24deg); }
.tape.t2 { top: -8px; right: -20px; transform: rotate(18deg); }
.tape.t3 { bottom: 60px; right: -28px; transform: rotate(-70deg); }

/* tear-off tabs */
.tabs { display: flex; margin: 16px -26px 0; border-top: 2px dashed rgba(0, 0, 0, 0.55); }
.tab {
  flex: 1; height: 118px; border: 0; border-right: 1px dashed rgba(0, 0, 0, 0.45); background: transparent;
  writing-mode: vertical-rl; transform: rotate(180deg); font: 12px var(--type); color: var(--marker);
  display: flex; align-items: center; justify-content: center; padding: 6px 0; overflow: hidden; white-space: nowrap;
  transition: background .15s;
}
.tab:hover { background: rgba(0, 0, 0, 0.06); }
.tab.gone { visibility: hidden; }
.tab-fly { position: fixed; z-index: 30; background: var(--paper); pointer-events: none; animation: tear 1.1s cubic-bezier(.4, 0, .8, .6) forwards; }
@keyframes tear { 30% { transform: translateY(-26px) rotate(-14deg); } to { transform: translateY(110vh) rotate(160deg); } }

.gen { display: grid; gap: 8px; margin: 12px 0; }
.up { display: block; text-align: center; padding: 12px; border: 2px dashed var(--marker); font-size: 20px; cursor: pointer; }
.field { width: 100%; padding: 8px 10px; border: 0; border-bottom: 2px solid var(--marker); background: transparent; font-size: 15px; color: var(--marker); outline: none; }
#pOut { display: block; width: 100%; height: auto; margin-top: 6px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25); transform: rotate(1deg); }
.dl { display: block; margin: 14px auto 22px; background: none; border: 0; font-size: 26px; color: var(--stamp); }

/* ---------------- intro ---------------- */
#intro {
  position: fixed; inset: 0; z-index: 20; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity 1.4s ease;
}
#intro.out { opacity: 0; pointer-events: none; }
.where { margin: 0; font-size: 12px; letter-spacing: 0.32em; color: var(--fog); }
.where i { font-style: normal; opacity: 0.5; padding: 0 6px; }
.hint { margin: 0; font-size: 11px; letter-spacing: 0.14em; color: rgba(230, 236, 245, 0.35); }
.intro-flyer {
  position: absolute; right: 7vw; bottom: 12vh; width: 150px; padding: 16px 12px; transform: rotate(6deg);
  background: var(--paper); color: var(--marker); font: 12px/1.2 var(--type); text-align: center;
  filter: grayscale(1) contrast(1.2); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8); opacity: 0.88;
}
.intro-flyer b { display: block; font-size: 42px; line-height: 0.9; margin-bottom: 6px; }
.intro-flyer em { display: block; margin-top: 8px; font-style: normal; color: var(--stamp); filter: none; font-size: 15px; transform: rotate(-4deg); }

/* ---------------- brand shots ---------------- */
body.shot #ui, body.shot #ink, body.shot #intro, body.shot #modal { display: none !important; }
.shot-overlay { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.shot-overlay .logo { position: absolute; top: 7%; left: 5%; }
.shot-overlay .wm { font-size: 9vh; }
.shot-overlay .logo svg { width: 8vh; height: 9.5vh; }
.shot-overlay .cc { bottom: 9%; }
.shot-overlay .cc span { font-size: 3.6vh; }
.shot-overlay.banner .logo { left: auto; right: 5%; top: 12%; }
.shot-overlay.banner .cc { bottom: 12%; left: auto; right: 5%; transform: none; }

/* ---------------- small screens ---------------- */
@media (max-width: 760px) {
  .wm { font-size: 30px; }
  .logo svg { width: 26px; height: 31px; }
  .tag, .right .chip[data-link="dex"] { display: none; }
  .right .chip[data-copy] { padding: 0 10px; }
  .flyers { top: auto; bottom: 86px; left: 12px; transform: none; flex-direction: row; gap: 8px; }
  .flyer-mini { width: 76px; padding: 9px 6px 10px; font-size: 9px; }
  .flyer-mini b { font-size: 21px; }
  .fm-2 b { font-size: 16px; }
  .fm-3 b { font-size: 15px; }
  .stats { gap: 16px; font-size: 9px; }
  .stats b { font-size: 19px; }
  .actions { left: 12px; right: 12px; justify-content: flex-end; bottom: max(14px, env(safe-area-inset-bottom)); }
  .stats { bottom: 200px; left: 14px; }
  .cta { height: 46px; padding: 0 16px; font-size: 13px; }
  .cc { bottom: 238px; }
  .mk { font-size: 20px; }
  .mk.sm { display: none; }
  .intro-flyer { right: 16px; bottom: 6vh; width: 120px; }
}

/* ---------------- pfp studio + meme maker (clean half) ---------------- */
.chip.tool { border-color: rgba(255, 184, 113, 0.5); color: var(--lamp-2); }
.stats { gap: 22px; }
#studio { position: fixed; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px; }
#studio[hidden] { display: none; }
#studio .backdrop { position: absolute; inset: 0; background: rgba(4, 5, 7, 0.75); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel {
  position: relative; width: min(1040px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: rgba(13, 16, 22, 0.94); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 80px -30px rgba(255, 184, 113, 0.35);
}
.ph { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(13, 16, 22, 0.97); z-index: 1; }
.seg { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: 500 12px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fog); }
.seg button[aria-selected="true"] { background: rgba(255, 184, 113, 0.16); color: var(--lamp-2); }
.xbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; font-size: 20px; line-height: 1; }
.pbody { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; padding: 18px; }
.pview { display: grid; place-items: center; background: repeating-conic-gradient(#12151c 0 25%, #0e1116 0 50%) 0 0 / 22px 22px; border-radius: 12px; padding: 10px; }
.pview canvas { display: block; max-width: 100%; max-height: min(64vh, 560px); width: auto; height: auto; border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.pctl h4 { margin: 14px 0 8px; font: 500 11px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--lamp); }
.pctl h4:first-child { margin-top: 2px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts + .opts { margin-top: 6px; }
.opt { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font: 12px var(--mono); color: #e9ecf1; }
.opt:hover { border-color: rgba(255, 184, 113, 0.5); }
.opt[aria-pressed="true"] { border-color: var(--lamp); background: rgba(255, 184, 113, 0.16); color: var(--lamp-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); }
.sw[aria-pressed="true"] { outline: 2px solid var(--lamp); outline-offset: 2px; }
.fld { display: grid; gap: 6px; margin: 12px 0 0; font: 11px var(--mono); letter-spacing: 0.1em; color: var(--fog); text-transform: uppercase; }
.fld input[type="text"] { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: #f4f6f8; font: 14px var(--mono); text-transform: none; letter-spacing: 0; outline: none; }
.fld input[type="text"]:focus { border-color: var(--lamp); }
.fld input[type="file"] { font: 12px var(--mono); color: var(--fog); text-transform: none; letter-spacing: 0; }
#sDl { margin-top: 20px; width: 100%; justify-content: center; }
.flyer-mini.fm-3 b { font-size: 24px; }
.fm-4 { transform: rotate(4deg); }
.flyer-mini.fm-4 b { font: 24px/1 var(--hand); }

@media (max-width: 860px) {
  .pbody { grid-template-columns: 1fr; }
  .pview canvas { max-height: 46vh; }
}
@media (max-width: 760px) {
  .right .chip.tool { display: none; }
  .top { flex-wrap: wrap; }
}

/* ---------------- rooms ---------------- */
.rooms { margin-left: auto; display: flex; gap: 8px; }
.rooms ~ .right { margin-left: 0; }
.rooms .chip[aria-current="true"] { border-color: var(--lamp); background: rgba(255, 184, 113, 0.16); color: var(--lamp-2); }
/* the street's own things stay in the street */
body:not([data-room="street"]) :is(.stats, .actions, .flyers, #inkLamp, #inkHit) { display: none; }
body:not([data-room="street"]) #c { cursor: default; }
#fade { position: fixed; inset: 0; z-index: 30; background: #000; opacity: 0; pointer-events: none; transition: opacity .26s ease; }
#fade.on { opacity: 1; }
/* in its room, a tool is part of the wall: docked on the right, no backdrop */
#studio.docked, #modal.docked { inset: 76px clamp(16px, 2.6vw, 36px) 18px auto; width: min(440px, 40vw); padding: 0; display: block; z-index: 4; }
#studio.docked .backdrop, #modal.docked .backdrop, #studio.docked .seg { display: none; }
#studio.docked .panel { width: 100%; height: 100%; max-height: none; }
#studio.docked .pbody { grid-template-columns: 1fr; gap: 14px; }
#studio.docked .pview canvas { max-height: 38vh; }
#modal.docked { overflow: auto; }
#modal.docked .flyer { margin: 0 auto; transform: none; width: 100%; max-width: none; }
@media (max-width: 760px) {
  .rooms { order: 5; flex-basis: 100%; margin: 4px 0 0; overflow-x: auto; scrollbar-width: none; }
  .rooms .chip { flex: none; height: 32px; padding: 0 11px; font-size: 10px; }
  #studio.docked, #modal.docked { inset: auto 0 0 0; width: auto; height: 52dvh; }
  #studio.docked .panel { border-radius: 18px 18px 0 0; }
  #studio.docked .pview canvas { max-height: 26vh; }
}
#modal.docked .flyer.on { animation: none; }
.rooms .chip { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 761px) {
  .tag { display: none; }
  .rooms .chip, .right .chip { padding: 0 10px; font-size: 11px; letter-spacing: 0.05em; }
}
