/* ═══════════════════════════════════════════════════════
   RXD Cloud Consulting
   Design: deep teal on warm white, Space Grotesk display.
   A consulting site should feel precise and steady, not
   templated — so: sharp radii, no card shadows, one bold
   typographic moment (the hero stat).
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ── */

:root {
  --bg: #ffffff;
  --bg-warm: #f5f2ec;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #0d5c63;
  --accent-hover: #0a4a50;
  --accent-contrast: #ffffff;
  --accent-soft: #e8f0f1;
  --border: #e7e5e4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --success: #15803d;
  --error: #b91c1c;
  --radius: 0.375rem;
  --radius-lg: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0c0a;
    --bg-warm: #1c1917;
    --text: #f5f5f4;
    --muted: #a8a29e;
    --accent: #5ec4bc;
    --accent-hover: #7dd3cb;
    --accent-contrast: #0e0c0a;
    --accent-soft: #1a2f2c;
    --border: #292524;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --success: #4ade80;
    --error: #fca5a5;
  }
}

/* ── Reset & base ── */

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Sticky header would otherwise cover the target of an in-page jump. */
:target { scroll-margin-top: 5rem; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .brand, .stat-number, .case-figure {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

img { max-width: 100%; height: auto; }

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

/* ── Layout ── */

.container {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow { max-width: 46rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus { left: 0; }

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--muted); font-weight: 400; }

.nav-menu > summary { list-style: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--text);
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
}

.nav-toggle-bars { position: relative; }

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -0.35rem; }
.nav-toggle-bars::after { top: 0.35rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a.btn:hover { color: var(--accent-contrast); }

/* Above the mobile breakpoint the <details> wrapper must not hide its own contents.
   Browsers implement that hiding two different ways depending on version — the older
   one puts display:none on non-summary children, the newer one uses
   ::details-content { content-visibility: hidden }. Both are neutralised here. */
@media (min-width: 40.0625rem) {
  .nav-menu::details-content {
    content-visibility: visible;
    display: contents;
  }

  .nav-menu > .nav-links { display: flex; }
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid var(--accent);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 0.15s ease, transform 0.1s ease; }
}

.btn:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-small { padding: 0.4rem 0.85rem; font-size: 0.88rem; }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

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

/* ── Hero ── */

.hero {
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--border);
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2rem;
}

.availability .dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-stat {
  padding-top: 0.25rem;
}

.stat-number {
  display: block;
  font-size: 5rem;
  font-weight: 700;
  line-height: 0.85;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  line-height: 1.2;
  max-width: 40rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.experience-strip {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

/* ── Sections ── */

.section { padding: 4.5rem 0; }

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

.section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.section-intro {
  color: var(--muted);
  max-width: 42rem;
  margin-bottom: 2rem;
}

.section h2 + .grid,
.section h2 + .about,
.section h2 + .faq { margin-top: 1.75rem; }

/* ── Grid ── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

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

/* ── Services — an editorial list, not a card grid ── */

#services .grid {
  display: flex;
  flex-direction: column;
}

#services .card {
  background: none;
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
}

#services .card + .card {
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: no-preference) {
  #services .card { transition: background-color 0.15s ease; }
}

#services .card:hover { background: var(--accent-soft); }

#services .card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

#services .card p {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 40rem;
}

/* ── Case studies ── */

