/* NHA Knowledge Center case page only (v2, showcase).
   Page chrome uses the portfolio tokens from site.css. NHA colours appear only in the
   colour tiles, as values sampled from the screens. Kanit is loaded for the specimen only. */

.nh-hero { background: radial-gradient(120% 90% at 50% 0%, #1d2a33 0%, var(--card-dark) 62%); }
.nh-shots { position: relative; width: min(820px, 100%); padding: 0 0 24px; }
.nh-shots .laptop { width: 88%; }
.nh-shots .screen .xp-wrap { display: block; width: 100%; height: 100%; }
.nh-shots .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.nh-shots .nh-hphone { position: absolute; right: 0; bottom: 0; width: 22%; min-width: 110px; }

.nh-sec { margin-top: 112px; }
.nh-k { margin: 0 0 6px; font: 500 13px ui-monospace, Menlo, monospace; letter-spacing: .02em; color: var(--text-soft); }
.nh-sec .cs-h { margin: 0; }
.nh-sec .cs-h + p { margin-top: 10px; color: var(--text-soft); }
.nh-more { display: none; margin: 36px 0 0; }
body.tldr .nh-more { display: block; }

/* two-column brief */
.nh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 20px; }
.nh-two h3 { font: 600 13px var(--font); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 6px; }
.nh-two p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-soft); }
@media (max-width: 640px) { .nh-two { grid-template-columns: 1fr; } }

