/* TEAMSolutions Group — Site Styles */

:root {
  --navy: #0B1D3A;
  --teal: #2BBCB3;
  --slate: #2E4369;
  --steel: #D7DEE7;
  --charcoal: #1A1F2B;
  --white: #F8FAFC;

  --hero-gradient: linear-gradient(135deg, #0B1D3A, #123F52);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --container-wide: 1280px;
  --container-narrow: 760px;
  --radius: 10px;

  --transition: 180ms ease;
}

/* Default theme: dark */
:root,
[data-theme="dark"] {
  --bg: var(--navy);
  --surface: var(--charcoal);
  --surface-2: var(--slate);
  --text: var(--white);
  --muted: var(--steel);
  --accent: var(--teal);
  --accent-on: var(--navy);
  --border: rgba(215, 222, 231, 0.12);
  --header-bg: rgba(11, 29, 58, 0.7);
  --header-border: rgba(215, 222, 231, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: var(--white);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --text: var(--charcoal);
  --muted: var(--slate);
  --accent: var(--teal);
  --accent-on: var(--navy);
  --border: rgba(46, 67, 105, 0.14);
  --header-bg: rgba(248, 250, 252, 0.75);
  --header-border: rgba(46, 67, 105, 0.08);
  --shadow: 0 8px 24px rgba(11, 29, 58, 0.08);
}

/* Reset / base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

img,
picture,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--text);
}

[data-theme="light"] a:hover {
  color: var(--navy);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p {
  margin: 0 0 1.1em;
  color: var(--muted);
}

p.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 60ch;
}

strong {
  color: var(--text);
  font-weight: 600;
}

::selection {
  background: var(--teal);
  color: var(--navy);
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: 0;
}

.section--alt {
  background: var(--surface);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 26px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
    border-color var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-on);
}

.btn--primary:hover {
  background: var(--white);
  color: var(--navy);
}

[data-theme="light"] .btn--primary:hover {
  background: var(--navy);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition), border-color var(--transition),
    backdrop-filter var(--transition);
}

.site-header.is-scrolled {
  background: var(--header-bg);
  border-bottom-color: var(--header-border);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.wordmark:hover {
  color: var(--text);
  opacity: 0.9;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle svg { width: 18px; height: 18px; }

/* Hero */
.hero {
  background: var(--hero-gradient);
  color: var(--white);
  padding: clamp(96px, 14vw, 180px) 0 clamp(96px, 14vw, 180px);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .hero {
  background: var(--hero-gradient);
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin: 0 auto 1.4rem;
  color: var(--white);
}

.hero h1 .accent {
  display: block;
  color: var(--teal);
}

.hero p {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--steel);
  max-width: 56ch;
  margin: 0 auto 2.2rem;
}

.hero .btn--primary:hover {
  background: var(--white);
  color: var(--navy);
}

/* Page header (non-hero pages) */
.page-header {
  padding: clamp(80px, 10vw, 130px) 0 clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 0.5rem;
  max-width: 22ch;
}

.page-header .tagline {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

/* Card grids */
.grid {
  display: grid;
  gap: 24px;
}

.grid--3 { grid-template-columns: repeat(1, 1fr); }
.grid--2 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--accent);
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin-bottom: 1rem;
}

.card__link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

.card__link::after {
  content: " →";
  transition: margin-left var(--transition);
}

.card__link:hover::after {
  margin-left: 4px;
}

/* Manifesto block */
.manifesto {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.manifesto p {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.005em;
}

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

/* CTA band */
.cta-band {
  background: var(--charcoal);
  text-align: center;
  padding: clamp(64px, 9vw, 110px) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .cta-band {
  background: var(--surface);
}

.cta-band h2 {
  margin-bottom: 1.6rem;
  max-width: 22ch;
  margin-left: auto;
  margin-right: auto;
}

/* Article / prose */
.prose {
  max-width: var(--container-narrow);
  margin: 0 auto;
}

.prose h2 {
  margin-top: 2.5em;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose ul,
.prose ol {
  color: var(--muted);
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.4em;
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--text);
  margin: 1.6em 0;
}

/* Forms */
.form {
  display: grid;
  gap: 18px;
  max-width: 620px;
}

.form__group {
  display: grid;
  gap: 6px;
}

.form label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.form input,
.form select,
.form textarea {
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  transition: border-color var(--transition), background-color var(--transition);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form textarea {
  min-height: 160px;
  resize: vertical;
}

/* Course list */
.course-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.course-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  list-style: none;
  align-items: baseline;
}

.course-list .num {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--accent);
}

.course-list .title {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
}

.course-list .desc {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Posts list */
.post-card {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.post-card:first-child { border-top: 1px solid var(--border); }

.post-card:hover h3 { color: var(--accent); }

.post-card .meta {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.post-card h3 {
  margin-bottom: 0.4rem;
  transition: color var(--transition);
}

.post-card p {
  margin: 0;
  max-width: 70ch;
}

/* Contact direct list */
.contact-direct {
  display: grid;
  gap: 18px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.contact-direct dt {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.contact-direct dd {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--text);
}

/* Two-col layout (contact, methodology) */
.split {
  display: grid;
  gap: 48px;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .split { grid-template-columns: 1.2fr 1fr; gap: 80px; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  position: relative;
  padding: 64px 0 32px;
  margin-top: 0;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; }
}

.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.footer-col p,
.footer-col a {
  font-size: 0.95rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-col ul a {
  color: var(--muted);
}

.footer-col ul a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-bottom a {
  color: var(--muted);
  margin-left: 18px;
}

.footer-bottom a:hover {
  color: var(--text);
}

/* Mobile nav */
@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78%, 320px);
    background: var(--bg);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 96px 28px 28px;
    transform: translateX(100%);
    transition: transform var(--transition);
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav a { font-size: 1.1rem; }
  .nav-toggle { display: inline-flex; }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--navy);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
