/* Portfolio evidence and responsive refinements — 2026-08-23 */

/* Evidence line lives in the preview card on desktop; the mobile
   breakpoint below re-shows it inside each project row. */
.project-evidence { display:none; }

.case-comparison { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin:30px 0 8px; background:var(--line-paper); }
.case-comparison article { min-height:150px; padding:24px; background:var(--paper); }
.case-comparison small { display:block; margin-bottom:12px; color:var(--muted-paper); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.case-comparison strong { display:block; font-size:clamp(30px,3vw,48px); line-height:1; letter-spacing:-.055em; }
.case-comparison p { margin:10px 0 0; font-size:13px; line-height:1.6; }
.handoff-detail { margin-top:28px; padding-top:24px; border-top:1px solid var(--line-paper); }
.handoff-detail h3 { margin-top:0; }

/* Selected research/additional rows: keep every description on one shared vertical axis. */
@media(min-width:1181px) {
  .additional-list a { grid-template-columns:330px minmax(0,1fr) 150px; column-gap:48px; align-items:center; }
  .additional-list small { display:block; margin:0; justify-self:stretch; }
  .additional-list b { justify-self:end; text-align:right; white-space:nowrap; }
}

@media(min-width:821px) and (max-width:1180px) {
  .additional-list a { grid-template-columns:250px minmax(0,1fr) 140px; column-gap:28px; }
  .additional-list b { justify-self:end; text-align:right; }
}

/* Give both connector columns enough room and align their labels identically. */
@media(min-width:1181px) {
  .ecosystem-flow { grid-template-columns:minmax(0,1fr) 112px minmax(0,1fr) 112px minmax(0,1fr); gap:14px; }
}
@media(min-width:821px) and (max-width:1180px) {
  .ecosystem-flow { grid-template-columns:minmax(0,1fr) 82px minmax(0,1fr) 82px minmax(0,1fr); gap:8px; }
}
.ecosystem-connector { min-width:0; }
.ecosystem-connector .connector-label {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:28px;
  margin:0 auto;
  padding:0 2px;
  white-space:nowrap;
  word-break:normal;
  overflow-wrap:normal;
  hyphens:none;
  font-size:8px;
  line-height:1.2;
  letter-spacing:.045em;
  text-align:center;
}
.ecosystem-node .node-live-link { display:inline-block; margin-top:16px; color:inherit; font-size:11px; font-weight:800; letter-spacing:.04em; text-decoration:none; border-bottom:1px solid currentColor; padding-bottom:3px; }
.current-node .node-live-link { color:var(--white); }
.current-node .node-live-link:hover,.current-node .node-live-link:focus-visible { color:var(--accent); }

/* Medi-Matrix: real demo evidence. */
.live-evidence-section h2 { max-width:880px; }
.case-shot { margin:28px 0 0; }
.case-shot img {
  width:100%;
  height:auto;
  display:block;
  object-fit:contain;
  background:#0d0d0b;
  border:1px solid var(--line-paper);
}
.case-shot figcaption {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-top:12px;
  color:var(--muted-paper);
  font-size:9px;
  font-weight:800;
  line-height:1.4;
  letter-spacing:.105em;
  text-transform:uppercase;
}
.case-shot figcaption a {
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px solid currentColor;
  padding-bottom:2px;
  white-space:nowrap;
}
.case-shot figcaption a:hover,.case-shot figcaption a:focus-visible { color:var(--accent-deep); }
.case-shot figcaption strong { color:var(--accent-deep); font-size:9px; white-space:nowrap; }

.demo-evidence-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-top:28px;
}
.demo-evidence-grid .case-shot { margin:0; }

.demo-flow-rail {
  display:grid;
  grid-template-columns:auto 1fr auto 1fr auto;
  gap:14px;
  align-items:center;
  margin-top:26px;
  padding:14px 0;
  border-top:1px solid var(--line-paper);
  border-bottom:1px solid var(--line-paper);
  color:var(--muted-paper);
  font-size:10px;
  font-weight:800;
  letter-spacing:.1em;
}
.demo-flow-rail i { height:1px; background:var(--line-paper); position:relative; }
.demo-flow-rail i::after { content:'→'; position:absolute; right:0; top:50%; transform:translateY(-55%); color:var(--accent-deep); font-style:normal; background:var(--paper); padding-left:8px; }

.handoff-boundary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin-top:24px; background:var(--line-paper); }
.handoff-boundary>div { background:var(--paper); padding:20px 22px; }
.handoff-boundary small { display:block; color:var(--accent-deep); font-size:9px; font-weight:900; letter-spacing:.12em; }
.handoff-boundary p { margin:8px 0 0; color:var(--muted-paper); font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size:11px; line-height:1.65; }

