/*
 * File:    public/assets/styles.css
 * Version: v1.1.2
 * Date:    2026-06-04
 * Changes: v1.1.2 — Added .live-list / .live-card for the public
 *                    landing's "Live now" section, plus a pulsing
 *                    @keyframes for the section header dot.
 *          v1.1.1 — Added .org-card / .app-chip pattern so the
 *                    personal dashboard can render app shortcuts
 *                    inline under each org without an extra click.
 *          v1.0.0 — Initial release — platform shell aesthetic.
 *
 * Design intent: stoic.fit is the calm container. Apps inside it
 * (Atlas Scoring etc.) bring their own loud personalities. The
 * platform itself reads as a thoughtful publication: serif display
 * type, generous whitespace, cream-on-ink palette, a single narrow
 * accent line that ties everything together.
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,700;9..144,900&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink:        #14110d;
  --ink-2:      #1f1b15;
  --ink-3:      #2a251d;
  --paper:      #f5efe3;
  --paper-2:    #ebe3d1;
  --paper-dim:  #c9bfa9;
  --rule:       #3a3328;
  --accent:     #d4541f;     /* burnt vermilion — restrained but warm */
  --accent-2:   #e8a87c;
  --muted:      #8a7f6c;
  --good:       #4f7a3a;
  --bad:        #b53a2e;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--paper);
  background: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — just enough to kill the dead-flat black */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Display type ─────────────────────────────────────────────── */
.display, h1, h2, h3 {
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-feature-settings: 'ss01', 'ss02';
  letter-spacing: -0.01em;
  font-weight: 500;
}
h1 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.0; font-weight: 700; }
h2 { font-size: 1.85rem; line-height: 1.1; }
h3 { font-size: 1.25rem; line-height: 1.2; }

/* ── Layout shell ─────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 2rem 6rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--paper);
}
.brand .dot {
  width: 0.42rem; height: 0.42rem; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin: 0 0.05rem 0.18rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
}
.topbar nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.92rem;
}
.topbar nav a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.topbar nav a:hover { color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  margin: 5rem 0 7rem;
  position: relative;
}
.hero .eyebrow {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: inline-block;
}
.hero .lede {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--paper-2);
  max-width: 38rem;
  margin-top: 1.8rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

/* ── Section rule ─────────────────────────────────────────────── */
.section-rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 5rem 0 2rem;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  color: var(--muted);
}
.section-rule::before,
.section-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── Apps grid ────────────────────────────────────────────────── */
.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.app-card {
  border: 1px solid var(--rule);
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--ink-2);
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none;
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
}
.app-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.app-card .tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.app-card h3 { color: var(--paper); }
.app-card .desc {
  color: var(--paper-dim);
  font-size: 0.93rem;
}
.app-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.app-card .status {
  position: absolute; top: 1rem; right: 1.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.app-card.live .status { color: var(--good); }

/* ── Forms (login etc.) ───────────────────────────────────────── */
.card {
  max-width: 26rem;
  margin: 6rem auto;
  padding: 2.5rem 2.5rem 2rem;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--accent);
}
.card h2 { margin-bottom: 0.4rem; }
.card .sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.4rem;
  margin-top: 1.2rem;
}
input[type=text], input[type=password], input[type=email] {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--ink);
  border: 1px solid var(--rule);
  color: var(--paper);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: border-color 0.15s;
}
input:focus {
  outline: none;
  border-color: var(--accent);
}

button, .btn {
  display: inline-block;
  margin-top: 1.8rem;
  padding: 0.8rem 1.4rem;
  background: var(--accent);
  color: var(--paper);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}
button:hover, .btn:hover { background: #b8451a; }
button:active, .btn:active { transform: translateY(1px); }
button.full { display: block; width: 100%; }
button.ghost {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--paper-2);
}
button.ghost:hover { border-color: var(--accent); background: var(--ink-3); }

.error {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  background: rgba(181, 58, 46, 0.15);
  border-left: 3px solid var(--bad);
  color: var(--paper-2);
  font-size: 0.9rem;
  display: none;
}
.error.visible { display: block; }

/* ── Strength meter ───────────────────────────────────────────── */
.meter {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--ink);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.meter > span {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--bad);
  transition: width 0.2s, background 0.2s;
}
.meter > span[data-score="2"] { background: #d18a3a; }
.meter > span[data-score="3"] { background: #c9a23a; }
.meter > span[data-score="4"] { background: var(--good); }
.meter-label {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1em;
}
.meter-label.bad  { color: var(--bad); }
.meter-label.good { color: var(--good); }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  margin-top: 6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ── Live-now list (public landing) ────────────────────────────
   A small list of active competitions across opted-in orgs. Each
   entry is a single clickable bar — competition name as headline,
   org name + current event below, "Watch live →" on the right. */
.live-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.live-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--rule);
  background: var(--ink-2);
  text-decoration: none;
  color: var(--paper);
  transition: border-color 0.15s, transform 0.05s;
}
.live-card:hover { border-color: var(--accent); }
.live-card:active { transform: translateY(1px); }
.live-card .live-title {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.live-card .live-meta {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--paper-dim);
}
.live-card .live-arrow {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0     rgba(212, 84, 31, 0.55); }
  70%  { box-shadow: 0 0 0 0.55rem rgba(212, 84, 31, 0); }
  100% { box-shadow: 0 0 0 0     rgba(212, 84, 31, 0); }
}

/* ── Org dashboard list ───────────────────────────────────────── */
.orgs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Each org renders as a card: header row (name + role link) plus a
   row of app chips beneath. Clicking the header navigates to the org
   dashboard; clicking a chip jumps straight into that app. */
.org-card {
  border: 1px solid var(--rule);
  background: var(--ink-2);
  transition: border-color 0.15s;
}
.org-card:hover { border-color: var(--accent); }

.org-card .org-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--paper);
}
.org-card .org-head .org-slug {
  color: var(--muted);
  font-size: 0.9rem;
  margin-left: 0.4rem;
}
.org-card .role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.org-apps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.2rem 1rem;
}
.org-apps .empty {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--paper-2);
  font-size: 0.85rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.app-chip:hover {
  border-color: var(--accent);
  color: var(--paper);
  background: var(--ink-3);
}
.app-chip .arrow {
  font-size: 0.75rem;
  color: var(--muted);
}
.app-chip:hover .arrow { color: var(--accent); }

/* Backward-compat: keep the old .orgs-list a styling for any page
   that hasn't been migrated to the card pattern yet. */
.orgs-list > a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  background: var(--ink-2);
  text-decoration: none;
  color: var(--paper);
  transition: border-color 0.15s;
}
.orgs-list > a:hover { border-color: var(--accent); }
.orgs-list .role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

@media (max-width: 600px) {
  .shell { padding: 1.2rem 1.2rem 4rem; }
  .topbar { margin-bottom: 2.5rem; }
  .topbar nav { gap: 1rem; font-size: 0.85rem; }
  .hero { margin: 2.5rem 0 4rem; }
  .card { margin: 2rem auto; padding: 2rem 1.6rem 1.6rem; }
}
