/* ============================================================
   Bruno Maestrini — Portfolio
   Split-panel SPA. Black + Yellow. No scroll. Tabbed content.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
p + p { margin-top: 1em; }

:root {
  --bg:           #0a0a0a;
  --bg-alt:       #0e0e0e;
  --bg-card:      #141414;
  --bg-card-h:    #1a1a1a;
  --text:         #e8e8e8;
  --text-muted:   #888;
  --text-dim:     #444;
  --accent:       #FFD600;
  --accent-h:     #FFE44D;
  --accent-dim:   rgba(255,214,0,.08);
  --accent-glow:  rgba(255,214,0,.15);
  --accent-text:  #0a0a0a;
  --border:       #1e1e1e;
  --border-h:     #2a2a2a;
  --badge-bg:     #1a1a1a;
  --badge-bd:     #2a2a2a;
  --badge-tx:     #999;
  --radius:       8px;
  --radius-lg:    16px;
  --tr:           .2s ease;
  --left-w:       45%;
}

[data-theme="light"] {
  --bg:           #edf2f8;
  --bg-alt:       #e2eaf4;
  --bg-card:      #f4f8fe;
  --bg-card-h:    #eef3fb;
  --text:         #1a2030;
  --text-muted:   #4a5a72;
  --text-dim:     #8a9ab5;
  --accent:       #d4a800;
  --accent-h:     #b89200;
  --accent-dim:   rgba(212,168,0,.06);
  --accent-glow:  rgba(212,168,0,.10);
  --accent-text:  #fff;
  --border:       #cdd8e8;
  --border-h:     #b8c6da;
  --badge-bg:     #e4ecf8;
  --badge-bd:     #cdd8e8;
  --badge-tx:     #4a5a72;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--tr), color var(--tr);
}

a { color: var(--accent); text-decoration: none; transition: color var(--tr); }
a:hover { color: var(--accent-h); }
::selection { background: var(--accent); color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* =============================================================
   LAYOUT: side-by-side, full viewport
   ============================================================= */
.layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* --- Left panel: particles ---------------------------------- */
.panel-left {
  position: relative;
  width: var(--left-w);
  min-width: 300px;
  height: 100vh;
  background: #050505 url('header-web2.jpg') center / cover no-repeat;
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="light"] .panel-left { background: #edf2f8 url('header-web.png') center / cover no-repeat; }

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.panel-left__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  z-index: 2;
  background: linear-gradient(180deg, transparent 40%, rgba(5,5,5,.8) 100%);
  pointer-events: none;
}

[data-theme="light"] .panel-left__overlay {
  background: linear-gradient(180deg, transparent 40%, rgba(240,244,248,.85) 100%);
}

.panel-left__brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-left__name {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -.04em;
  color: var(--text);
}

.panel-left__title {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Floating tech badges */
.panel-left__floaters {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.floater {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-dim);
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  white-space: nowrap;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  will-change: left, top;
}
.floater:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,214,0,.08);
  z-index: 2;
}
.floater--accent {
  border-color: rgba(255,214,0,.15);
  color: var(--accent);
  background: rgba(255,214,0,.05);
}
.floater--accent:hover {
  background: rgba(255,214,0,.15);
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- Right panel: content ----------------------------------- */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  border-left: 1px solid var(--border);
}
.panel-right::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}
[data-theme="light"] .panel-right::before { opacity: .045; }

/* --- Top bar / navigation ----------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.topbar__nav {
  display: flex;
  gap: 4px;
}

.topbar__link {
  padding: 8px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--tr);
  position: relative;
}
.topbar__link:hover { color: var(--text); background: var(--accent-dim); }
.topbar__link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 34px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--tr);
}
.lang-toggle:hover { color: var(--accent); border-color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--tr);
  flex-shrink: 0;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Content area ------------------------------------------- */
.content-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.content-section {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.content-section.active {
  opacity: 1;
  visibility: visible;
}

.content-inner {
  padding: 48px 40px 60px;
  max-width: 680px;
}

/* --- Footer ------------------------------------------------- */
.panel-footer {
  flex-shrink: 0;
  padding: 12px 40px;
  border-top: 1px solid var(--border);
  font-size: .7rem;
  color: var(--text-dim);
}

/* =============================================================
   SECTION STYLES
   ============================================================= */

.section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: "";
  width: 24px; height: 2px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 14px;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: .9rem;
  max-width: 500px;
}

