/* Default (and `[data-style="shuttermark"][data-mode="dark"]`): the
   full neon "JARVIS" look. appearance.js sets `data-style`/`data-mode`
   on <html> from the per-device Style x Mode choice (Settings ->
   Appearance) before first paint; every other combination below
   overrides these same custom properties, so a component never
   branches on style/mode itself -- it just reads the token. */
:root {
  --void: #05080d;
  --glass: #0e1620;
  --glass-alpha: rgba(14, 22, 32, 0.6);
  --arc: #00e5ff;
  --golden: #ffb547;
  --blue-hour: #4d7cff;
  --astro: #a66bff;
  --signal: #ff4d5e;
  --ink: #e6fbff;
  --ink-dim: #8fa3ae;
  --font-ui: "Rajdhani", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: "Share Tech Mono", ui-monospace, monospace;
  --card-border: rgba(0, 229, 255, 0.18);
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 0 32px rgba(0, 229, 255, 0.06);
  --card-blur: blur(16px);
  --grid-opacity: 0.05;
  --btn-ink: #04131a;
  --input-bg: rgba(5, 8, 13, 0.6);
  --logo-glow: drop-shadow(0 0 16px rgba(0, 229, 255, 0.35));
  --focus-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
  --btn-shadow: 0 0 20px rgba(0, 229, 255, 0.35);
  --btn-shadow-hover: 0 0 28px rgba(0, 229, 255, 0.55);
  --btn-danger-shadow: 0 0 20px rgba(255, 77, 94, 0.3);
  --btn-danger-shadow-hover: 0 0 28px rgba(255, 77, 94, 0.5);
}

/* Shuttermark Light: a daylight variant of the same neon language --
   pale cool-gray background, frosted white glass, crisp outlines
   (a tight shadow, not a glow) instead of glow, and deeper accent
   shades chosen to meet WCAG AA contrast on a light background. */
:root[data-style="shuttermark"][data-mode="light"] {
  --void: #f4fafb;
  --glass: #ffffff;
  --glass-alpha: rgba(255, 255, 255, 0.72);
  --arc: #007a8c;
  --golden: #9a5b00;
  --blue-hour: #2b55d9;
  --astro: #6e3bd1;
  --signal: #c8243a;
  --ink: #0e1620;
  --ink-dim: #4f6773;
  --card-border: rgba(0, 122, 140, 0.35);
  --card-shadow: 0 1px 2px rgba(14, 22, 32, 0.08);
  --card-blur: blur(16px);
  --grid-opacity: 0.035;
  --btn-ink: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.6);
  --logo-glow: drop-shadow(0 0 10px rgba(0, 122, 140, 0.25));
  --focus-shadow: 0 0 0 3px rgba(0, 122, 140, 0.18);
  --btn-shadow: none;
  --btn-shadow-hover: none;
  --btn-danger-shadow: none;
  --btn-danger-shadow-hover: none;
}

/* Standard: system-ui/ui-monospace and flat native-app colors/materials
   instead of Rajdhani/Share Tech Mono and glass+glow -- CLAUDE.md's
   "looks like a native app" style, mirroring iOS's Standard tokens
   (systemBlue/systemOrange/etc.) as their nearest web equivalents. */
:root[data-style="standard"][data-mode="dark"] {
  --void: #000000;
  --glass: #1c1c1e;
  --glass-alpha: rgba(28, 28, 30, 0.92);
  --arc: #0a84ff;
  --golden: #ff9f0a;
  --blue-hour: #0a84ff;
  --astro: #bf5af2;
  --signal: #ff453a;
  --ink: #ffffff;
  --ink-dim: #98989d;
  /* Same as --font-ui, not a monospace stack: a Standard label reaches
     for font-variant-numeric: tabular-nums at the call site (.badge,
     .secret) when it needs digits to line up, rather than this token
     pulling SF Mono onto every label that uses it -- most of which
     aren't numeric at all. See docs/decisions.md. */
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: none;
  --card-blur: none;
  --grid-opacity: 0;
  --btn-ink: #ffffff;
  --input-bg: rgba(255, 255, 255, 0.08);
  --logo-glow: none;
  --focus-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
  --btn-shadow: none;
  --btn-shadow-hover: none;
  --btn-danger-shadow: none;
  --btn-danger-shadow-hover: none;
}

:root[data-style="standard"][data-mode="light"] {
  --void: #f2f2f7;
  --glass: #ffffff;
  --glass-alpha: rgba(255, 255, 255, 0.94);
  --arc: #007aff;
  --golden: #ff9500;
  --blue-hour: #007aff;
  --astro: #af52de;
  --signal: #ff3b30;
  --ink: #000000;
  --ink-dim: #6e6e73;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --card-border: rgba(0, 0, 0, 0.1);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  --card-blur: none;
  --grid-opacity: 0;
  --btn-ink: #ffffff;
  --input-bg: rgba(0, 0, 0, 0.04);
  --logo-glow: none;
  --focus-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
  --btn-shadow: none;
  --btn-shadow-hover: none;
  --btn-danger-shadow: none;
  --btn-danger-shadow-hover: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100%;
}

body {
  background-image:
    linear-gradient(color-mix(in srgb, var(--arc) calc(var(--grid-opacity) * 100%), transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--arc) calc(var(--grid-opacity) * 100%), transparent) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
}

