/* =========================================================
   Overseas ordering, specialist work and the curved-work demo.
   Loaded after styles.css.
   ========================================================= */
.nav-links { gap: 24px; }
.seg-sm { margin-top: 0; }
.seg-sm button { padding: 9px 12px; font-size: 11.5px; }

/* ---------- overseas ---------- */
.os-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4.5vw, 72px); align-items: center; margin-top: 60px; }
.os-why { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.os-why li { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.os-why li > span { font: 500 12px/1.9 var(--mono); color: var(--laser); letter-spacing: .1em; }
.os-why h3 { font-size: 21px; margin-bottom: 8px; }
.os-why p { margin: 0; color: var(--muted); font-size: 15px; }

.gate { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px 26px; position: relative; }
.gate-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.gate-rail { position: relative; margin: 58px 0 34px; }
.gate-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.gate-track::before { content: ""; position: absolute; left: 7.14%; right: 7.14%; top: 9px; height: 1px; background: var(--line-2); }
.gate-track li { position: relative; padding-top: 34px; text-align: center; font: 500 11px/1.3 var(--mono); letter-spacing: .04em; color: var(--dim); transition: color .4s; }
.gate-track li::before { content: ""; position: absolute; left: 50%; top: 3px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .4s, background .4s; }
.gate-track li.past { color: var(--soft); }
.gate-track li.past::before { border-color: var(--text); background: var(--text); }
.gate-track li.found { color: var(--state, var(--laser)); font-weight: 700; }
.gate-track li.found::before { border-color: var(--state, var(--laser)); }
.gate[data-state=good] { --state: var(--ok); }
.gate[data-state=warn] { --state: var(--warn); }
.gate[data-state=bad] { --state: var(--laser); }
.gate-dot { position: absolute; top: 9.5px; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--state, var(--laser)); box-shadow: 0 0 0 5px rgba(255, 255, 255, .06), 0 0 26px var(--state, var(--laser)); transition: left .8s cubic-bezier(.3, .8, .2, 1), background .4s, box-shadow .4s; }
.gate-line { position: absolute; left: 42.86%; top: -34px; bottom: -14px; border-left: 1px dashed rgba(var(--laser-rgb), .7); pointer-events: none; }
.gate-line span { position: absolute; left: 10px; top: -4px; white-space: nowrap; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; color: var(--bad-text); }
.gate-out { display: grid; grid-template-columns: minmax(0, .5fr) minmax(0, 1.5fr); gap: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.gate-k { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
.gate-where { font: 700 30px/1 var(--display); font-stretch: 112%; margin: 0; color: var(--state, var(--laser)); transition: color .4s; }
.gate-fix { margin: 0; font-size: 16px; color: var(--soft); min-height: 3.2em; }

.os-sub { margin-top: clamp(56px, 7vw, 96px); font-size: clamp(22px, 2.3vw, 30px); }
.os-pack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; border-radius: var(--r); overflow: hidden; }
.os-pack > div { background: var(--bg-2); padding: 26px 26px 24px; }
.os-pack b { font: 500 11px/1 var(--mono); color: var(--laser); letter-spacing: .1em; }
.os-pack h4 { font: 700 18px/1.2 var(--display); font-stretch: 110%; margin: 14px 0 8px; }
.os-pack p { margin: 0; font-size: 14.5px; color: var(--muted); }
.os-pack .os-key { background: linear-gradient(160deg, rgba(var(--laser-rgb), .13), transparent 60%), var(--bg-2); }
.os-pack .os-key h4 { color: var(--bad-text); }

.os-table { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.os-row { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr) minmax(0, 1.3fr); gap: 24px; padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--soft); }
.os-row:last-child { border-bottom: 0; }
.os-row b { color: var(--text); font-weight: 600; font-size: 16px; }
.os-row span:nth-child(2) { color: var(--bad-text); }
.os-rhead { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); background: rgba(255, 255, 255, .02); padding-block: 14px; }
.os-rhead span:nth-child(2) { color: var(--dim); }
.os-cta { margin-top: 44px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.os-cta p { margin: 0; max-width: 46ch; font: 600 clamp(19px, 2vw, 25px)/1.3 var(--display); font-stretch: 108%; letter-spacing: -.01em; }

/* ---------- use cards: nine, in threes ---------- */
.uses { grid-template-columns: repeat(3, 1fr); }
.use { display: flex; flex-direction: column; }
.use > p { min-height: 3em; }
.use-more { margin-top: auto; padding-top: 18px; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--laser); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.use-more::after { content: "\2193"; transition: transform .2s; }
.use-more:hover::after { transform: translateY(3px); }
.use-more + .use-more { margin-top: 0; padding-top: 12px; }

/* ---------- specialist work ---------- */
.capget { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 28px; }
.capget h4 { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--laser); margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.capget .ticks { margin-top: 16px; gap: 9px; }
.capget .ticks li { font-size: 14.5px; }
.ex-foot { margin: 22px 0 0; font-size: 13.5px; color: var(--dim); }
#specialist .seg { margin-top: 24px; }
#specialist .exhibit { align-items: start; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
#specialist .exhibit-flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
#specialist .ex-stage { position: sticky; top: 92px; }

.ill-body { aspect-ratio: auto; background: radial-gradient(90% 80% at 50% 40%, #101821, #06080b); }
.ill { width: 100%; height: auto; display: block; }
.ill text { font-family: var(--mono); }
.ill-wall { fill: none; stroke: #e9edf1; stroke-width: 3; stroke-linecap: round; }
.ill-dash { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.2; stroke-dasharray: 6 5; }
.ill-cut { fill: rgba(7, 9, 12, .55); stroke: #9aa5b3; stroke-width: 1.3; }
.ill-cl { stroke: var(--laser); stroke-width: 1.3; fill: none; }
.ill-dim { fill: none; stroke: #8d97a5; stroke-width: 1; }
.ill-num { font-size: 13px; font-weight: 700; fill: #e9edf1; }
.ill-lab { font-size: 10px; font-weight: 500; fill: #8d97a5; letter-spacing: .08em; }
.ill-red { fill: var(--bad-text); }
.ill-beam { stroke: rgba(var(--laser-rgb), .5); stroke-width: 1.1; fill: none; }
.ill-beam-live { stroke: var(--laser); stroke-width: 1.8; filter: drop-shadow(0 0 5px var(--laser)); }
.shot { fill: var(--laser); stroke: rgba(255, 255, 255, .85); stroke-width: 1; filter: drop-shadow(0 0 4px rgba(var(--laser-rgb), .9)); }

.riser { padding: 18px 22px 20px; border-top: 1px solid var(--line-2); background: rgba(7, 9, 12, .5); }
.riser .field-range label { font-size: 14px; }
#riser-bars { width: 100%; height: auto; margin-top: 10px; }
.riser-verdict { margin: 10px 0 0; font-size: 14.5px; color: var(--soft); padding-left: 14px; border-left: 2px solid var(--line-2); }
.riser-verdict.bad { border-color: var(--laser); }
.riser-verdict.bad b { color: var(--bad-text); }
.riser-verdict.good { border-color: var(--ok); }
.riser-verdict.good b { color: var(--ok); }

#curve-svg { touch-action: pan-y; cursor: crosshair; }
.curve-pick { padding: 14px 16px 2px; }
#specialist .curve-pick .seg { margin-top: 0; display: flex; }
.curve-pick .seg button { flex: 1; }
.curve-read { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-2); background: rgba(7, 9, 12, .5); }
.curve-read div { padding: 14px 18px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.curve-read div:nth-child(3n+1) { border-left: 0; }
.curve-read div:nth-last-child(-n+3) { border-bottom: 0; }
.curve-read dt { font-size: 9.5px; }
.curve-read dd { font: 700 16px/1.3 var(--mono); color: var(--text); margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ---------- curved stair: a real survey ---------- */
.realjob { margin-top: clamp(64px, 8vw, 120px); }
.rj-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 72px); align-items: end; margin-bottom: 36px; }
.label + .realjob { margin-top: 0; }
.rj-head h2 { margin: 0; }
.rj-head h3 { font-size: clamp(26px, 2.8vw, 38px); margin: 0; }
.rj-head > p { margin: 0; color: var(--soft); font-size: 16px; }
.rj-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
.rj-stage { position: relative; aspect-ratio: 1 / .94; min-height: 340px; }
#stair3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#stair3d.drag { cursor: grabbing; }
.rj-hint { position: absolute; left: 16px; bottom: 12px; margin: 0; font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); pointer-events: none; }
.rj-side { border-left: 1px solid var(--line-2); background: rgba(7, 9, 12, .5); display: flex; flex-direction: column; min-width: 0; }
.rj-side .rj-read { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 0; background: none; }
.rj-side .rj-read div { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 18px; }
.rj-side .rj-read div:nth-child(odd) { border-left: 0; }
.rj-side .rj-read div:nth-last-child(-n+2) { border-bottom: 0; }
.rj-side .rj-read dd { font-size: 15px; white-space: nowrap; }
.rj-bars { margin-top: auto; padding: 20px 18px 22px; border-top: 1px solid var(--line-2); }
.rj-bars .gate-k { margin-bottom: 4px; }
#stair-bars { width: 100%; height: auto; display: block; touch-action: pan-y; cursor: crosshair; }
.rj-bars .riser-verdict { border-color: var(--warn); }
.rj-bars .riser-verdict b { color: var(--text); }
.rj-finds { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rj-finds li { background: var(--bg-2); padding: 26px 26px 24px; }
.rj-finds span { display: block; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rj-finds b { display: block; font: 700 clamp(26px, 2.6vw, 36px)/1 var(--display); font-stretch: 112%; letter-spacing: -.01em; margin: 16px 0 12px; color: var(--text); }
.rj-finds p { margin: 0; font-size: 14.5px; color: var(--muted); }
.rj-link { color: var(--laser); text-decoration: none; border-bottom: 1px solid rgba(var(--laser-rgb), .4); margin-left: 6px; }
.rj-link:hover { border-bottom-color: var(--laser); }
@media (max-width: 980px) {
  .rj-head { grid-template-columns: 1fr; gap: 18px; }
  .rj-body { grid-template-columns: minmax(0, 1fr); }
  .rj-side { border-left: 0; border-top: 1px solid var(--line-2); }
  .rj-finds { grid-template-columns: 1fr; }
}

/* ---------- touch and trace ---------- */
.trace-line { fill: none; stroke: var(--laser); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(var(--laser-rgb), .9)); }
.trace-track { stroke: rgba(var(--laser-rgb), .75); stroke-width: 1.1; stroke-dasharray: 5 5; transition: opacity .4s; }
#trace-pen { transition: opacity .4s; }

/* ---------- the three rules, now a strip under "How it works" ---------- */
.rules-k { margin: clamp(52px, 6vw, 84px) 0 0; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--laser); }
.rules-strip { margin-top: 18px; }
.rules-strip .rule { padding: 24px 26px; }
.rules-strip .rule h3 { font-size: 17px; margin-bottom: 8px; }

/* instrument illustration: the beam is longer now */
.i-beam { stroke-dasharray: 300; animation-name: beam2; }
@keyframes beam2 { 0% { stroke-dashoffset: 300; } 40%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -300; } }

@media (max-width: 1320px) {
  .coords { display: none; }
}
@media (max-width: 1180px) {
  .uses { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 13px; }
}
@media (max-width: 980px) {
  .os-grid { grid-template-columns: 1fr; }
  .os-pack { grid-template-columns: 1fr 1fr; }
  #specialist .exhibit, #specialist .exhibit-flip { grid-template-columns: 1fr; }
  #specialist .ex-stage { position: static; }
  .nav-links { gap: 0; }
  .nav-links a { font-size: 17px; }
}
@media (max-width: 720px) {
  .uses { grid-template-columns: 1fr; }
  .os-pack { grid-template-columns: 1fr; }
  .os-row { grid-template-columns: 1fr; gap: 8px; }
  .os-rhead { display: none; }
  .capget { grid-template-columns: 1fr; }
  .gate { padding: 18px 14px 22px; }
  .gate-track li { font-size: 0; letter-spacing: 0; }
  .gate-track li::after { content: attr(data-short); font-size: 9.5px; }
  .gate-line span { font-size: 9px; white-space: normal; width: 150px; top: -24px; line-height: 1.3; }
  .gate-out { grid-template-columns: 1fr; gap: 16px; }
  .curve-read { grid-template-columns: 1fr 1fr; }
  .curve-read div:nth-child(3n+1) { border-left: 1px solid var(--line); }
  .curve-read div:nth-child(2n+1) { border-left: 0; }
  .curve-read div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .curve-read div:nth-last-child(-n+2) { border-bottom: 0; }
}

/* ---------- header and timeline at tablet-landscape and small-laptop widths ---------- */
.nav-links a, .nav .btn, .brand-text i { white-space: nowrap; }
@media (min-width: 981px) and (max-width: 1180px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 12.5px; }
  .gate-line span { white-space: normal; width: 200px; top: -18px; line-height: 1.3; }
}
@media (min-width: 981px) and (max-width: 1080px) {
  .brand-text i { display: none; }
}

/* ---------- touch screens: a prompt in the hero, and sideways drags aim the laser ---------- */
.hero-tap { display: none; }
@media (pointer: coarse) {
  .hero { touch-action: pan-y; }
  .hero-inner > .hero-tap { pointer-events: none; }
  .hero-tap { display: inline-flex; align-items: center; gap: 10px; margin: 22px 0 0; padding: 9px 14px 9px 12px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); background: rgba(7, 9, 12, .74); border: 1px solid rgba(var(--laser-rgb), .45); border-radius: 999px; pointer-events: none; }
  .hero-tap::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--laser); box-shadow: 0 0 10px var(--laser); animation: tapPulse 1.6s ease-in-out infinite; }
}
@keyframes tapPulse { 50% { transform: scale(1.7); opacity: .45; } }

/* ---------- phones: a shorter page ----------
   Card grids become one row you swipe sideways, the worked examples fold up,
   and the case file shows its critical rows first. The script in special.js adds
   the classes (.js-short, .accordion) so nothing is hidden if scripts are off. */
.swipe-hint, .more-btn { display: none; }
@media (max-width: 720px) {
  #outputs .ex-copy .ticks, #outputs .ex-copy .ticks-lead { display: none; }
  .os-table { background: none; }
  .os-table .os-rhead { display: none; }
  .os-table .os-row { background: var(--panel); padding: 18px; }
  .uses, .os-pack, .os-table, .rj-finds, .packs, .rules {
    display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    background: none; border: 0; border-radius: 0; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
  }
  .uses::-webkit-scrollbar, .os-pack::-webkit-scrollbar, .os-table::-webkit-scrollbar, .rj-finds::-webkit-scrollbar, .packs::-webkit-scrollbar, .rules::-webkit-scrollbar { display: none; }
  .uses > *, .os-pack > *, .os-table > *, .rj-finds > *, .packs > *, .rules > * { flex: 0 0 84%; scroll-snap-align: start; border: 1px solid var(--line); border-radius: var(--r); opacity: 1; transform: none; }
  .swipe-hint { display: block; margin: 12px 0 0; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
  .contents { display: none; }

  .register.js-short:not(.all) .reg-row.watch, .register.js-short:not(.all) .reg-row.ok { display: none; }
  .register.js-short:not(.all) .reg-row.crit:nth-last-of-type(1) { border-bottom: 0; }
  .more-btn { display: inline-flex; margin-top: 14px; background: none; border: 1px solid var(--line-2); border-radius: var(--r); padding: 11px 14px; font: 500 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); cursor: pointer; }

  #specialist.accordion .exhibit { margin-top: 0; padding: 20px 0; border-top: 1px solid var(--line); gap: 0; }
  #specialist.accordion .exhibit:first-of-type { margin-top: 36px; }
  #specialist.accordion .exhibit:last-of-type { border-bottom: 1px solid var(--line); }
  #specialist.accordion .ex-copy { order: 0; }
  #specialist.accordion .ex-n { margin-bottom: 10px; cursor: pointer; }
  #specialist.accordion .ex-copy h3 { margin-bottom: 0; padding-right: 36px; position: relative; font-size: 21px; cursor: pointer; }
  #specialist.accordion .ex-copy h3::after { content: "+"; position: absolute; right: 2px; top: -2px; font: 400 26px/1 var(--mono); color: var(--laser); }
  #specialist.accordion .exhibit.open .ex-copy h3 { margin-bottom: 16px; }
  #specialist.accordion .exhibit.open .ex-copy h3::after { content: "\2212"; }
  #specialist.accordion .exhibit:not(.open) .ex-copy > :not(.ex-n):not(h3), #specialist.accordion .exhibit:not(.open) .ex-stage { display: none; }
  #specialist.accordion .exhibit.open .ex-stage { margin-top: 22px; }
}
@media (max-width: 720px) {
  .curve-pick .seg button { padding: 11px 4px; font-size: 11px; letter-spacing: 0; white-space: nowrap; }
}
