/* ctrl-exec.com — corporate stylesheet
   Audience: business decision-makers, service provider partners
   Typeface: Instrument Serif (headings) + Inter (body) + JetBrains Mono (code/identifiers)
   Palette: near-white background, deep ink text, accent #0a6e5c (deep teal)
   Related to ctrl-exec.io but warmer, lighter, less terminal
   ------------------------------------------------------------------ */

/* ── Fonts ─────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400&display=swap');

/* ── Design tokens ──────────────────────────────────────────────────── */

:root {
  /* Palette */
  --bg:           #f8f7f5;
  --bg-surface:   #ffffff;
  --bg-raised:    #f0efec;
  --bg-border:    #e2ddd8;
  --bg-hover:     #f0efec;

  --text:         #1a1a18;
  --text-muted:   #5a5750;
  --text-faint:   #9a9590;

  --accent:       #0a6e5c;
  --accent-dim:   #085c4c;
  --accent-light: #e6f4f1;
  --accent-mid:   #cceae4;

  --code-bg:      #f0efec;
  --code-border:  #e2ddd8;
  --code-text:    #2a4a44;

  --link:         #0a6e5c;
  --link-hover:   #085c4c;

  --warn:         #92670a;
  --subtle-rule:  #e8e4df;

  /* Layout */
  --nav-h:        60px;
  --content-max:  680px;
  --page-max:     1140px;
  --sidebar-w:    220px;

  /* Type */
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-serif:   'Instrument Serif', 'Georgia', serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      1.375rem;
  --text-2xl:     1.875rem;
  --text-3xl:     2.5rem;
  --text-4xl:     3.25rem;

  /* Spacing */
  --space-1:  0.25rem;  --space-2:  0.5rem;   --space-3:  0.75rem;
  --space-4:  1rem;     --space-6:  1.5rem;   --space-8:  2rem;
  --space-10: 2.5rem;   --space-12: 3rem;     --space-16: 4rem;
  --space-20: 5rem;     --space-24: 6rem;

  /* Radius */
  --radius-sm: 3px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
}

/* ── Reset ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Base ───────────────────────────────────────────────────────────── */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Page shell ─────────────────────────────────────────────────────── */

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Nav ────────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--subtle-rule);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  gap: var(--space-8);
}

.site-nav__wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

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

.site-nav__spacer { flex: 1; }

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.site-nav__links a {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav__links a:hover,
.site-nav__links a.active {
  color: var(--text);
}

.site-nav__links a.active {
  font-weight: 500;
}

.site-nav__links .nav-cta {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--bg-surface);
  background: var(--accent);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.site-nav__links .nav-cta:hover {
  background: var(--accent-dim);
  color: var(--bg-surface);
}

/* ── Main content ───────────────────────────────────────────────────── */

.site-content {
  flex: 1;
}

/* ── Page header ────────────────────────────────────────────────────── */

.page-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--subtle-rule);
  padding: var(--space-16) var(--space-8) var(--space-12);
  text-align: center;
}

.page-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.page-header--graphic {
  position: relative;
  background-image: url('/assets/ctrl-exec-com-header.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.page-header--graphic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(248, 247, 245, 0.55);
}

.page-header--graphic .page-header__inner {
  position: relative;
  z-index: 1;
}

.page-header__title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.page-header__summary {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ── Content wrapper ────────────────────────────────────────────────── */

.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-16) var(--space-8);
}

.content-wrap--wide {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--space-16) var(--space-8);
}

/* ── Prose typography ───────────────────────────────────────────────── */

.prose h1 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-6);
  margin-top: 0;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  margin-top: var(--space-16);
  margin-bottom: var(--space-4);
}

.prose h3 {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
}

.prose h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--text-xs);
}

.prose p {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

.prose > p:first-child {
  font-size: var(--text-lg);
  color: var(--text);
  font-weight: 300;
  line-height: 1.65;
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent-mid);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s;
}

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

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

.prose em {
  font-style: italic;
  font-family: var(--font-serif);
}

.prose ul,
.prose ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.prose li {
  margin-bottom: var(--space-2);
  color: var(--text-muted);
}

.prose li::marker {
  color: var(--accent);
}

