:root {
  --bg: #0b0b0b; --fg: #ece6d8; --muted: #9b958a; --card: #efe9dc; --ink: #1f1c18; --accent: #c9a24a;
  --font: "Josefin Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-weight: 300; }
body {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 48px 16px 64px;
  /* a very light gradient with film grain over it */
  background: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0) 50%), radial-gradient(ellipse 120% 90% at 50% 60%, #1c1b19 0%, #121110 45%, #0b0b0b 100%), #000;
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.065;
  /* the grain fades out to pure black at the top */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 60%); mask-image: linear-gradient(to bottom, transparent 0%, #000 60%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
a { color: var(--accent); }
h1 { font-weight: 300; letter-spacing: 0.5em; margin: 0 0 36px 0.5em; font-size: clamp(20px, 5.4vw, 46px); text-align: center; }
main { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.panel { background: var(--card); color: var(--ink); border-radius: 4px; padding: 28px; width: 100%; max-width: 380px; text-align: center;
         box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.qr svg { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; }
.btn { display: inline-block; margin-top: 20px; padding: 12px 22px; background: var(--ink); color: var(--card); text-decoration: none;
       letter-spacing: 0.2em; text-transform: uppercase; font-size: 13px; font-weight: 600; border-radius: 2px; }
.small { font-size: 12px; color: #5d574e; margin-top: 14px; line-height: 1.6; word-break: break-all; }
.small code { font-family: ui-monospace, monospace; font-size: 12px; }
form { display: flex; gap: 8px; width: 100%; max-width: 380px; }
input { flex: 1; min-width: 0; padding: 12px; font: inherit; font-size: 16px; letter-spacing: 0.2em; text-transform: uppercase;
        background: #151515; color: var(--fg); border: 1px solid #333; border-radius: 2px; }
button { padding: 12px 16px; font: inherit; font-weight: 600; letter-spacing: 0.15em; background: var(--fg); color: var(--ink); border: 0; border-radius: 2px; cursor: pointer; }
.label { color: var(--muted); font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; }

/* home: a photo strip */
.pstrip { width: min(340px, 100%); background: var(--card); padding: 14px 14px 46px; display: flex; flex-direction: column; gap: 12px;
          box-shadow: 4px 8px 18px rgba(0,0,0,0.35), 1px 2px 4px rgba(0,0,0,0.25); transform: rotate(-1.2deg); }
.frame { aspect-ratio: 1 / 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
         background: #2a2826; background-size: cover; background-position: center; }
.frame.photo { filter: grayscale(1) contrast(1.1); }
button.frame { width: 100%; padding: 0; border: 0; border-radius: 0; cursor: zoom-in; }
.frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame.dark { background: radial-gradient(circle at 50% 40%, #3a3734, #161514); color: var(--fg); }
.cta { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; white-space: nowrap;
       background: var(--card); color: var(--ink); font-size: 11px; padding: 11px 16px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
.frame form { flex-direction: column; align-items: stretch; width: 78%; max-width: none; gap: 10px; }
.frame input { text-align: center; background: rgba(0,0,0,0.35); border-color: #5a5650; }
.flabel { text-align: center; letter-spacing: 0.4em; text-transform: uppercase; font-size: 13px; color: var(--fg); margin-bottom: 6px; transition: color 0.25s ease; }
.flabel .hot, .frame:hover .flabel .idle, .frame:focus-within .flabel .idle { display: none; }
.frame:hover .flabel .hot, .frame:focus-within .flabel .hot { display: inline; }
.frame:hover .flabel, .frame:focus-within .flabel { color: var(--accent); }
/* the form button appears when you hover its frame (always shown on touch screens, and when focused with the keyboard) */
@media (hover: hover) {
  .frame form button { opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; transform: translateY(6px); }
  .frame:hover form button, .frame:focus-within form button { opacity: 1; transform: none; }
  .frame.photo::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0); transition: background 0.25s ease; pointer-events: none; }
  .frame.photo:hover::after { background: rgba(0,0,0,0.25); }
  .frame.photo:has(.cta) { transition: filter 0.6s ease; }
  .frame.photo:has(.cta):hover, .frame.photo:has(.cta):focus-within { filter: none; }
  .frame .cta { z-index: 1; }
}

dialog.modal { position: fixed; inset: 0; margin: auto; width: min(560px, calc(100vw - 32px)); max-width: none; min-height: min(500px, 85dvh); max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain; padding: 36px 32px 28px; border: 0; border-radius: 2px;
             background: var(--card); color: var(--ink); line-height: 1.6; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.modal dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; }
.modal dt { font-weight: 600; }
.modal dd { margin: 0; }
.modal .copy { padding: 0; background: none; color: inherit; font-weight: 300; letter-spacing: 0; border-bottom: 1px dashed currentColor; border-radius: 0; }
.modal .copy:hover, .modal .copy:focus-visible { color: #8a6a1f; }
.modal .copy.done::after { content: "  copied"; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: #8a6a1f; }
.modal .btn { display: table; margin: 4px auto 20px; background: var(--ink); color: var(--card); }
html:has(dialog.modal[open]) { overflow: hidden; }
dialog.modal:focus { outline: none; }
dialog.modal::backdrop { background: rgba(0,0,0,0.75); }
dialog.modal h2 { margin: 0 0 18px; font-weight: 600; font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; }
dialog.modal p { margin: 0 0 14px; }
dialog.modal h2:not(:first-child) { margin-top: 28px; }
dialog.modal ol { margin: 0 0 14px; padding-left: 1.3em; }
.mixtape { margin-top: 30px; color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(201,162,74,0.4); padding-bottom: 3px; }
.aiOpen { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px;
          background: rgba(20,19,18,0.85); color: var(--muted); border: 1px solid #3a3734; font-size: 11px; letter-spacing: 0.2em;
          text-transform: uppercase; box-shadow: 0 6px 20px rgba(0,0,0,0.5); transition: color 0.25s ease, border-color 0.25s ease; }
.aiOpen img { display: block; }
.aiOpen:hover, .aiOpen:focus-visible { color: var(--accent); border-color: var(--accent); }
footer { margin-top: auto; padding-top: 56px; color: var(--muted); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
footer a { color: inherit; text-decoration: none; }
footer a:hover, footer a:focus-visible { color: var(--accent); }
.mixtape img { display: block; width: 120px; height: auto; margin: 0 auto 14px; transform: rotate(-3deg); transition: transform 0.25s ease; }
.mixtape:hover img, .mixtape:focus-visible img { transform: rotate(0deg) scale(1.04); }
.mixtape:hover, .mixtape:focus-visible { border-bottom-color: var(--accent); }

/* strip view */
.card { width: min(260px, 64vw); aspect-ratio: 240 / 1068;   /* the strip plus the code band printCode adds below it */ background: var(--card); box-shadow: 0 20px 60px rgba(0,0,0,0.6); position: relative; overflow: hidden; }
.card img { width: 100%; height: 100%; display: block; }
.developing { display: flex; align-items: center; justify-content: center; height: 100%; color: #5d574e; font-size: 13px; padding: 16px; text-align: center; background: #d8d2c4; }
.actions { margin-top: 8px; text-align: center; font-size: 14px; }
[hidden] { display: none !important; }
