/* Casevault Desk — IBM Carbon–inspired editorial style */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0f62fe;
  --primary-hover: #0050e6;
  --primary-dark: #002d9c;
  --ink: #161616;
  --ink-muted: #525252;
  --ink-subtle: #8c8c8c;
  --canvas: #ffffff;
  --surface-1: #f4f4f4;
  --surface-2: #e0e0e0;
  --inverse-canvas: #161616;
  --inverse-ink: #ffffff;
  --inverse-ink-muted: #c6c6c6;
  --hairline: #e0e0e0;
  --hairline-strong: #161616;
  --font: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --header-h: 64px;
  --container: 1312px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

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

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0;
  flex-shrink: 0;
}
.logo-text {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.2;
}
.logo-text strong { font-weight: 600; }

.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  padding: 0 16px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  letter-spacing: 0.16px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--primary); text-decoration: none; border-bottom-color: var(--primary); }
.primary-nav a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

.burger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.burger-btn span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: var(--canvas);
  z-index: 99;
  border-top: 1px solid var(--hairline);
  overflow-y: auto;
}
.mobile-nav.open { display: flex; flex-direction: column; }
.mobile-nav a {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  padding: 16px 32px;
  border-bottom: 1px solid var(--hairline);
  display: block;
  letter-spacing: 0.16px;
}
.mobile-nav a:hover { background: var(--surface-1); text-decoration: none; }

/* EYEBROW */
.eyebrow {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.16px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: block;
}

/* HERO */
.hero {
  background: var(--canvas);
  padding: 80px 0 72px;
  border-bottom: 1px solid var(--hairline);
}
.hero-inner { max-width: 800px; }
.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 300;
  line-height: 1.17;
  letter-spacing: -0.4px;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero-lead {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-muted);
  max-width: 640px;
  margin-bottom: 40px;
}
.hero-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-subtle);
  letter-spacing: 0.16px;
}
.hero-meta span strong { color: var(--ink-muted); font-weight: 600; }

/* SECTIONS */
.section { padding: 64px 0; border-top: 1px solid var(--hairline); }
.section-alt { background: var(--surface-1); }
.section-header { margin-bottom: 40px; }
.section-header h2 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--ink);
}

/* MAIN CARD */
.main-case-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hairline);
  background: var(--canvas);
}
.main-case-img {
  background: var(--surface-1);
  min-height: 300px;
  overflow: hidden;
}
.main-case-img img { width: 100%; height: 100%; object-fit: cover; }
.main-case-body {
  padding: 40px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}
.main-case-body h2 {
  font-size: 32px;
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
}
.main-case-body p { font-size: 16px; line-height: 1.6; color: var(--ink-muted); }
.card-meta { font-size: 12px; color: var(--ink-subtle); letter-spacing: 0.32px; display: flex; gap: 24px; flex-wrap: wrap; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.16px;
}
.btn-ghost:hover { color: var(--primary-hover); text-decoration: underline; }
.btn-ghost::after { content: '→'; }

/* CASE CARDS */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
}
.case-card {
  border-right: 1px solid var(--hairline);
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  transition: background 0.15s;
}
.case-card:last-child { border-right: none; }
.case-card:hover { background: var(--surface-1); }
.case-card-img {
  height: 180px;
  background: var(--surface-1);
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}
.case-card-img img { width: 100%; height: 100%; object-fit: cover; }
.case-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.case-category {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-subtle);
  letter-spacing: 0.32px;
  text-transform: uppercase;
}
.case-card-body h3 { font-size: 20px; font-weight: 400; line-height: 1.33; color: var(--ink); flex: 1; }
.case-card-body p { font-size: 14px; line-height: 1.5; color: var(--ink-muted); letter-spacing: 0.16px; }
.case-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-subtle);
}

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  margin: 32px 0;
}
.gallery-item {
  aspect-ratio: 4/3;
  background: var(--surface-1);
  overflow: hidden;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ARTICLE */
.page-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}
.breadcrumb {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  letter-spacing: 0.32px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--surface-2); }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  padding: 64px 0;
  align-items: start;
}
.article-body h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 300;
  line-height: 1.17;
  letter-spacing: -0.4px;
  color: var(--ink);
  margin-bottom: 24px;
}
.article-byline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0.32px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}
.article-byline span strong { color: var(--ink-muted); font-weight: 600; }
.article-summary {
  background: var(--surface-1);
  border-left: 3px solid var(--primary);
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-muted);
  font-weight: 400;
}
.article-content h2 {
  font-size: 28px;
  font-weight: 300;
  color: var(--ink);
  margin: 48px 0 16px;
  letter-spacing: 0;
}
.article-content h3 {
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
  margin: 32px 0 12px;
}
.article-content p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-muted);
  letter-spacing: 0.16px;
  margin-bottom: 16px;
}
.article-content ul, .article-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--ink-muted);
  line-height: 1.65;
  letter-spacing: 0.16px;
}
.article-content li { margin-bottom: 6px; }
.article-img-block {
  margin: 32px 0;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
}
.article-img-block img { width: 100%; }
.article-img-block figcaption {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0.32px;
  border-top: 1px solid var(--hairline);
}
.not-covered {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  padding: 20px 24px;
  margin: 32px 0;
}
.not-covered h3 { font-size: 12px; letter-spacing: 0.32px; text-transform: uppercase; color: var(--ink-subtle); margin-bottom: 12px; font-weight: 400; }
.not-covered ul { color: var(--ink-muted); font-size: 14px; letter-spacing: 0.16px; }

