/*
 * main.css — Thinkingrag Ltd marketing site (MIT; see LICENSE)
 * Created: 2026-04-27
 */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --text: #0c1222;
  --text-muted: #5c6578;
  --border: rgba(12, 18, 34, 0.08);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-2: #7c3aed;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --bg-elevated: #0f1629;
  --text: #e8ecf7;
  --text-muted: #9aa3b5;
  --border: rgba(232, 236, 247, 0.08);
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.15);
  --accent-2: #a78bfa;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  color: var(--text);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
  box-shadow: 0 6px 18px var(--accent-soft);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.55rem;
  cursor: pointer;
}

.nav-toggle span:nth-child(n + 2) {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

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

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

.nav-cta {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}

.theme-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.theme-icon--moon {
  box-shadow: inset -5px -2px 0 0 currentColor;
  border-color: transparent;
  background: transparent;
}

[data-theme="dark"] .theme-icon--sun {
  opacity: 0.35;
}

[data-theme="light"] .theme-icon--moon {
  opacity: 0.35;
}

.flash-wrap {
  margin-top: 0.75rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.flash--success {
  background: color-mix(in srgb, #16a34a 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
}

.flash--error {
  background: color-mix(in srgb, #dc2626 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, #dc2626 35%, transparent);
}

.hero {
  position: relative;
  padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 6rem);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(ellipse at 30% 20%, var(--accent-soft), transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(124, 58, 237, 0.12), transparent 45%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 1rem;
}

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

.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.lead.narrow {
  max-width: 40rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px var(--accent-soft);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 16px 40px var(--accent-soft);
}

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

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

.btn-on-dark {
  background: #fff;
  color: #0b1220;
}

.btn-on-dark:hover {
  color: #0b1220;
}

.btn-block {
  width: 100%;
}

.hero-metrics {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}

.hero-metrics li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.metric-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-visual {
  display: flex;
  justify-content: flex-end;
}

.dashboard-card {
  width: min(100%, 400px);
  background: var(--bg-elevated);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px color-mix(in srgb, #22c55e 35%, transparent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, #22c55e 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.dash-rows {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
}

.tag {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.tag--ok {
  background: color-mix(in srgb, #22c55e 18%, var(--bg));
  color: #16a34a;
}

.tag--muted {
  background: var(--border);
  color: var(--text-muted);
}

.dash-chart {
  padding: 0 0.5rem 0.75rem;
}

.chart-svg {
  width: 100%;
  height: 72px;
}

.section {
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.section--alt {
  background: color-mix(in srgb, var(--bg-elevated) 70%, var(--bg));
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-head h2,
.section h2,
.page-hero h1 {
  letter-spacing: -0.02em;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.card h3,
.card h2 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.card--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(145deg, var(--bg-elevated), color-mix(in srgb, var(--accent-soft) 55%, var(--bg-elevated)));
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.65rem;
  color: var(--text-muted);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.checklist--compact li {
  margin-bottom: 0.45rem;
}

.cta-band {
  background: linear-gradient(120deg, #0b1220, #111a33 55%, #1a1030);
  color: #e8ecf7;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: #c7cedd;
}

.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-hero {
  padding: clamp(2.5rem, 5vw, 4rem) 0 1rem;
}

.page-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0.35rem 0 1rem;
}

.prose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.narrow-text {
  max-width: 720px;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.service-block {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.service-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.service-block p {
  color: var(--text-muted);
  max-width: 52rem;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.lead-form .field {
  margin-bottom: 1.1rem;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.field-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.field-textarea {
  resize: vertical;
  min-height: 140px;
}

.field-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

.field-error {
  color: #b91c1c;
  font-size: 0.82rem;
  margin: 0.25rem 0 0;
}

.contact-aside {
  padding: 1.25rem 0;
}

.contact-aside h2 {
  margin-top: 0;
}

.fine-print {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
  background: var(--bg-elevated);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand {
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.footer-tag {
  color: var(--text-muted);
  margin: 0;
  max-width: 22rem;
}

.footer-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay {
  transition-delay: 0.08s;
}

@media (max-width: 960px) {
  .hero-inner,
  .split,
  .card-grid,
  .card-grid--2,
  .prose-grid,
  .contact-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: absolute;
    right: 1.25rem;
    top: 64px;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
    min-width: 200px;
    display: none;
  }

  .nav-list.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }
}