.prose blockquote {
  border-left: 2px solid var(--accent-mid);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose blockquote p {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  margin: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--subtle-rule);
  margin: var(--space-12) 0;
}

/* Definition lists */
.prose dl { margin: var(--space-6) 0; }

.prose dt {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
}

.prose dd {
  color: var(--text-muted);
  padding-left: var(--space-4);
  border-left: 2px solid var(--subtle-rule);
  margin-left: 0;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: var(--space-6) 0;
}

.prose thead {
  border-bottom: 2px solid var(--subtle-rule);
}

.prose th {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  padding: var(--space-2) var(--space-4) var(--space-2) 0;
}

.prose td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--subtle-rule);
  color: var(--text-muted);
  vertical-align: top;
}

.prose tr:last-child td { border-bottom: none; }

/* Inline code */
.prose code,
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

/* Code blocks */
.prose pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-lg);
  margin: var(--space-6) 0;
  overflow: hidden;
}

.prose pre code {
  display: block;
  overflow-x: auto;
  padding: var(--space-4) var(--space-6);
  background: none;
  border: none;
  border-radius: 0;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--code-text);
}

/* ── Fenced div styles ──────────────────────────────────────────────── */

.marginbox,
.examplebox,
.widebox,
.textbox {
  margin: var(--space-8) 0;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.marginbox p, .examplebox p, .widebox p, .textbox p { margin-bottom: var(--space-2); }
.marginbox p:last-child, .examplebox p:last-child,
.widebox p:last-child, .textbox p:last-child { margin-bottom: 0; }

.marginbox {
  border-left: 2px solid var(--accent-mid);
  padding: var(--space-4) var(--space-6);
  background: var(--accent-light);
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
}

.marginbox strong {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
}

.examplebox {
  background: var(--bg-surface);
  border: 1px solid var(--subtle-rule);
  border-top: 2px solid var(--accent);
  padding: var(--space-6);
  color: var(--text-muted);
}

.examplebox strong { color: var(--text); }

.widebox {
  width: 100%;
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  padding: var(--space-8);
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 400;
  font-family: var(--font-serif);
  text-align: center;
  border-radius: var(--radius-lg);
}

.textbox {
  width: 60%;
  background: var(--bg-surface);
  border: 1px solid var(--subtle-rule);
  border-left: 2px solid var(--accent-mid);
  padding: var(--space-4) var(--space-6);
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .textbox { width: 100%; }
}

/* ── Provider cards (used on providers.md) ──────────────────────────── */

.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

.provider-card {
  background: var(--bg-surface);
  border: 1px solid var(--subtle-rule);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.provider-card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 4px 24px rgba(10, 110, 92, 0.08);
}

.provider-card__name {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.provider-card__region {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.provider-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.provider-card__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

/* ── CTA block ──────────────────────────────────────────────────────── */

.cta-block {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-xl);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  margin: var(--space-16) 0;
}

.cta-block__heading {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 400;
  margin-bottom: var(--space-4);
  color: var(--bg);
}

.cta-block__body {
  font-size: var(--text-lg);
  color: rgba(248, 247, 245, 0.7);
  font-weight: 300;
  margin-bottom: var(--space-8);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-block__button {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-surface);
  font-weight: 500;
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.cta-block__button:hover {
  background: var(--accent-dim);
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--subtle-rule);
  padding: var(--space-10) var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.site-footer__wordmark {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.site-footer__links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  flex: 1;
}

.site-footer__links a {
  font-size: var(--text-sm);
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.12s;
}

.site-footer__links a:hover { color: var(--text-muted); }

.site-footer__copy {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .site-nav {
    padding: 0 var(--space-4);
    gap: var(--space-4);
  }

  .site-nav__links {
    gap: var(--space-4);
  }

  .site-nav__links li:not(:last-child) {
    display: none;
  }

  .page-header {
    padding: var(--space-12) var(--space-4) var(--space-8);
  }

  .page-header__title {
    font-size: var(--text-2xl);
  }

  .content-wrap,
  .content-wrap--wide {
    padding: var(--space-10) var(--space-4);
  }

  .cta-block {
    padding: var(--space-10) var(--space-6);
  }

  .site-footer {
    padding: var(--space-6) var(--space-4);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
}