/* TOC */
.toc-box {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.toc-box h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.32px; text-transform: uppercase; color: var(--ink-subtle); margin-bottom: 16px; }
.toc-list { list-style: none; display: flex; flex-direction: column; }
.toc-list a { font-size: 13px; font-weight: 400; color: var(--ink-muted); padding: 6px 0; border-bottom: 1px solid var(--hairline); display: block; letter-spacing: 0.16px; }
.toc-list a:hover { color: var(--primary); text-decoration: none; }
.toc-list li:last-child a { border-bottom: none; }
.related-box { margin-top: 24px; background: var(--surface-1); border: 1px solid var(--hairline); padding: 20px; }
.related-box h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.32px; text-transform: uppercase; color: var(--ink-subtle); margin-bottom: 16px; }
.related-link { display: block; font-size: 13px; color: var(--ink-muted); padding: 8px 0; border-bottom: 1px solid var(--hairline); letter-spacing: 0.16px; }
.related-link:last-child { border-bottom: none; }
.related-link:hover { color: var(--primary); text-decoration: none; }

/* INNER PAGES */
.inner-hero { padding: 48px 0 40px; border-bottom: 1px solid var(--hairline); }
.inner-hero h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 300; letter-spacing: 0; line-height: 1.2; color: var(--ink); }
.inner-content { max-width: 740px; padding: 64px 0; }
.inner-content h2 { font-size: 24px; font-weight: 400; color: var(--ink); margin: 40px 0 12px; }
.inner-content h3 { font-size: 20px; font-weight: 400; color: var(--ink); margin: 28px 0 10px; }
.inner-content p { font-size: 16px; line-height: 1.65; color: var(--ink-muted); letter-spacing: 0.16px; margin-bottom: 16px; }
.inner-content ul, .inner-content ol { padding-left: 24px; color: var(--ink-muted); line-height: 1.65; margin-bottom: 16px; letter-spacing: 0.16px; }
.inner-content li { margin-bottom: 6px; }
.inner-content a { color: var(--primary); }
.inner-content a:hover { color: var(--primary-hover); }

/* CONTACT */
.contact-form { max-width: 540px; display: flex; flex-direction: column; gap: 24px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.32px; text-transform: uppercase; }
.form-group input, .form-group textarea {
  background: var(--surface-1);
  border: none;
  border-bottom: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.16px;
  padding: 11px 16px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
  border-radius: 0;
}
.form-group input:focus, .form-group textarea:focus { border-bottom: 2px solid var(--primary); }
.form-group textarea { min-height: 140px; resize: vertical; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.16px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--surface-2); color: var(--ink-subtle); cursor: not-allowed; }
.form-status { font-size: 14px; color: var(--primary); min-height: 20px; letter-spacing: 0.16px; }

/* COOKIE BANNER */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--inverse-canvas);
  border-top: 3px solid var(--primary);
  padding: 16px 32px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
#cookie-banner p { font-size: 13px; color: var(--inverse-ink-muted); flex: 1; min-width: 200px; letter-spacing: 0.16px; }
#cookie-banner a { color: #74b3ff; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-cookie {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  padding: 8px 16px;
  border: 1px solid var(--surface-2);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 0;
  letter-spacing: 0.16px;
}
.btn-cookie-accept { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-cookie-accept:hover { background: var(--primary-hover); }
.btn-cookie-reject { background: transparent; color: var(--inverse-ink-muted); }
.btn-cookie-reject:hover { background: #262626; color: #fff; }
.btn-cookie-settings { background: transparent; color: var(--inverse-ink-muted); }
.btn-cookie-settings:hover { color: #74b3ff; }

/* FOOTER */
.site-footer {
  background: var(--inverse-canvas);
  padding: 64px 32px 40px;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 64px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid #262626;
}
.footer-brand .logo-text { color: var(--inverse-ink); }
.footer-brand p { font-size: 13px; color: var(--inverse-ink-muted); margin-top: 12px; line-height: 1.6; max-width: 260px; letter-spacing: 0.16px; }
.footer-col h5 { font-size: 12px; font-weight: 600; letter-spacing: 0.32px; text-transform: uppercase; color: var(--inverse-ink-muted); margin-bottom: 16px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 13px; color: #c6c6c6; letter-spacing: 0.16px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { font-size: 12px; color: #525252; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; letter-spacing: 0.32px; }
.footer-bottom a { color: #525252; }
.footer-bottom a:hover { color: #c6c6c6; }

/* RESPONSIVE */
@media (max-width: 1056px) {
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .cases-grid .case-card:nth-child(2) { border-right: none; }
  .main-case-card { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 672px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 0 16px; }
  .site-footer { padding: 48px 16px 32px; }
  .primary-nav { display: none; }
  .burger-btn { display: flex; }
  .cases-grid { grid-template-columns: 1fr; }
  .cases-grid .case-card { border-right: none; border-bottom: 1px solid var(--hairline); }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
  #cookie-banner { padding: 16px; }
}
