/* ─── Cal Sans ─── */
@font-face {
  font-family: 'Cal Sans';
  src: url('https://cdn.jsdelivr.net/npm/@calcom/cal-sans@1.0.1/fonts/CalSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Password gate ─── */
.pw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #1f1f1f;
  background-image: url('assets/portrait-bg.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.pw-gate.unlocking {
  opacity: 0;
  transform: scale(1.02);
}

@keyframes pwShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

.pw-gate.shake .pw-inner {
  animation: pwShake 0.45s ease;
}

.pw-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: clamp(280px, 38vw, 480px);
}

.pw-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.pw-input-wrap { width: 100%; }

.pw-input {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #ffffff;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  outline: none;
  width: 100%;
  padding: 6px 0 14px;
  transition: border-color 0.2s ease;
  caret-color: #ffffff;
}

.pw-input:focus { border-bottom-color: rgba(255, 255, 255, 0.6); }

.pw-input::placeholder { color: rgba(255, 255, 255, 0.12); }

.pw-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.02em;
}

/* ─── Base ─── */
html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(to top, #bae6fd, #7dd3fc 45%, #0284c7); /* fallback */
  color: #1f1f1f;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* background updated by JS gradient — CSS transitions don't animate gradients */
}

/* ─── Adaptive text — light sky (default) ─── */
/* All text elements that sit directly on the gradient need a subtle shadow
   to stay legible during mid-sky transitions (sunrise, golden hour, sunset). */
.hero-tagline, .hero-desc,
.cases-heading, .case-company,
.case-title-h, .case-desc-h,
.case-chevron {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

/* ─── Dark-sky overrides (night / dawn / dusk / sunset) ─── */
.sky-dark .hero-tagline,
.sky-dark .hero-desc { color: rgba(255, 255, 255, 0.95); }

.sky-dark .hero-logo { color: rgba(255, 255, 255, 0.95); }

.sky-dark .start-btn {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sky-dark .start-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Portfolio — case list text */
.sky-dark .cases-heading      { color: rgba(255, 255, 255, 0.45); }
.sky-dark .case-company       { color: rgba(255, 255, 255, 0.45); }
.sky-dark .case-title-h       { color: rgba(255, 255, 255, 0.95); }
.sky-dark .case-desc-h        { color: rgba(255, 255, 255, 0.65); }
.sky-dark .case-chevron                    { color: rgba(255, 255, 255, 0.25); }
.sky-dark .case-card-h:hover .case-chevron { color: rgba(255, 255, 255, 0.7); }
.sky-dark .case-card-h                     { border-bottom-color: rgba(255, 255, 255, 0.14); }

/* Header links */
.sky-dark .site-header        { border-bottom-color: rgba(255, 255, 255, 0.1); }
.sky-dark .site-header a,
.sky-dark .site-header svg    { color: rgba(255, 255, 255, 0.7); }

/* ─── Chat rail — dark sky ─── */
.sky-dark .chat-rail {
  border-right-color: rgba(255, 255, 255, 0.1);
}

/* Name prompt */
.sky-dark .name-question { color: rgba(255, 255, 255, 0.95); }
.sky-dark .name-input {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.28);
}
.sky-dark .name-input::placeholder { color: rgba(255, 255, 255, 0.22); }
.sky-dark .name-input:focus         { border-bottom-color: rgba(255, 255, 255, 0.75); }
.sky-dark .name-hint               { color: rgba(255, 255, 255, 0.4); }

/* Messages */
.sky-dark .msg-text                { color: rgba(255, 255, 255, 0.92); }
.sky-dark .msg--user .msg-text {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
}
.sky-dark .msg-dot-wrap span       { background: rgba(255, 255, 255, 0.5); }

/* Input bar */
.sky-dark .rail-input-wrap {
  border-top-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}
.sky-dark .chat-input {
  color: #1f1f1f;
  background: #ffffff;
  border-color: rgba(31, 31, 31, 0.15);
}
.sky-dark .chat-input::placeholder { color: rgba(31, 31, 31, 0.4); }
.sky-dark .chat-input:focus {
  border-color: rgba(31, 31, 31, 0.35);
  background: #ffffff;
}

/* ─── Sticky Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f1f1f;
  padding: 16px 60px;
  height: 80px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-avatar {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  object-fit: cover;
  object-position: center top;
  display: block;
  flex-shrink: 0;
}

.header-identity {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.header-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.15s ease;
}

.header-social a:hover { color: #ffffff; }

/* ─── Main layout ─── */
main {
  height: calc(100vh - 80px);
  overflow: hidden;
  position: relative;
}

/* ─── Landing ─── */
.landing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 80px 60px;
  z-index: 10;
}

