/* ============ Case-study pages (themed via --case-a / --case-b / --case-glow) ============ */
.case { --case-a: #fed970; --case-b: #1d3655; --case-glow: rgba(254,217,112,.6); }

/* Hero */
.case-hero { position: sticky; top: 0; z-index: 1; padding: 240px var(--pad) 120px; text-align: center; transform-origin: 50% 0; will-change: transform, opacity; }
.case { position: relative; }
.case-hero__title { position: relative; font-size: 82px; line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.case-hero__tags { position: relative; margin-top: 24px; font-size: 14px; line-height: 1.1; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.case-hero__intro { position: relative; display: flex; justify-content: center; gap: 145px; margin: 160px auto 0; text-align: left; }
.case-feature, .case-body, .case-pager, .case-page .footer { position: relative; z-index: 2; }
.case-hero__intro p { width: 320px; font-size: 18px; line-height: 1.3; letter-spacing: -0.04em; color: var(--text-2); }

/* Feature panel (grows with scroll via [data-grow]) */
.case-feature { display: flex; justify-content: center; padding: 0 var(--pad) 120px; }
.case-feature__panel { width: 100%; max-width: 1360px; height: 790px; border-radius: 24px; overflow: hidden; transform: scale(.9); transform-origin: 50% 0;
  will-change: transform; background: linear-gradient(160deg, var(--case-a), var(--case-b)); }

/* Body: sticky chapter list + image column */
.case-body { display: grid; grid-template-columns: 350px 930px; gap: 80px; justify-content: center; padding: 0 var(--pad) 200px; }
.case-toc { /* like the original: display-only, no hover or click */ position: sticky; top: 0; height: 100vh; align-self: start; display: flex; flex-direction: column; justify-content: center; }
.toc-item { display: block; width: 350px; min-height: 71px; border-radius: 24px; background: var(--surface); padding: 24px; margin: 0;
  transform: scale(.8); opacity: .8; transform-origin: 50% 50%;
  transition: transform .6s cubic-bezier(.45, 0, .25, 1), opacity .6s cubic-bezier(.45, 0, .25, 1), margin .6s cubic-bezier(.45, 0, .25, 1); }
.toc-item.is-active { transform: none; opacity: 1; margin: 4px 0; }
.toc-item__label { display: block; font-size: 14px; line-height: 1.1; font-weight: 400; letter-spacing: -0.02em; color: var(--text-2); }
.toc-item__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s cubic-bezier(.45, 0, .25, 1); }
.toc-item__inner { overflow: hidden; display: flex; flex-direction: column; gap: 20px; opacity: 0; transition: opacity .35s var(--ease), padding .6s cubic-bezier(.45, 0, .25, 1); }
.toc-item.is-active .toc-item__body { grid-template-rows: 1fr; }
.toc-item.is-active .toc-item__inner { opacity: 1; transition-delay: .15s; padding-top: 40px; }
.toc-item strong { font-size: 24px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; color: var(--fg); }
.toc-item__inner > span { font-size: 16px; line-height: 1.3; font-weight: 400; letter-spacing: -0.03em; color: var(--text-2); }

.case-col { display: flex; flex-direction: column; gap: 40px; }
.case-chapter { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 110px; }
.case-chapter:first-child .case-panel { height: 575px; }
.case-chapter__card { display: none; }
.case-chapter__head { font-size: 24px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; }
.case-panel { height: 594px; border-radius: 16px; overflow: hidden; background: var(--navy-deep); }

/* Previous / Next — matches the original buttons */
.case-btns { display: flex; justify-content: center; gap: 40px; padding-top: 40px; }
.case-btn { display: inline-flex; align-items: center; gap: 12px; height: 48px; padding: 0 18px; border-radius: 20px; background: rgba(29,54,85,.06);
  color: var(--fg); font-size: 16px; line-height: 1.3; font-weight: 500; letter-spacing: -0.03em;
  transition: background-color .3s var(--ease), color .3s var(--ease); }
.case-btn__icon { width: 11px; height: 11px; transition: opacity .3s var(--ease); }
.case-btn--prev .case-btn__icon { transform: rotate(-135deg); }
.case-btn--next .case-btn__icon { transform: rotate(45deg); }
.case-btn:hover { background: rgba(29,54,85,.1); color: var(--text-2); }
.case-btn:hover .case-btn__icon { opacity: .8; }

/* ============ Original CSS illustrations (all tinted by the theme) ============ */
.art { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; color: #fff;
  background: radial-gradient(80% 90% at 70% 0%, color-mix(in srgb, var(--case-a) 55%, transparent), transparent 70%), linear-gradient(160deg, #1d3655, #0f1f33); }
.art--feature, .art--split, .art--wide { background: linear-gradient(160deg, var(--case-a), var(--case-b)); }
.art--site-alt { background: linear-gradient(200deg, color-mix(in srgb, var(--case-a) 30%, #f3f1ee), #e9e6e1); }

.mock-phone { width: 210px; height: 430px; border-radius: 36px; background: #0b0b0b; padding: 9px; box-shadow: 0 40px 80px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.08); }
.mock-phone__screen { width: 100%; height: 100%; border-radius: 28px; padding: 26px 16px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--case-a) 80%, #fff), var(--case-b)); }
.mock-phone__screen .bar { width: 40%; height: 8px; border-radius: 4px; background: rgba(255,255,255,.5); }
.mock-phone__screen .num { height: 36px; width: 75%; border-radius: 8px; background: rgba(255,255,255,.9); margin: 8px 0 10px; }
.mock-phone__screen .row { height: 42px; border-radius: 12px; background: rgba(255,255,255,.18); }
.mock-phone__screen .row.short { width: 70%; }
.mock-phone__screen .pill { margin-top: auto; height: 38px; border-radius: 19px; background: #fff; }
.mock-phone.tilt-l { transform: rotate(-8deg) translateY(30px); }
.mock-phone.tilt-r { transform: rotate(8deg) translateY(30px); }
.mock-phone--front { position: absolute; right: 16%; bottom: -60px; transform: rotate(6deg); }

.mock-monitor { width: 64%; aspect-ratio: 16 / 10; border-radius: 16px; border: 10px solid #0d0d0d; background: #0d0d0d; box-shadow: 0 50px 120px rgba(0,0,0,.5); }
.mock-monitor__screen { position: relative; width: 100%; height: 100%; border-radius: 8px; padding: 6% 7%;
  background: radial-gradient(70% 90% at 80% 20%, color-mix(in srgb, var(--case-a) 70%, #fff), var(--case-b)); display: flex; flex-direction: column; gap: 6%; }
.mock-brand { font-size: 20px; letter-spacing: -0.03em; }
.mock-head { font-size: clamp(24px, 3.4vw, 54px); line-height: 1; letter-spacing: -0.04em; font-weight: 500; }
.mock-cta { width: 120px; height: 34px; border-radius: 10px; background: #fff; }

.mock-split { width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-around; }
.mock-logo { font-size: 110px; letter-spacing: -0.06em; font-weight: 500; }
.mock-row { display: flex; gap: 34px; align-items: center; }

.mock-wire { display: flex; gap: 18px; padding: 0 30px; }
.mock-wire__screen { width: 150px; height: 320px; border-radius: 18px; background: #f2f2f2; padding: 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.mock-wire__screen i { height: 12px; border-radius: 6px; background: #d6d6d6; }
.mock-wire__screen i.short { width: 60%; }
.mock-wire__screen i.box { height: 90px; border-radius: 12px; background: color-mix(in srgb, var(--case-a) 25%, #e3e3e3); }

.mock-flow { display: flex; align-items: center; gap: 16px; }
.mock-flow__step { width: 150px; height: 190px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.mock-flow__step b { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--case-a); font-weight: 500; }
.mock-flow__step i { height: 10px; border-radius: 5px; background: rgba(255,255,255,.2); }
.mock-flow__step i.short { width: 60%; }
.mock-flow__arrow { color: rgba(255,255,255,.4); font-size: 22px; }

.mock-detail { display: flex; gap: 30px; align-items: center; }
.mock-detail__card { width: 300px; height: 200px; border-radius: 24px; padding: 26px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(160deg, var(--case-a), var(--case-b)); }
.mock-detail__card .num { height: 44px; width: 70%; border-radius: 10px; background: rgba(255,255,255,.9); }
.mock-detail__card i { height: 12px; border-radius: 6px; background: rgba(255,255,255,.35); }
.mock-detail__card i.short { width: 55%; }
.mock-detail__chart { width: 360px; height: 220px; display: flex; align-items: flex-end; gap: 10px; }
.mock-detail__chart i { flex: 1; height: var(--h); border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--case-a), color-mix(in srgb, var(--case-b) 70%, transparent)); }

.mock-dash { width: 78%; height: 66%; border-radius: 18px; background: #f4f4f4; display: grid; grid-template-columns: 180px 1fr; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.4); }
.mock-dash__side { background: #ececec; padding: 24px 18px; display: flex; flex-direction: column; gap: 14px; }
.mock-dash__side i { height: 12px; border-radius: 6px; background: #d4d4d4; }
.mock-dash__main { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mock-dash__main i { border-radius: 14px; background: #e6e6e6; }
.mock-dash__main i.big { grid-column: span 2; background: linear-gradient(120deg, var(--case-a), var(--case-b)); }

.mock-site { width: 80%; height: 74%; border-radius: 18px; padding: 26px 32px; background: #0f0f0f; box-shadow: 0 40px 100px rgba(0,0,0,.45);
  display: flex; flex-direction: column; gap: 16px; border: 1px solid rgba(255,255,255,.08); }
.mock-site--alt { background: #fff; color: #111; }
.mock-site__nav { display: flex; gap: 10px; justify-content: flex-end; }
.mock-site__nav i { width: 46px; height: 10px; border-radius: 5px; background: rgba(127,127,127,.35); }
.mock-site__head { font-size: 64px; line-height: 1; letter-spacing: -0.05em; font-weight: 500; margin-top: 20px; }
.mock-site__line { height: 12px; width: 60%; border-radius: 6px; background: rgba(127,127,127,.3); }
.mock-site__line.short { width: 40%; }
.mock-site__grid { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; height: 34%; }
.mock-site__grid i { border-radius: 12px; background: linear-gradient(160deg, var(--case-a), var(--case-b)); }

.mock-wide { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.mock-wide span { font-size: 14px; color: rgba(255,255,255,.7); letter-spacing: -0.02em; }
.mock-wide b { font-size: 120px; line-height: .9; letter-spacing: -0.06em; font-weight: 500; }

/* Project cards on the home page link here; keep the cursor consistent */
.case-page .nav__logo { cursor: pointer; }

@media (max-width: 1100px) {
  .case-hero__title { font-size: 54px; }
  .case-hero__intro { flex-direction: column; align-items: center; gap: 20px; margin-top: 80px; }
  .case-body { grid-template-columns: 1fr; }
  .case-toc { position: relative; top: 0; height: auto; }
  .toc-item { width: 100%; }
  .case-hero { position: relative; }
  .case-feature { height: 560px; }
  .case-feature__panel, .case-panel { height: 520px; }
  .mock-wire__screen:nth-child(n+4), .mock-flow__step:nth-child(n+5), .mock-flow__arrow:nth-child(n+4) { display: none; }
}
@media (max-width: 640px) {
  .case-hero__title { font-size: 40px; }
  .case-panel { height: 380px; }
  .mock-phone { width: 150px; height: 310px; }
  .mock-row .tilt-l, .mock-row .tilt-r, .mock-detail__chart { display: none; }
  .mock-logo, .mock-wide b { font-size: 56px; }
}

/* ============ Phone layout (matches the original's mobile case page) ============ */
@media (max-width: 809px) {
  .case-hero { padding: 160px 20px 80px; }
  .case-hero__title { font-size: 42px; line-height: 1; letter-spacing: -0.04em; }
  .case-hero__tags { margin-top: 24px; }
  .case-hero__intro { flex-direction: column; align-items: stretch; gap: 24px; margin: 80px 0 0; padding: 0 20px; }
  .case-hero__intro p { width: auto; font-size: 16px; line-height: 1.3; letter-spacing: -0.04em; }
  
  .case-feature { height: auto; padding: 0 20px 80px; }
  .case-feature__panel { height: 431px; border-radius: 16px; }

  .case-body { display: block; padding: 0 20px 200px; }
  .case-toc { display: none; }
  .case-col { gap: 40px; }
  .case-chapter { gap: 8px; scroll-margin-top: 90px; }
  .case-chapter__head { display: none; }
  .case-chapter__card { display: flex; flex-direction: column; gap: 0; border-radius: 24px; background: var(--surface); padding: 24px; }
  .case-chapter__card strong { margin-top: 40px; font-size: 24px; line-height: 1.1; font-weight: 500; letter-spacing: -0.02em; color: var(--fg); }
  .case-chapter__card > span:last-child { margin-top: 20px; font-size: 16px; line-height: 1.3; font-weight: 400; letter-spacing: -0.03em; color: var(--text-2); }
  .case-panel, .case-chapter:first-child .case-panel { height: 214px; border-radius: 12px; }
  .case-chapter:first-child .case-panel { height: 207px; }
  .case-btns { gap: 40px; }

  /* scaled-down illustrations so they fit the small panels */
  .art > * { transform: scale(.42); transform-origin: 50% 50%; flex: none; }
  .art--feature > * { transform: scale(.6); }
}