/* --- Hero (Home tab) ---------------------------------------- */
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: 20px;
}

.highlight {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-glow);
}

.hero-sub {
  font-size: clamp(.9rem, 2vw, 1.05rem);
  color: var(--text-muted);
  margin-bottom: 44px;
  line-height: 1.6;
  max-width: 480px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Home pillars */
.home-pillars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}
.home-pillar {
  padding: 22px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--tr);
}
.home-pillar:hover { border-color: var(--accent); }
.home-pillar__title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.home-pillar__desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
}
@media (max-width: 500px) {
  .home-pillar { padding: 18px 20px; }
  .home-pillars { gap: 12px; margin-bottom: 40px; }
}

/* --- Buttons ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--tr);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn--primary:hover {
  background: var(--accent-h);
  color: var(--accent-text);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Services ----------------------------------------------- */
.services-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s ease;
}
.service-card:hover { border-color: var(--border-h); background: var(--bg-card-h); }
.service-card:hover::before { transform: scaleY(1); }

.service-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.service-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.service-card__icon svg { width: 20px; height: 20px; }

.service-card__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.service-card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 54px;
}
.service-card__list li {
  padding-left: 14px;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
}
.service-card__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Case Study cards --------------------------------------- */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cases-grid .case-card:first-child {
  grid-column: 1 / -1;
}
.cases-grid .case-card:first-child .case-card__thumb {
  aspect-ratio: 21 / 9;
}

.case-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all .3s ease;
}
.case-card:hover {
  border-color: rgba(255,214,0,.25);
  box-shadow: 0 8px 32px rgba(255,214,0,.04);
}

.case-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
}
.case-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.case-card:hover .case-card__thumb img { transform: scale(1.04); }
.case-card__thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
}
.case-card__thumb-icon {
  font-size: 2rem; opacity: .15; color: var(--accent);
}

.case-card__body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.case-card__title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.02em;
  color: var(--text);
}

.case-card__outcome {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
  flex: 1;
}
.case-card__hook {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 4px;
}

.case-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: .65rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-tx);
  border: 1px solid var(--badge-bd);
}
.badge--accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(255,214,0,.15);
}

@media (max-width: 900px) {
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .cases-grid .case-card:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .cases-grid { grid-template-columns: 1fr; }
  .cases-grid .case-card:first-child .case-card__thumb { aspect-ratio: 16 / 10; }
}

/* --- Process ------------------------------------------------ */
.process-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.process-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: border-color var(--tr);
}
.process-step:hover { border-color: var(--border-h); }

.process-step__number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 0 16px var(--accent-glow);
}

.process-step__title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.process-step__desc {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- About -------------------------------------------------- */
.about-content { max-width: 560px; }
.about-content p {
  color: var(--text-muted);
  margin-bottom: 14px;
  font-size: .9rem;
  line-height: 1.7;
}
.about-content strong { color: var(--text); }

/* --- Contact ------------------------------------------------ */
.contact-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-form { display: flex; flex-direction: column; gap: 14px; }

.form-group label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group--hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.contact-info { font-size: .85rem; color: var(--text-muted); }
.contact-info a { font-weight: 600; }
.contact-info p { margin-bottom: 8px; }
.contact-info__label {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-dim);
  margin-bottom: 4px; margin-top: 20px;
}
.contact-info__label:first-child { margin-top: 0; }