/* Lightbox */
.zoomable-image { cursor:zoom-in; transition:opacity .2s; }
.zoomable-image:hover,.zoomable-image:focus-visible { opacity:.9; }
.zoomable-image:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.lightbox-overlay {
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  padding:clamp(18px,3vw,40px);
  background:rgba(10,10,10,.95);
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease;
}
.lightbox-overlay.is-active { opacity:1; pointer-events:auto; }
.lightbox-img {
  display:block;
  width:auto;
  height:auto;
  max-width:calc(100vw - clamp(36px,6vw,80px));
  max-height:calc(100vh - clamp(36px,6vw,80px));
  object-fit:contain;
  box-shadow:0 10px 40px rgba(0,0,0,.5);
  transform:scale(.95);
  transition:transform .3s cubic-bezier(.16,1,.3,1);
}
.lightbox-overlay.is-active .lightbox-img { transform:scale(1); }
.lightbox-close {
  position:absolute;
  top:20px;
  right:24px;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  background:rgba(17,17,15,.72);
  border:1px solid rgba(255,253,248,.28);
  color:var(--white);
  font-size:30px;
  line-height:1;
  cursor:pointer;
  padding:0;
  z-index:10000;
  font-weight:300;
  transition:transform .2s,border-color .2s;
}
.lightbox-close:hover,.lightbox-close:focus-visible { transform:scale(1.06); border-color:var(--accent); outline:0; }

@media(max-width:820px) {
  .project-preview { display:none; }
  .project-copy .project-evidence { display:block; margin-top:8px; color:var(--accent-deep); font-size:9px; font-weight:800; line-height:1.45; letter-spacing:.025em; }
  .case-comparison { grid-template-columns:1fr; }
  .ecosystem-connector .connector-label { display:block; width:auto; min-height:0; white-space:normal; padding:0; }
  .demo-evidence-grid,.handoff-boundary { grid-template-columns:1fr; }
  .case-shot figcaption { align-items:flex-start; flex-direction:column; gap:7px; }
  .demo-flow-rail { gap:8px; font-size:9px; }
  .lightbox-overlay { padding:14px; }
  .lightbox-img { max-width:calc(100vw - 28px); max-height:calc(100vh - 28px); }
  .lightbox-close { top:10px; right:10px; }
}

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

/* Medi-Matrix case-study balance pass — 2026-09-11 */
.case-section li {
  position: relative;
  display: block;
  padding: 14px 0 14px 32px;
}

.case-section li::before {
  position: absolute;
  left: 0;
  top: 14px;
}

