.design-study {
  color-scheme: light;
  --study-ink: var(--studio-ink);
  --study-muted: var(--studio-muted);
  --study-accent: var(--studio-blue);
  --study-rule: var(--studio-rule);
  padding-block: var(--section-space);
  background: var(--paper-warm);
  color: var(--study-ink);
}

.design-study [hidden] { display: none !important; }
.design-study__inner { width: min(calc(100% - var(--gutter, 1rem) * 2), var(--page-width, 78rem)); margin-inline: auto; }
.design-study__header { display: grid; grid-template-columns: 1.5fr 1fr; align-items: end; gap: 2rem 5vw; margin-bottom: clamp(2.25rem, 6vw, 4.5rem); }
.design-study__eyebrow { display: flex; align-items: center; gap: .7rem; margin: 0 0 1.3rem; color: var(--study-accent); font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.design-study__eyebrow > span { padding-right: .7rem; border-right: 1px solid var(--study-rule); font-variant-numeric: tabular-nums; }
.design-study__header h2 { margin: 0; color: inherit; font-size: var(--heading-2); font-weight: var(--weight-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
.design-study__intro { max-width: 33rem; }
.design-study__intro > p:first-child { margin: 0; color: var(--study-muted); font-size: clamp(1.0625rem, 1.55vw, 1.25rem); line-height: 1.6; }
.design-study__disclosure { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 0; color: var(--study-accent); font-size: .875rem; font-weight: 650; }
.design-study__disclosure::before { width: .8rem; height: .5rem; flex: 0 0 auto; background: currentColor; content: ""; transform: skewX(-34deg); }

.study-figure { margin: 0; }
.study-figure__toolbar { display: flex; align-items: center; justify-content: space-between; gap: .85rem 2rem; margin-bottom: 1.1rem; }
.study-figure__instruction { display: flex; align-items: center; gap: .8rem; }
.study-figure__instruction > span { display: grid; flex: 0 0 auto; width: 2.75rem; height: 2.75rem; place-items: center; border: 1px solid var(--study-rule); border-radius: 50%; color: var(--study-accent); font-size: 1.55rem; line-height: 1; }
.study-figure__instruction p { margin: 0; line-height: 1.35; }
.study-figure__instruction strong, .study-figure__instruction small { display: block; }
.study-figure__instruction small { margin-top: .16rem; color: var(--study-muted); font-size: .875rem; }
.study-presets { display: flex; flex: 0 0 auto; width: max-content; max-width: 100%; padding: .2rem; border: 1px solid var(--study-rule); border-radius: .55rem; background: var(--studio-paper); }
.study-presets button { min-width: 0; min-height: 44px; padding: .4rem .85rem; border: 0; border-radius: .3rem; background: transparent; color: var(--study-ink); font: inherit; font-size: .875rem; font-weight: 650; cursor: pointer; }
.study-presets button:hover { background: var(--studio-hover-light); }
.study-presets button[aria-pressed="true"] { background: var(--study-ink); color: #fff; }
.study-window { overflow: hidden; border: 1px solid #9aafcb; border-radius: var(--studio-radius); background: var(--studio-shell); box-shadow: var(--studio-shadow); }
.study-window__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .55rem; min-height: 44px; padding: .4rem clamp(.65rem, 2.3vw, 1.35rem); border-bottom: 1px solid #9cb0cf43; color: #e1ebfb; font-size: .875rem; font-weight: 650; }
.study-window__bar > span:nth-child(2) { grid-column: 2; text-align: center; }
.study-window__dots { display: flex; gap: .25rem; align-items: center; }
.study-window__dots i { width: .38rem; height: .38rem; border-radius: 50%; background: #8aa5ce; }
.study-window__dots i:first-child { background: var(--studio-signal); }
.study-window__split { justify-self: end; color: #c4d7f5; font: .75rem var(--font-technical); font-variant-numeric: tabular-nums; white-space: nowrap; }
.study-figure__labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.study-figure__labels > span { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .15rem .6rem; padding: .8rem clamp(.65rem, 2vw, 1.2rem); background: var(--studio-field); color: var(--studio-ink); line-height: 1.25; }
.study-figure__labels > span:last-child { background: var(--studio-raised); color: #fff; }
.study-figure__labels b { font-size: 1rem; }
.study-figure__labels > span > span { font-size: .875rem; }

.study-surface { --position: 50%; --capture-ratio: 1600 / 1164; --handle-size: 4.25rem; --handle-clearance: 2.375rem; position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; background: var(--studio-shell); }
.study-surface__capture { display: block; min-width: 0; }
.study-surface__capture img { display: block; width: 100%; height: auto; aspect-ratio: var(--capture-ratio); object-fit: contain; }
.study-surface__line { display: none; }
.study-surface[data-study-enhanced] { display: block; width: 100%; aspect-ratio: var(--capture-ratio); cursor: ew-resize; touch-action: pan-y pinch-zoom; user-select: none; }
.study-surface[data-study-enhanced] .study-surface__capture { position: absolute; inset: 0; pointer-events: none; }
.study-surface[data-study-enhanced] .study-surface__capture img { height: 100%; }
.study-surface[data-study-enhanced] .study-surface__capture--before { z-index: 1; clip-path: inset(0 calc(100% - var(--position)) 0 0); }
.study-surface[data-study-enhanced] .study-surface__line { position: absolute; z-index: 2; inset-block: 0; left: var(--position); display: block; width: 2px; background: #f7faff; box-shadow: 0 0 0 1px #10243d, 0 0 9px #0c193a66; transform: translateX(-50%); pointer-events: none; }
.study-surface__handle { position: absolute; z-index: 4; top: clamp(5rem, 38%, 17rem); left: clamp(var(--handle-clearance), var(--position), calc(100% - var(--handle-clearance))); display: grid; width: var(--handle-size); height: var(--handle-size); place-items: center; border: 2px solid #fff; border-radius: 50%; background: #171e2c; color: #fff; box-shadow: inset 0 0 0 4px #3a465b, 0 0 0 1px #11264b, 0 5px 15px #0812266b; transform: translate(-50%, -50%); cursor: grab; transition: background-color var(--motion-fast), box-shadow var(--motion-fast); }
.study-surface__handle:is(:hover,:focus-visible), .study-surface[data-study-dragging] .study-surface__handle { background: var(--study-accent); box-shadow: inset 0 0 0 4px #ffffff38, 0 0 0 1px #11264b, 0 5px 15px #0812266b; }
.study-surface[data-study-dragging] .study-surface__handle { cursor: grabbing; }
.study-handle-hint { display: none; position: absolute; z-index: 3; top: calc(clamp(5rem, 38%, 17rem) + var(--handle-size) / 2 + .55rem); left: clamp(5.4rem, var(--position), calc(100% - 5.4rem)); width: max-content; padding: .38rem .62rem; border: 1px solid #c4d3f570; border-radius: 1rem; background: #171e2c; color: #fff; font-size: var(--label); font-weight: 700; line-height: 1.25; transform: translateX(-50%); pointer-events: none; }
.study-surface[data-study-enhanced]:not([data-study-used]) .study-handle-hint,
.study-surface[data-study-discovery] .study-handle-hint { display: block; }
.study-handle-hint__touch { display: none; }
@media (pointer: coarse) {
  .study-handle-hint__mouse { display: none; }
  .study-handle-hint__touch { display: inline; }
}
.study-surface[data-study-discovery] .study-surface__handle::before { position: absolute; inset: -3px; border: 2px solid #e4eeff; border-radius: inherit; background: #c3d6ff4a; content: ''; pointer-events: none; animation: study-discovery-halo 1.25s ease-out 2; }
@keyframes study-discovery-halo { from { opacity: .65; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }

.study-markers { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.study-marker { position: absolute; top: var(--marker-y); left: var(--marker-x); display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; }
.study-marker > span { display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 1px solid #fff; border-radius: 50%; background: #193e96; box-shadow: 0 0 0 2px #193e9680; font-size: .8125rem; font-weight: 750; }
.study-marker:hover > span, .study-marker[aria-expanded="true"] > span { background: #fff; color: #142b5c; }
.study-note { position: absolute; z-index: 5; top: var(--note-y); left: var(--note-x); width: min(22rem, calc(100% - 1.5rem)); padding: 1rem 3.25rem 1rem 1rem; border: 1px solid var(--study-rule); border-top: 2px solid var(--study-accent); border-radius: var(--studio-radius); background: var(--studio-paper); color: var(--study-ink); box-shadow: var(--studio-shadow); user-select: text; cursor: auto; }
.study-note h3 { margin: 0; color: inherit; font-size: 1.125rem; line-height: 1.28; }
.study-note p { margin: .4rem 0 0; color: var(--study-muted); font-size: .9375rem; line-height: 1.45; }
.study-note button { position: absolute; inset: .25rem .25rem auto auto; display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--study-accent); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.study-note button:hover { background: #dbe5f5; }
.study-presets button:focus-visible, .study-note button:focus-visible, .study-details summary:focus-visible { outline: 2px solid var(--study-accent); outline-offset: 3px; }
.study-surface__handle:focus-visible, .study-marker:focus-visible { outline: 2px solid #fff; outline-offset: -5px; box-shadow: 0 0 0 2px #183e91; }
.study-note h3:focus { outline: none; }

.study-observations-title { margin: clamp(2.75rem, 5vw, 4.25rem) 0 1rem; color: var(--study-ink); font-size: clamp(1.35rem, 2.1vw, 1.85rem); letter-spacing: -.025em; }
.study-observations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem clamp(1rem, 3.5vw, 3.5rem); margin: 0; }
.study-observations > div { padding-top: .85rem; border-top: 1px solid var(--study-rule); }
.study-observations dt { display: flex; align-items: baseline; gap: .65rem; line-height: 1.3; }
.study-observations dt span { color: var(--study-accent); font-size: .8125rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.study-observations dd { margin: .45rem 0 0 1.9rem; color: var(--study-muted); font-size: .975rem; line-height: 1.55; }
.study-details { margin-top: 1.75rem; border-bottom: 1px solid var(--study-rule); }
.study-details summary { display: flex; align-items: center; gap: .5rem; min-height: 44px; width: fit-content; padding: .35rem .25rem .35rem 0; color: var(--study-accent); font-weight: 700; cursor: pointer; list-style: none; }
.study-details summary::-webkit-details-marker { display: none; }
.study-details summary span::before { content: "+"; }
.study-details[open] summary span::before { content: "−"; }
.study-details p { max-width: 66ch; margin: 0 0 .8rem; color: var(--study-muted); }

.project-studies { margin-top: clamp(3.2rem,7vw,6rem); padding-top: clamp(1.5rem,3vw,2.5rem); border-top: 1px solid var(--study-rule); }
.project-studies__header { display: grid; grid-template-columns: 1.45fr 1fr; align-items: end; gap: .7rem 2rem; margin-bottom: clamp(1.35rem,2.8vw,2.2rem); }
.project-studies__header .site-kicker { margin-bottom: .5rem; color: var(--study-accent); }
.project-studies__header h3 { font-size: var(--heading-3); letter-spacing: -.035em; }
.project-studies__header > p { max-width: 42ch; color: var(--study-muted); }
.project-studies__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2rem clamp(1rem,2.8vw,2.35rem); }
.project-study { display: flex; flex-direction: column; align-items: start; min-width: 0; }
.project-study__visual { position: relative; isolation: isolate; display: grid; width: 100%; min-height: 10.5rem; aspect-ratio: 1.9; overflow: hidden; border-radius: .48rem; }
.project-study__visual img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.project-study__visual:is(.project-study__visual--site,.project-study__visual--editorial)::before { position: absolute; z-index: -1; inset: 0; background: var(--project-image-shade,linear-gradient(90deg,#0c1623f5,#0c16232e 84%)); content: ""; }
.project-study__visual--site { align-content: end; padding: .8rem; background: #1b2939; color: #fff; }
.project-study__visual--editorial { --project-image-shade: linear-gradient(90deg,#421c12ea,#421c1226 85%); align-content: end; padding: .8rem; background: #59361f; color: #fff4e4; }
.project-study__visual--editorial img { object-position: center 67%; }
.project-study__visual:is(.project-study__visual--site,.project-study__visual--editorial) span { font-size: var(--label); font-weight: 740; }
.project-study__visual > div > strong { display: block; margin: .2rem 0; font-size: clamp(1.4rem,2.6vw,2.3rem); line-height: 1; letter-spacing: -.045em; }
.project-study__visual--operations { align-content: center; gap: .32rem; padding: .75rem; background: #172741; color: #fff; font-size: var(--label); line-height: 1.35; }
.project-study__visual--operations > span { margin-bottom: .2rem; color: #c7dcff; font-weight: 730; }
.project-study__visual--operations > div { display: grid; grid-template-columns: minmax(5.7rem,.9fr) minmax(0,1.1fr); gap: .25rem .45rem; padding: .35rem .52rem; border-radius: .3rem; background: #263b5e; }
.project-study__visual--operations > div:last-child { background: #1d4947; }
.project-study__category { margin: .8rem 0 .26rem; color: var(--study-accent); font-size: var(--label); font-weight: 730; }
.project-study h4 { margin-bottom: .42rem; font-size: clamp(1.2rem,2vw,1.55rem); }
.project-study > p:not(.project-study__category) { margin-bottom: .7rem; color: var(--study-muted); font-size: var(--text-ui); }
.project-study > a { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; margin-top: auto; color: var(--study-accent); font-size: var(--text-ui); font-weight: 730; text-decoration: none; }
.project-study > a:hover { text-decoration: underline; }

@media (max-width: 48rem) {
  .design-study__header { grid-template-columns: 1fr; gap: 1.2rem; }
  .study-observations { grid-template-columns: 1fr; gap: .85rem; }
  .project-studies__header { grid-template-columns: 1fr; }
  .project-studies__grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 40rem) {
  .study-surface { --capture-ratio: 780 / 2376; --handle-size: 3.625rem; --handle-clearance: 2rem; }
  .study-surface__handle { top: clamp(6.5rem, 20%, 13.5rem); }
}

@media (max-width: 36rem) {
  .study-figure__toolbar { align-items: start; flex-direction: column; }
  .project-studies__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .study-surface__handle { transition: none; }
  .study-surface[data-study-discovery] .study-surface__handle::before { display: none; }
}