/* =============================================================
   MOBILE HAMBURGER
   ============================================================= */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px; right: 16px;
  z-index: 300;
  width: 40px; height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
}
.mobile-menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  transition: all .25s ease;
}
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(3px, 3px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  html, body { overflow: auto; }

  .panel-left {
    width: 100%;
    height: 45vh;
    min-width: unset;
  }

  .panel-right {
    height: auto;
    overflow: visible;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .content-area { position: relative; }

  .content-section {
    position: relative;
    display: none;
    overflow: visible;
  }
  .content-section.active { display: block; opacity: 1; visibility: visible; }

  .topbar { padding: 0 20px; overflow-x: auto; }
  .topbar__nav { gap: 2px; }
  .topbar__link { padding: 8px 10px; font-size: .75rem; white-space: nowrap; }

  .content-inner { padding: 32px 20px 48px; }

  .process-grid { grid-template-columns: 1fr; }

  .mobile-menu-btn { display: none; /* keep tabs visible on mobile instead */ }
}

@media (max-width: 500px) {
  .panel-left { height: 35vh; }
  .panel-left__overlay { padding: 24px; }
  .panel-left__name { font-size: 1.8rem; }
  .panel-left__floaters { display: none; }
  .content-inner { padding: 24px 16px 40px; }

  /* Float lang + theme toggles top-right on mobile (homepage) */
  .topbar__right {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 200;
    padding: 10px 12px;
    gap: 6px;
  }
  .lang-toggle, .theme-toggle { height: 30px; }
  .lang-toggle { padding: 0 8px; font-size: .68rem; }
  .theme-toggle { width: 30px; height: 30px; }
}

/* Float lang + theme toggles top-right on mobile (case study pages) */
@media (max-width: 600px) {
  .nav__right {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 210;
    padding: 13px 12px;
    gap: 6px;
  }
}

/* =============================================================
   CASE STUDY DETAIL + INDEX PAGES (separate pages, scrollable)
   ============================================================= */

/* These pages use normal scroll layout */
body.page-scroll {
  overflow: auto;
}
body.page-scroll .layout { display: block; height: auto; }

/* Shared nav for sub-pages */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 60px;
  display: flex;
  align-items: center;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav { background: rgba(237,242,248,.9); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav__logo {
  display: flex;
  align-items: center;
}
.nav__logo-img {
  height: 24px;
  width: auto;
}
.nav__logo:hover .nav__logo-img { opacity: .8; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}
.nav__links a {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--tr);
}
.nav__links a:hover, .nav__links a.active { color: var(--text); }

.nav__right { display: flex; align-items: center; gap: 8px; }

.nav__menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}
.nav__menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav__menu-btn { display: block; }
  .nav__links {
    position: fixed;
    inset: 60px 0 0 0;
    flex-direction: column;
    background: var(--bg);
    padding: 40px 24px;
    gap: 20px;
    transform: translateX(100%);
    transition: transform .25s ease;
  }
  .nav__links.open { transform: translateX(0); }
}

/* Sub-page container */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Case study detail */
.case-detail { padding: 48px 0 80px; }
.case-detail__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 500; margin-bottom: 24px; color: var(--text-muted);
}
.case-detail__back:hover { color: var(--accent); }

.case-detail__title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 14px;
}
.case-detail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 36px; }

.case-detail h2 {
  font-size: 1rem; font-weight: 700;
  margin: 36px 0 10px;
  color: var(--accent);
}
.case-detail p, .case-detail li {
  color: var(--text-muted); font-size: .9rem; line-height: 1.7;
}
.case-detail ul { padding-left: 20px; margin-bottom: 16px; }
.case-detail li { margin-bottom: 6px; }
.case-detail li::marker { color: var(--accent); }

.stack-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 28px; }

.case-detail__cta {
  margin-top: 48px; padding: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.case-detail__cta p {
  margin-bottom: 16px; font-size: 1rem;
  color: var(--text) !important; font-weight: 700;
}

/* Case detail — blog-style figures & comparisons */
.case-detail__figure {
  margin: 24px 0;
}
.case-detail__figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity var(--tr);
}
.case-detail__figure img:hover { opacity: .85; }
.case-detail__figure--half { max-width: 50%; margin-left: auto; margin-right: auto; }
.case-detail__figure figcaption {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--text);
  opacity: .7;
  line-height: 1.5;
  font-style: italic;
}

