/* ============================================================
   Capitol Litho – Global Auto Light/Dark Theme
   ============================================================ */

/* Theme variables */
:root {
  color-scheme: light dark;

  /* Light theme */
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --surface: #ffffff;
  --surface-alt: #e5eefb;

  --text: #111827;
  --text-muted: #4b5563;

  --border: #e5e7eb;
  --shadow-soft: 0 4px 16px rgba(15, 23, 42, 0.06);

  --brand: #0f766e;
  --brand-hover: #115e59;

  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.12);

  --footer-bg: #111827;
  --footer-text: #e5e7eb;
}

/* Dark theme (auto when OS is in dark mode) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #020617;
    --bg-alt: #020617;
    --surface: #0b1220;
    --surface-alt: #111827;

    --text: #e2e8f0;
    --text-muted: #94a3b8;

    --border: #1f2937;
    --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.75);

    --brand: #22d3ee;
    --brand-hover: #06b6d4;

    --accent: #f97316;
    --accent-soft: rgba(249, 115, 22, 0.15);

    --footer-bg: #020617;
    --footer-text: #94a3b8;
  }
}

/* ============================================================
   Manual theme overrides via [data-theme] attribute
   ============================================================ */

/* Force LIGHT mode when user chooses it */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --surface: #ffffff;
  --surface-alt: #e5eefb;

  --text: #111827;
  --text-muted: #4b5563;

  --border: #e5e7eb;
  --shadow-soft: 0 4px 16px rgba(15, 23, 42, 0.06);

  --brand: #0f766e;
  --brand-hover: #115e59;

  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.12);

  --footer-bg: #111827;
  --footer-text: #e5e7eb;
}

/* Force DARK mode when user chooses it */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #020617;
  --bg-alt: #020617;
  --surface: #0b1220;
  --surface-alt: #111827;

  --text: #e2e8f0;
  --text-muted: #94a3b8;

  --border: #1f2937;
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.75);

  --brand: #22d3ee;
  --brand-hover: #06b6d4;

  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.15);

  --footer-bg: #020617;
  --footer-text: #94a3b8;
}

/* ============================================================
   Base layout
   ============================================================ */

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Utility layout container */
.cl-container,
.cl-section-inner,
.cl-cta-inner,
.cl-footer-inner,
.cl-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Simple link reset */
a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Header & Navigation
   ============================================================ */

.cl-header, .cl-header * {
  box-sizing: border-box;
}

/* Header wrapper */
.cl-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Header inner layout */
.cl-container {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand block */
.cl-brand {
  display: flex;
  flex-direction: column;
}

.cl-brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: 0.04em;
}

.cl-brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* Nav menu */
.cl-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cl-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1rem;
}

.cl-nav a {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cl-nav a:hover {
  color: var(--brand);
}

/* Contact CTA button in nav */
.cl-btn-link {
  background: var(--brand);
  color: #fff !important;
  border-radius: 999px;
  text-align: center;
  padding: 0.6rem 0;
  font-weight: 600;
  margin-top: 0.5rem;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.45);
}

.cl-btn-link:hover {
  background: var(--brand-hover);
}

/* Show nav when header has .cl-open */
.cl-header.cl-open .cl-nav {
  display: block;
}

/* Hamburger button */
.cl-nav-toggle {
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cl-bar {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: 0.2s ease;
}

/* Hamburger transforms to X */
.cl-header.cl-open .cl-bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.cl-header.cl-open .cl-bar:nth-child(2) {
  opacity: 0;
}
.cl-header.cl-open .cl-bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Desktop nav */
@media (min-width: 768px) {
  .cl-nav {
    display: block !important;
    position: static;
    background: transparent;
    border: none;
  }

  .cl-nav ul {
    display: flex;
    gap: 1.5rem;
    padding: 0;
    align-items: center;
  }

  .cl-nav a {
    padding: 0;
  }

  .cl-btn-link {
    padding: 0.4rem 1rem;
    margin: 0;
  }

  .cl-nav-toggle {
    display: none;
  }
}

/* ============================================================
   Hero
   ============================================================ */

.cl-hero {
  background: radial-gradient(circle at top left,
    var(--surface-alt) 0,
    var(--bg-alt) 55%,
    var(--bg) 100%
  );
  padding: 3.5rem 1rem 3rem;
}

.cl-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.cl-hero-text h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 1rem;
  color: var(--text);
}

.cl-hero-text p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Hero actions (buttons) */
.cl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Hero meta (contact details) */
.cl-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cl-hero-meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.cl-hero-meta-value a {
  color: var(--brand);
  text-decoration: none;
}

.cl-hero-meta-value a:hover {
  text-decoration: underline;
}

/* Hero media cards (default layout) */
.cl-hero-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.cl-hero-card {
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, var(--bg-alt) 15%);
  box-shadow: var(--shadow-soft);
}

.cl-hero-card.big {
  grid-column: span 2;
}

.cl-hero-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

.cl-hero-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Mobile hero layout */
@media (max-width: 767px) {
  .cl-hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .cl-hero-media {
    order: -1;
  }
}

/* ===== Hero with integrated logo ===== */