/* ---------- device frames ---------- */
.dv-ph { position: relative; background: #121312; border-radius: 42px; padding: 9px; box-shadow: inset 0 0 0 1.5px #3a3d39, 0 30px 60px rgba(15, 16, 14, .28); }
.dv-ph::before { content: ""; position: absolute; left: -3px; top: 22%; width: 3px; height: 12%; background: #2a2c29; border-radius: 3px 0 0 3px; }
.dv-ph::after { content: ""; position: absolute; left: 50%; top: 17px; width: 30%; height: 20px; transform: translateX(-50%); background: #121312; border-radius: 999px; z-index: 2; }
.dv-ph .xp-wrap { border-radius: 33px; overflow: hidden; }
.dv-ph img { display: block; width: 100%; height: auto; aspect-ratio: 402 / 874; object-fit: cover; object-position: top; border-radius: 33px; }
.dv-ph .xp-btn { z-index: 3; }

.dv-mon { position: relative; padding-bottom: 70px; }
.dv-mon .scr { background: #121312; border-radius: 18px; padding: 12px 12px 30px; box-shadow: 0 30px 60px rgba(15, 16, 14, .25); }
.dv-mon .scr img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-radius: 6px; }
.dv-mon::before { content: ""; position: absolute; left: 50%; bottom: 10px; width: 16%; height: 64px; transform: translateX(-50%); background: linear-gradient(90deg, #b9bdb6, #e2e5df 50%, #b9bdb6); clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }
.dv-mon::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 30%; height: 12px; transform: translateX(-50%); background: linear-gradient(#e2e5df, #a9aea5); border-radius: 6px 6px 3px 3px; }

/* ---------- showcase stages ---------- */
.sc { position: relative; border-radius: var(--r-card); overflow: hidden; display: grid; place-items: center; padding: clamp(28px, 5vw, 64px); margin-top: 16px; }
.sc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.sc-row .sc { margin-top: 0; min-height: 520px; }
@media (max-width: 760px) { .sc-row { grid-template-columns: 1fr; } .sc-row .sc { min-height: 0; } }
.sc.dark { background: radial-gradient(90% 70% at 50% 20%, #283037 0%, var(--card-dark) 70%); }
.sc.sage { background: var(--card-sage); }
.sc.lime { background: var(--card-accent); }
.sc.soft { background: var(--card-soft); }
/* a wall and a floor, for the leaning phone */
.sc.wall { background: linear-gradient(172deg, #c9cdc5 0 64%, #e4e7e1 64.2% 100%); }
.sc.wall::after { content: ""; position: absolute; left: 30%; right: -10%; bottom: 0; height: 36%; background: linear-gradient(100deg, rgba(15,16,14,.28), rgba(15,16,14,0) 70%); transform: skewX(-38deg); transform-origin: bottom; pointer-events: none; }

.sc-mon { width: min(860px, 100%); position: relative; }
.sc-mon .dv-ph { position: absolute; right: -2%; bottom: 0; width: 21%; min-width: 96px; }
.sc-lean { width: min(250px, 62%); transform: perspective(1400px) rotateX(16deg) rotateY(-18deg) rotateZ(9deg); position: relative; z-index: 1; }
.sc-lean .dv-ph { box-shadow: inset 0 0 0 1.5px #3a3d39, -30px 40px 50px rgba(15, 16, 14, .35); }
.sc-lap { width: 100%; }
.sc-trio { display: flex; justify-content: center; align-items: flex-end; width: min(760px, 100%); }
.sc-trio .dv-ph { width: 32%; flex: none; }
.sc-trio .dv-ph:nth-child(1) { transform: rotate(-8deg) translate(18%, 6%); }
.sc-trio .dv-ph:nth-child(2) { z-index: 2; transform: translateY(-4%); }
.sc-trio .dv-ph:nth-child(3) { transform: rotate(8deg) translate(-18%, 6%); }
.sc-cap { position: absolute; left: 24px; bottom: 18px; margin: 0; font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-soft); z-index: 3; }
.sc.dark .sc-cap, .sc.sage .sc-cap { color: var(--text-on-dark); }
@media (prefers-reduced-motion: no-preference) {
  .sc-lean { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
  .sc:hover .sc-lean { transform: perspective(1400px) rotateX(10deg) rotateY(-10deg) rotateZ(5deg); }
}

/* ---------- annotated screens: thin leader lines ---------- */
.an-panel { --gut: 230px; background: var(--card-dark); color: var(--text-on-dark); border-radius: var(--r-card); padding: 56px 32px; margin-top: 16px; }
.an-panel.soft { background: var(--card-soft); color: var(--text); }
.an { position: relative; margin: 0 auto; max-width: 820px; }
.an.l { margin-left: var(--gut); margin-right: auto; }
.an.r { margin-right: var(--gut); margin-left: auto; }
.an.lr { margin-left: var(--gut); margin-right: var(--gut); }
.an .browser { box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.an .browser .bar span { color: var(--text-soft); }
.an img { display: block; width: 100%; height: auto; }

.co { position: absolute; top: var(--y); display: flex; align-items: center; transform: translateY(-50%); pointer-events: none; z-index: 2; }
.co.r { left: var(--x); width: calc(100% - var(--x) + var(--gut)); }
.co.l { right: calc(100% - var(--x)); width: calc(var(--x) + var(--gut)); flex-direction: row-reverse; }
.co i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(15, 16, 14, .6), 0 0 0 7px rgba(228, 251, 108, .25); }
.co s { flex: 1; height: 1px; min-width: 16px; background: rgba(244, 246, 241, .5); text-decoration: none; }
.co .t { flex: none; width: calc(var(--gut) - 26px); font-size: 14px; line-height: 1.4; }
.co.r .t { padding-left: 12px; }
.co.l .t { padding-right: 12px; }
.co .t b { display: block; font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-on-dark-soft); margin-bottom: 3px; }
.an-panel.soft .co s { background: rgba(15, 16, 14, .35); }
.an-panel.soft .co .t b { color: var(--text-soft); }
.an-panel .an + .an { margin-top: 72px; }
.an-h { text-align: center; margin: 0 0 28px; font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-on-dark-soft); }
.an-panel.soft .an-h { color: var(--text-soft); }

@media (max-width: 1060px) {
  .an-panel { padding: 28px 18px; }
  .an.l, .an.r, .an.lr { margin-left: 0; margin-right: 0; }
  .an { display: flex; flex-direction: column; }
  .co { position: static; transform: none; width: auto !important; flex-direction: row !important; margin-top: 12px; }
  .co s { display: none; }
  .co .t { width: auto; padding: 0 0 0 12px !important; }
  .co i { align-self: flex-start; margin-top: 5px; }
  .co .t b { display: inline; margin-right: 6px; }
}

/* four phones that scroll */
.nh-phones { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 20px; max-width: 1000px; margin: 32px auto 0; padding: 0 24px 12px; }
.nh-phone { margin: 0; }
.nh-ph { background: #121312; border-radius: 34px; padding: 7px; box-shadow: 0 18px 40px rgba(15, 16, 14, .18); }
.nh-scroll { overflow-y: auto; overscroll-behavior: contain; }
.nh-scroll:focus-visible { outline: 3px solid var(--ref-ink-900); outline-offset: 2px; }
.nh-ph .nh-scroll { aspect-ratio: 402 / 874; border-radius: 27px; background: #e8f3fd; scrollbar-width: none; }
.nh-ph .nh-scroll::-webkit-scrollbar { display: none; }
.nh-ph img { display: block; width: 100%; height: auto; }
.nh-phone figcaption { margin-top: 10px; font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-soft); }
@media (max-width: 860px) {
  .nh-phones { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 16px; }
  .nh-phone { scroll-snap-align: start; }
}

/* prototype */
.nh-proto { margin-top: 24px; background: var(--card-dark); border-radius: var(--r-card); padding: clamp(14px, 3vw, 28px); }
.nh-proto .embed-actions { padding: 80px 0; }
.nh-proto .embed-actions .pill { background: var(--accent); color: var(--text); }
.nh-proto-note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--text-on-dark-soft); }
.nh-proto-note a { color: var(--text-on-dark); }

/* ---------- [typography & color] ---------- */
.nh-sheet { margin-top: 24px; background: var(--card-dark); color: var(--text-on-dark); border-radius: var(--r-card); padding: clamp(24px, 4vw, 44px); overflow: hidden; }
.nh-sheet .nh-k { color: var(--text-on-dark-soft); }
.kn { font-family: "Kanit", "IBM Plex Sans Thai", sans-serif; }
.ty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: end; margin-top: 18px; }
.ty-name { font-weight: 300; font-size: clamp(72px, 10vw, 128px); line-height: .9; letter-spacing: -.02em; margin: 0; color: #dce9f6; }
.ty-meta { margin: 14px 0 0; font-size: 14px; color: var(--text-on-dark-soft); }
.ty-th { margin: 36px 0 0; font-weight: 600; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.25; color: #f4f6f1; }
/* overlapping weight cards, each cropping the same glyph */
.ty-cards { display: flex; height: 300px; border-radius: 24px; overflow: hidden; background: #dce9f6; color: #232a31; }
.ty-cards div { position: relative; flex: 0 0 15%; border-right: 1px solid rgba(35, 42, 49, .14); overflow: hidden; }
.ty-cards div:last-child { flex: 1; border-right: 0; }
.ty-cards small { position: absolute; left: 12px; top: 12px; font: 500 12px var(--font); color: #4d5762; white-space: nowrap; }
.ty-cards span { position: absolute; left: 12px; bottom: -40px; font-size: 230px; line-height: 1; }
.ty-cards div:last-child span { left: 50%; transform: translateX(-50%); }
.ty-cards div:last-child small.w { left: auto; right: 16px; }
.ty-rows { margin: 36px 0 0; display: grid; }
.ty-rows > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 14px 0; border-top: 1px solid #2f342d; }
.ty-rows dt { font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-on-dark-soft); }
.ty-rows dd { margin: 0; color: #f4f6f1; }
@media (max-width: 760px) {
  .ty { grid-template-columns: 1fr; }
  .ty-cards { height: 220px; }
  .ty-cards span { font-size: 170px; bottom: -30px; }
  .ty-rows > div { grid-template-columns: 1fr; gap: 4px; }
}

.nh-sheet hr { border: 0; border-top: 1px solid #2f342d; margin: 44px 0 32px; }
.sw-big { list-style: none; padding: 0 !important; margin: 18px 0 0 !important; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.sw-big li { margin: 0 !important; height: 150px; border-radius: 18px; background: var(--c); color: var(--fg, #fff); padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px !important; line-height: 1.3 !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sw-big li span { display: flex; justify-content: space-between; font: 12px ui-monospace, Menlo, monospace; }
.sw-big li.grad { background: linear-gradient(135deg, #0d73fc, #a1f1fd); }
@media (max-width: 760px) { .sw-big { grid-template-columns: repeat(2, 1fr); } .sw-big li { height: 110px; } }
/* category and file-type colours as symbols, label beside (never text on the colour) */
.sw-sym { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 30px; }
.sw-sym h4 { font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-on-dark-soft); margin: 0 0 12px; }
.sw-sym ul { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 8px; }
.sw-sym li { margin: 0 !important; display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 14px !important; line-height: 1.3 !important; }
.sw-sym li i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); }
.sw-sym .file li i { border-radius: 6px; }
.sw-sym li code { background: none !important; padding: 0 !important; font: 12px ui-monospace, Menlo, monospace; color: var(--text-on-dark-soft); }
@media (max-width: 640px) { .sw-sym { grid-template-columns: 1fr; } }

/* bento gallery */
.nh-bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 24px; }
.nh-bento figure { margin: 0; background: var(--card); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.nh-bento img { width: 100%; height: auto; display: block; border-radius: 12px; }
.nh-bento figcaption { font: 500 12px ui-monospace, Menlo, monospace; color: var(--text-soft); margin: 10px 4px 0; }
.nh-bento .b-wide { grid-column: span 6; }
.nh-bento .b-4 { grid-column: span 4; }
.nh-bento .b-2 { grid-column: span 2; }
.nh-bento .b-3 { grid-column: span 3; }
.nh-bento .b-sage { background: var(--card-soft); }
@media (max-width: 760px) { .nh-bento { grid-template-columns: 1fr; } .nh-bento > * { grid-column: auto !important; } }

/* the image box inside a frame is the positioning box for the callouts */
.an-in { position: relative; }
@media (max-width: 1060px) {
  .an-in .co { padding: 0 14px; color: var(--text); }
  .an-in .co:last-child { padding-bottom: 14px; }
  .an-in .co .t b { color: var(--text-soft); }
}

/* fixes: height attributes vs aspect-ratio, lightbox wrapper in laptop screens, callouts not clipped */
.dv-mon .scr img { height: auto; }
.sc-lap .screen .xp-wrap { display: block; width: 100%; height: 100%; }
.sc-lap .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.an .browser { overflow: visible; }
.an .browser .bar { border-radius: var(--r-inner) var(--r-inner) 0 0; }
.an .an-in img { border-radius: 0 0 var(--r-inner) var(--r-inner); }
.co s { background: rgba(244, 246, 241, .75); box-shadow: 0 1px 0 rgba(15, 16, 14, .45); }
.an-panel.soft .co s { background: rgba(15, 16, 14, .55); box-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.sc-cap { top: 18px; bottom: auto; }
.cs-body .ty-name { font-size: clamp(72px, 10vw, 128px); line-height: .9; }
.cs-body .ty-th { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.25; }
.cs-body .ty-meta { font-size: 14px; }
.ty-cards span { bottom: -22px; }

/* ---------- iPhone 17 Pro mockup (layers from the creatoom PSD, tools/nha_iphone_mockup.py) ----------
   The box includes the drop shadow, so the phone itself is the left 70% of the width. */
.ip17 { position: relative; aspect-ratio: 881 / 1556; }
.ip17::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: url(ip17-frame.webp) 0 0 / 100% 100% no-repeat; }
.ip17 > .gl { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: url(ip17-glare.webp) 0 0 / 100% 100% no-repeat; mix-blend-mode: plus-lighter; opacity: .85; }
.ip17-scr { position: absolute; z-index: 1; left: 3.178%; top: 1.542%; width: 64.018%; height: 79.049%; border-radius: 15.96% / 7.32%; overflow: hidden; background: #e8f3fd; }
.ip17-scr .xp-wrap { display: block; width: 100%; height: 100%; }
.ip17-scr img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ip17-scr .xp-btn { top: 46px; right: 10px; }
.ip17-scr.nh-scroll { overflow-y: auto; scrollbar-width: none; }
.ip17-scr.nh-scroll::-webkit-scrollbar { display: none; }
.ip17-scr.nh-scroll .xp-wrap { height: auto; }
.ip17-scr.nh-scroll img { height: auto; object-fit: initial; }
.ip17-scr.nh-scroll:focus-visible { outline: 3px solid var(--ref-ink-900); outline-offset: 3px; }

/* placements */
.nh-shots .nh-hphone { width: 29%; min-width: 140px; right: -6%; bottom: -6%; }
.sc-mon .ip17 { position: absolute; right: -9%; bottom: -8%; width: 27%; min-width: 120px; }
.sc-lean { width: min(330px, 80%); margin-left: 12%; }
.sc-trio { align-items: center; }
.sc-trio .ip17 { width: 40%; flex: none; }
.sc-trio .ip17:nth-child(1) { transform: rotate(-8deg) translate(30%, 6%); }
.sc-trio .ip17:nth-child(2) { z-index: 2; transform: translate(6%, -4%); }
.sc-trio .ip17:nth-child(3) { transform: rotate(8deg) translate(-18%, 6%); }
.nh-phones { grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 0 4px; }
.nh-phone figcaption { padding-left: 4px; margin-top: 0; }
.ip17 .xp-btn, .sc .xp-btn { opacity: 0; transition: opacity .2s; }
.ip17:hover .xp-btn, .sc:hover .xp-btn, .ip17 .xp-btn:focus-visible, .sc .xp-btn:focus-visible { opacity: 1; }
.nh-phone figcaption { margin-top: -27%; position: relative; z-index: 4; }

/* ---------- v3: photographic scene mockups (creatoom PSDs, tools/nha_mockups.sh) ---------- */
.cs-hero .stage.nh-hero { padding: 0; min-height: 0; background: #0b1530; }
.nh-hero-img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 1417; object-fit: cover; max-height: 760px; object-position: 50% 45%; }
.nh-hero .xp-wrap { width: 100%; }
.scene { position: relative; margin: 16px 0 0; border-radius: var(--r-card); overflow: hidden; background: var(--card-dark); }
.scene img { display: block; width: 100%; height: auto; }
.scene figcaption { position: absolute; left: 22px; top: 18px; margin: 0; font: 500 12px ui-monospace, Menlo, monospace; color: rgba(244, 246, 241, .85); z-index: 2; pointer-events: none; }
.scene-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.scene-row .scene { margin-top: 16px; }
.scene-row .scene img { height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.scene-row .scene .xp-wrap { height: 100%; }
@media (max-width: 640px) { .scene-row { grid-template-columns: 1fr; } }
.credit { margin: 12px 4px 0; font-size: 12px; color: var(--text-soft); text-align: right; }
/* richer dark surfaces, taken from the floating MacBook scene */
.an-panel:not(.soft), .nh-sheet, .nh-proto { background: radial-gradient(120% 80% at 85% 0%, #3b3f8f 0%, rgba(59, 63, 143, 0) 55%), linear-gradient(170deg, #17204a 0%, #0c1024 55%, #07080c 100%); }
.an-panel.soft { background: radial-gradient(120% 80% at 10% 0%, #ffffff 0%, rgba(255,255,255,0) 60%), var(--card-soft); }