.case-section li code {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.demo-evidence-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.demo-evidence-grid .case-shot:nth-child(2) {
  width: 100%;
  max-width: 360px;
  justify-self: end;
}

.demo-evidence-grid .case-shot:nth-child(2) img {
  width: auto;
  max-width: 100%;
  max-height: 560px;
  margin-left: auto;
}

.live-evidence-section > div,
.case-content:has(.demo-evidence-grid) .case-section > div {
  min-width: 0;
}

@media (min-width: 821px) {
  .case-content:has(.demo-evidence-grid) {
    width: min(100%, 1320px);
    margin-inline: auto;
    padding: 94px clamp(32px, 3.2vw, 52px) 116px;
  }

  .case-content:has(.demo-evidence-grid) .case-lead,
  .case-content:has(.demo-evidence-grid) .case-section {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(32px, 3.4vw, 48px);
  }

  .case-content:has(.demo-evidence-grid) .case-section {
    padding: 46px 0;
  }

  .case-content:has(.demo-evidence-grid) .case-section h2 {
    max-width: 840px;
    font-size: clamp(28px, 2.6vw, 38px);
    line-height: 1.22;
  }

  .case-content:has(.demo-evidence-grid) .case-section p {
    max-width: 820px;
    font-size: 16px;
    line-height: 1.76;
  }

  .case-content:has(.demo-evidence-grid) .case-section li {
    font-size: 15px;
    line-height: 1.65;
  }
}

@media (max-width: 820px) {
  .demo-evidence-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .demo-evidence-grid .case-shot:nth-child(2) {
    max-width: none;
    justify-self: stretch;
  }

  .demo-evidence-grid .case-shot:nth-child(2) img {
    width: 100%;
    max-height: none;
    margin-left: 0;
  }

  .case-section li {
    padding-left: 28px;
  }
}


/* Medi-Matrix recruiter-density pass — 2026-09-11 */
.medi-case-body .case-section h2 { max-width: 820px; }
.medi-case-body .case-section h3 { margin: 22px 0 8px; font-size: 18px; line-height: 1.35; }
.medi-case-body .case-shot { margin-top: 20px; }
.medi-case-body .case-shot img { max-height: 560px; margin-inline: auto; }
.medi-case-body .case-shot.case-shot-hero img { max-height: 500px; }
.medi-case-body .demo-flow-rail { margin-top: 18px; padding-block: 11px; }
.medi-case-body .demo-evidence-grid { margin-top: 20px; gap: clamp(22px, 2.5vw, 34px); }
.medi-case-body .demo-evidence-grid .case-shot:nth-child(2) { max-width: 320px; }
.medi-case-body .demo-evidence-grid .case-shot:nth-child(2) img { max-height: 480px; }
.medi-case-body .handoff-boundary { margin-top: 18px; }
.medi-case-body .handoff-boundary > div { padding: 16px 18px; }
.medi-case-body .case-note { margin-top: 14px; }
.medi-case-body .case-visual .preview-stage { min-height: 230px; }
.medi-case-body .case-visual .algo-log { margin-top: 24px; }

@media (min-width: 821px) {
  .medi-case-body .case-content { width: min(100%, 1280px); margin-inline: auto; padding: 76px clamp(32px, 3vw, 48px) 92px; }
  .medi-case-body .case-lead,
  .medi-case-body .case-section { grid-template-columns: 140px minmax(0, 1fr); gap: clamp(28px, 3vw, 42px); }
  .medi-case-body .case-section { padding: 34px 0; }
  .medi-case-body .case-section h2 { margin-bottom: 14px; font-size: clamp(27px, 2.35vw, 34px); line-height: 1.2; }
  .medi-case-body .case-section p { max-width: 800px; margin-bottom: 12px; font-size: 15px; line-height: 1.72; }
  .medi-case-body .case-section li { padding-block: 11px; font-size: 14px; line-height: 1.6; }
  .medi-case-body .case-section li::before { top: 11px; }
}

@media (max-width: 820px) {
  .medi-case-body .case-content { padding-top: 64px; padding-bottom: 78px; }
  .medi-case-body .case-lead,
  .medi-case-body .case-section { gap: 14px; }
  .medi-case-body .case-section { padding: 30px 0; }
  .medi-case-body .case-section h2 { margin-bottom: 14px; font-size: clamp(24px, 7.6vw, 29px); line-height: 1.24; }
  .medi-case-body .case-section h3 { margin-top: 18px; font-size: 17px; }
  .medi-case-body .case-section p { margin-bottom: 12px; font-size: 15px; line-height: 1.7; }
  .medi-case-body .case-shot img { width: auto; max-width: 100%; max-height: 430px; margin-inline: auto; }
  .medi-case-body .case-shot.case-shot-hero img { max-height: 340px; }
  .medi-case-body .demo-evidence-grid { gap: 24px; }
  .medi-case-body .demo-evidence-grid .case-shot:nth-child(2) { max-width: none; }
  .medi-case-body .demo-evidence-grid .case-shot:nth-child(2) img { width: auto; max-height: 390px; margin-inline: auto; }
  .medi-case-body .case-section li { padding: 10px 0 10px 27px; font-size: 14px; line-height: 1.58; }
  .medi-case-body .case-section li::before { top: 10px; }
  .medi-case-body .handoff-boundary > div { padding: 14px 15px; }
}

/* Algo Pipeline: generated card-news output samples. */
.algo-output-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-top:28px;
  align-items:start;
}
.algo-output-grid .case-shot { margin:0; }
.algo-output-grid .case-shot img { max-height:560px; margin-inline:auto; }
@media (max-width:720px) {
  .algo-output-grid { grid-template-columns:minmax(0,1fr); gap:22px; }
  .algo-output-grid .case-shot img { max-height:420px; }
}

/* Dense multi-panel figures: keep them legible on narrow screens by
   scrolling horizontally instead of shrinking past readability. */
@media (max-width:720px) {
  /* The section's grid item defaults to min-width:auto, so a wide child
     would stretch it past the viewport instead of scrolling inside it. */
  .case-section > div:has(.case-shot-wide) { min-width:0; }
  .case-shot-wide,
  .case-shot-wide .shot-scroll { min-width:0; max-width:100%; }
  .case-shot-wide .shot-scroll {
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border:1px solid var(--line-paper);
  }
  .case-shot-wide .shot-scroll img { min-width:660px; border:0; }
  .case-shot-wide figcaption::after {
    content:'좌우로 밀어서 보기';
    color:var(--accent-deep);
    white-space:nowrap;
  }
}


/* Note under an external link whose target needs a caveat.
   Scoped to .case-section so it outranks `.case-section p`. */
.case-section p.link-note {
  margin:14px 0 0;
  max-width:62ch;
  color:var(--muted-paper);
  font-size:12px;
  line-height:1.6;
}
.case-section p.link-note em { font-style:normal; color:var(--accent-deep); }

/* At-a-glance summary: plain-text overview placed before the evidence section. */
.glance-body { max-width: 78ch; }
.glance-body h2 {
  margin: 0 0 20px;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.02em;
}
.glance-body p { margin: 0 0 18px; color: var(--muted-paper); line-height: 1.75; }
.glance-body ul { margin: 22px 0; padding: 0; list-style: none; border-top: 1px solid var(--line-paper); }
.glance-body li { padding: 14px 0; border-bottom: 1px solid var(--line-paper); line-height: 1.65; }
.glance-body li a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--accent); }
.glance-body .glance-stack { font-size: 13px; }
.glance-section { padding: 56px var(--pad) 72px; }
.glance-section .glance-body { margin-top: 44px; }
