/* PHARMAICY backup page. Values mirror the app's WITHDRAWAL screen
   (app/terminal-theme.css): same colours, fonts, headline sweep, button
   glow and badge. Mobile first. */

@font-face {
  font-family: "W95F";
  src: url("fonts/W95F.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "Syne";
  src: url("fonts/Syne-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --fg: #ffffff;
  --glow: #ff4400;
  --hairline: rgba(255, 255, 255, 0.18);
  --rainbow: conic-gradient(from 0deg, #ff3b3b, #ff9f1c, #ffe135, #4ade80, #38bdf8, #a78bfa, #ff3b3b);
  --text-corner: 14.4px;
  --text-headline: 36px;
  --text-body: 20px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (min-width: 768px) {
  :root {
    --text-headline: 60px;
    --text-body: 26px;
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Syne", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-body);
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

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

/* Starfield sits behind everything. Fixed, one viewport, never intercepts taps. */
#field {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Corner furniture: fixed, no layout space, same as the app. */
.corner {
  position: fixed;
  top: 16px;
  z-index: 10;
  font-size: var(--text-corner);
  text-transform: uppercase;
  pointer-events: none;
}
.corner--tl { left: 16px; letter-spacing: 0.08em; }
.corner--tr {
  right: 16px;
  max-width: min(60vw, 14rem);
  font-size: 11.52px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-align: right;
  opacity: 0.9;
}
.corner--tr .hl { font-family: "W95F", monospace; }

.badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  width: 104px;
  height: 104px;
  color: var(--fg);
  opacity: 0.45;
  pointer-events: none;
  font-family: "W95F", monospace;
  animation: badge-spin 80s linear infinite;
}
@keyframes badge-spin { to { transform: rotate(360deg); } }

/* Content column. Top and bottom padding clear the fixed furniture. */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 104px 16px 140px;
}

.panel {
  width: 100%;
  max-width: 44rem;
  padding: 24px 20px 20px;
  /* No panel background: text sits straight on the starfield. The soft
     shadow keeps it readable when a bright star passes behind a letter. */
  text-shadow: 0 0 6px #000, 0 0 14px rgba(0, 0, 0, 0.9);
}
@media (min-width: 768px) {
  .page { justify-content: center; padding: 72px 32px 110px; }
  .panel { padding: 40px 56px 32px; }
  .foot { align-self: center; }
}

.headline {
  margin: 0 0 0.5em;
  font-family: "W95F", monospace;
  font-weight: normal;
  font-size: var(--text-headline);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: break-word;
  color: transparent;
  background-image: linear-gradient(100deg, var(--fg) 38%, var(--glow) 50%, var(--fg) 62%);
  background-repeat: repeat;
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sweep 5s linear infinite;
  /* text-shadow would show through the transparent gradient fill, so the
     headline uses a drop-shadow on the painted result instead. */
  text-shadow: none;
  filter: drop-shadow(0 0 6px #000) drop-shadow(0 0 14px rgba(0, 0, 0, 0.9));
}
@keyframes sweep {
  from { background-position: 0% 0; }
  to { background-position: -162.5% 0; }
}

.subline, .body { margin: 0 0 0.8em; }
.subline { color: rgba(255, 255, 255, 0.8); }
.instruction { margin-top: 1.2em; }

/* Download button: outlined, with the app's rainbow glow always on. */
.cta-wrap { margin: 1.6em 0 1em; }
.cta {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: 44px;
  max-width: 100%;
  padding: 14px 28px;
  border: 1px solid var(--hairline);
  color: var(--fg);
  background: transparent;
  font-family: inherit;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  touch-action: manipulation;
}
.cta::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 999px;
  background: var(--rainbow);
  filter: blur(20px);
  opacity: 0.5;
  animation: hue 10s linear infinite;
}
.cta:hover::before, .cta:active::before { opacity: 0.75; }
.cta:focus-visible, summary:focus-visible, .copy:focus-visible, pre:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
}
@keyframes hue { to { filter: blur(20px) hue-rotate(360deg); } }

.hint {
  margin: 0 0 1.4em;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
}

/* Expander */
.raw summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  cursor: pointer;
  font-size: var(--text-body);
  touch-action: manipulation;
}
.raw-body { padding-top: 12px; }
.raw pre {
  margin: 0 0 14px;
  max-height: 45vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--hairline);
  background: #050505;
  color: #e8e8e8;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-overflow-scrolling: touch;
}
.copy {
  min-height: 48px;
  min-width: 44px;
  padding: 10px 22px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  touch-action: manipulation;
}
.copy:active { background: rgba(255, 255, 255, 0.12); }
.copy[hidden] { display: none; }

.foot {
  /* Left on phones so the fixed badge (bottom right) never covers it. */
  align-self: flex-start;
  margin-top: 20px;
  padding: 2px 0;
  text-shadow: 0 0 6px #000, 0 0 14px rgba(0, 0, 0, 0.9);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Reduced motion: the badge slows (never freezes, same rule as the app),
   everything else stops. */
@media (prefers-reduced-motion: reduce) {
  .badge { animation-duration: 320s; }
  .headline { animation: none; -webkit-text-fill-color: var(--fg); color: var(--fg); background: none; }
  .cta::before { animation: none; }
}
