/* ==========================================================================
   VENHYIA — app.css
   The shared design layer. Every page uses this file; nothing defines its own
   colours, spacing or type. Served fingerprinted via keel's serve_assets, so
   it is cached forever and invalidated the instant it changes.

   DIRECTION
   Built for Ghanaian churches, schools and small businesses: mostly phones,
   often metered data, often bright daylight. The competition is corporate and
   cold — the opening is warm, human and confident.

   Two surfaces, on purpose:
     • LIGHT and warm everywhere outside a call — approachable, readable in
       sunlight, feels fast.
     • DARK inside the call only — video genuinely looks better against dark,
       and it makes entering a call feel like entering a room.

   NO WEB FONTS on any page. ~150KB before a single video frame is real money
   on metered mobile data. Character comes from weight, tracking and scale.
   ========================================================================== */

/* --------------------------------------------------------------------------
   TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --gold: #F2B705;          /* the ONE action colour */
  --gold-deep: #D99F04;
  --gold-ink: #1A1400;      /* text on gold */
  --teal: #0F8B8D;          /* live / speaking ONLY — never decoration */
  --clay: #C2410C;          /* destructive ONLY */

  /* Light surface */
  --bone: #FBF9F5;          /* page background, warm not stark */
  --card: #FFFFFF;
  --ink: #12141A;           /* primary text */
  --ink-2: #4A515E;         /* secondary text */
  --ink-3: #767F8E;         /* muted / hints */
  --rule: #E6E1D8;          /* borders on light */
  --rule-2: #F0ECE4;        /* subtle dividers */

  /* Dark surface (call stage) */
  --stage: #101319;
  --stage-2: #181C25;       /* raised panels */
  --stage-edge: #262C38;
  --stage-text: #EEF1F5;
  --stage-mute: #8E99A8;

  /* Spacing — 8px scale, no arbitrary values anywhere */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii + shadow */
  --r1: 8px; --r2: 12px; --r3: 16px; --r-pill: 100px;
  --shadow-1: 0 1px 2px rgba(18,20,26,.06), 0 1px 3px rgba(18,20,26,.08);
  --shadow-2: 0 4px 12px rgba(18,20,26,.08), 0 2px 4px rgba(18,20,26,.06);
  --shadow-3: 0 12px 32px rgba(18,20,26,.14);

  --tap: 44px;              /* minimum touch target */
}

/* --------------------------------------------------------------------------
   RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bone);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); font-size: 14px; text-decoration: none;
  padding: var(--s2) 0;
}
.backlink:hover { color: var(--ink); }
a:hover { text-decoration-color: var(--ink); }

/* One focus style everywhere. Keyboard users are not an edge case. */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--r1); }
:focus:not(:focus-visible) { outline: none; }

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

/* --------------------------------------------------------------------------
   TYPE SCALE
   -------------------------------------------------------------------------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: clamp(22px, 3.5vw, 28px); }
h3 { font-size: 18px; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--ink-2); }
.small { font-size: 14px; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }

/* The utility voice: wide, small, uppercase. Used for labels and eyebrows. */
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.wrap { width: 100%; max-width: 960px; margin-inline: auto; padding-inline: var(--s4); }
.wrap-narrow { max-width: 440px; }
.stack > * + * { margin-top: var(--s4); }
.stack-tight > * + * { margin-top: var(--s2); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.grow { flex: 1 1 auto; min-width: 0; }
.center-page { flex: 1 1 auto; display: grid; place-items: center; padding-block: var(--s7); }

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */
.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  padding-block: var(--s3);
}
.brand {
  font-size: 15px; font-weight: 750; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
}
.brand span { color: var(--gold-deep); }

/* --------------------------------------------------------------------------
   THE SIGNATURE — woven mark
   Drawn from the GRID LOGIC of kente weaving: interlocking warp and weft, not a
   literal print. Used sparingly (empty states, lobby, post-call) so it reads as
   a mark of origin rather than decoration.
   -------------------------------------------------------------------------- */
