/* ===========================================================================
   QR//2000 — Y2K skin
   Chrome bevels, pixel type, iridescent gradients and a matrix grid.
   Everything is CSS: no images to download.
   =========================================================================== */

:root {
  /* The four house colors */
  --gold:   #FFC349;
  --indigo: #525EA7;
  --sky:    #5FACD3;
  --ice:    #97DDE9;

  /* Deep backdrop, mixed from the indigo so the grid feels related to it */
  --void:   #0B0F2A;
  --void-2: #161C4A;
  --ink:    #101828;

  /* Chrome: the trick is a hard light/dark break in the middle. A smooth
     gradient reads as plastic; the abrupt step is what makes it metal. */
  --chrome: linear-gradient(180deg,
              #ffffff 0%, #e9edf6 14%, #b9c2d6 46%, #8e99b4 50%,
              #d6dced 54%, #f7f9ff 84%, #c8cfe0 100%);
  --chrome-soft: linear-gradient(180deg, #fdfdff 0%, #dfe5f2 48%, #aeb8d0 52%, #eef1f9 100%);

  /* Iridescent: the oil-slick sweep, all four colors plus a hot pink that
     was on every CD-ROM case in 1999 */
  --irid: linear-gradient(100deg,
            var(--gold) 0%, #FF7BD5 22%, var(--indigo) 44%,
            var(--sky) 66%, var(--ice) 84%, var(--gold) 100%);

  --edge-light: rgba(255,255,255,.9);
  --edge-dark:  rgba(20,26,70,.55);

  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-term:  'VT323', 'Consolas', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: 28px 16px 48px;
  background: var(--void);
  color: #E8ECFF;
  font-family: var(--font-term);
  font-size: 20px;               /* VT323 runs small, so the base is large */
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}

/* ── Backdrop layers ──────────────────────────────────────────────────── */

/* The matrix grid. Two sets of lines, the finer one dimmer, so it reads as
   depth rather than graph paper. */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-color: var(--void);
  background-image:
    linear-gradient(rgba(95,172,211,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95,172,211,.22) 1px, transparent 1px),
    linear-gradient(rgba(82,94,167,.30) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82,94,167,.30) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  to { background-position: 96px 96px, 96px 96px, 24px 24px, 24px 24px; }
}

/* Two colored pools of light so the grid isn't evenly lit */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vw 50vh at 12% 0%, rgba(255,195,73,.20), transparent 60%),
    radial-gradient(70vw 60vh at 90% 20%, rgba(95,172,211,.24), transparent 62%),
    radial-gradient(80vw 70vh at 50% 110%, rgba(82,94,167,.45), transparent 60%);
}

/* CRT scanlines, very faint */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: .5;
}

/* ── The window ───────────────────────────────────────────────────────── */

.window {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--chrome);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.75);
  box-shadow:
    0 0 0 1px rgba(11,15,42,.9),
    0 28px 60px rgba(0,0,0,.55),
    inset 0 1px 0 #fff;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px 7px 0 0;
  background: var(--irid);
  background-size: 250% 100%;
  animation: sheen 9s linear infinite;
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -2px 6px rgba(11,15,42,.35);
}

@keyframes sheen {
  to { background-position: 250% 0; }
}

.titlebar-icon {
  width: 14px; height: 14px;
  background: var(--chrome);
  border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px #fff;
}

.titlebar-name {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: .05em;
  color: #0B0F2A;
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}

.titlebar-btns {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.titlebar-btns b {
  width: 22px; height: 18px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--ink);
  background: var(--chrome-soft);
  border: 1px solid rgba(11,15,42,.6);
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(11,15,42,.3);
}

