/* Loser Studios — "the Files" look. Mobile-first, no frameworks. */
:root {
  --bg: #0b0a09;
  --bg-2: #15120f;
  --ink: #1d1813;
  --ink-soft: #4a4136;
  --paper: #e9dfc8;
  --paper-2: #ddd0b2;
  --cream: #f2ead8;
  --muted: #a89e8c;
  --red: #a8231d;
  --red-bright: #c8352c;
  --gold: #c9a24a;
  --line: #2e2923;
  --radius: 10px;
  --font: "Courier Prime", "Courier New", ui-monospace, monospace;
  --tap: 52px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--cream);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, #2a211a 0%, transparent 60%),
    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'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 10, 9, .86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cream); font-weight: 700; letter-spacing: .14em; font-size: 15px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px;
  font: 700 17px/1 var(--font); letter-spacing: .04em;
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--red); color: var(--cream); box-shadow: 0 3px 0 #5e120f; }
.btn-primary:hover { background: var(--red-bright); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-sm { min-height: 42px; padding: 0 14px; font-size: 14px; background: transparent; color: var(--cream); border-color: var(--line); }
.btn-x { background: var(--cream); color: var(--bg); }

/* ---------- hero ---------- */
.hero-banner img { width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-bottom: 1px solid var(--line); }
.hero-copy { padding: 26px 20px 8px; max-width: 720px; margin: 0 auto; }
.eyebrow { color: var(--red-bright); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; margin: 0 0 8px; font-weight: 700; }
h1 { font-size: clamp(34px, 9vw, 58px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -.01em; }
.redact-hover { position: relative; white-space: nowrap; }
.redact-hover::after {
  content: ""; position: absolute; left: -4px; right: -4px; top: 18%; bottom: 8%;
  background: #000; transform-origin: left; animation: redact 2.6s 1s ease-in-out infinite alternate;
}
@keyframes redact { 0%, 35% { transform: scaleX(0); } 65%, 100% { transform: scaleX(1); } }
.lede { color: #d8cfbd; font-size: 18px; margin: 0 0 20px; }
.tiny { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------- sections ---------- */
.section { padding: 22px 16px; max-width: 760px; margin: 0 auto; }
.h2 { font-size: 24px; margin: 0 0 14px; letter-spacing: .02em; }

.paper {
  position: relative;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .15  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23p)'/></svg>"),
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.35), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(120,90,40,.25), transparent 60%);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 18px 40px rgba(0,0,0,.55), 0 2px 0 #b9ab8c;
}
.notes { padding: 22px 18px 16px; transform: rotate(-.6deg); }
.paper-label { margin: 0 0 10px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.typed { list-style: none; padding: 0; margin: 0; }
.typed li { padding: 8px 0 8px 26px; border-bottom: 1px dashed rgba(29,24,19,.25); position: relative; }
.typed li::before { content: "—"; position: absolute; left: 0; color: var(--red); }
.bar { display: inline-block; height: 1em; width: 9ch; background: var(--ink); vertical-align: -2px; }
.bar.short { width: 5ch; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.02); }
.steps .n { color: var(--red-bright); font-weight: 700; font-size: 20px; min-width: 2.2ch; }
.handle { color: var(--gold); }

/* ---------- case file ---------- */
.apply { padding-top: 30px; padding-bottom: 40px; scroll-margin-top: 72px; }
.folder { position: relative; padding-top: 26px; overflow: hidden; }
.folder-tab {
  position: absolute; top: 0; left: 18px; height: 30px; padding: 6px 18px 0;
  background: #b89a62; color: var(--ink); font-weight: 700; font-size: 13px; letter-spacing: .2em;
  border-radius: 8px 8px 0 0; box-shadow: 0 -1px 0 rgba(255,255,255,.3) inset;
}
.sheet { position: relative; padding: 20px 18px 22px; }
.sheet.paper { }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.sheet-title { color: var(--ink-soft); }
.progress-label { color: var(--red); font-weight: 700; }
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 18px; }
.progress i { height: 6px; background: rgba(29,24,19,.15); border-radius: 3px; }
.progress i.on { background: var(--red); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.step { animation: slidein .25s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.entry-label { font-size: 22px; font-weight: 700; color: var(--ink); padding: 0; margin: 0 0 8px; letter-spacing: .02em; }
.entry-label.small { font-size: 17px; margin-top: 18px; }
.entry-label.small.sub { display: block; font-size: 14px; margin: 14px 0 6px; letter-spacing: .04em; color: var(--ink-soft); }
.entry-label.small + .hint { margin-top: 4px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; min-height: var(--tap);
  font: 400 18px/1.45 var(--font); color: var(--ink);
  background: rgba(255,255,255,.35);
  border: 0; border-bottom: 2px solid var(--ink);
  border-radius: 4px 4px 0 0; padding: 12px 12px;
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 170px; background-image: repeating-linear-gradient(transparent 0 25px, rgba(29,24,19,.14) 25px 26px); background-attachment: local; line-height: 26px; padding-top: 8px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(29,24,19,.45); }
.field.at input { padding-left: 34px; }
.field.at .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 18px; font-weight: 700; }
.field.invalid input, .field.invalid textarea { border-bottom-color: var(--red); background-color: rgba(168,35,29,.08); }
.hint { color: var(--ink-soft); font-size: 14px; margin: 8px 0 0; }
.muted { opacity: .7; font-weight: 400; }
.err { color: var(--red); font-size: 15px; font-weight: 700; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.count { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.nav-row .btn { flex: 1; }
.nav-row span:empty { display: none; }

.shots { margin-top: 16px; }
.attach { width: 100%; border-style: dashed; font-size: 16px; }
.thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 104px; height: 104px; border-radius: 6px; overflow: hidden; border: 2px solid var(--ink); background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; font-size: 18px; cursor: pointer; }
.thumb .kb { position: absolute; bottom: 0; left: 0; right: 0; font-size: 11px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 6px; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--red); flex: none; }
.turnstile:empty { display: none; }
.turnstile { margin-top: 16px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-err { margin-top: 14px; }

/* ---------- stamp ---------- */
.stamp {
  position: absolute; left: 50%; top: 46%; z-index: 5;
  font: 700 clamp(64px, 20vw, 120px)/1 var(--font); letter-spacing: .08em;
  color: var(--red); border: 8px solid var(--red); border-radius: 14px; padding: 8px 22px 4px;
  transform: translate(-50%, -50%) rotate(-14deg) scale(2.4);
  opacity: 0; pointer-events: none; mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 0 1 1 1 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/><feComponentTransfer><feFuncA type='discrete' tableValues='1 1 1 0 1 1 1 1'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
}
.stamp.go { animation: stamp .42s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(2.4); }
  70% { opacity: .95; transform: translate(-50%, -50%) rotate(-14deg) scale(.96); }
  100% { opacity: .9; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }
}
.sheet.shake { animation: shake .38s .3s ease; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-6px, 2px) rotate(-.6deg); }
  40% { transform: translate(5px, -2px) rotate(.5deg); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, 0); }
}
.sheet.filed form { opacity: .55; filter: grayscale(.4); }

/* ---------- result ---------- */
.result { margin-top: 26px; animation: slidein .3s ease; }
.card-img { width: 100%; border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.6); border: 1px solid var(--line); background: #111; }
.actions { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 24px 16px 40px; color: var(--muted); font-size: 14px; text-align: center; }
.footer p { margin: 6px auto; max-width: 640px; }
.disclaimer { font-size: 12px; opacity: .8; }

/* ---------- larger screens ---------- */
@media (min-width: 760px) {
  .hero-copy { padding-top: 40px; }
  .sheet { padding: 30px 34px 30px; }
  .actions { grid-template-columns: repeat(3, 1fr); }
  .nav-row .btn { flex: 0 0 auto; min-width: 180px; }
  .nav-row span:empty { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.result .btn-ghost { color: var(--cream); border-color: var(--cream); }
