:root {
  --bg: #0a0a0f;
  --bg-2: #11111a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f7;
  --text-dim: #a0a0b0;
  --text-mute: #6c6c7a;
  --accent: #b9ff66;
  --accent-warm: #ff8a5b;
  --accent-cool: #7aa8ff;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: default;
}

/* ===== Mouse-following background ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, #15151f 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, #161a25 0%, transparent 50%),
    var(--bg);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
}

.orb-1 {
  width: 600px;
  height: 600px;
  top: -100px;
  left: -150px;
  background: radial-gradient(circle, var(--accent-cool) 0%, transparent 65%);
}

.orb-2 {
  width: 700px;
  height: 700px;
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, var(--accent-warm) 0%, transparent 65%);
  opacity: 0.25;
}

.orb-3 {
  width: 500px;
  height: 500px;
  top: 40%;
  left: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  opacity: 0.15;
}

.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 10, 15, 0.55);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  position: relative;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links a.nav-cta {
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
}

.nav-links a.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ===== Layout ===== */
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 160px 48px;
  position: relative;
}

.section-head {
  margin-bottom: 80px;
  max-width: 700px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 20px;
}

h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.accent {
  font-style: italic;
  color: var(--accent);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 48px 160px;
  position: relative;
}

.hero-inner {
  max-width: 1100px;
  text-align: center;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(48px, 7.5vw, 104px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 24px 0 28px;
}

.hero-sub {
  font-size: 19px;
  color: var(--text-dim);
  max-width: 580px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.proof-strip {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 36px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.proof-strip .proof-label {
  color: var(--text-mute);
  opacity: 0.7;
}

.proof-strip .proof-name {
  color: var(--text-dim);
  font-weight: 500;
}

.proof-strip .proof-divider {
  color: var(--text-mute);
  opacity: 0.4;
}

@media (max-width: 720px) {
  .hero { padding: 100px 24px 80px; }
  .proof-strip { margin-top: 28px; gap: 10px; font-size: 11px; }
  .scroll-hint { display: none; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn svg {
  position: relative;
  z-index: 1;
  transition: transform 0.4s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #ccff7a;
  box-shadow: 0 12px 30px -8px rgba(185, 255, 102, 0.4);
}

.btn-primary:hover svg {
  transform: translateX(4px);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--text);
  transform: translateY(-2px);
}

.btn-large {
  padding: 20px 32px;
  font-size: 18px;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-mute), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(1.3); opacity: 1; }
}

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }

/* ===== Work grid ===== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.work-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.6s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
  cursor: pointer;
  will-change: transform;
}

.work-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.6);
}

.work-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #15151f 0%, #1a1a26 100%);
}

.work-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1.1s var(--ease);
}

.work-card:hover .work-visual {
  transform: scale(1.05);
}

.work-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0f0f17;
  transition: transform 1.1s var(--ease), filter 0.5s var(--ease);
  filter: saturate(1.05);
}

/* Static thumbnail variant — no parallax scaling, full image always visible.
   Use when the card image has UI detail at the edges that mustn't be cropped. */
.work-thumb-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0f0f17;
  transition: transform 1.1s var(--ease), filter 0.5s var(--ease);
}

.work-card:hover .work-thumb-static {
  transform: scale(1.03);
}

.work-card:hover .work-video {
  transform: scale(1.05);
  filter: saturate(1.15);
}

.visual-1 {
  background:
    radial-gradient(circle at 30% 40%, rgba(122, 168, 255, 0.25), transparent 50%),
    linear-gradient(135deg, #161a2a 0%, #1a1f30 100%);
}

.visual-1::before,
.visual-1::after {
  content: '';
  position: absolute;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.visual-1::before {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 22%;
  transition: transform 0.8s var(--ease);
}

.work-card:hover .visual-1::before {
  transform: translate(-6px, -6px);
}

.visual-1::after {
  width: 40%;
  height: 50%;
  top: 35%;
  left: 45%;
  background: rgba(185, 255, 102, 0.12);
  border-color: rgba(185, 255, 102, 0.25);
  transition: transform 0.8s var(--ease);
}

.work-card:hover .visual-1::after {
  transform: translate(8px, 8px);
}

.card-chip, .card-bar { display: none; }

.visual-2 {
  background:
    radial-gradient(circle at center, rgba(255, 138, 91, 0.18), transparent 60%),
    linear-gradient(135deg, #1f1815 0%, #1a1614 100%);
}

.ring {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 138, 91, 0.4);
  border-radius: 50%;
  animation: pulseRing 4s ease-in-out infinite;
}

.ring-2 {
  width: 320px;
  height: 320px;
  border-color: rgba(255, 138, 91, 0.2);
  animation-delay: 1s;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.08); opacity: 1; }
}

