/* BeamMP web pages: the "Organic" design system from Claude Design, dark variant.
   Warm and rounded: Caprasimo headings over Figtree, a terracotta accent, a sage
   second voice, pill controls and over-rounded cards. Tokens first, then the shared
   components. Both login.html and uploader.html link this file. */

:root {
  color-scheme: dark;

  /* The light theme's cream becomes the text; the ground is a warm near-black */
  --color-bg: #1a1714;
  --color-surface: #25201b;
  --color-surface-2: #2f2923;
  --color-text: #f5ead8;
  --color-muted: color-mix(in srgb, var(--color-text) 62%, transparent);
  --color-faint: color-mix(in srgb, var(--color-text) 42%, transparent);
  --color-accent: #d67f48;     /* one step lighter than the light theme's base */
  --color-accent-2: #8fa073;
  --color-divider: color-mix(in srgb, var(--color-text) 14%, transparent);

  /* Tonal ramps (same values as the light theme). On a dark ground the light
     steps are text on tinted fills and the dark steps are the fills. */
  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;

  /* Status colors the system didn't need, kept warm to match */
  --color-danger: #e66a5e;
  --color-danger-text: #ffb4aa;
  --color-warn: #e3b154;
  --color-warn-text: #f5d79c;

  --font-heading: "Caprasimo", Georgia, serif;
  --font-heading-weight: 400;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-card: calc(var(--radius-lg) * 1.15);

  /* Elevation on a dark ground: a hairline edge plus ambient darkness */
  --shadow-sm: 0 0 0 1px color-mix(in srgb, var(--color-text) 5%, transparent), 0 1px 2px rgb(0 0 0 / .35);
  --shadow-md: 0 0 0 1px color-mix(in srgb, var(--color-text) 6%, transparent), 0 6px 18px rgb(0 0 0 / .38);
  --shadow-lg: 0 0 0 1px color-mix(in srgb, var(--color-text) 7%, transparent), 0 18px 44px rgb(0 0 0 / .5);
}

/* — base — */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--color-bg); }
body {
  margin: 0; min-height: 100vh;
  background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: clamp(32px, 6vw, 42px); }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-400); text-underline-offset: 3px; }
b, strong { font-weight: 700; }
.text-muted { color: var(--color-muted); }
.small { font-size: 13px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 35%, transparent); }
svg { display: block; flex: none; }
kbd {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--color-divider); border-bottom-width: 2px;
}

/* — brand mark — */
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--color-text); text-decoration: none;
  font-family: var(--font-heading); font-size: 19px; line-height: 1;
}
.mark {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-bg);
  box-shadow: 10px 0 0 -4px var(--color-accent-2);  /* a sage moon peeking out */
  margin-right: 8px;
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 15px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 10px calc(var(--space-3) * 1.4);
  border-radius: 999px;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:not(:disabled):hover { background: var(--color-accent-400); }
.btn-primary:not(:disabled):active { background: var(--color-accent-300); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:not(:disabled):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:not(:disabled):active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent-400); padding-inline: var(--space-2); }
.btn-ghost:not(:disabled):hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-ghost:not(:disabled):active { background: color-mix(in srgb, var(--color-accent) 20%, transparent); }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-block { width: 100%; }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 4px 12px; border-radius: 999px;
}
.tag b { font-weight: 700; }
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-200); }
.tag-accent-2 { background: var(--color-accent-2-800); color: var(--color-accent-2-200); }
.tag-neutral { background: var(--color-surface-2); color: var(--color-neutral-300); }
.tag-outline { border: 1px solid var(--color-divider); color: var(--color-muted); }
.tag-danger { background: color-mix(in srgb, var(--color-danger) 22%, transparent); color: var(--color-danger-text); }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tag-accent-2 .dot { background: var(--color-accent-2-400); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent-2-400) 25%, transparent); }

/* — forms — */
.field { display: block; }
.field + .field { margin-top: var(--space-4); }
.field > label, .field > .label {
  display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px 14px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.input {
  width: 100%; min-height: 44px; padding: 9px 18px; font: inherit;
  font-size: 15px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: 999px;
  transition: border-color .15s, background-color .15s;
}
.card .input { background: var(--color-bg); }
.input::placeholder { color: var(--color-faint); }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
select.input {
  width: auto; cursor: pointer; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5ead8' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}

.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: 999px;
}
.seg-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--color-text); background: transparent; border: 0;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt[aria-pressed="true"] { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not([aria-pressed="true"]):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:focus-visible { outline-offset: -2px; }
.seg-opt .count { font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-card); background: var(--color-surface);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — notices (results, warnings, errors) — */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: 22px; font-size: 14px;
}
.notice svg { margin-top: 1px; }
.notice .title { font-weight: 700; overflow-wrap: anywhere; }
.notice .detail { color: var(--color-muted); font-size: 13.5px; overflow-wrap: anywhere; }
.notice-action { display: inline-block; margin-top: 6px; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.notice-action:hover { text-decoration: underline; }
.notice.ok { background: color-mix(in srgb, var(--color-accent-2) 18%, transparent); }
.notice.ok svg { color: var(--color-accent-2-300); }
.notice.warn { background: color-mix(in srgb, var(--color-warn) 14%, transparent); }
.notice.warn svg { color: var(--color-warn); }
.notice.error { background: color-mix(in srgb, var(--color-danger) 16%, transparent); }
.notice.error svg { color: var(--color-danger); }
.notice.error .detail { color: var(--color-danger-text); }
.notice.info { background: var(--color-surface-2); }
.notice.info svg { color: var(--color-muted); }

/* — soft circles behind the page (decoration only) — */
.blobs { position: absolute; inset: 0 0 auto 0; height: 560px; overflow: hidden; pointer-events: none; z-index: 0; }
.blobs span { position: absolute; border-radius: 50%; }
.blobs .b1 { width: 460px; height: 460px; right: -140px; top: -210px; background: var(--color-accent-900); opacity: .55; }
.blobs .b2 { width: 230px; height: 230px; right: 230px; top: -120px; background: var(--color-accent-2-900); opacity: .75; }
.blobs .b3 { width: 18px; height: 18px; right: 210px; top: 150px; background: var(--color-accent); opacity: .7; }
.above-blobs { position: relative; z-index: 1; }
@media (max-width: 600px) {
  .blobs .b1 { width: 300px; height: 300px; right: -130px; top: -170px; }
  .blobs .b2 { width: 150px; height: 150px; right: 120px; top: -95px; }
  .blobs .b3 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
