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

/* ============================================================
   Case study subpages — dark premium theme
   Shares the design language of css/portfolio.css.
   Self-contained: restyles every case-study page with no
   changes to their individual <head> markup.
   ============================================================ */
:root {
  --bg: #0a0b0e;
  --bg-1: #0e1015;
  --bg-2: #14171f;
  --bg-3: #1a1e28;
  --bg-inset: #090a0d;

  --text: #eef1f6;
  --text-2: #a7aebd;
  --text-3: #6f7787;

  --accent: #6e8bff;
  --accent-text: #8ea2ff;
  --accent-soft: rgba(110, 139, 255, 0.1);
  --accent-line: rgba(110, 139, 255, 0.24);
  --mint: #5ed2a0;

  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --ring: rgba(110, 139, 255, 0.55);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Consolas, Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.shell {
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 14, 0.78);
  backdrop-filter: saturate(150%) blur(14px);
}

.site-header__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header a {
  color: var(--text);
  font-weight: 600;
}

.site-header a:hover {
  color: #fff;
}

.brand {
  letter-spacing: -0.01em;
  font-size: 1rem;
}

.site-header__inner a[href*="#"],
.site-header__inner a:last-child {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
}

.site-header__inner a[href*="#"]:hover,
.site-header__inner a:last-child:hover {
  color: var(--accent-text);
}

/* ---- Headings ---- */
h1, h2, h3 {
  margin-top: 0;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

h1 {
  max-width: 900px;
  margin-bottom: 22px;
  font-size: clamp(2.6rem, 6.5vw, 4.3rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
}

h3 {
  margin-bottom: 10px;
  font-size: 1.28rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--accent-line);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 104px) 0 clamp(52px, 7vw, 84px);
  background:
    radial-gradient(circle at 12% 8%, rgba(110, 139, 255, 0.16), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(94, 210, 160, 0.07), transparent 46%),
    var(--bg-1);
  border-bottom: 1px solid var(--border);
}

.hero .eyebrow {
  color: var(--accent-text);
}

.hero__lead {
  max-width: 840px;
  margin: 0;
  color: var(--text-2);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.5;
}

.facts {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fact {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.fact span {
  display: block;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fact strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 550;
  line-height: 1.4;
}

/* ---- Sections ---- */
main section {
  padding: clamp(56px, 8vw, 84px) 0;
}

.intro-grid,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(300px, 1.18fr);
  gap: clamp(32px, 5vw, 60px);
  align-items: start;
}

.intro-grid > p {
  margin: 0;
  color: var(--text-2);
  font-size: 1.15rem;
  line-height: 1.6;
}

.detail-section {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.status-note {
  margin: 0;
  color: var(--text-2);
}

/* ---- Cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  transition: border-color 0.24s var(--ease), transform 0.24s var(--ease), background 0.24s var(--ease);
}

.card:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  background: var(--bg-2);
}

.card h3 {
  color: var(--text);
}

.card p {
  margin-bottom: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

/* ---- Architecture panel ---- */
.architecture {
  padding: 30px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  color: var(--text-2);
  background:
    radial-gradient(circle at 90% 0%, rgba(110, 139, 255, 0.1), transparent 55%),
    var(--bg-inset);
}

.architecture ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: arch;
}

.architecture li {
  position: relative;
  padding-left: 46px;
  min-height: 32px;
}

.architecture li + li {
  margin-top: 20px;
}

.architecture li::before {
  counter-increment: arch;
  content: counter(arch, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

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

/* ---- Tags ---- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.tag-list span {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
}

/* ---- Footer ---- */
.footer {
  padding: 34px 0;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  background: var(--bg-inset);
}

.footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.88rem;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro-grid,
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 32px, 1100px);
  }

  .facts,
  .cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition-duration: 0.001ms !important;
  }
}
