/* Customertimes Intelligence — corporate stylesheet
   Palette derived from the CTI logo gradient: teal → blue → purple */

:root {
  --ct-teal: #23D2C6;
  --ct-blue: #1689F2;
  --ct-purple: #8B35D7;
  --ct-deep: #6F39DC;
  --ct-gradient: linear-gradient(120deg, #23D2C6 0%, #1689F2 50%, #8B35D7 100%);
  --ct-gradient-soft: linear-gradient(120deg, rgba(35,210,198,0.18) 0%, rgba(22,137,242,0.18) 50%, rgba(139,53,215,0.18) 100%);

  /* Light theme tokens */
  --bg: #F6F8FC;
  --bg-elevated: #FFFFFF;
  --bg-muted: #EEF1F7;
  --text: #0E1530;
  --text-muted: #4B5675;
  --text-soft: #6B7491;
  --border: #E0E5EE;
  --border-strong: #C9D1DE;
  --shadow-sm: 0 1px 2px rgba(14,21,48,0.04), 0 1px 3px rgba(14,21,48,0.06);
  --shadow-md: 0 6px 18px rgba(14,21,48,0.08), 0 2px 6px rgba(14,21,48,0.05);
  --shadow-lg: 0 24px 48px rgba(14,21,48,0.12);
  --link: #1689F2;
  --link-hover: #6F39DC;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --max-w: 1180px;
  --header-h: 72px;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0A0E1F;
  --bg-elevated: #131930;
  --bg-muted: #1A2240;
  --text: #EDF1FA;
  --text-muted: #B2BDD8;
  --text-soft: #8590B0;
  --border: #232C4A;
  --border-strong: #344066;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 48px rgba(0,0,0,0.55);
  --link: #5DB6FF;
  --link-hover: #B58CFF;
  --ct-gradient-soft: linear-gradient(120deg, rgba(35,210,198,0.14) 0%, rgba(22,137,242,0.14) 50%, rgba(139,53,215,0.14) 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-hover); }

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

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--text-muted); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
}
.brand__logo {
  width: 40px;
  height: 40px;
}
.brand__title {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand__title span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.93rem;
}
.header-nav a:hover { background: var(--bg-muted); color: var(--text); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 18px; height: 18px; }

/* Lang dropdown */
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  display: none;
  z-index: 100;
}
.lang-menu.is-open { display: block; }
.lang-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.lang-menu button:hover { background: var(--bg-muted); }
.lang-menu button[aria-current="true"] { color: var(--link); font-weight: 600; }
.lang-menu .flag {
  width: 22px; height: 16px; border-radius: 2px; flex: none;
  background: var(--bg-muted);
  display: inline-block;
  font-size: 14px;
  line-height: 16px;
  text-align: center;
}

.lang-wrap { position: relative; }

/* ====== Hero ====== */
.hero {
  position: relative;
  padding: 96px 0 64px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ct-gradient-soft);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, rgba(139,53,215,0.22), transparent 60%);
  z-index: -1;
  filter: blur(40px);
}
.hero h1 {
  background: var(--ct-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 720px;
  margin-top: 8px;
}
.hero__actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 23px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn--primary {
  background: var(--ct-gradient);
  background-clip: padding-box;
  color: #fff;
  box-shadow: 0 10px 24px rgba(22,137,242,0.32);
}
.btn--primary:hover { transform: translateY(-1px); color: #fff; }
.btn--ghost {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 22px;
}
.btn--ghost:hover { border-color: var(--border-strong); }

/* ====== Section ====== */
section.section {
  padding: 72px 0;
}
section.section--alt {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head {
  max-width: 720px;
  margin-bottom: 36px;
}
.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--link);
  font-weight: 600;
}

/* ====== Solutions grid ====== */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.solution-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.solution-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ct-gradient);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 0;
}
.solution-card > * { position: relative; z-index: 1; }
.solution-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.solution-card:hover::before { opacity: 0.06; }

.solution-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ct-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.solution-card__icon svg { width: 24px; height: 24px; }
.solution-card h3 { margin: 4px 0 0; color: var(--text); }
.solution-card p { font-size: 0.95rem; margin: 0; color: var(--text-muted); }
.solution-card__cta {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--link);
  font-weight: 600;
}

/* ====== Stories ====== */
.story {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.story__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.story__title h3 { margin: 0; line-height: 1.3; }
a.story__num,
.story__num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--ct-gradient);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
a.story__num:hover {
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(22,137,242,0.35);
}
a.story__num:focus-visible {
  outline: 2px solid var(--ct-blue);
  outline-offset: 2px;
}
.story__steps {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}
.story__step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
}
.story__step-num {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.story__step-body { font-size: 0.96rem; color: var(--text); }
.story__step-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.tag--solution {
  background: var(--ct-gradient);
  background-clip: padding-box;
  color: #fff;
  border: 0;
  padding: 5px 11px;
}
.tag--solution:hover { color: #fff; opacity: 0.9; }
.tag img {
  width: 16px;
  height: 16px;
  flex: none;
  background: #fff;
  border-radius: 3px;
  padding: 1px;
}

/* Tool strip — used in stories and integration */
.tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}
.tool-chip img {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 4px;
  background: #fff;
  padding: 1px;
}
[data-theme="dark"] .tool-chip img { background: #fff; }

/* ====== Integration ====== */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.integration-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.integration-card h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

/* ====== Solution page ====== */
.solution-hero {
  padding: 96px 0 40px;
  position: relative;
  overflow: hidden;
}
.solution-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ct-gradient-soft);
  z-index: -1;
}
.solution-hero__back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.solution-hero__back:hover { color: var(--text); }
.solution-hero__icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--ct-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(22,137,242,0.25);
}
.solution-hero__icon svg { width: 32px; height: 32px; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.feature-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
}
.feature-list li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ct-gradient);
  margin-top: 6px;
}

.related-stories h2 { margin-bottom: 18px; }
.related-list {
  display: grid;
  gap: 12px;
}
.related-list a {
  display: block;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.related-list a:hover { border-color: var(--border-strong); transform: translateX(2px); color: var(--text); }

/* ====== Footer ====== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 60px;
  font-size: 0.88rem;
  color: var(--text-soft);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ====== Reveal-on-scroll animation ====== */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ====== Responsive ====== */
@media (max-width: 860px) {
  .header-nav { display: none; }
  .hero { padding: 64px 0 40px; }
  section.section { padding: 56px 0; }
  .story { padding: 22px; }
  .brand__title span { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .icon-btn { width: 38px; height: 38px; }
  .story__step { grid-template-columns: 24px 1fr; }
}
