@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #050813;
  --surface: rgba(16, 23, 42, 0.9);
  --surface-alt: rgba(22, 32, 56, 0.9);
  --text-primary: #f5f8ff;
  --text-secondary: rgba(245, 248, 255, 0.72);
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.15);
  --border: rgba(79, 140, 255, 0.35);
  --shadow: 0 24px 48px -28px rgba(4, 11, 28, 0.85);
  --body-background:
    radial-gradient(130% 130% at 100% 0%, rgba(79, 140, 255, 0.24) 0%, rgba(79, 140, 255, 0) 55%),
    linear-gradient(135deg, #040915 0%, #091527 55%, #0d1c34 100%);
}

html {
  color-scheme: dark;
  background: var(--bg);
}

html[data-theme="light"] {
  --bg: #f5f8ff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-alt: rgba(245, 248, 255, 0.95);
  --text-primary: #0c1733;
  --text-secondary: rgba(17, 38, 78, 0.72);
  --accent: #4f6cff;
  --accent-soft: rgba(79, 108, 255, 0.12);
  --border: rgba(63, 104, 209, 0.24);
  --shadow: 0 24px 48px -30px rgba(35, 60, 120, 0.18);
  --body-background:
    radial-gradient(130% 130% at 100% 0%, rgba(79, 140, 255, 0.12) 0%, rgba(79, 140, 255, 0) 55%),
    linear-gradient(135deg, #fdfdff 0%, #edf2ff 52%, #dde6ff 100%);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--body-background);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  padding: 80px 24px 120px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #88a7ff;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.case-study {
  width: 100%;
  max-width: 960px;
  display: grid;
  gap: 36px;
}

.case-study__header {
  padding: 40px;
  display: grid;
  gap: 16px;
  position: relative;
}

.case-study__header::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.2), transparent 75%);
  pointer-events: none;
}

.case-study__header * {
  position: relative;
  z-index: 1;
}

.case-study__header,
.case-study__content,
.case-studies__header {
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
  backdrop-filter: blur(24px);
}

.case-study__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.case-study__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.case-study__back,
.case-studies__back {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(79, 140, 255, 0.16);
}

.case-study__back--secondary {
  background: transparent;
  color: var(--text-secondary);
}

.case-study__back--secondary:hover {
  background: transparent;
  color: var(--accent);
}

.case-study__back:hover,
.case-studies__back:hover {
  background: rgba(79, 140, 255, 0.24);
}

.case-study__subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.case-study__tags,
.case-studies__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.case-study__tags li,
.case-studies__tags li {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
  border: 1px solid rgba(79, 140, 255, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
  white-space: nowrap;
}

.case-study__metric {
  display: inline-flex;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(79, 140, 255, 0.14);
  border: 1px solid rgba(79, 140, 255, 0.28);
  color: var(--accent);
}

.case-study__hero-image {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(79, 140, 255, 0.2);
  box-shadow: var(--shadow);
}

.case-study__hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.case-study__content {
  padding: 48px;
  display: grid;
  gap: 28px;
}

.case-study__content h2,
.case-study__content h3,
.case-study__content h4 {
  margin: 24px 0 8px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}

.case-study__content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.case-study__content ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

.case-study__content li + li {
  margin-top: 10px;
}

.case-study__content hr {
  border: none;
  border-top: 1px solid rgba(79, 140, 255, 0.18);
  margin: 12px 0;
}

.case-study__content code {
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.28);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent);
}

.case-study__content blockquote {
  margin: 0;
  padding: 18px 24px;
  border-left: 3px solid var(--accent);
  background: rgba(79, 140, 255, 0.08);
  border-radius: 14px;
  font-style: italic;
  color: var(--text-primary);
}

.case-study__content figure {
  margin: 0;
  display: grid;
  gap: 12px;
}

.case-study__content figcaption {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

.case-study__content a {
  font-weight: 500;
}

.case-studies {
  width: 100%;
  max-width: 1080px;
  display: grid;
  gap: 32px;
}

.case-studies__header {
  padding: 40px;
  display: grid;
  gap: 12px;
}

.case-studies__header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.case-studies__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.case-studies__card {
  background: var(--surface-alt);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 12px;
}

.case-studies__card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.case-studies__subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.case-studies__metric {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0;
}

.case-studies__link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  body {
    padding: 60px 16px 100px;
  }

  .case-study__header,
  .case-study__content,
  .case-studies__header {
    padding: 28px;
  }

  .case-study__meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
