/* Concrete Motorsports house style (CMS_STYLE_GUIDE.md; Tire Tracker is the
   reference implementation). Every color goes through a token so all three
   theme modes (Auto / Light / Dark) stay correct. */
:root {
  --bg: #F1EFEA;
  --surface: #FFFFFF;
  --surface-2: #E9E7E1;
  --text: #17171A;
  --text-muted: #68666B;
  --accent: #C8102E;
  --accent-text: #FFFFFF;
  --accent-2: #55606B;
  --warn: #8F6109;
  --danger: #7A1620;
  --border: #D8D5CE;
  --shadow: rgba(20, 20, 20, 0.08);
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Work Sans', system-ui, -apple-system, sans-serif;
  /* logo.svg is 1440x510 */
  --logo-ratio: 2.8235;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --surface: #1D1D1D;
    --surface-2: #262626;
    --text: #F1EFEA;
    --text-muted: #A3A3A3;
    --accent: #E01E36;
    --accent-text: #FFFFFF;
    --accent-2: #9AA3AC;
    --warn: #D9A441;
    --danger: #E2574C;
    --border: #3A3A3A;
    --shadow: rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141414;
  --surface: #1D1D1D;
  --surface-2: #262626;
  --text: #F1EFEA;
  --text-muted: #A3A3A3;
  --accent: #E01E36;
  --accent-text: #FFFFFF;
  --accent-2: #9AA3AC;
  --warn: #D9A441;
  --danger: #E2574C;
  --border: #3A3A3A;
  --shadow: rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 16px 20px 80px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Top bar: theme control ---- */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }


.theme-seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); overflow: hidden;
}
.theme-seg button {
  border: none; background: transparent; color: var(--text-muted);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  padding: 6px 11px; min-height: 36px; cursor: pointer;
  border-right: 1px solid var(--border);
}
.theme-seg a {
  color: var(--text-muted); font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  padding: 6px 11px; min-height: 36px; display: inline-flex; align-items: center;
  text-decoration: none; border-right: 1px solid var(--border);
}
.theme-seg a:last-child { border-right: none; }
.theme-seg a:hover { color: var(--text); }
.theme-seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.theme-seg button:last-child { border-right: none; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button.active { background: var(--accent); color: var(--accent-text); }
.theme-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- Hero: the logo, centered ---- */
.hero {
  display: flex; align-items: center; justify-content: center;
  margin: 24px 0 40px;
}
.hero h1 { margin: 0; width: 100%; display: flex; justify-content: center; }
.hero-logo {
  display: block; height: auto;
  /* ~60% of the 920px content column on desktop (≈560×198); runs
     edge-to-edge on a phone, where the column is narrower than the cap. */
  width: min(100%, 560px);
}

/* ---- App list ---- */
.label-caps {
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
  margin: 0 0 10px;
}

.app-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px;
}
.app-list li { display: flex; }

.app-card {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 10px;
  padding: 22px; box-shadow: 0 1px 2px var(--shadow);
  transition: border-color 0.15s ease;
}
a.app-card:hover { border-bottom-color: var(--accent); }
.app-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.app-desc { color: var(--text-muted); font-size: 14px; flex: 1; }
.app-open { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 8px; }

/* For an app that's listed but not deployed yet */
.app-card--placeholder { border-style: dashed; border-bottom-width: 1px; background: transparent; box-shadow: none; }
.app-card--placeholder .app-name { color: var(--text-muted); }
.badge {
  display: inline-block; align-self: flex-start; font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); color: var(--text-muted);
}

@media (max-width: 560px) {
  .hero { min-height: 0; margin: 20px 0 28px; }
  .app-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