.cl-hero-with-logo .cl-hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
}

.cl-hero-with-logo .cl-hero-text,
.cl-hero-with-logo .cl-hero-media {
  flex: 1 1 280px;
}

.cl-hero-with-logo .cl-hero-media {
  display: flex;
  justify-content: center;
}

.cl-logo-panel {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 60%, #0f172a 40%),
    color-mix(in srgb, var(--accent) 60%, #020617 40%)
  );
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
  width: 100%;
}

.cl-hero-logo-img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 0.75rem;
  display: block;
}

.cl-logo-caption {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.9);
}

/* Mobile adjustments for hero with logo */
@media (max-width: 767px) {
  .cl-hero-with-logo .cl-hero-inner {
    flex-direction: column-reverse;
  }

  .cl-hero-with-logo .cl-hero-media {
    max-width: 420px;
    margin-inline: auto;
  }
}

/* ============================================================
   Generic Buttons
   ============================================================ */

.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease,
              background-color 0.1s ease, color 0.1s ease;
}

.cl-btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.cl-btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 118, 110, 0.35);
}

.cl-btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.cl-btn-ghost:hover {
  background: rgba(15, 118, 110, 0.08);
}

/* ============================================================
   Sections
   ============================================================ */

.cl-section {
  padding: 3rem 1rem;
  background: var(--bg);
}

.cl-section-alt {
  background: var(--bg-alt);
}

.cl-section-inner {
  padding-left: 0;
  padding-right: 0;
}

.cl-section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.cl-section-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.8rem;
  color: var(--text);
}

.cl-section-header p {
  margin: 0;
  color: var(--text-muted);
}

/* ============================================================
   Grid Helpers
   ============================================================ */

.cl-grid {
  display: grid;
  gap: 1.5rem;
}

.cl-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cl-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* ============================================================
   Cards / Pills
   ============================================================ */

.cl-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.3rem 1.3rem 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.cl-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}

.cl-card p {
  margin: 0 0 0.7rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cl-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Pills (Why Capitol Litho) */
.cl-pill {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1.1rem 1.4rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent 60%);
}

.cl-pill h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

.cl-pill p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================================
   Capabilities strip (below hero)
   ============================================================ */

.cl-capabilities-strip {
  padding: 2rem 1rem 2.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.cl-capabilities-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.cl-cap-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.cl-cap-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--text);
}

.cl-cap-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================================
   Portfolio Thumbs
   ============================================================ */

.cl-portfolio-grid {
  margin-top: 1rem;
}

.cl-thumb-card {
  position: relative;
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #f9fafb;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.cl-thumb-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 0, rgba(255,255,255,0.35), transparent 60%);
  opacity: 0.8;
}

.cl-thumb-card h4,
.cl-thumb-card .cl-tag {
  position: relative;
  z-index: 1;
}

.cl-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(15, 23, 42, 0.2);
  margin-bottom: 0.4rem;
}

/* ============================================================
   CTA Strip
   ============================================================ */

.cl-cta-strip {
  background: #0f172a; /* fallback */
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 35%, #0f172a 65%),
    color-mix(in srgb, var(--accent) 35%, #020617 65%)
  );
  color: #e5e7eb;
  padding: 2.5rem 1rem;
}

.cl-cta-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cl-cta-inner h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.cl-cta-inner p {
  margin: 0;
  font-size: 0.95rem;
}

.cl-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Mobile CTA layout */
@media (max-width: 640px) {
  .cl-cta-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   Footer
   ============================================================ */

.cl-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 2.5rem 1rem 1.5rem;
}

.cl-footer-inner {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 0;
}

.cl-footer-col h3,
.cl-footer-col h4 {
  margin: 0 0 0.5rem;
  color: #f9fafb;
}

.cl-footer-col p,
.cl-footer-col ul {
  margin: 0;
  color: var(--footer-text);
  font-size: 0.9rem;
}

.cl-footer-col ul {
  list-style: none;
  padding: 0;
}

.cl-footer-col li + li {
  margin-top: 0.25rem;
}

.cl-footer-col a {
  color: inherit;
  text-decoration: none;
}

.cl-footer-col a:hover {
  text-decoration: underline;
}

/* Footer bottom strip */
.cl-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 1.5rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--footer-text);
}

/* Active nav link */
.cl-nav a.cl-active {
  color: var(--brand);
  font-weight: 600;
  border-bottom: 2px solid var(--brand);
}

/* ============================================================
   Theme toggle inside nav
   ============================================================ */

.cl-theme-toggle-item {
  margin-top: 0.5rem;
}

.cl-theme-toggle {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, var(--bg-alt) 20%);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.cl-theme-toggle:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.cl-theme-toggle:active {
  transform: translateY(0);
  box-shadow: none;
}

.cl-theme-toggle-icon {
  font-size: 0.9rem;
}

.cl-theme-toggle-label {
  font-size: 0.8rem;
}

/* Desktop tuning for toggle */
@media (min-width: 768px) {
  .cl-theme-toggle-item {
    margin-top: 0;
    margin-left: 0.75rem;
  }
}