.case {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.case-figure {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.case-client {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.case dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.case dd {
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.case dd:last-child { margin-bottom: 0; }

@media (max-width: 52rem) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── About ── */

.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about p + p { margin-top: 1rem; }

.about-intro {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  /* .about p + p doesn't reach the paragraph after this wrapper, so space it here. */
  margin-bottom: 1rem;
}

.portrait {
  width: 9rem;
  height: 9rem;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
}

#about .certs {
  background: var(--bg-warm);
  border: none;
  padding: 1.5rem;
}

.certs ul {
  list-style: none;
  margin-bottom: 1.25rem;
}

.certs li {
  padding-left: 1.3rem;
  position: relative;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.certs li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.certs h3 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.small { font-size: 0.85rem; }

/* ── FAQ ── */

.faq {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  margin-top: -2px;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .faq summary::after { transition: transform 0.2s ease; }
}

.faq[open] summary::after { transform: rotate(45deg); }

.faq > p {
  color: var(--muted);
  padding-bottom: 1.25rem;
  max-width: 40rem;
  font-size: 0.95rem;
}

/* ── Contact ── */

.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

#contact-form {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}

.field textarea { resize: vertical; min-height: 6rem; }

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form .btn { width: 100%; margin-top: 0.5rem; }

.form-status {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  min-height: 1.4rem;
}

.form-status.is-pending { color: var(--muted); }
.form-status.is-success { color: var(--success); font-weight: 600; }
.form-status.is-error { color: var(--error); }
.form-status a { color: inherit; }

.contact-direct h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.contact-direct h3 + p { margin-bottom: 0.9rem; }

.contact-direct .btn { margin-bottom: 1.75rem; }

.contact-direct p { margin-bottom: 0.5rem; }

.contact-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-link:hover { text-decoration: underline; }

.copy-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.1rem 0.45rem;
  margin-left: 0.5rem;
  cursor: pointer;
  vertical-align: middle;
}

.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Mobile CTA bar — shown only on narrow screens (see media query below) */
.mobile-cta { display: none; }

/* ── Responsive ── */

@media (max-width: 46rem) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 40rem) {
  .hero { padding: 2.5rem 0 3rem; }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .stat-number { font-size: 3.25rem; }

  .nav-toggle { display: inline-flex; }

  /* Anchored to .site-header (position: sticky is a containing block) rather than to
     the <details> wrapper, whose box model differs across browser versions. */
  .nav-menu[open] > .nav-links {
    position: absolute;
    right: 1.5rem;
    top: 100%;
    margin-top: 0.5rem;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    min-width: 12rem;
    padding: 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }

  .nav-menu[open] > .nav-links a { padding: 0.5rem 0.6rem; border-radius: var(--radius); }
  .nav-menu[open] > .nav-links a.btn { margin-top: 0.35rem; text-align: center; }

  .about-intro { flex-direction: column; gap: 1rem; }

  .portrait { width: 7rem; height: 7rem; }

  /* Sticky conversion bar. Body padding below keeps it clear of the footer. */
  body { padding-bottom: 5rem; }

  .mobile-cta {
    display: flex;
    gap: 0.5rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
  }

  .mobile-cta .btn { flex: 1; padding: 0.65rem 0.75rem; font-size: 0.92rem; }
}

@media print {
  .site-header, .mobile-cta, .skip-link, .contact-form { display: none; }
  .faq[open] > p, .faq > p { display: block; }
}
/* ── Legal pages (privacy notice, legal notice) ── */

.legal h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; scroll-margin-top: 5rem; }
.legal p, .legal li { margin-bottom: 0.9rem; }
.legal ul { padding-left: 1.25rem; margin-bottom: 0.9rem; }
.legal li { margin-bottom: 0.4rem; }
.legal .updated { color: var(--muted); font-size: 0.9rem; }

/* ── Contact form notice ── */

.form-note { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }
.form-note a { color: var(--accent); }

/* ── Footer links ── */

.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ── Hero proof strip ── */

.proof {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 40rem;
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--border);
}

.proof strong {
  display: block;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.proof span { display: block; font-size: 0.82rem; line-height: 1.45; color: var(--muted); }

/* ── Problems ── */

.pains {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 2.5rem;
}

.pains li {
  padding: 0.75rem 0 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  font-size: 0.95rem;
  color: var(--muted);
}

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

.pains-cta { margin-top: 2rem; }

/* ── Process ── */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.steps li {
  counter-increment: step;
  border-top: 2px solid var(--accent);
  padding-top: 1rem;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.steps h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; }
.steps p { font-size: 0.9rem; color: var(--muted); line-height: 1.55; }

.engage-title { font-size: 1.15rem; font-weight: 600; margin: 3rem 0 1rem; }

.engage .card {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.engage h4 {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.engage p { font-size: 0.9rem; color: var(--muted); line-height: 1.55; }

/* ── CTA band ── */

.cta-band {
  background: var(--accent-soft);
  padding: 2.75rem 0;
}

.cta-band .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.cta-band h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.25rem; }
.cta-band p { color: var(--muted); font-size: 0.95rem; }
.cta-band .btn { flex-shrink: 0; }

/* Case cards sit on a warm section: give them the page background so they read as cards. */
#cases .case { background: var(--bg); }

.legal .btn { margin: 0.5rem 0.5rem 0 0; }

@media (max-width: 52rem) {
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 40rem) {
  .proof { grid-template-columns: 1fr; gap: 0.85rem; }
  .pains { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .cta-band .container { flex-direction: column; align-items: flex-start; }
}

@media print {
  .cta-band, .pains-cta { display: none; }
}

/* ── Insights (blog) ── */

.nav-links-plain { display: flex; }

.post h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 1rem; }
.post h2 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; }
.post h3 { font-size: 1.05rem; margin: 1.75rem 0 0.5rem; }
.post p, .post ul, .post ol, .post blockquote { margin-bottom: 1rem; }
.post ul, .post ol { padding-left: 1.25rem; }
.post li { margin-bottom: 0.4rem; }
.post a { color: var(--accent); }
.post code { font-size: 0.9em; background: var(--bg-warm); padding: 0.1rem 0.3rem; border-radius: var(--radius); }

.post blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
}

.post-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.post-meta a { color: inherit; }

.post-source {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
}

.post .post-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }

.post-tags li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.15rem 0.55rem;
  margin: 0;
}

.post .post-list { list-style: none; padding: 0; }
.post-list li { padding: 1.5rem 0; border-top: 1px solid var(--border); margin: 0; }
.post-list h2 { font-size: 1.2rem; margin: 0 0 0.35rem; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); text-decoration: underline; }
.post-list p:last-child { color: var(--muted); font-size: 0.95rem; margin: 0; }
