/* edocrq brand stylesheet — single source of truth for tokens, fonts, and
   base styles shared across every page in public/.

   See docs/brand-marks.md for visual rules. Update tokens here, not in
   individual HTML files.
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=DM+Serif+Display:ital@1&family=Syne:wght@700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand palette */
  --brand: #FF2D87;          /* primary CTA, links, accents */
  --brand-hover: #E91E78;    /* darker pink on hover */
  --brand-soft: #FF8FB8;     /* decorative shadow / secondary accent */
  --brand-tint: #FFF0F6;     /* very faint pink for hover surfaces, badges */
  --brand-ink: #B30E5B;      /* deep pink for text on tint surfaces */

  /* Neutrals */
  --ink: #1A1A1A;            /* primary text */
  --paper: #FFFFFF;          /* page background */
  --surface: #FFFFFF;        /* card / panel surface */
  --surface-2: #FAFAFA;      /* subtle elevation */
  --muted: #6B6B6B;          /* secondary text */
  --subtle: #9A9A9A;         /* tertiary / placeholder text */

  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* Status */
  --success: #16A34A;
  --danger: #DC2626;

  /* Semantic aliases — older code uses these names, keep them working. */
  --bg: var(--paper);
  --text: var(--ink);
  --text-muted: var(--muted);

  /* The brand is hot-pink-on-pure-white by definition, and every page paints
     hardcoded white surfaces. Pin the scheme to light so OS dark mode can't
     flip text tokens to white and leave white-on-white. A true dark theme
     would require dark surfaces on every page — out of scope for the brand. */
  color-scheme: light;

  /* Elevation — layered, low-spread shadows read more crafted than a single
     blurry drop. The brand shadow is the signature "offset pink" lift. */
  --shadow-sm: 0 1px 2px rgba(16, 17, 19, .04), 0 2px 8px rgba(16, 17, 19, .05);
  --shadow-md: 0 2px 4px rgba(16, 17, 19, .04), 0 12px 28px rgba(16, 17, 19, .08);
  --shadow-lg: 0 4px 8px rgba(16, 17, 19, .04), 0 30px 70px rgba(16, 17, 19, .14);
  --shadow-brand: 0 10px 30px rgba(255, 45, 135, .26);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Type stack */
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Syne', 'Inter', sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

/* (Dark-mode token overrides intentionally removed — see color-scheme note
   above. Pages hardcode white surfaces, so flipping text to white produced
   white-on-white. The palette stays light on every OS setting.) */

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }

html { -webkit-text-size-adjust: 100% }
html, body { height: 100% }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
}

/* Pink text selection — a small brand touch that shows up everywhere. */
::selection { background: var(--brand); color: #FFFFFF }

/* Nav */
nav {
  display: flex;
  align-items: center;
  padding: 16px 28px;
  gap: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -.03em;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  transition: opacity .15s;
}
.logo:hover { opacity: .82 }
/* The wordmark is "qr code" spelled backwards: edoc→code, rq→qr. Tinting the
   "rq" pink lets people decode the joke. */
.logo .rq { color: var(--brand) }

.logo::before {
  content: "";
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: #FFFFFF url("assets/brand/brand-mark.svg") top center / 30px auto no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 45, 135, 0.22), var(--shadow-sm);
}

/* Brand mark (QR + wordmark + tagline lockup). The SVG is inlined into
   pages by scripts/build-brand-marks.js so the wordmark <text> inherits
   Syne / DM Sans from the page (an <img>-loaded SVG is sandboxed and
   falls back to system sans). Used on the homepage hero and auth pages
   — anywhere we want the full identity rather than just the inline
   wordmark. The container holds the inline SVG; the SVG fills it. */
.brand-mark {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
}
.brand-mark.sm { max-width: 180px }
.brand-mark.lg { max-width: 300px }
.brand-mark > svg { display: block; width: 100%; height: auto }

nav .spacer { flex: 1 }

nav #nav-guest,
nav #nav-user {
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

nav #nav-guest { display: flex }

nav a.navlink {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-weight: 500;
  transition: color .15s, background .15s;
}
nav a.navlink:hover { color: var(--ink); background: var(--surface-2) }

nav a.outline {
  border: 1.5px solid var(--border-strong);
  padding: 8px 17px;
  border-radius: var(--r-pill);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
nav a.outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-tint);
}

@media (max-width: 520px) {
  nav {
    padding: 16px 18px;
    gap: 8px;
  }

  .logo {
    font-size: 20px;
    letter-spacing: -.02em;
  }

  nav a.navlink {
    font-size: 13px;
    padding: 7px 9px;
  }

  nav a.outline {
    font-size: 13px;
    padding: 7px 13px;
  }
}

/* Buttons */
button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .08s;
}
button:active, .btn:active { transform: translateY(1px) }

button.primary, .btn.primary {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}
button.primary:hover:not(:disabled),
.btn.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(255, 45, 135, .34);
}
button.primary:active:not(:disabled),
.btn.primary:active:not(:disabled) { transform: translateY(0) }
button.primary:disabled, .btn.primary:disabled {
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
button.secondary:hover:not(:disabled),
.btn.secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface-2);
}
button.secondary:disabled, .btn.secondary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

button.danger, .btn.danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}
button.danger:hover:not(:disabled),
.btn.danger:hover:not(:disabled) {
  background: #B91C1C;
  border-color: #B91C1C;
}

/* Links — a brand underline that grows in on hover. */
a {
  color: var(--brand);
  text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent);
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-hover) }

/* Footer */
footer {
  padding: 24px 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
footer .links { margin-top: 6px }
footer a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 10px;
}
footer a:hover { color: var(--ink) }

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Page-load reveal — opt-in with class="reveal" (and optional inline
   animation-delay for staggering). Respects reduced-motion. */
@keyframes brand-rise {
  from { opacity: 0; transform: translateY(14px) }
  to   { opacity: 1; transform: translateY(0) }
}
.reveal {
  animation: brand-rise .6s cubic-bezier(.22, .61, .36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