.window-body {
  background:
    linear-gradient(180deg, rgba(151,221,233,.35), rgba(255,255,255,.92) 30%, #ffffff 100%);
  border: 1px solid rgba(11,15,42,.35);
  border-top: 0;
  padding: 26px 22px 22px;
  color: var(--ink);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { text-align: center; margin-bottom: 22px; }

.wordmark {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(26px, 6.5vw, 46px);
  letter-spacing: .02em;
  /* Chrome lettering: the gradient is clipped to the glyphs, and the stack of
     shadows below fakes an extruded metal edge. */
  background: linear-gradient(180deg,
      #ffffff 0%, #cfd8ec 40%, #6d79a4 52%, #ffffff 66%, #9aa5c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 2px 0 var(--indigo))
    drop-shadow(0 4px 0 rgba(11,15,42,.55))
    drop-shadow(0 0 18px rgba(95,172,211,.9));
}

.wordmark-slash { color: transparent; opacity: .85; }

.tagline {
  margin: 12px 0 0;
  font-size: 22px;
  letter-spacing: .06em;
  color: var(--indigo);
  text-transform: uppercase;
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}

.tab {
  font-family: var(--font-pixel);
  font-size: 10px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--chrome-soft);
  border: 1px solid rgba(11,15,42,.55);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(11,15,42,.25);
}

.tab:hover { filter: brightness(1.06); }

.tab.is-on {
  background: var(--irid);
  background-size: 250% 100%;
  animation: sheen 9s linear infinite;
  color: #0B0F2A;
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 12px rgba(82,94,167,.45);
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, #ffffff, #eef2fb);
  border: 2px solid var(--indigo);
  border-radius: 8px;
  padding: 16px;
  box-shadow: inset 1px 1px 0 #fff, 0 6px 0 rgba(82,94,167,.18);
  min-height: 320px;
}

.panel-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

@media (max-width: 760px) {
  body { padding: 14px 10px 36px; }
  .columns { grid-template-columns: 1fr; }
  .window-body { padding: 18px 14px 16px; }
  .panel { min-height: 0; }
  .tab { font-size: 9px; padding: 10px 10px; }
}

/* ── Form bits ────────────────────────────────────────────────────────── */

.label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: .04em;
  color: var(--indigo);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  font-family: var(--font-term);
  font-size: 20px;
  color: var(--ink);
  background: #fff;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  /* Inset shadow = the sunken 3D field every OS had in 1999 */
  box-shadow: inset 2px 2px 0 rgba(82,94,167,.28);
  resize: vertical;
}

.input:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

.input-line { flex: 1; min-width: 0; }

.msg {
  margin: 10px 0 0;
  font-size: 19px;
  letter-spacing: .04em;
  color: var(--indigo);
  text-transform: uppercase;
}

.msg.small { font-size: 17px; text-align: center; }
.msg.is-ok  { color: #0E7A4A; }
.msg.is-bad { color: #C2255C; }

.caret {
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink { 50% { opacity: 0; } }

.note {
  margin: 14px 0 0;
  font-size: 18px;
  line-height: 1.3;
  color: #3A4368;
  background: rgba(151,221,233,.28);
  border-left: 4px solid var(--sky);
  padding: 10px 12px;
}

.note b { color: var(--ink); }
.note i { font-style: normal; color: var(--indigo); }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: .04em;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--chrome-soft);
  border: 2px solid var(--ink);
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: inset 1px 1px 0 #fff, 0 3px 0 rgba(11,15,42,.7);
  transition: transform .06s, box-shadow .06s;
}

.btn:hover { filter: brightness(1.08); }

/* Pressing physically moves the button down onto its own shadow */
.btn:active {
  transform: translateY(3px);
  box-shadow: inset 1px 1px 0 #fff, 0 0 0 rgba(11,15,42,.7);
}

.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-go {
  background: linear-gradient(180deg, #FFE39A, var(--gold) 52%, #E8A62B 100%);
}

.btn-copy.is-done {
  background: linear-gradient(180deg, #B9F5D5, #4FCB8C 52%, #17A05E 100%);
}

/* ── Drop zone ────────────────────────────────────────────────────────── */

.drop {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  color: var(--indigo);
  background:
    repeating-linear-gradient(45deg,
      rgba(151,221,233,.30) 0 12px, rgba(255,255,255,.6) 12px 24px);
  border: 3px dashed var(--indigo);
  border-radius: 6px;
}

.drop:hover, .drop.is-over {
  border-color: var(--gold);
  background:
    repeating-linear-gradient(45deg,
      rgba(255,195,73,.35) 0 12px, rgba(255,255,255,.7) 12px 24px);
}

.drop:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.drop-icon { font-size: 34px; line-height: 1; color: var(--sky); }

.drop-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
}

.drop-sub { font-size: 18px; color: #3A4368; }
.drop-sub i { font-style: normal; color: var(--indigo); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── File card ────────────────────────────────────────────────────────── */

.filecard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 3px 0 rgba(82,94,167,.35);
}

.thumb {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--chrome-soft);
  border: 2px solid var(--indigo);
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--indigo);
  text-transform: uppercase;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.filecard-text { min-width: 0; }

.filecard-text b {
  display: block;
  font-family: var(--font-term);
  font-size: 21px;
  color: var(--ink);
  word-break: break-all;
}

.filecard-text span { font-size: 18px; color: var(--indigo); }

/* ── Progress bar ─────────────────────────────────────────────────────── */

.bar {
  margin-top: 12px;
  height: 20px;
  padding: 2px;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 rgba(82,94,167,.3);
}

/* Blocky segments, the way a 2001 installer filled up */
.bar-fill {
  height: 100%;
  width: 0;
  background:
    repeating-linear-gradient(90deg,
      var(--indigo) 0 10px, transparent 10px 13px);
  transition: width .18s linear;
}

/* ── Alert ────────────────────────────────────────────────────────────── */

.alert {
  background: #FFF1F5;
  border: 2px solid #C2255C;
  border-radius: 6px;
  padding: 12px;
}

.alert b {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #C2255C;
  display: block;
  margin-bottom: 8px;
}

.alert p { margin: 0; font-size: 19px; color: #4A2036; }

/* ── QR bezel ─────────────────────────────────────────────────────────── */

.bezel {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12px;
  background: var(--chrome);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow:
    inset 0 2px 0 #fff,
    inset 0 -3px 8px rgba(11,15,42,.35),
    0 0 26px rgba(95,172,211,.55);
}

#qr-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  /* Never let the browser smooth the modules: blurry edges break scanning */
  image-rendering: pixelated;
}

.qr-empty {
  text-align: center;
  color: #5A6489;
  font-size: 18px;
  padding: 10px;
}

.qr-empty span { display: block; font-size: 40px; color: #8E99B4; }
.qr-empty p { margin: 6px 0 0; text-transform: uppercase; letter-spacing: .05em; }

/* ── Skins ────────────────────────────────────────────────────────────── */

.skins {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.skin {
  width: 40px; height: 40px;
  padding: 0;
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 3px 0 rgba(11,15,42,.5);
  position: relative;
  overflow: hidden;
}

/* Each swatch previews its own pair: dot on backdrop */
.skin::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 2px;
  background: var(--dot);
}

.skin:hover { filter: brightness(1.08); }

.skin.is-on {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.skin:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.skin:disabled { opacity: .35; cursor: not-allowed; }

/* ── Status bar ───────────────────────────────────────────────────────── */

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  font-family: var(--font-pixel);
  font-size: 8px;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--chrome-soft);
  border: 1px solid rgba(11,15,42,.4);
  border-radius: 0 0 7px 7px;
  box-shadow: inset 1px 1px 0 #fff;
}

.statusbar-right { color: var(--indigo); }
.statusbar-right b { color: var(--ink); }

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 22px);
  z-index: 100;
  padding: 12px 18px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--ink);
  background: var(--irid);
  background-size: 250% 100%;
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 6px 0 rgba(11,15,42,.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .bg-grid, .titlebar, .tab.is-on, .toast { animation: none; }
  .caret { animation: none; }
  * { transition-duration: .01ms !important; }
}