/* Phone mockup frame */
.phone-frame {
  display: inline-block;
  position: relative;
  width: 220px;
  padding: 10px;
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border-radius: 36px;
  border: 2px solid #444;
  box-shadow:
    0 12px 40px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.phone-frame::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: #1a1a1a;
  border-radius: 0 0 12px 12px;
  z-index: 3;
}
.phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
  border: none !important;
  cursor: zoom-in;
}
.case-detail__phones {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 28px 0;
  flex-wrap: wrap;
}
.case-detail__phones figure {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.case-detail__phones figcaption {
  text-align: center;
  margin-top: 14px;
  font-size: .78rem;
  color: var(--text);
  opacity: .7;
  font-style: italic;
}
[data-theme="light"] .phone-frame {
  background: linear-gradient(145deg, #e8e8e8, #d8d8d8);
  border-color: #bbb;
  box-shadow: 0 12px 40px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.5);
}
[data-theme="light"] .phone-frame::before { background: #e0e0e0; }
@media (max-width: 500px) {
  .phone-frame { width: 160px; border-radius: 28px; padding: 8px; }
  .phone-frame img { border-radius: 20px; }
  .phone-frame::before { width: 48px; height: 16px; top: 6px; border-radius: 0 0 10px 10px; }
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.92);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  cursor: zoom-out;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox__content {
  display: flex; flex-direction: column; align-items: center;
  max-width: 90vw; max-height: 92vh;
}
.lightbox__img {
  max-width: 90vw; max-height: 82vh;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 8px 60px rgba(0,0,0,.6);
  object-fit: contain;
}
.lightbox__caption {
  max-width: 100%; width: 100%;
  padding: 10px 16px;
  background: rgba(0,0,0,.75);
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.75);
  line-height: 1.5;
  font-style: italic;
}
.lightbox__close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none;
  color: rgba(255,255,255,.6);
  font-size: 2rem; line-height: 1;
  cursor: pointer; transition: color .15s;
}
.lightbox__close:hover { color: #fff; }
.case-detail h3 {
  font-size: .9rem; font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text);
}
.case-detail ol {
  padding-left: 20px; margin-bottom: 16px;
}
.case-detail ol li { margin-bottom: 6px; }
.case-detail ol li::marker { color: var(--accent); font-weight: 700; }
.case-detail__comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.case-detail__comparison-img {
  position: relative;
}
.case-detail__comparison-img img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.case-detail__comparison-label {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
@media (max-width: 600px) {
  .case-detail__comparison { grid-template-columns: 1fr; }
}

/* More case studies */
.more-studies {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.more-studies__heading {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.more-studies__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.more-studies__card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.more-studies__card:hover {
  border-color: rgba(255,214,0,.25);
  box-shadow: 0 6px 24px rgba(255,214,0,.04);
}
.more-studies__card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.more-studies__card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.more-studies__card:hover .more-studies__card-thumb img { transform: scale(1.04); }
.more-studies__card-thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
}
.more-studies__card-thumb-icon {
  font-size: 1.5rem; opacity: .15; color: var(--accent);
}
.more-studies__card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.more-studies__card-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.more-studies__card-desc {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.more-studies__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.more-studies__card-tags .badge {
  font-size: .6rem;
  padding: 2px 8px;
}
@media (max-width: 768px) {
  .more-studies__grid { grid-template-columns: 1fr; }
}

/* Architecture diagram */
.arch-diagram {
  display: flex; flex-wrap: wrap; gap: 0;
  justify-content: center; margin: 28px 0;
}
.arch-step {
  flex: 1 1 130px; max-width: 160px;
  text-align: center; padding: 14px 6px; position: relative;
}
.arch-step__box {
  background: var(--accent-dim);
  border: 1px solid rgba(255,214,0,.2);
  border-radius: var(--radius);
  padding: 12px 8px; margin-bottom: 6px;
  font-size: .7rem; font-weight: 700; color: var(--accent);
}
.arch-step__desc { font-size: .65rem; color: var(--text-muted); line-height: 1.3; }
.arch-step + .arch-step::before {
  content: "→"; position: absolute;
  left: -6px; top: 24px; font-size: .9rem; color: var(--text-dim);
}
@media (max-width: 600px) {
  .arch-diagram { flex-direction: column; align-items: center; }
  .arch-step + .arch-step::before { content: "↓"; position: static; display: block; margin-bottom: 2px; color: var(--accent); }
  .arch-step { max-width: 240px; }
}

/* Case studies index */
.cs-index-header { padding: 48px 0 24px; }
.cs-index-header .page-container,
.cs-section .page-container { max-width: 1080px; }
.cs-index-header__title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 900; letter-spacing: -.03em; margin-bottom: 8px;
}
.cs-section { padding: 0 0 60px; }

.cs-index-controls {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; margin-bottom: 24px;
}
.search-input {
  flex: 1; min-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit; font-size: .85rem;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.tag-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-btn {
  padding: 6px 14px; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px;
  background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all var(--tr);
}
.tag-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-btn.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.cs-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }

/* Sub-page footer */
.page-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .7rem;
  color: var(--text-dim);
}