a { color: var(--arc); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 28px;
  width: auto;
  filter: var(--logo-glow);
}

.nav-links { display: flex; gap: 20px; font-size: 15px; }
.nav-links a { color: var(--ink-dim); text-decoration: none; }
.nav-links a:hover { color: var(--arc); }

.card {
  background: var(--glass-alpha);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: var(--card-blur);
  box-shadow: var(--card-shadow);
  padding: 32px;
}

h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

h2 { font-size: 24px; margin: 0 0 12px; }

p.lede {
  color: var(--ink-dim);
  font-size: 17px;
  line-height: 1.6;
  max-width: 560px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  text-align: left;
}

.field label {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* Standard: sentence case, no tracking -- CLAUDE.md's Appearance
   system. Shuttermark keeps the small-caps data-readout look above;
   every rule here only resets what that rule set, nothing else. */
:root[data-style="standard"] .field label,
:root[data-style="standard"] .btn,
:root[data-style="standard"] .badge,
:root[data-style="standard"] .admin-table th {
  text-transform: none;
  letter-spacing: normal;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--arc);
  box-shadow: var(--focus-shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--arc);
  color: var(--btn-ink);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 10px;
  padding: 13px 22px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--btn-shadow);
}

.btn:hover { box-shadow: var(--btn-shadow-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--arc);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: none;
}

.form-row { width: 100%; }
form { width: 100%; max-width: 380px; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-shell .card { width: 100%; max-width: 420px; text-align: center; }
.auth-shell form { margin: 0 auto; text-align: left; }

.msg {
  font-size: 14px;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  display: none;
}

.msg.show { display: block; }
.msg.ok { background: rgba(0, 229, 255, 0.1); color: var(--arc); border: 1px solid rgba(0, 229, 255, 0.3); }
.msg.err { background: rgba(255, 77, 94, 0.1); color: var(--signal); border: 1px solid rgba(255, 77, 94, 0.3); }

.foot-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-dim);
}

footer {
  padding: 40px 0 60px;
  text-align: center;
  color: var(--ink-dim);
  font-size: 13px;
}

.prose {
  color: var(--ink-dim);
  line-height: 1.7;
  font-size: 15px;
}

.prose h2 { color: var(--ink); margin-top: 32px; }
.prose a { color: var(--arc); }

.badge {
  display: inline-block;
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--arc);
}

@media (prefers-reduced-transparency: reduce) {
  .card {
    background: var(--glass);
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---- signed-in shell (shell.js renders this into #shell) ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.14);
}

.topbar .brand img { height: 24px; }

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  margin-left: auto;
}

.topbar-nav { display: flex; gap: 20px; flex: 1; }
.topbar-nav a { color: var(--ink-dim); text-decoration: none; font-size: 15px; }
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav a.active { color: var(--arc); border-bottom: 2px solid var(--arc); padding-bottom: 2px; }

.topbar-account { position: relative; }
.topbar-account-btn {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
}
.topbar-account-btn:hover { color: var(--ink); }

.topbar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--glass);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 20;
}
.topbar-menu a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
}
.topbar-menu a:hover { background: rgba(0, 229, 255, 0.1); }

@media (max-width: 720px) {
  .topbar-toggle { display: block; }
  .topbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--glass);
    border-bottom: 1px solid rgba(0, 229, 255, 0.14);
    padding: 8px 20px;
    z-index: 15;
  }
  .topbar-nav a { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
  .topbar.open { position: relative; }
  .topbar.open .topbar-nav { display: flex; }
}

.app-wrap { max-width: 860px; margin: 0 auto; padding: 32px 20px 80px; }

.coming-soon {
  text-align: center;
  padding: 100px 20px;
  color: var(--ink-dim);
}
.coming-soon h1 { color: var(--ink); }

/* ---- settings ---- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.settings-tile {
  display: block;
  text-decoration: none;
  background: var(--glass-alpha);
  border: 1px solid rgba(0, 229, 255, 0.14);
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.settings-tile:hover { border-color: rgba(0, 229, 255, 0.4); }
.settings-tile.active { border-color: var(--arc); box-shadow: 0 0 0 1px var(--arc); }
.settings-tile .sub { display: block; color: var(--ink-dim); font-weight: 400; font-size: 12px; margin-top: 2px; }

/* ---- admin ---- */

.admin-subnav { display: flex; gap: 16px; margin-bottom: 20px; font-size: 14px; }
.admin-subnav a { color: var(--ink-dim); text-decoration: none; padding-bottom: 4px; }
.admin-subnav a.active { color: var(--arc); border-bottom: 2px solid var(--arc); }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.admin-table th {
  text-align: left;
  color: var(--ink-dim);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
}
.admin-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--signal); box-shadow: var(--btn-danger-shadow); }
.btn-danger:hover { box-shadow: var(--btn-danger-shadow-hover); }

.qr-box { background: #fff; display: inline-block; padding: 12px; border-radius: 8px; margin: 16px 0; }
.qr-box img { display: block; width: 180px; height: 180px; }
.secret { font-family: var(--font-data); font-variant-numeric: tabular-nums; color: var(--ink-dim); word-break: break-all; }