.landing.exiting {
  animation: landingExit 0.55s cubic-bezier(0.4, 0, 0.6, 1) both;
}

@keyframes landingExit {
  to {
    transform: translateY(-80px);
    opacity: 0;
  }
}

.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
  max-width: 640px;
}

/* ─── LDG logo ─── */
.hero-logo {
  height: 100px;
  width: auto;
  color: #1f1f1f;
  cursor: default;
  user-select: none;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), color 3s ease;
}

.hero-logo:hover { transform: scale(1.3) rotate(0.3deg); }

.hero-logo svg {
  height: 100px;
  width: auto;
  display: block;
}

/* ─── Landing copy ─── */
.hero-tagline {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), color 3s ease;
  line-height: 1;
}

.hero-desc {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1.5rem, 2.1vw, 2.25rem);
  font-weight: 400;
  color: #1f1f1f;
  line-height: 1.2;
  max-width: 22em;
  transition: color 3s ease;
}


/* ─── Start button ─── */
.start-btn {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.6rem, 2.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  background: #1f1f1f;
  border: none;
  border-radius: 18px;
  padding: clamp(16px, 2vh, 28px) clamp(40px, 4vw, 64px);
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-btn:hover {
  background: #383838;
  transform: translateY(-4px) scale(1.02);
}

.start-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ─── Portfolio view (split layout) ─── */
.portfolio-view {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.portfolio-view.active {
  display: flex;
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Right panel: clips the two sliding sub-panels ─── */
.portfolio-left {
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ─── Shared panel base ─── */
.case-list-panel,
.case-detail-panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 56px 60px 80px;
  -webkit-overflow-scrolling: touch;
  will-change: transform, opacity;
}

/* ─── List panel — default: visible ─── */
.case-list-panel {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.case-list-panel.hidden {
  opacity: 0;
  transform: translateX(-48px);
  pointer-events: none;
}

/* ─── Detail panel — default: offscreen right ─── */
.case-detail-panel {
  opacity: 0;
  transform: translateX(72px);
  pointer-events: none;
  background: #ffffff;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.case-detail-panel.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* ─── Back button ─── */
.case-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 44px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000000;
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.case-back-btn:hover {
  color: #000000;
  transform: translateX(-5px);
}

/* ─── "Selected cases" label ─── */
.cases-heading {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31, 31, 31, 0.4);
  margin-bottom: 20px;
  max-width: 860px;
}

.case-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
}

/* ─── Case item wrapper ─── */
.case-item {
  display: flex;
  flex-direction: column;
}

/* ─── Chevron ─── */
.case-chevron {
  flex-shrink: 0;
  color: rgba(31, 31, 31, 0.25);
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
}

.case-card-h:hover .case-chevron {
  color: rgba(31, 31, 31, 0.6);
  transform: translateX(4px);
}

/* ─── Horizontal case card ─── */
.case-card-h {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(31, 31, 31, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.case-card-h.visible {
  opacity: 1;
  transform: translateY(0);
}

.case-card-h:hover {
  transform: translateX(6px);
}

.case-card-h:hover .case-title-h {
  opacity: 0.7;
}

.case-logo { display: none; }

.case-body {
  flex: 1;
}

.case-company {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31, 31, 31, 0.4);
  margin-bottom: 8px;
}

.case-title-h {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.4rem, 1.9vw, 2rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.case-desc-h {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1.1rem, 1.3vw, 1.35rem);
  font-weight: 400;
  color: rgba(31, 31, 31, 0.6);
  line-height: 1.45;
}

/* ─── Right: chat rail ─── */
.chat-rail {
  width: 380px;
  flex-shrink: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1.5px solid rgba(31, 31, 31, 0.1);
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ─── Rail: name prompt ─── */
.rail-name-prompt {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 36px;
  gap: 28px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.rail-name-prompt.exiting {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.name-question {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.9rem, 2.6vw, 2.7rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.name-input-wrap {
  width: 100%;
}

.name-input {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.9rem, 2.6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #1f1f1f;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid rgba(31, 31, 31, 0.25);
  outline: none;
  width: 100%;
  padding: 6px 0 14px;
  transition: border-color 0.2s ease;
}

.name-input:focus { border-bottom-color: #1f1f1f; }

.name-input::placeholder { color: rgba(31, 31, 31, 0.22); }

.name-hint {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(31, 31, 31, 0.4);
  letter-spacing: 0.02em;
}

/* ─── Rail: conversation ─── */
.rail-convo {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 8px;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

.rail-convo.active {
  display: flex;
}

.convo-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── Message rows ─── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

.msg.typing {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.msg.typing .msg-dot-wrap { display: flex; }
.msg.typing .msg-text      { display: none; }

.msg.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.msg.visible .msg-dot-wrap { display: none; }
.msg.visible .msg-text      { display: block; }

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  margin-top: 4px;
}

.msg-bubble { flex: 1; }

/* Typing indicator */
.msg-dot-wrap {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 10px 0;
}

.msg-dot-wrap span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(31, 31, 31, 0.35);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.msg-dot-wrap span:nth-child(2) { animation-delay: 0.2s; }
.msg-dot-wrap span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(1);   opacity: 0.35; }
  40%            { transform: scale(1.4); opacity: 1;    }
}

/* Message text */
.msg-text {
  font-family: 'Golos Text', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  color: #1f1f1f;
  line-height: 1.5;
}

.msg-text strong { font-weight: 500; }

/* User bubble */
.msg--user {
  justify-content: flex-end;
  gap: 0;
}

.msg--user .msg-text {
  font-size: 0.9rem;
  background: rgba(31, 31, 31, 0.1);
  border-radius: 18px 18px 4px 18px;
  padding: 8px 14px;
  display: inline-block;
  max-width: 85%;
}

/* ─── Rail: chat input ─── */
.rail-input-wrap {
  padding: 16px 20px 24px;
  border-top: 1.5px solid rgba(31, 31, 31, 0.08);
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.rail-input-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.chat-input {
  width: 100%;
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1.1rem, 1.3vw, 1.4rem);
  font-weight: 400;
  color: #1f1f1f;
  background: #ffffff;
  border: 1.5px solid rgba(31, 31, 31, 0.15);
  border-radius: 14px;
  padding: 13px 18px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: block;
}

.chat-input:focus {
  border-color: rgba(31, 31, 31, 0.4);
  background: rgba(255, 255, 255, 0.8);
}

.chat-input::placeholder {
  color: rgba(31, 31, 31, 0.4);
}

/* ─── Case detail rich content (inside .case-expand) ─── */
.cd-company {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31, 31, 31, 0.4);
  margin-bottom: 12px;
}

.cd-headline {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.6rem, 2.5vw, 2.6rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 32px;
  max-width: 18em;
}

.cd-metrics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.cd-metric {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-metric-value {
  font-family: 'Cal Sans', sans-serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
}

.cd-metric-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(31, 31, 31, 0.5);
  letter-spacing: 0.01em;
}

.cd-section {
  margin-bottom: 40px;
}

.cd-section-heading {
  font-family: 'Cal Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.cd-section-body {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1.05rem, 1.2vw, 1.2rem);
  font-weight: 400;
  color: rgba(31, 31, 31, 0.75);
  line-height: 1.6;
  max-width: 54em;
}

.cd-img-placeholder {
  margin-top: 24px;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 800px;
  background: rgba(31, 31, 31, 0.06);
  border: 1.5px dashed rgba(31, 31, 31, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: rgba(31, 31, 31, 0.25);
  letter-spacing: 0.05em;
}

/* ─── Case detail rich content ─── */
.cd-intro {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1.1rem, 1.3vw, 1.25rem);
  font-weight: 400;
  color: rgba(31, 31, 31, 0.8);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 52em;
}

.cd-block {
  margin-bottom: 44px;
}

.cd-h2 {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.cd-h3 {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  font-weight: 500;
  color: #1f1f1f;
  margin-top: 20px;
  margin-bottom: 8px;
}

.cd-body {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  font-weight: 400;
  color: rgba(31, 31, 31, 0.75);
  line-height: 1.65;
  max-width: 60em;
  margin-bottom: 12px;
}

.cd-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cd-list li {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  font-weight: 400;
  color: rgba(31, 31, 31, 0.75);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}

.cd-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: rgba(31, 31, 31, 0.3);
  font-size: 0.75rem;
  top: 2px;
}

.cd-callout {
  margin: 16px 0 20px;
  border-left: 2px solid rgba(31, 31, 31, 0.15);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-callout-from,
.cd-callout-to {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  color: rgba(31, 31, 31, 0.65);
  line-height: 1.5;
}

.cd-callout-from span,
.cd-callout-to span {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-block;
  margin-right: 8px;
  color: rgba(31, 31, 31, 0.35);
}

.cd-callout-to {
  color: #1f1f1f;
}

.cd-callout-to span { color: rgba(31, 31, 31, 0.5); }

.cd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.cd-chips span {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(31, 31, 31, 0.6);
  background: rgba(31, 31, 31, 0.07);
  border-radius: 100px;
  padding: 5px 12px;
}

.cd-closer {
  border-top: 1.5px solid rgba(31, 31, 31, 0.08);
  padding-top: 32px;
  margin-top: 8px;
}

.cd-closer .cd-body {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: rgba(31, 31, 31, 0.6);
  font-style: italic;
}

/* ─── Case study rich layout components ─── */

/* Role badge */
.cd-role-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

/* Screenshots row — side by side frames */
.cd-screenshots-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.cd-screenshot-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(31, 31, 31, 0.08);
}
.cd-screenshot-frame img {
  width: 100%;
  display: block;
  height: auto;
}
.cd-screenshot-frame span {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(31, 31, 31, 0.4);
  padding: 0 14px 12px;
}

/* Hero image — bleeds past panel padding */
.cd-hero-img-wrap {
  width: calc(100% + 120px);
  margin-left: -60px;
  margin-top: -20px;
  margin-bottom: 48px;
  overflow: hidden;
}
.cd-hero-img {
  width: 100%;
  display: block;
  height: auto;
}

/* Two-column grid */
.cd-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 44px;
}

/* Checklist — green checks */
.cd-checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cd-checklist li {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: rgba(31, 31, 31, 0.75);
  line-height: 1.55;
  padding-left: 22px;
  position: relative;
}
.cd-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-size: 0.8rem;
  font-weight: 700;
  top: 1px;
}

/* From → To reframe */
.cd-reframe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0 24px;
}
.cd-reframe-from,
.cd-reframe-to {
  padding: 20px 22px;
  border-radius: 12px;
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  line-height: 1.5;
}
.cd-reframe-from {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: rgba(31, 31, 31, 0.65);
}
.cd-reframe-to {
  background: rgba(22, 163, 74, 0.07);
  border: 1px solid rgba(22, 163, 74, 0.2);
  color: #1f1f1f;
}
.cd-reframe-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.45;
}

/* Inline screenshot — bleeds past panel padding */
.cd-screenshot-wrap {
  width: calc(100% + 120px);
  margin-left: -60px;
  margin-bottom: 48px;
  overflow: hidden;
}
.cd-screenshot {
  width: 100%;
  display: block;
  height: auto;
}

/* Ecosystem flow diagram */
.cd-flow-wrap {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cd-flow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cd-flow-node {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  text-align: center;
  line-height: 1.35;
}
.cd-flow-source {
  background: rgba(59, 130, 246, 0.09);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1d4ed8;
}
.cd-flow-hub {
  background: rgba(124, 58, 237, 0.09);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: #6d28d9;
}
.cd-flow-primary {
  background: rgba(22, 163, 74, 0.09);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}
.cd-flow-secondary {
  background: rgba(234, 88, 12, 0.09);
  border: 1px solid rgba(234, 88, 12, 0.22);
  color: #c2410c;
}
.cd-flow-conn {
  color: rgba(31, 31, 31, 0.25);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cd-flow-branches {
  padding-left: 24px;
  border-left: 2px solid rgba(31, 31, 31, 0.08);
  margin-left: 32px;
}
.cd-flow-branch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Outcome callout boxes */
.cd-outcome-callouts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0 32px;
}
.cd-outcome-callout {
  padding: 18px 22px;
  border-radius: 12px;
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  line-height: 1.55;
  color: #1f1f1f;
}
.cd-oc-green {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.cd-oc-orange {
  background: rgba(234, 88, 12, 0.08);
  border: 1px solid rgba(234, 88, 12, 0.2);
}
.cd-oc-blue {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.cd-oc-purple {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

/* Haiku closing */
.cd-haiku {
  margin-top: 48px;
  padding: 32px 0 16px;
  border-top: 1px solid rgba(31, 31, 31, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cd-haiku p {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: rgba(31, 31, 31, 0.4);
  line-height: 1.8;
  margin: 0;
}

/* Outcomes grid */
.cd-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 24px 0 32px;
  padding: 28px 32px;
  background: rgba(31, 31, 31, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(31, 31, 31, 0.07);
}
.cd-outcome-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cd-outcome-val {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(2rem, 2.6vw, 3rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
  line-height: 1;
}
.cd-outcome-text {
  font-size: clamp(1.2rem, 1.6vw, 1.8rem);
}
.cd-outcome-desc {
  font-family: 'Golos Text', sans-serif;
  font-size: 0.82rem;
  color: rgba(31, 31, 31, 0.5);
  line-height: 1.45;
}

/* Image injected from chat */
.cd-injected-img {
  margin-top: 20px;
  width: 100%;
  max-width: 800px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(31, 31, 31, 0.06);
}

.cd-injected-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

/* ─── How we match up button ─── */
.fit-btn-wrap {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(31, 31, 31, 0.1);
}
.sky-dark .fit-btn-wrap { border-top-color: rgba(255,255,255,0.12); }

.fit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.3rem, 1.8vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #ffffff;
  background: #1f1f1f;
  border: none;
  border-radius: 18px;
  padding: clamp(14px, 1.8vh, 24px) clamp(32px, 3.5vw, 52px);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fit-btn:hover {
  background: #383838;
  transform: translateY(-4px) scale(1.02);
}
.fit-btn:active { transform: translateY(0) scale(0.98); }
.sky-dark .fit-btn {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sky-dark .fit-btn:hover { background: rgba(255, 255, 255, 0.22); }

/* ─── Fit panel (same sheet mechanic as case detail) ─── */
.fit-panel {
  position: absolute;
  inset: 0;
  background: #ffffff;
  padding: 56px 60px 80px;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(72px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-overflow-scrolling: touch;
}
.fit-panel.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.fit-title {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(2.2rem, 3.5vw, 3.8rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.fit-desc {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  color: rgba(31,31,31,0.55);
  line-height: 1.5;
  margin: 0 0 32px;
}

/* Textarea + char count */
.fit-input-wrap { margin-bottom: 8px; }
.fit-textarea {
  width: 100%;
  min-height: 180px;
  font-family: 'Golos Text', sans-serif;
  font-size: 1rem;
  color: #1f1f1f;
  background: #f8f8f7;
  border: 1.5px solid rgba(31,31,31,0.12);
  border-radius: 14px;
  padding: 16px 18px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.fit-textarea:focus {
  border-color: rgba(31,31,31,0.35);
  background: #ffffff;
}
.fit-textarea::placeholder { color: rgba(31,31,31,0.3); }
.fit-char-row {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: rgba(31,31,31,0.3);
  text-align: right;
  padding: 6px 2px 0;
}

/* Error */
.fit-error {
  font-family: 'Golos Text', sans-serif;
  font-size: 0.9rem;
  color: #b91c1c;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 12px;
  line-height: 1.5;
}

/* Loading dots */
.fit-loading {
  display: flex;
  gap: 7px;
  padding: 24px 0;
}
.fit-loading span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(31,31,31,0.2);
  animation: fitPulse 1.2s ease-in-out infinite;
}
.fit-loading span:nth-child(2) { animation-delay: 0.2s; }
.fit-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fitPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.9); }
  40%           { opacity: 1;    transform: scale(1.1); }
}

/* Results */
.fit-results { margin-top: 28px; }

.fit-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 18px;
}
.fit-headline {
  font-family: 'Cal Sans', sans-serif;
  font-size: clamp(1.3rem, 1.8vw, 1.8rem);
  font-weight: 600;
  color: #1f1f1f;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 14px;
}
.fit-rationale {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: rgba(31,31,31,0.7);
  line-height: 1.65;
  margin: 0 0 28px;
}
.fit-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(31,31,31,0.35);
  margin: 0 0 10px;
}
.fit-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fit-list li {
  font-family: 'Golos Text', sans-serif;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  line-height: 1.55;
  padding-left: 20px;
  position: relative;
  color: rgba(31,31,31,0.75);
}
.fit-list--strengths li::before {
  content: '✓';
  position: absolute; left: 0;
  color: #16a34a; font-weight: 700; font-size: 0.8rem; top: 1px;
}
.fit-list--considerations li::before {
  content: '→';
  position: absolute; left: 0;
  color: rgba(31,31,31,0.35); font-size: 0.85rem; top: 1px;
}
.fit-cases {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.fit-case-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1d4ed8;
  background: rgba(37,99,235,0.06);
  border: 1px solid rgba(37,99,235,0.18);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.fit-case-link:hover { background: rgba(37,99,235,0.1); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .site-header { padding: 14px 24px; }

  .landing { padding: 60px 24px; }

  .portfolio-view.active {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .portfolio-left {
    padding: 40px 24px 32px;
    overflow-y: visible;
  }

  .chat-rail {
    width: 100%;
    border-right: none;
    border-top: 1.5px solid rgba(31, 31, 31, 0.1);
    min-height: 420px;
  }

  .rail-name-prompt { padding: 36px 24px; }

  .rail-convo { padding: 20px 20px 8px; }

  .rail-input-wrap { padding: 14px 16px 20px; }

  .case-stack { gap: 16px; }

  .case-card-h { padding: 24px 20px; gap: 18px; }

  .case-logo { width: 56px; height: 56px; }
  .case-logo svg { width: 56px; height: 56px; }
}

/* ─── Mobile tab bar (hidden on desktop/tablet) ─── */
.mob-tabs { display: none; }

@media (max-width: 680px) {

  /* ── Header ── */
  .header-identity { display: none; }
  .site-header { padding: 12px 20px; }

  /* ── Landing ── */
  .landing { padding: 48px 20px; }
  .hero-logo { height: 72px; }
  .hero-logo svg { height: 72px; }

  /* ── Tab bar ── */
  .mob-tabs {
    display: flex;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1.5px solid rgba(31, 31, 31, 0.09);
    z-index: 20;
  }

  .mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    background: none;
    color: rgba(31, 31, 31, 0.35);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mob-tab.mob-tab--active { color: #1f1f1f; }

  /* ── Split → tabbed layout ── */
  .portfolio-view.active {
    display: block;
    overflow: hidden;
    position: absolute;
    inset: 0;
  }

  .portfolio-left {
    position: absolute;
    inset: 0;
    bottom: 62px;
    height: auto;
    width: 100%;
    overflow-y: auto;
    padding: 40px 20px 32px;
    display: none;
  }

  .portfolio-left.mob-active { display: block; }

  .chat-rail {
    position: absolute;
    inset: 0;
    bottom: 62px;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: none;
    min-height: unset;
    display: none;
  }

  .chat-rail.mob-active { display: flex; }

  /* ── Cards ── */
  .case-card-h {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* ── Header padding fix — prevent overlap on mobile ── */
  main {
    padding-top: 0;
  }
  .landing {
    padding-top: 60px;
  }

  /* ── Fit panel on mobile ── */
  .fit-panel {
    position: absolute;
    inset: 0;
    bottom: 62px;
    width: 100%;
    height: auto;
    padding: 32px 20px 40px;
    display: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    overflow-y: auto;
  }
  /* On mobile, fit panel is the default view — shown via mob-active */
  .fit-panel.mob-active {
    display: block;
  }
  /* Keep slide-in for desktop active class — on mobile it's tab-controlled */
  .fit-panel.active {
    display: block;
  }

  /* Hide the fit-btn-wrap on mobile — fit is a top-level tab, not nested */
  .fit-btn-wrap { display: none; }

  .fit-title { font-size: clamp(1.8rem, 6vw, 2.4rem); }
  .fit-textarea { min-height: 140px; }
}