.visual-3 {
  background: linear-gradient(135deg, #0f1518 0%, #131a1d 100%);
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(122, 168, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 168, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  transition: background-size 0.8s var(--ease);
}

.work-card:hover .grid-lines {
  background-size: 24px 24px;
}

.visual-4 {
  background: linear-gradient(135deg, #1a1422 0%, #14101a 100%);
  overflow: hidden;
}

.visual-recorder {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(185, 255, 102, 0.12) 0%, transparent 55%),
    linear-gradient(135deg, #1a1a26 0%, #14141e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
}

/* CycurID / Imme card — two stacked phone mockups */
.visual-cycurid {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(255, 138, 91, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 70%, rgba(180, 120, 220, 0.14) 0%, transparent 55%),
    linear-gradient(135deg, #1a1620 0%, #14101a 100%);
  position: relative;
  overflow: hidden;
}

.cy-phone {
  position: absolute;
  width: 32%;
  aspect-ratio: 375 / 812;
  background: linear-gradient(180deg, #1a1a22 0%, #14141a 100%);
  border-radius: 18px;
  padding: 5px;
  box-shadow:
    0 18px 40px -8px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.cy-phone-back {
  top: 22%;
  left: 30%;
  transform: rotate(-8deg);
  opacity: 0.85;
}

.cy-phone-front {
  top: 18%;
  left: 50%;
  transform: rotate(6deg);
  z-index: 2;
}

.cy-screen {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  overflow: hidden;
}

.cy-screen-purple {
  background: linear-gradient(180deg, #6e5cc4 0%, #4d3d99 60%, #2d2470 100%);
}

.cy-screen-coral {
  background: linear-gradient(180deg, #ff8a72 0%, #ff6a50 60%, #e8442a 100%);
  padding: 14% 8%;
  display: flex;
  flex-direction: column;
  gap: 8%;
}

.cy-screen-bar {
  width: 38%;
  height: 4px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
}

.cy-screen-card {
  width: 100%;
  height: 22%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

.work-card:hover .cy-phone-back { transform: rotate(-10deg) translateY(-4px); }
.work-card:hover .cy-phone-front { transform: rotate(8deg) translateY(-4px); }

/* Network Events Summary card — stylized category bar chart */
.visual-summary {
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255, 85, 85, 0.06) 0%, transparent 55%),
    linear-gradient(135deg, #181820 0%, #14141c 100%);
  display: flex;
  align-items: center;
  padding: 7% 8%;
}

.summary-chart {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: var(--text-mute);
  font-family: 'Inter', sans-serif;
}

.summary-label {
  width: 32%;
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.summary-bar {
  flex: 1;
  display: flex;
  align-items: center;
  height: 7px;
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  display: block;
  transition: width 1.2s var(--ease);
}

.bar-fill.bar-critical { background: #b8312f; }
.bar-fill.bar-error    { background: #f06c5e; }
.bar-fill.bar-warning  { background: #e8b339; }

.work-card:hover .visual-summary .bar-fill {
  filter: brightness(1.1);
}

.recorder-thumb {
  max-width: 70%;
  max-height: 80%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.5));
  transition: transform 1.1s var(--ease);
}

.work-card:hover .recorder-thumb {
  transform: scale(1.06);
}

.wave {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(185, 255, 102, 0.15), transparent);
  animation: rotate 14s linear infinite;
}

.wave-2 {
  background: conic-gradient(from 180deg, transparent, rgba(122, 168, 255, 0.12), transparent);
  animation-duration: 22s;
  animation-direction: reverse;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.work-meta {
  padding: 28px 32px 32px;
}

.tag {
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 14px;
}

.work-meta h3 {
  margin-bottom: 10px;
  transition: color 0.3s var(--ease);
}

.work-card:hover .work-meta h3 {
  color: var(--accent);
}

.work-meta p {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.55;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: gap 0.4s var(--ease), border-color 0.3s var(--ease);
}

.link-arrow span {
  transition: transform 0.4s var(--ease);
}

.work-card:hover .link-arrow {
  gap: 14px;
  border-color: var(--text);
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text p {
  font-size: 17px;
  color: var(--text-dim);
  margin-top: 24px;
  line-height: 1.65;
  max-width: 540px;
}

.about-text h2 {
  margin-top: 4px;
}

.about-side {
  padding-top: 44px;
}

.about-side .eyebrow {
  margin-bottom: 18px;
}

.experience-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.experience-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), padding 0.4s var(--ease);
}

.experience-list li:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
  border-color: var(--border-strong);
  padding-left: 30px;
}

.experience-list strong {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color 0.3s var(--ease);
}

.experience-list li:hover strong {
  color: var(--accent);
}

.experience-list span {
  font-size: 13px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

/* Available status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(185, 255, 102, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 255, 102, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(185, 255, 102, 0); }
}

/* ===== Process ===== */
.process-list {
  display: grid;
  gap: 4px;
}

.process-step {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 60px;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  transition: padding 0.5s var(--ease), background 0.5s var(--ease);
  border-radius: 8px;
}

.process-step:last-child {
  border-bottom: 1px solid var(--border);
}

.process-step:hover {
  background: var(--surface);
  padding-left: 36px;
}

.step-num {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  color: var(--text-mute);
  transition: color 0.4s var(--ease);
}

.process-step:hover .step-num {
  color: var(--accent);
}

.process-step h3 {
  margin-bottom: 6px;
  font-size: 28px;
  font-family: 'Fraunces', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.process-step p {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 560px;
}

/* ===== Contact ===== */
.contact {
  text-align: center;
  padding: 200px 48px;
}

.contact-inner {
  max-width: 800px;
  margin: 0 auto;
}

.contact h2 {
  margin-bottom: 56px;
}

.contact .btn-primary {
  margin: 0 auto;
}

.socials {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 64px;
  flex-wrap: wrap;
}

.socials a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}

.socials a:hover {
  color: var(--text);
  border-color: var(--text);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-mute);
  font-size: 13px;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .nav { padding: 20px 24px; }
  .nav-links { gap: 4px; }
  .nav-links a { padding: 8px 12px; font-size: 13px; }
  .section { padding: 100px 24px; }
  .hero { padding: 100px 24px 60px; }
  .work-grid { grid-template-columns: 1fr; gap: 24px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-side { padding-top: 0; }
  .process-step { grid-template-columns: 60px 1fr; gap: 24px; padding: 28px 16px; }
  .footer { flex-direction: column; gap: 8px; text-align: center; padding: 24px; }
}

@media (max-width: 560px) {
  .nav-links li:not(:last-child) a:not(.nav-cta) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ===========================================================
   Case Study (project) pages
   =========================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.3s var(--ease), background 0.3s var(--ease), gap 0.4s var(--ease);
}

.back-link:hover {
  color: var(--text);
  background: var(--surface);
  gap: 12px;
}

.case-hero {
  padding: 180px 48px 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.case-hero .eyebrow {
  margin-bottom: 24px;
}

.case-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(44px, 6.5vw, 88px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.case-sub {
  font-size: 20px;
  color: var(--text-dim);
  max-width: 720px;
  line-height: 1.55;
}

.case-meta {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 48px 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.case-meta div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.case-meta dt {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.case-meta dd {
  font-size: 15px;
  color: var(--text);
}

.case-cover {
  max-width: 1280px;
  margin: 80px auto;
  padding: 0 48px;
}

.case-cover-inner {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #15151f 0%, #1a1a26 100%);
}

.case-cover-inner video,
.case-cover-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Thumbnail-style cover (used when the project art itself is the hero,
   e.g. an object on a glow background rather than a UI screenshot) */
.case-cover-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #15151f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6%;
}

.case-cover-thumb img {
  max-width: 52%;
  max-height: 78%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.55));
}

/* ===== Workspace cover scene ===== */
.workspace-scene {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 50% 25%, rgba(255, 170, 110, 0.10) 0%, transparent 55%),
    linear-gradient(180deg, #0e0e16 0%, #14141d 60%, #1c1812 100%);
}

/* warm desk-lamp glow behind the monitor */
.scene-glow {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(255, 168, 110, 0.22) 0%, transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

/* hint of a window pane behind everything */
.scene-window {
  position: absolute;
  top: 8%;
  right: 6%;
  width: 22%;
  height: 38%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  opacity: 0.5;
  pointer-events: none;
}

.window-pane {
  background:
    linear-gradient(135deg, rgba(122, 168, 255, 0.06) 0%, rgba(122, 168, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}

/* monitor */
.monitor {
  position: absolute;
  top: calc(7% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 61%;
  aspect-ratio: 1.48 / 1;
  z-index: 2;
}

.monitor-bezel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  padding: 1.4% 1.4% 4%;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  background: linear-gradient(180deg, #1a1a22 0%, #14141a 50%, #0f0f15 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.monitor-video,
.monitor-still {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  background: #0a0a10;
}

/* Video covers (events page): show the whole frame, letterbox if needed. */
.monitor-video {
  object-fit: contain;
}

/* Image stills (recorder-node page): fit width-wise, anchor to top so any
   overflow gets cropped from the bottom only. */
.monitor-still {
  object-fit: cover;
  object-position: top;
}

/* Cover placeholder for projects without a real screenshot yet */
.cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 12px, transparent 12px 24px),
    radial-gradient(ellipse at 50% 50%, rgba(255, 138, 91, 0.06), transparent 60%),
    #0a0a10;
}

.cover-placeholder .cover-placeholder-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  opacity: 0.55;
  font-style: italic;
  text-transform: none;
}

/* Compact browser chrome for the cover monitor */
.monitor-bezel > .cv-chrome {
  height: 22px;
  padding: 0 10px;
  gap: 10px;
  border-radius: 4px 4px 0 0;
  flex-shrink: 0;
}

.monitor-bezel > .cv-chrome .cv-traffic-lights span {
  width: 7px;
  height: 7px;
}

.monitor-bezel > .cv-chrome .cv-url-bar {
  height: 13px;
  max-width: 200px;
}

.monitor-bezel > .cv-chrome .cv-url-bar::before {
  width: 6px;
  height: 6px;
}

.monitor-bezel > .cv-chrome .cv-nav-arrows,
.monitor-bezel > .cv-chrome .cv-window-actions {
  font-size: 10px;
  gap: 6px;
}

.monitor-bezel > .monitor-video,
.monitor-bezel > .monitor-still {
  border-radius: 0 0 4px 4px;
}

.monitor-led {
  position: absolute;
  bottom: 1.4%;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(185, 255, 102, 0.6);
  animation: ledPulse 3s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.monitor-neck {
  position: absolute;
  top: calc(73% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 7%;
  height: 6%;
  background: linear-gradient(180deg, #15151c 0%, #0e0e14 100%);
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  z-index: 2;
}

.monitor-base {
  position: absolute;
  top: calc(78% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 1.4%;
  background: linear-gradient(180deg, #18181f 0%, #0c0c12 100%);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* desk surface */
.desk {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 22%;
  background:
    linear-gradient(180deg, rgba(60, 40, 28, 0.55) 0%, rgba(30, 22, 16, 0.85) 100%);
  border-top: 1px solid rgba(255, 200, 150, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 220, 180, 0.04);
}

/* desk items use % of scene so they scale together
   Depth ordering (back → front):
   plant (back-left) · mug (back-right) · keyboard (front-center) · mouse (front-right) */
.desk-mug {
  position: absolute;
  bottom: 14%;
  right: 14%;
  width: 3%;
  aspect-ratio: 1 / 1.1;
  background: linear-gradient(180deg, #b85a35 0%, #8a3f23 100%);
  border-radius: 6% 6% 20% 20%;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 6px 12px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.desk-mug::before {
  /* mug rim highlight */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  border-radius: 6% 6% 0 0;
}

.desk-mug::after {
  /* handle */
  content: '';
  position: absolute;
  right: -38%;
  top: 22%;
  width: 38%;
  height: 50%;
  border: 3px solid #8a3f23;
  border-left: none;
  border-radius: 0 60% 60% 0 / 0 50% 50% 0;
}

.mug-steam {
  position: absolute;
  top: -90%;
  left: 35%;
  width: 22%;
  height: 80%;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 240, 220, 0.18) 60%, rgba(255, 240, 220, 0.05) 100%);
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0;
  animation: steamRise 4s ease-in-out infinite;
}

.steam-2 {
  left: 55%;
  width: 18%;
  animation-delay: 1.6s;
}

@keyframes steamRise {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-40%) scale(1.3); }
}

/* plant */
.desk-plant {
  position: absolute;
  bottom: 14%;
  left: 10%;
  width: 4%;
  aspect-ratio: 1 / 1.5;
  z-index: 3;
}

.plant-pot {
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 38%;
  background: linear-gradient(180deg, #5d4733 0%, #3d2e20 100%);
  border-radius: 3px 3px 18% 18%;
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0% 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 5px 10px rgba(0, 0, 0, 0.35);
}

.plant-leaf {
  position: absolute;
  background: linear-gradient(135deg, #5b8f54 0%, #2f5a32 100%);
  border-radius: 50% 0;
  transform-origin: bottom center;
}

.leaf-1 {
  bottom: 32%;
  left: 5%;
  width: 38%;
  height: 55%;
  transform: rotate(-25deg);
}

.leaf-2 {
  bottom: 38%;
  left: 30%;
  width: 42%;
  height: 65%;
  transform: rotate(2deg);
}

.leaf-3 {
  bottom: 32%;
  right: 5%;
  width: 38%;
  height: 50%;
  transform: rotate(30deg);
}

/* keyboard — thin slab with visible key squares */
.desk-keyboard {
  position: absolute;
  bottom: 5%;
  left: 40.3%;
  width: 19.4%;
  aspect-ratio: 4.1 / 1;
  background: linear-gradient(180deg, #25252e 0%, #1a1a22 55%, #14141a 100%);
  border-radius: 3px;
  padding: 0.9% 0.6%;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  row-gap: 4%;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 8px 14px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  z-index: 4;
}

.kb-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6%;
}

.kb-row > span {
  aspect-ratio: 1 / 1;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1px;
}

.kb-row.kb-bottom {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.kb-bottom .kb-space {
  width: 52%;
  aspect-ratio: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

/* mouse */
.desk-mouse {
  position: absolute;
  bottom: 5%;
  right: calc(37% - 20px);
  width: 3.3%;
  aspect-ratio: 1 / 1.6;
  background: linear-gradient(180deg, #20202a 0%, #14141a 100%);
  border-radius: 50% 50% 45% 45%;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.7),
    0 8px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  z-index: 4;
}

.mouse-wheel {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 16%;
  height: 14%;
  background: linear-gradient(180deg, #2a2a36 0%, #16161e 100%);
  border-radius: 2px;
}

/* on very narrow screens, hide small accessories so the monitor stays readable */
@media (max-width: 640px) {
  .desk-mouse,
  .scene-window { display: none; }
  .desk-keyboard { width: 23.2%; left: 38.4%; }
  .monitor { width: 65%; top: 12%; }
  .monitor-neck { top: 76%; }
  .monitor-base { top: 80%; }
}

.case-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 48px;
}

.case-section .eyebrow {
  margin-bottom: 18px;
}

.case-section h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  line-height: 1.1;
}

.case-section p {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 18px;
}

.case-section p + p {
  margin-top: 0;
}

.case-section ul.bullets {
  list-style: none;
  margin: 24px 0;
  max-width: 760px;
}

.case-section ul.bullets li {
  position: relative;
  padding: 12px 0 12px 28px;
  color: var(--text-dim);
  font-size: 16px;
  border-bottom: 1px solid var(--border);
}

.case-section ul.bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Placeholder boxes for unsupplied images */
.placeholder {
  position: relative;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 10px, transparent 10px 20px),
    linear-gradient(135deg, #15151f 0%, #1a1a26 100%);
  border: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  overflow: hidden;
  transition: transform 0.6s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.placeholder:hover {
  border-color: var(--accent);
  color: var(--text-dim);
  transform: translateY(-3px);
}

.placeholder.tall { aspect-ratio: 4 / 5; }
.placeholder.wide { aspect-ratio: 16 / 9; }
.placeholder.square { aspect-ratio: 1 / 1; }
.placeholder.hero { aspect-ratio: 16 / 10; }

.case-gallery {
  display: grid;
  gap: 24px;
  margin: 32px 0 16px;
}

.case-gallery.two { grid-template-columns: 1fr 1fr; }
.case-gallery.three { grid-template-columns: repeat(3, 1fr); }

.case-pull {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 880px;
  padding: 48px 0;
  margin: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.case-pull span {
  color: var(--accent);
  font-style: italic;
}

.findings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0 8px;
  list-style: none;
  padding: 0;
}

/* Category cards (Environment / Hardware / L1 / L2) */
.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 8px;
  list-style: none;
  padding: 0;
}

.category {
  padding: 28px 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.category:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
}

.category-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category .eyebrow {
  margin-bottom: 0;
}

.category h4 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.event-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  margin: 0;
}

.event-pill {
  padding: 10px 12px;
  background: rgba(185, 255, 102, 0.04);
  border: 1px solid rgba(185, 255, 102, 0.14);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.category:hover .event-pill {
  background: rgba(185, 255, 102, 0.07);
  border-color: rgba(185, 255, 102, 0.22);
}

.event-pill.ellipsis {
  color: var(--text-mute);
  letter-spacing: 0.16em;
}

/* ----- Built-In vs Custom category comparison (inheritance concept) ----- */
.inheritance-compare {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  margin: 40px 0 32px;
  align-items: start;
}

.inh-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.inh-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.inh-builtin { border-top: 3px solid var(--accent-cool); }
.inh-custom  { border-top: 3px solid var(--accent); }

.inh-head { text-align: center; }
.inh-head .eyebrow { margin-bottom: 4px; }

.inh-head h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.inh-builtin .inh-head h4 { color: var(--accent-cool); }
.inh-custom .inh-head h4  { color: var(--accent); }

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

.inh-event {
  position: relative;
  padding: 10px 36px 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.inh-event .lock-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-mute);
}

.inh-event.ellipsis {
  color: var(--text-mute);
  letter-spacing: 0.16em;
  padding-right: 14px;
}

.inh-event.unlocked {
  background: rgba(185, 255, 102, 0.05);
  border-color: rgba(185, 255, 102, 0.22);
  color: var(--text);
}

.inh-event.unlocked .lock-icon { color: var(--accent); }

.inh-event.inherited {
  padding: 14px 14px 12px;
  background: rgba(122, 168, 255, 0.06);
  border-color: rgba(122, 168, 255, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inh-event.inherited .inh-label {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.inh-event.inherited .inh-group {
  position: relative;
  padding: 6px 32px 6px 12px;
  background: rgba(122, 168, 255, 0.08);
  border: 1px solid rgba(122, 168, 255, 0.22);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-cool);
}

.inh-event.inherited .inh-group .lock-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-cool);
}

@media (max-width: 720px) {
  .inheritance-compare { grid-template-columns: 1fr; }
}

/* ===== User flow diagram ===== */
.user-flow {
  margin-top: 32px;
  padding: 40px 32px 32px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
}

.user-flow::-webkit-scrollbar { height: 8px; }
.user-flow::-webkit-scrollbar-track { background: transparent; }
.user-flow::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.flow-track + .flow-track {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.flow-track-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 28px;
  min-width: max-content;
}

.flow-track-head h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}

.flow-tag {
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.flow-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
}

.flow-node {
  width: 160px;
  min-height: 76px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text);
  border-radius: 12px;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.flow-node:hover {
  transform: translateY(-2px);
}

.flow-node.intent {
  background: rgba(255, 138, 91, 0.06);
  border: 1px solid rgba(255, 138, 91, 0.32);
  border-radius: 100px;
  padding: 14px 20px;
}

.flow-node.intent:hover {
  background: rgba(255, 138, 91, 0.1);
  border-color: rgba(255, 138, 91, 0.55);
}

.flow-node.action {
  background: rgba(122, 168, 255, 0.05);
  border: 1px solid rgba(122, 168, 255, 0.3);
}

.flow-node.action:hover {
  background: rgba(122, 168, 255, 0.09);
  border-color: rgba(122, 168, 255, 0.5);
}

.flow-node.decision {
  background: rgba(185, 255, 102, 0.04);
  border: 1px dashed rgba(185, 255, 102, 0.45);
  font-style: italic;
  width: 180px;
}

.flow-node.decision:hover {
  background: rgba(185, 255, 102, 0.08);
  border-color: rgba(185, 255, 102, 0.7);
}

/* arrow */
.flow-arrow {
  width: 22px;
  height: 1px;
  background: var(--border-strong);
  flex-shrink: 0;
  position: relative;
}

.flow-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong);
  transform: translateY(-50%) rotate(45deg);
}

/* branches */
.flow-branches {
  margin-top: 24px;
  margin-left: 92px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
}

.flow-branches::before {
  content: '';
  position: absolute;
  left: -48px;
  top: -24px;
  bottom: 24px;
  width: 1px;
  border-left: 1px dashed rgba(185, 255, 102, 0.4);
}

.flow-branch {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: max-content;
}

.flow-branch::before {
  content: '';
  position: absolute;
  left: -48px;
  top: 24px;
  width: 36px;
  height: 1px;
  border-top: 1px dashed rgba(185, 255, 102, 0.4);
}

.flow-branch-label {
  font-size: 10.5px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
}

.flow-legend {
  display: flex;
  gap: 28px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
  min-width: max-content;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.legend-swatch.intent {
  background: rgba(255, 138, 91, 0.06);
  border: 1px solid rgba(255, 138, 91, 0.4);
  border-radius: 100px;
}

.legend-swatch.action {
  background: rgba(122, 168, 255, 0.05);
  border: 1px solid rgba(122, 168, 255, 0.4);
  border-radius: 4px;
}

.legend-swatch.decision {
  background: rgba(185, 255, 102, 0.05);
  border: 1px dashed rgba(185, 255, 102, 0.55);
  border-radius: 4px;
}

.finding {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.finding:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.finding .eyebrow {
  margin-bottom: 0;
}

.finding h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}

.finding p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.metric {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.metric:hover {
  transform: translateY(-4px);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.metric strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 48px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.metric span {
  font-size: 13px;
  color: var(--text-mute);
}

.case-next {
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 60px 48px 80px;
}

.case-next a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.5s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.case-next a:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.case-next .eyebrow {
  margin-bottom: 14px;
}

.case-next h3 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.case-next h3 span {
  transition: transform 0.4s var(--ease);
  color: var(--accent);
}

.case-next a:hover h3 span {
  transform: translateX(8px);
}

@media (max-width: 880px) {
  .case-hero { padding: 140px 24px 60px; }
  .case-meta { grid-template-columns: 1fr 1fr; padding: 28px 24px 36px; }
  .case-cover { margin: 48px auto; padding: 0 24px; }
  .case-section { padding: 60px 24px; }
  .case-gallery.two, .case-gallery.three { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .findings { grid-template-columns: 1fr; }
  .categories { grid-template-columns: 1fr 1fr; }
  .case-next { padding: 40px 24px 60px; }
  .case-next a { padding: 32px; }
}

/* Project restriction / disclaimer callout */
.restriction-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent-warm);
  border-radius: var(--radius);
  padding: 40px 48px;
  max-width: 880px;
  margin: 24px 0;
}

.restriction-box h3 {
  font-family: 'Inter', sans-serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.restriction-box h3::before {
  content: '// ';
  color: var(--accent-warm);
  font-weight: 500;
}

.restriction-box p {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0 0 10px 0;
  max-width: none;
}

.restriction-box p:last-of-type {
  margin-bottom: 0;
}

.restriction-box .btn {
  margin-top: 24px;
}

/* ===========================================================
   Event Categories app mockup (laptop frame + dark UI)
   =========================================================== */
.mockup-laptop {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.laptop-lid {
  width: 82%;
  background: linear-gradient(180deg, #2a2a32 0%, #1f1f26 100%);
  border-radius: 16px 16px 4px 4px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 30px 50px -12px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.laptop-screen {
  background: #0d0d14;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.5);
  position: relative;
}

.laptop-base {
  width: 100%;
  height: 14px;
  background: linear-gradient(180deg, #2a2a32 0%, #14141a 100%);
  border-radius: 2px 2px 10px 10px;
  position: relative;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: none;
}

.laptop-base::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18%;
  height: 5px;
  background: #0a0a10;
  border-radius: 0 0 6px 6px;
}

/* ----- app within screen ----- */
.cv-app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  color: var(--text);
}

.cv-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  height: 32px;
  background: #15151d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

/* Light-mode browser chrome variant (used when the screen content
   below is a light UI screenshot) */
.cv-chrome.light {
  background: #e8e8ea;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cv-chrome.light .cv-nav-arrows,
.cv-chrome.light .cv-window-actions {
  color: #6c6c75;
}

.cv-chrome.light .cv-url-bar {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cv-chrome.light .cv-url-bar::before {
  border-color: rgba(0, 0, 0, 0.25);
}

/* Screenshot embedded in laptop screen */
.cv-shot {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.cv-traffic-lights {
  display: flex;
  gap: 6px;
}

.cv-traffic-lights span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cv-traffic-lights span:nth-child(1) { background: #ff5f57; }
.cv-traffic-lights span:nth-child(2) { background: #febc2e; }
.cv-traffic-lights span:nth-child(3) { background: #28c840; }

.cv-nav-arrows {
  display: flex;
  gap: 6px;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1;
}

.cv-url-bar {
  flex: 1;
  max-width: 320px;
  height: 20px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-url-bar::before {
  content: '';
  width: 8px;
  height: 8px;
  border: 1.2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  position: relative;
}

.cv-window-actions {
  display: flex;
  gap: 10px;
  color: var(--text-mute);
  font-size: 13px;
}

.cv-app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* sidebar */
.cv-sidebar {
  width: 44px;
  background: linear-gradient(180deg, #181822 0%, #131319 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 8px;
  flex-shrink: 0;
}

.cv-sidebar-logo {
  width: 28px;
  height: 28px;
  background: rgba(185, 255, 102, 0.08);
  border: 1px solid rgba(185, 255, 102, 0.22);
  border-radius: 50%;
  margin-bottom: 8px;
  position: relative;
}

.cv-sidebar-logo::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 8px;
  background: var(--accent);
  border-radius: 50% 50% 0 0;
  opacity: 0.75;
}

.cv-sidebar-icon {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.cv-sidebar-icon::before {
  content: '';
  position: absolute;
  inset: 7px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

.cv-sidebar-icon.var-1::before { border-radius: 50%; inset: 8px; }
.cv-sidebar-icon.var-2::before { height: 2px; inset: 7px 5px; border-radius: 1px; box-shadow: 0 3px rgba(255,255,255,0.18), 0 6px rgba(255,255,255,0.18); background: rgba(255,255,255,0.18); }
.cv-sidebar-icon.var-3::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.cv-sidebar-icon.var-4::before { border-radius: 50% 50% 0 0; }

/* main */
.cv-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  min-width: 0;
}

.cv-page-header {
  padding: 14px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  flex-shrink: 0;
}

.cv-avatar {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cool);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-breadcrumb {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
}

.cv-page-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

.cv-page-subtitle {
  font-size: 10.5px;
  color: var(--text-dim);
  margin: 0;
}

.cv-page-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.cv-categories {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.cv-search {
  height: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-mute);
}

.cv-search::before {
  content: '';
  width: 9px;
  height: 9px;
  border: 1.2px solid currentColor;
  border-radius: 50%;
}

.cv-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  padding: 0 2px;
}

.cv-add-cat { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.cv-sort { color: var(--text-dim); }

.cv-cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0 0 12px;
  flex: 1;
  overflow: hidden;
}

.cv-cat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cv-cat-item.active {
  background: rgba(185, 255, 102, 0.05);
  border-color: rgba(185, 255, 102, 0.28);
}

.cv-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.cv-cat-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text);
}

.cv-badge {
  font-size: 8.5px;
  padding: 1.5px 5px;
  border-radius: 999px;
  background: rgba(122, 168, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(122, 168, 255, 0.18);
  white-space: nowrap;
}

.cv-cat-item.active .cv-badge {
  background: rgba(185, 255, 102, 0.1);
  color: var(--accent);
  border-color: rgba(185, 255, 102, 0.3);
}

.cv-cat-desc {
  font-size: 9.5px;
  color: var(--text-mute);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cv-cat-meta {
  font-size: 9px;
  color: var(--text-mute);
}

/* detail */
.cv-detail {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.cv-detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-detail-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cv-detail-pencil {
  color: var(--text-mute);
  font-size: 10px;
}

.cv-detail-desc {
  font-size: 10px;
  color: var(--text-mute);
  margin-top: -4px;
}

.cv-detail-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  margin-top: 2px;
}

.cv-detail-counts { color: var(--text-dim); }

.cv-action-group { display: flex; gap: 14px; }

.cv-action {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
}

.cv-empty-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cv-empty-label {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.cv-empty-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

.cv-empty-icon {
  width: 28px;
  height: 22px;
  position: relative;
  margin-bottom: 4px;
}

.cv-empty-icon::before {
  content: '';
  position: absolute;
  inset: 6px 0 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px 2px 4px 4px;
}

.cv-empty-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px 4px 0 0;
}

.cv-empty-primary {
  font-size: 10.5px;
  color: var(--text);
  font-weight: 500;
}

.cv-empty-secondary {
  font-size: 9.5px;
  color: var(--text-mute);
}

.cv-empty-cta {
  font-size: 10px;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(185, 255, 102, 0.25);
  border-radius: 4px;
  background: rgba(185, 255, 102, 0.05);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* responsive: shrink the laptop on narrow screens */
@media (max-width: 720px) {
  .laptop-lid { width: 100%; padding: 8px 8px 10px; }
  .cv-sidebar { width: 36px; }
  .cv-categories { width: 180px; padding: 8px; }
  .cv-detail { padding: 10px 12px; }
  .cv-page-header { padding: 10px 14px; }
  .cv-avatar { top: 10px; right: 10px; }
}

/* ===========================================================
   Image lightbox (click any case-section image to expand)
   =========================================================== */
.lightbox-trigger {
  cursor: zoom-in;
  transition: filter 0.3s var(--ease);
}

.lightbox-trigger:hover {
  filter: brightness(1.05);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: rgba(5, 5, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  cursor: zoom-out;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  transform: scale(0.95);
  transition: transform 0.4s var(--ease);
  cursor: default;
}

.lightbox.open .lightbox-image {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
  font-family: inherit;
  padding: 0;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .lightbox { padding: 24px; }
  .lightbox-close { top: 16px; right: 16px; width: 38px; height: 38px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-image,
  .lightbox-close { transition: none !important; }
  .lightbox-image { transform: none !important; }
}

/* Hide volume/mute controls on inline video players that don't need audio.
   (No standard attribute exists for this — only the WebKit pseudo-elements
   work in Chrome/Safari/Edge. Firefox falls back to showing them.) */
.cv-shot::-webkit-media-controls-volume-slider,
.cv-shot::-webkit-media-controls-mute-button,
.cv-shot::-webkit-media-controls-volume-control-container,
.cv-shot::-webkit-media-controls-volume-slider-container {
  display: none !important;
}

/* Hide the entire control panel until the user hovers over the video.
   Smoothly fades in/out so the transition isn't jarring. */
.cv-shot::-webkit-media-controls-panel {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cv-shot:hover::-webkit-media-controls-panel,
.cv-shot:focus-within::-webkit-media-controls-panel {
  opacity: 1;
}

/* ===========================================================
   Mobile phone mockup frame (used on the CycurID/Imme page)
   =========================================================== */
.mockup-phone {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 375 / 812;
  background: linear-gradient(180deg, #1a1a22 0%, #0f0f15 100%);
  border-radius: 38px;
  padding: 8px;
  position: relative;
  box-shadow:
    0 30px 60px -16px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  margin: 0 auto;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.phone-screen img,
.phone-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* small notch hint at the top of the screen */
.mockup-phone::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 18px;
  background: #0a0a10;
  border-radius: 0 0 12px 12px;
  z-index: 3;
}

/* Phone gallery — multiple phones in a row */
.phone-gallery {
  display: grid;
  gap: 24px;
  margin: 32px 0 16px;
  align-items: start;
}

.phone-gallery.two   { grid-template-columns: repeat(2, 1fr); }
.phone-gallery.three { grid-template-columns: repeat(3, 1fr); }
.phone-gallery.four  { grid-template-columns: repeat(4, 1fr); }
.phone-gallery.five  { grid-template-columns: repeat(5, 1fr); }

.phone-gallery figcaption {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.phone-gallery figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 880px) {
  .phone-gallery.four,
  .phone-gallery.five { grid-template-columns: repeat(2, 1fr); }
  .phone-gallery.three { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .phone-gallery.three,
  .phone-gallery.four,
  .phone-gallery.five { grid-template-columns: 1fr; }
}

/* ===========================================================
   Onboarding flow diagram (CycurID/Imme — before/after steps)
   =========================================================== */
.onboarding-flow {
  margin: 40px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}

/* Each row + its label sizes to the diagram's natural width and centers
   horizontally — so the label and its lines line up with the step icons
   instead of stretching across the whole page. */
.flow-row-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: max-content;
  max-width: 100%;
}

.flow-row-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.flow-row-label::before,
.flow-row-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.flow-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  width: 92px;
}

.flow-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-dim);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}

.flow-circle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-circle:hover {
  transform: translateY(-2px);
  border-color: var(--text-mute);
  color: var(--text);
}

.flow-label {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.flow-connector {
  flex: 0 0 28px;
  height: 0;
  border-top: 1.5px dashed var(--border-strong);
  margin-top: 29px;
}

/* "After" row — accent green to signal the improved/shorter flow */
.flow-row-after .flow-circle {
  border-color: rgba(185, 255, 102, 0.45);
  background: rgba(185, 255, 102, 0.06);
  color: var(--accent);
}

.flow-row-after .flow-circle:hover {
  border-color: var(--accent);
  background: rgba(185, 255, 102, 0.12);
}

.flow-row-after .flow-connector {
  border-top-color: rgba(185, 255, 102, 0.4);
}

.flow-row-after .flow-label {
  color: var(--text);
}

.flow-row-after-label::before,
.flow-row-after-label::after {
  background: rgba(185, 255, 102, 0.25);
}

.flow-row-after-label {
  color: var(--accent);
}

/* SVG fill icon (passcode dots) */
.flow-circle svg.icon-fill {
  fill: currentColor;
  stroke: none;
}

@media (max-width: 720px) {
  .flow-step { width: 76px; }
  .flow-circle { width: 48px; height: 48px; }
  .flow-circle svg { width: 22px; height: 22px; }
  .flow-label { font-size: 11px; }
  .flow-connector { flex-basis: 14px; margin-top: 24px; }
}

/* ===========================================================
   Cover phones — size phones by container height so they don't
   overflow the fixed-aspect cover frame at any viewport width.
   =========================================================== */
.case-cover-thumb .phone-gallery {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 0 !important;
}

.case-cover-thumb .phone-gallery figure {
  height: 88%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-cover-thumb .mockup-phone {
  height: 100%;
  width: auto;
  max-width: none;
}

/* ===========================================================
   Phone video placeholder — drop-in inside any .phone-screen.
   To swap for the real video, replace this div with:
     <video src="..." autoplay muted loop playsinline></video>
   =========================================================== */
.phone-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #1a1a26 0%, #0d0d14 100%);
  color: var(--text-mute);
  padding: 24px;
  text-align: center;
}

.phone-video-placeholder .placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(185, 255, 102, 0.06);
  border: 1px solid rgba(185, 255, 102, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 20px;
  padding-left: 4px;
  transition: transform 0.4s var(--ease), background 0.3s var(--ease);
}

.phone-video-placeholder:hover .placeholder-icon {
  background: rgba(185, 255, 102, 0.12);
  transform: scale(1.06);
}

.phone-video-placeholder .placeholder-text {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.phone-video-placeholder .placeholder-hint {
  font-size: 10px;
  color: var(--text-mute);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* Standalone single phone block (for video walkthroughs) */
.phone-feature {
  margin: 40px auto 8px;
  max-width: 320px;
}

.phone-feature figcaption {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
}

/* ===========================================================
   CycurID/Imme cover — top-down desk view with the two phones
   laid flat on the desk, surrounded by everyday desk items.
   =========================================================== */
.cy-cover {
  position: relative;
  overflow: hidden;
  background: #14100a;
}

.cy-scenery {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Dark walnut desk surface with subtle wood grain */
.cy-desk-grain {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      88deg,
      transparent 0,
      transparent 14px,
      rgba(0, 0, 0, 0.18) 14px,
      rgba(0, 0, 0, 0.18) 15px,
      transparent 15px,
      transparent 38px,
      rgba(0, 0, 0, 0.10) 38px,
      rgba(0, 0, 0, 0.10) 39px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 70px,
      rgba(255, 220, 180, 0.025) 70px,
      rgba(255, 220, 180, 0.025) 72px
    ),
    linear-gradient(135deg, #3a2618 0%, #281a10 50%, #1c1208 100%);
}

/* Soft vignette so the corners feel like the edge of the desk */
.cy-desk-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}

/* A warm overhead-lamp glow */
.cy-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.cy-glow-warm {
  width: 80%;
  aspect-ratio: 1 / 1;
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 200, 140, 0.18) 0%, transparent 60%);
  opacity: 0.9;
}

/* ----- Top-down desk items ----- */

/* Notepad with pen, top-left */
.td-notepad {
  position: absolute;
  top: 10%;
  left: 5%;
  width: 14%;
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(180deg, #f4ecd5 0%, #e8dec3 100%);
  border-radius: 3px;
  padding: 8% 10%;
  display: flex;
  flex-direction: column;
  gap: 7%;
  transform: rotate(-8deg);
  box-shadow:
    0 12px 24px -6px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.td-notepad::before {
  /* binding strip at top */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5%;
  background:
    repeating-linear-gradient(90deg,
      #b8946a 0, #b8946a 6%,
      transparent 6%, transparent 10%);
  border-radius: 3px 3px 0 0;
}

.td-note-line {
  height: 8%;
  background: rgba(70, 55, 35, 0.22);
  border-radius: 1px;
}

.td-note-line.short {
  width: 65%;
}

/* Pen lying diagonally across the notepad, extending off to the left
   so it stays clear of the phones in the centre of the desk. */
.td-pen {
  position: absolute;
  top: 32%;
  left: -50%;
  width: 80%;
  height: 6%;
  background:
    linear-gradient(90deg,
      #9a7d3a 0%, #9a7d3a 12%,           /* gold tip (far left) */
      #1a1a1f 12%, #1a1a1f 88%,          /* body */
      #444 88%, #444 100%                 /* end cap (near notepad) */
    );
  border-radius: 4px;
  transform: translateX(10px) rotate(-32deg);
  transform-origin: right center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Stylus, top-right — subtle taper on the writing end (not as sharp
   as a real pencil), flat cylinder body, slightly chamfered back.
   Angled to match the iPad's −10° tilt. */
.td-stylus {
  position: absolute;
  top: 22%;
  right: 14%;
  width: 24%;
  height: 2%;
  background: linear-gradient(90deg,
    #cfcfd4 0%, #cfcfd4 5%,                  /* light grey writing tip */
    #f2f2f5 7%, #ededf0 92%,                 /* white body */
    #cfcfd4 92%, #cfcfd4 100%                /* matching light grey end cap */
  );
  /* Small flat tip on the left (40-60%) so it's tapered but not sharp */
  clip-path: polygon(
    0%   40%,
    8%   0%,
    98%  0%,
    100% 25%,
    100% 75%,
    98%  100%,
    8%   100%,
    0%   60%
  );
  transform: rotate(-10deg);
  /* drop-shadow works through clip-path; box-shadow doesn't */
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
}

/* AirPods case, bottom-left — nudged ~15px down and left. */
.td-airpods {
  position: absolute;
  bottom: 14%;
  left: 8%;
  width: 8%;
  aspect-ratio: 1.35 / 1;
  background: linear-gradient(135deg, #f4f4f7 0%, #d8d8de 100%);
  border-radius: 22% / 30%;
  transform: translate(-15px, 15px) rotate(18deg);
  box-shadow:
    0 10px 20px -4px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.td-airpods-hinge {
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 1px;
  background: rgba(0, 0, 0, 0.18);
  transform: translateY(-50%);
}

.td-airpods-led {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 14%;
  height: 8%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

/* Small succulent in a terracotta pot, bottom-right */
.td-plant {
  position: absolute;
  bottom: 12%;
  right: 7%;
  width: 9%;
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 50%, #6b4f35 0%, #4a3422 75%, #2e2014 100%);
  border-radius: 50%;
  box-shadow:
    0 12px 22px -6px rgba(0, 0, 0, 0.6),
    inset 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.td-plant-leaves {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #6a9658 0%, #4a7a3e 35%, transparent 36%),
    radial-gradient(circle at 70% 30%, #588a4d 0%, #3e6d36 35%, transparent 36%),
    radial-gradient(circle at 50% 70%, #6a9658 0%, #406d36 38%, transparent 39%),
    radial-gradient(circle at 25% 65%, #588a4d 0%, #2f5a32 30%, transparent 31%),
    radial-gradient(circle at 75% 65%, #6a9658 0%, #406d36 30%, transparent 31%),
    #2a4a2c;
}

/* Make sure the phone gallery sits above the scenery */
.cy-cover .phone-gallery {
  position: relative;
  z-index: 1;
}

/* On very narrow viewports, hide a couple of items so the desk isn't cluttered */
@media (max-width: 640px) {
  .td-airpods,
  .td-notepad { display: none; }
  .td-stylus { width: 30%; top: 6%; right: 10%; }
  .td-plant { width: 12%; bottom: 8%; right: 6%; }
}

/* ===========================================================
   CycurID/Imme cover layout — phones on the left, iPad on the
   right, all sized by container height so they scale together.
   =========================================================== */
.cy-cover .cy-devices {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 3% 4%;
  box-sizing: border-box;
}

/* Override the generic .case-cover-thumb .phone-gallery rules so the
   gallery sits as a sibling of the iPad instead of filling the cover. */
.cy-cover .cy-devices .phone-gallery {
  width: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 0 !important;
}

.cy-cover .cy-devices .phone-gallery figure {
  height: 76%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cy-cover .cy-devices .mockup-phone {
  height: 100%;
  width: auto;
  max-width: none;
}

/* iPad mockup (landscape). Sized by width (more reliable inside a flex
   layout than percentage height) — aspect-ratio computes the height.
   Rotated −30° so it sits on the desk at an angle. */
.mockup-ipad {
  width: 42%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(180deg, #1a1a22 0%, #0f0f15 100%);
  border-radius: 18px;
  padding: 10px;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  transform: translateX(15px) rotate(-10deg);
  transform-origin: center;
  box-shadow:
    0 24px 40px -10px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.ipad-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Pin the screen content absolutely so it always fills the screen
   regardless of the image's intrinsic dimensions. The max-*: none
   overrides the .case-cover-thumb img max-width/max-height defaults
   meant for the recorder-node thumbnail. */
.ipad-screen img,
.ipad-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Front-facing camera dot on the left bezel (landscape orientation) */
.mockup-ipad::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  z-index: 2;
}

/* On narrow viewports, hide the iPad and let the phones take the cover */
@media (max-width: 720px) {
  .cy-cover .cy-devices { gap: 3%; padding: 3%; }
  .mockup-ipad { display: none; }
}

/* ===========================================================
   Time Series Component — home card visual + anatomy styles
   =========================================================== */

/* Card visual: 4 rows of small time-block segments coloured by status */
.visual-timeseries {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(122, 168, 255, 0.06) 0%, transparent 55%),
    linear-gradient(135deg, #15151c 0%, #11111a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8% 7%;
  gap: 9px;
}

.ts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  color: var(--text-mute);
  font-family: 'Inter', sans-serif;
}

.ts-row-label {
  width: 22%;
  text-align: right;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ts-row-blocks {
  flex: 1;
  display: flex;
  gap: 1.5px;
  height: 10px;
  border-radius: 1px;
  overflow: hidden;
}

.ts-block { flex: 1; height: 100%; }

.ts-block.ts-good   { background: rgba(110, 210, 130, 0.6); }
.ts-block.ts-warn   { background: rgba(255, 200, 80, 0.6); }
.ts-block.ts-error  { background: rgba(240, 108, 94, 0.65); }
.ts-block.ts-bad    { background: rgba(184, 49, 47, 0.78); }
.ts-block.ts-nodata { background: rgba(255, 255, 255, 0.04); }

.work-card:hover .visual-timeseries .ts-block { filter: brightness(1.1); }

/* Case-study subsection headings (inside anatomy and similar parents) */
.case-subsection-head {
  margin: 56px 0 12px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.case-subsection-head .case-subsection-tag {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
}

.case-subsection-head h3 {
  font-family: 'Fraunces', serif;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

/* Image wrapper used for the anatomy screenshots (light bg to match Figma) */
.anatomy-figure {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  padding: 18px;
}

.anatomy-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.anatomy-figure figcaption {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.anatomy-figure.half {
  max-width: 50%;
  margin-left: 0;
  margin-right: auto;
}

.lock-gate {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.lock-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 55%);
  pointer-events: none;
}

.lock-gate > * {
  position: relative;
  z-index: 1;
}

.lock-form {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  max-width: 480px;
  flex-wrap: wrap;
}

.lock-form input[type="password"] {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.lock-form input[type="password"]::placeholder {
  color: var(--text-mute);
}

.lock-form input[type="password"]:focus {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.lock-form .btn {
  flex: 0 0 auto;
}

.lock-error {
  margin-top: 16px;
  font-size: 14px;
  color: #ff8a8a;
}

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

.locked-content[hidden] {
  display: none;
}

.locked-content.unlocking {
  animation: lock-reveal 480ms ease-out both;
}

@keyframes lock-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Dashboard carousel ===== */
.dash-carousel {
  margin-top: 32px;
  outline: none;
}

.dash-carousel:focus-visible .dash-carousel-stage {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.dash-carousel-stage {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.dash-carousel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(0);
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.dash-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.dash-slide img,
.dash-slide video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

.dash-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.dash-arrow:hover {
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  transform: translateY(-50%) scale(1.05);
}

.dash-arrow:focus-visible {
  outline: none;
  border-color: color-mix(in oklab, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.dash-arrow.prev { left: 16px; }
.dash-arrow.next { right: 16px; }

.dash-arrow[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.dash-carousel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.dash-caption {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 500;
}

.dash-counter {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.dash-counter span {
  color: var(--text);
}

.dash-dots {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.dash-dot {
  appearance: none;
  border: 0;
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--text) 22%, transparent);
  cursor: pointer;
  transition: background 180ms ease, width 180ms ease;
}

.dash-dot:hover {
  background: color-mix(in oklab, var(--text) 40%, transparent);
}

.dash-dot.is-active {
  background: var(--accent);
  width: 22px;
}

.dash-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

@media (max-width: 720px) {
  .dash-carousel-stage { aspect-ratio: 4 / 3; }
  .dash-slide { padding: 12px; }
  .dash-arrow { width: 38px; height: 38px; }
  .dash-arrow.prev { left: 8px; }
  .dash-arrow.next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-carousel-track { transition: none; }
}

/* ===== Wider content on large screens =====
   Bumps the global content max-widths on viewports >= 1500px so videos,
   cards, and project visuals get bigger on bigger displays. Paragraph
   max-widths inside .case-section are left alone so long-form prose
   stays at a comfortable reading width. */
@media (min-width: 1500px) {
  .section      { max-width: 1600px; }
  .hero-inner   { max-width: 1400px; }
  .case-hero    { max-width: 1400px; }
  .case-meta    { max-width: 1600px; }
  .case-cover   { max-width: 1600px; }
  .case-section { max-width: 1400px; }
  .case-next    { max-width: 1400px; }
}

@media (min-width: 1900px) {
  .section      { max-width: 1760px; }
  .hero-inner   { max-width: 1520px; }
  .case-hero    { max-width: 1520px; }
  .case-meta    { max-width: 1760px; }
  .case-cover   { max-width: 1760px; }
  .case-section { max-width: 1520px; }
  .case-next    { max-width: 1520px; }
}

/* ===========================================================
   Site-wide password gate
   =========================================================== */
.lf-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
}

html.lf-locked body > *:not(.lf-gate) { display: none !important; }
html.lf-locked .lf-gate { display: flex; }
html.lf-locked { overflow: hidden; }

.lf-gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.lf-gate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 55%);
  pointer-events: none;
}

.lf-gate-card > * {
  position: relative;
  z-index: 1;
}

.lf-gate-logo {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 24px;
}

.lf-gate-logo span { color: var(--accent); }

.lf-gate-card h1 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.2;
}

.lf-gate-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.lf-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lf-gate-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.lf-gate-form input[type="password"],
.lf-gate-form input[type="text"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 12px 48px 12px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.lf-gate-form input[type="password"]::placeholder,
.lf-gate-form input[type="text"]::placeholder {
  color: var(--text-mute);
}

.lf-gate-form input[type="password"]:focus,
.lf-gate-form input[type="text"]:focus {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.lf-gate-form.has-error input[type="password"],
.lf-gate-form.has-error input[type="text"] {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18);
  animation: lf-gate-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes lf-gate-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .lf-gate-form.has-error input { animation: none; }
}

.lf-gate-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.lf-gate-eye:hover {
  color: var(--text);
  background: color-mix(in oklab, var(--text) 6%, transparent);
}

.lf-gate-eye:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 50%, transparent);
}

/* SVGs with the hidden attribute inside the eye toggle must truly hide.
   Browsers don't always apply display:none from [hidden] consistently
   when SVGs sit inside a flex container, so make it explicit. */
.lf-gate-eye svg[hidden] { display: none; }

.lf-gate-form .btn {
  justify-content: center;
}

/* Enter button: keep the colour/glow hover, drop the lift animation
   and the arrow slide so the button stays put. */
.lf-gate-form .btn-primary:hover,
.lf-gate-form .btn-primary:hover svg {
  transform: none;
}

.lf-gate-error {
  margin: 12px 0 0 0;
  font-size: 13px;
  color: #ff8a8a;
}

.lf-gate-foot {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.lf-gate-foot a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
