/*
 * TRTactics — styled as the SFMS application is: the same "Workbench" tokens (silver desktop,
 * white cards, steel-blue accent, sharp 2px corners) and the same three type families. Light is
 * the default for everyone; dark is the graphite theme SFMS offers, chosen with the header button
 * (theme.js sets data-theme on <html>).
 */

/* ============ "Workbench Light" ============ */
:root {
  --app-bg: #cdd4db;
  --window: #eaeef2;
  --window-bd: #98a3b0;
  --content: #f2f4f7;
  --header: #e8ecf0;
  --header-bd: #b3bcc7;
  --card: #ffffff;
  --card-bd: #c3ccd5;
  --divider: #d8dee4;
  --elevated: #eef1f4;
  --elevated-bd: #b3bcc7;
  --active: #d5e6f4;

  --text: #1a2431;
  --muted: #55616f;
  --faint: #8792a0;

  --accent: #2c6da3;
  --on-accent: #ffffff;
  --accent-tint: rgba(44, 109, 163, 0.10);
  --hover-tint: rgba(20, 30, 45, 0.045);

  --r: 2px;
  --t: .18s cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 10px 26px rgba(28, 40, 56, 0.18), 0 1px 2px rgba(28, 40, 56, 0.12);

  --wrap: 1080px;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* ============ "Workbench Dark" ============ */
:root[data-theme="dark"] {
  --app-bg: #14171b;
  --window: #232830;
  --window-bd: #3a434e;
  --content: #1a1e24;
  --header: #20252c;
  --header-bd: #333b45;
  --card: #262c34;
  --card-bd: #39424d;
  --divider: #2f363f;
  --elevated: #2b323b;
  --elevated-bd: #3d4650;
  --active: #22405c;

  --text: #e5eaf0;
  --muted: #aab4bf;
  --faint: #6f7b88;

  --accent: #4a93d4;
  --on-accent: #ffffff;
  --accent-tint: rgba(74, 147, 212, 0.14);
  --hover-tint: rgba(255, 255, 255, 0.05);

  --shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.50);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--text);
  color: var(--content);
  border-radius: var(--r);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Header: the application's title bar ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header);
  border-bottom: 1px solid var(--header-bd);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* The company mark, as supplied: its own blues on a clear ground, so it sits on either theme. */
.mark {
  height: 30px;
  width: auto;
  display: block;
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}

/* The logo's wordmark sets "TR" in the brand blue and "Tactics" in ink. */
.brand-name .tr { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: var(--r);
  transition: background var(--t), color var(--t);
}
.nav a:hover { background: var(--hover-tint); color: var(--text); }

.nav .nav-cta {
  color: var(--accent);
  font-weight: 600;
}

/* Same shape as the Settings bar's "Dark mode" button in the app. */
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 6px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); }

/* ---- Hero: the workspace ground ---- */
.hero {
  padding: 84px 0 88px;
  background: var(--content);
  border-bottom: 1px solid var(--divider);
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 21ch;
}

h1 .accent { color: var(--accent); }

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 40px;
  align-items: center;
}

.hero-mark {
  width: 100%;
  height: auto;
  display: block;
}

.lede {
  margin-top: 20px;
  max-width: 60ch;
  font-size: 17px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter var(--t), border-color var(--t), background var(--t);
}

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover { filter: brightness(1.08); }

.btn.ghost {
  background: var(--card);
  border-color: var(--card-bd);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); }

/* ---- Sections ---- */
.section {
  padding: 72px 0;
  background: var(--content);
}

.section.alt {
  background: var(--window);
  border-top: 1px solid var(--header-bd);
  border-bottom: 1px solid var(--header-bd);
}

h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  max-width: 26ch;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.body {
  margin-top: 14px;
  max-width: 56ch;
  color: var(--muted);
}

/* White cards that pop against the workspace, as panels do in the app. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
  padding: 22px 22px 24px;
}

.card .num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 2px 7px;
  border-radius: var(--r);
  margin-bottom: 14px;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---- SFMS: the feature list reads like one of the app's tables ---- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 44px;
  align-items: start;
}

.split .btn { margin-top: 24px; }

.features {
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-radius: var(--r);
}

.features li {
  display: grid;
  gap: 3px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  transition: background var(--t);
}
.features li:last-child { border-bottom: none; }
.features li:hover { background: var(--active); }

.features strong { font-weight: 600; font-size: 14.5px; }
.features span { color: var(--muted); font-size: 14px; }

/* ---- Steps ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 30px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--card-bd);
  border-top: 3px solid var(--accent);
  border-radius: var(--r);
  padding: 18px 18px 20px;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 6px;
}

.steps p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ---- Contact: one window-like panel, with the app's dialog shadow ---- */
.contact { border-top: 1px solid var(--divider); }

.contact-panel {
  background: var(--card);
  border: 1px solid var(--window-bd);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 34px 32px 38px;
}

.mail {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
  overflow-wrap: anywhere;
}
.mail:hover { filter: brightness(1.12); }

/* ---- Footer ---- */
.foot {
  background: var(--header);
  border-top: 1px solid var(--header-bd);
  padding: 18px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* The header is sticky: stop an in-page jump from landing underneath it. */
section[id] { scroll-margin-top: 64px; }

/* ---- Smaller screens ---- */
@media (max-width: 900px) {
  .hero-row { grid-template-columns: 1fr; }
  .hero-mark { display: none; }
  .cards { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav a:not(.nav-cta) { display: none; }
  .theme-label { display: none; }
  .hero { padding: 52px 0 56px; }
  .section { padding: 52px 0; }
  .lede { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .contact-panel { padding: 24px 20px 28px; }
}

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