.weave {
  background-image:
    repeating-linear-gradient(90deg,  var(--rule-2) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(0deg,   var(--rule-2) 0 2px, transparent 2px 14px);
  background-color: var(--card);
}
.weave-gold {
  background-image:
    repeating-linear-gradient(90deg, rgba(242,183,5,.16) 0 3px, transparent 3px 16px),
    repeating-linear-gradient(0deg,  rgba(242,183,5,.16) 0 3px, transparent 3px 16px);
}

/* --------------------------------------------------------------------------
   CARD / PANEL
   -------------------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r3); padding: var(--s5); box-shadow: var(--shadow-1);
}
.card-flush { padding: 0; overflow: hidden; }
.panel { border: 1px solid var(--rule); border-radius: var(--r2); padding: var(--s4); background: var(--card); }

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 0 var(--s5);
  border: 1px solid transparent; border-radius: var(--r2);
  background: var(--gold); color: var(--gold-ink);
  font-size: 16px; font-weight: 650; text-decoration: none;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-1);
}
.btn:hover { background: var(--gold-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { display: flex; width: 100%; }

.btn-quiet { background: var(--card); color: var(--ink); border-color: var(--rule); box-shadow: none; }
.btn-quiet:hover { background: var(--bone); border-color: var(--ink-3); }

.btn-danger { background: var(--clay); color: #fff; }
.btn-danger:hover { background: #A5350A; }

.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); padding-inline: var(--s3); }
.btn-ghost:hover { background: var(--rule-2); color: var(--ink); }

.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 14px; border-radius: var(--r1); }

/* --------------------------------------------------------------------------
   FORMS
   -------------------------------------------------------------------------- */
.field { display: block; }
.field > .eyebrow { display: block; margin-bottom: var(--s2); }
.input {
  width: 100%; min-height: var(--tap); padding: var(--s3) var(--s4);
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--r2); font-size: 16px; /* 16px: stops iOS zooming on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,183,5,.18); outline: none; }
.input-mono { font-family: var(--mono); letter-spacing: .12em; text-transform: lowercase; }
.field-error { color: var(--clay); font-size: 14px; margin-top: var(--s2); }
.input-invalid { border-color: var(--clay); }

/* --------------------------------------------------------------------------
   NOTICES / BADGES
   -------------------------------------------------------------------------- */
.notice {
  border: 1px solid var(--rule); border-left: 3px solid var(--gold);
  background: var(--card); border-radius: var(--r2);
  padding: var(--s3) var(--s4); font-size: 15px;
}
.notice-bad { border-left-color: var(--clay); }
.notice-good { border-left-color: var(--teal); }

.badge {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px var(--s2); border-radius: var(--r1);
  background: var(--rule-2); color: var(--ink-2);
}
.badge-host { background: rgba(242,183,5,.18); color: #7A5B00; }
.badge-live { background: rgba(15,139,141,.14); color: var(--teal); }

/* Initials avatar — used wherever a camera is off or a face is unavailable. */
.avatar {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--bone);
  font-size: 15px; font-weight: 650; letter-spacing: .02em;
}
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }

/* --------------------------------------------------------------------------
   LISTS (meetings)
   -------------------------------------------------------------------------- */
.list { list-style: none; padding: 0; }
.list > li + li { border-top: 1px solid var(--rule-2); }
.list-item { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); }
.list-item:hover { background: var(--bone); }

/* --------------------------------------------------------------------------
   EMPTY STATE
   -------------------------------------------------------------------------- */
.empty { text-align: center; padding: var(--s7) var(--s4); border-radius: var(--r3); }
.empty h3 { margin-bottom: var(--s2); }
.empty p { color: var(--ink-2); max-width: 42ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-foot {
  margin-top: auto; border-top: 1px solid var(--rule);
  padding-block: var(--s5); color: var(--ink-3); font-size: 14px;
}

/* --------------------------------------------------------------------------
   UTILITIES — deliberately few. Components carry the weight, not utilities.
   -------------------------------------------------------------------------- */
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .row-stack-sm { flex-direction: column; align-items: stretch; }
  .card { padding: var(--s4); }
}

/* --------------------------------------------------------------------------
   LOBBY — camera preview, level meter, device pickers
   -------------------------------------------------------------------------- */
.preview {
  position: relative; aspect-ratio: 4/3; background: var(--stage);
  border-radius: var(--r2); overflow: hidden; border: 1px solid var(--rule);
}
.preview video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);           /* a preview is a MIRROR; unmirrored feels wrong */
}
.preview-off {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--stage-mute); text-align: center;
}

/* The level meter earns its place: a microphone that is open but captures
   nothing looks exactly like a working one until someone says they cannot hear
   you. On this project that has cost entire evenings. */
.meter {
  height: 6px; border-radius: var(--r-pill); background: var(--rule-2); overflow: hidden;
}
.meter-fill {
  height: 100%; width: 0%; background: var(--teal);
  border-radius: var(--r-pill); transition: width .08s linear;
}

.devices {
  margin: var(--s4) 0;
  padding: var(--s4);
  background: var(--card-2, rgba(255,255,255,.02));
  border: 1px solid var(--rule);
  border-radius: var(--r2);
}
.devices-head {
  color: var(--ink-2); font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--s2);
}

/* Selects must LOOK like dropdowns. Stripping the native arrow (appearance:none)
   made them read as inert text boxes — users did not know to click. Draw a clear
   chevron and use a pointer cursor so it is obviously a dropdown. */
select.select, select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer;
  padding-right: calc(var(--s4) + 20px);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position:
    right calc(var(--s4) + 4px) center,
    right var(--s4) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select.select:focus, select.input:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
}
.is-copied { color: var(--teal) !important; }
