/* ============================================================================
 * Copious Secrets — matches copiousit.com
 * Palette and typeface mirror /js/tailwind-config.js and /css/base.css on the
 * main site so the two properties read as one brand. Keep these values in sync
 * if the main site palette changes.
 * ========================================================================= */

:root {
  /* Backgrounds */
  --ink: #020617;        /* page background, near-black navy */
  --ink-2: #0f172a;      /* deeper panel / raised surface */

  /* Brand cyan scale */
  --brand-50: #e6f7fc;
  --brand-100: #b3e8f7;
  --brand-200: #80d9f1;
  --brand-300: #4dcaec;
  --brand-400: #1abbe6;
  --brand-500: #00b7e3;  /* PRIMARY */
  --brand-600: #009abf;
  --brand-700: #007d9b;
  --brand-800: #006077;
  --brand-900: #004353;
  --brand-950: #00262f;

  /* Secondary accent */
  --accent: #dfba5c;
  --accent-glow: rgba(223, 186, 92, 0.15);

  /* Text */
  --text: #d7dee9;
  --text-bright: #ffffff;
  --muted: #64748b;

  /* Surfaces / borders */
  --panel: rgba(51, 65, 85, 0.5);
  --panel-soft: rgba(30, 41, 59, 0.5);
  --border: rgba(51, 65, 85, 0.5);

  /* Brand effects */
  --brand-glow: rgba(0, 183, 227, 0.15);
  --brand-ring: rgba(0, 183, 227, 0.3);

  --radius: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 64px;
  position: relative;
}

/* Ambient brand glow, echoing the hero orbs on the main site */
body::before {
  content: "";
  position: fixed;
  top: -10%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.wrap { width: 100%; max-width: 640px; position: relative; z-index: 1; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  /* Align the brand with the card's inner edge (card padding is 26px). */
  padding: 0 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text-bright);
}

.brand img {
  /* The wordmark is baked into the artwork, so it needs to be large enough to
     read. Sized against the 247x190 source aspect ratio. */
  height: 56px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.brand .sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  line-height: 1.3;
}

.who { font-size: 12.5px; color: var(--muted); text-align: right; }
.who strong { color: var(--text); font-weight: 600; }
.who a { color: var(--brand-400); text-decoration: none; font-weight: 600; }

/* Signed-out call to action: brand cyan outline, matching the ghost buttons. */
.signin {
  display: inline-block;
  border: 1px solid var(--brand-500);
  color: var(--brand-400) !important;
  background: transparent;
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.signin:hover {
  background: var(--brand-glow);
  color: var(--brand-300) !important;
  box-shadow: 0 0 20px var(--brand-ring);
}
.who a:hover { color: var(--brand-300); }

.card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

/* Keep prose within a comfortable measure on wide viewports. */
.card .sub,
.advice,
.errornote,
.warning-body {
  max-width: 62ch;
}

h1 {
  font-size: 21px;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.sub { color: #9aa6b8; font-size: 13.5px; margin: 0 0 22px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-300);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

textarea, input, select {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid var(--panel);
  color: var(--text-bright);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

/* Placeholders carry real instruction here, so keep them above 4.5:1
   against the input background rather than at the muted floor. */
textarea::placeholder, input::placeholder { color: #94a3b8; opacity: 1; }

textarea:focus, input:focus, select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.row { display: flex; gap: 14px; margin-top: 16px; }
.row > div { flex: 1; }

button {
  background: var(--brand-500);
  color: #02121a;
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

button:hover {
  background: var(--brand-400);
  box-shadow: 0 0 24px var(--brand-ring);
}

button:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

button.ghost {
  background: transparent;
  border: 1px solid var(--brand-500);
  color: var(--brand-400);
  font-weight: 600;
}
button.ghost:hover { background: var(--brand-glow); color: var(--brand-300); }

.actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

.msg {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  display: none;
}
.msg.show { display: block; }
.msg.err {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.msg.ok {
  background: var(--accent-glow);
  border: 1px solid rgba(223, 186, 92, 0.4);
  color: var(--accent);
}

.secretbox {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--brand-900);
  border-left: 3px solid var(--brand-500);
  border-radius: 10px;
  padding: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text-bright);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow: auto;
}

.linkrow { display: flex; gap: 8px; margin-top: 14px; }
.linkrow input { font-size: 12.5px; font-family: ui-monospace, monospace; }
.linkrow button { flex: 0 0 auto; }

.meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 14px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.center { text-align: center; }
.big { font-size: 18px; margin-bottom: 8px; }

footer {
  text-align: center;
  font-size: 12px;
  /* Muted (#64748b) sits under 4.5:1 on this ink background; this clears it. */
  color: #94a3b8;
  margin-top: 26px;
}
footer a { color: var(--brand-400); text-decoration: none; }
footer a:hover { color: var(--brand-300); }

/* ---------------------------------------------------------------------------
   Narrow viewports. The logo wordmark is baked into the artwork, so the header
   has to stack rather than shrink or the sign-in button gets pushed off-screen.
   ------------------------------------------------------------------------- */
@media (max-width: 560px) {
  body { padding: 20px 12px 48px; }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .brand img { height: 44px; }
  .brand { font-size: 15px; }

  .who { text-align: left; }

  .card { padding: 20px 16px; }

  h1 { font-size: 18px; }

  /* Expiry / max-views pair goes single column so neither field is clipped. */
  .row { flex-direction: column; gap: 12px; }
  .row > div { flex: none; width: 100%; }

  .linkrow { flex-direction: column; }
  .linkrow button { width: 100%; }

  .actions { flex-wrap: wrap; }
  .actions button { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .brand img { height: 38px; }
  .brand .sub { display: none; }
}

/* Footer separator shouldn't dangle at a line end on narrow screens. */
@media (max-width: 560px) {
  footer .sep { display: none; }
  footer a { display: block; margin-top: 4px; }
}

/* ---------------------------------------------------------------------------
   Reveal page states: terminal errors and the last-view warning.
   These carry the message when a link is dead, so they get real visual weight
   rather than being buried as grey helper text.
   ------------------------------------------------------------------------- */

.state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.state-icon svg { width: 24px; height: 24px; }

.state-icon.dead {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.state-icon.warn {
  background: rgba(223, 186, 92, 0.12);
  color: var(--accent);
}

.state-icon.ok {
  background: rgba(0, 183, 227, 0.12);
  color: var(--brand-400);
}

/* Next-step guidance under a terminal error */
.advice {
  font-size: 13.5px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--panel);
  border-left: 3px solid var(--brand-600);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 4px;
  line-height: 1.55;
}

/* Secondary explanation under a terminal error, e.g. who else could have
   opened the link. Quiet, but readable. */
.errornote {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.6;
  margin: -2px 0 4px;
}

/* Last-view warning, shown before the reveal button */
.warning {
  background: rgba(223, 186, 92, 0.08);
  border: 1px solid rgba(223, 186, 92, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 20px;
}

.warning.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.warning-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.warning.danger .warning-title { color: #fca5a5; }

.warning-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 6px;
}

.warning-body:last-child { margin-bottom: 0; }

.warning-body.strong {
  color: var(--text-bright);
  font-weight: 600;
}
