/* EUROCUTPRECISION main page: Tool Programme section (approved design).
   Every rule is scoped under .tp, and the design tokens are set on .tp, so nothing here can change the rest
   of the site. Fonts: the site's self-hosted IBM Plex (see README 8.3). Mono 400 is used by .rack__fam b, matching the existing self-hosted face. */

.tp {
  --band: #0D192E;
  --on-dark: #FFFFFF;
  --on-dark-2: #C9CDD6;
  --on-dark-muted: #8A91A0;
  --bright: #5B90E8;
  --stage-dark-hi: #22324E;
  --stage-dark-lo: #111C30;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
/* local resets (the mockup page had these globally) */
.tp *, .tp *::before, .tp *::after { box-sizing: border-box; }
.tp img { max-width: 100%; display: block; }
.tp [hidden] { display: none !important; }
.tp a { color: inherit; }
.tp h2, .tp h3 { text-wrap: balance; margin: 0; color: inherit; }  /* guards against site-wide heading colours */
.tp p { margin: 0; }
.tp :focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
/* layout helpers the section uses: map .wrap to the site's own container if it has one */
.tp .wrap { max-width: 1280px; margin-inline: auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.tp .mono-label { font: 600 11px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }

.tp { background: var(--band); color: var(--on-dark); padding-block: 88px 96px; }
/* new: header row */
.tp .tp__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; margin-bottom: 36px; }
.tp .tp__eyebrow { color: var(--bright); margin-bottom: 14px; display: block; }
.tp .tp__head h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.4rem); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
.tp .tp__lead { color: var(--on-dark-2); max-width: 60ch; margin-top: 14px; font-size: 16px; }
.tp .tp__all { color: var(--bright); font-weight: 600; font-size: 15px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; padding-bottom: 4px; }
.tp .tp__all .arr, .tp .rack__fam .arr, .tp .kind__head .arr { transition: transform 200ms var(--ease); }
.tp .tp__all:focus-visible .arr, .tp .rack__fam:focus-visible .arr { transform: translateX(4px); }
.tp .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp .nw { white-space: nowrap; }
.tp .sep { display: inline-flex; flex-wrap: wrap; column-gap: 0; }
.tp .sep span + span::before { content: "·"; margin-inline: 6px; color: var(--on-dark-muted); }

/* profile glyphs */
.tp .glyph { width: 14px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.tp .glyph--miter { stroke-linejoin: miter; }

/* key + hint above the rack */
.tp .rack-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.tp .rack__key { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--on-dark-2); letter-spacing: 0.08em; margin: 0; }
.tp .rack__key span { display: inline-flex; align-items: center; gap: 6px; }
.tp .rack__key .glyph { color: var(--on-dark-2); }
.tp .rack__key-note { color: var(--on-dark-muted); }
.tp .rack__hint { display: none; color: var(--on-dark-muted); margin: 0; }

/* lineup rack: one upright tool per series on a shared floor */
.tp .rack-scroll { position: relative; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.tp .rack { --rs: 1; display: grid; grid-template-columns: 6fr 3fr; gap: 0 32px; background: radial-gradient(70% 90% at 50% 60%, rgba(91, 144, 232, 0.10) 0%, rgba(91, 144, 232, 0) 70%); }
.tp .rack__fam { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--on-dark); border-top: 1px solid rgba(255, 255, 255, 0.28); padding-top: 12px; margin-bottom: 8px; }
.tp .rack__fam span:first-child { font-weight: 600; font-size: 15px; }
.tp .rack__fam b { font: 400 12px var(--font-mono); color: var(--on-dark-muted); letter-spacing: 0.04em; }
.tp .rack__fam .arr { color: var(--bright); }
.tp .rack__tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: 12px; }
.tp .tool { position: relative; display: grid; grid-template-rows: calc(530px * var(--rs)) auto auto auto auto auto; align-content: start; justify-items: center; text-align: center; text-decoration: none; color: var(--on-dark); padding-bottom: 6px; height: 100%; }
.tp .tool__img { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.tp .tool__img img { height: calc(var(--h) * var(--rs)); width: auto; max-width: none; flex: none; transition: transform 420ms var(--ease); }
.tp .tool:focus-visible .tool__img img { transform: translateY(-14px); }
.tp .tool__code { position: relative; font: 600 15px/1 var(--font-mono); margin-top: 16px; letter-spacing: 0.02em; }
.tp .tool__code .arr { position: absolute; left: 100%; margin-left: 4px; color: var(--bright); opacity: 0; transition: opacity 200ms var(--ease); }
.tp .tool:focus-visible .tool__code { color: var(--bright); }
.tp .tool:focus-visible .tool__code .arr { opacity: 1; }
.tp .tool__name { font-size: 13px; color: var(--on-dark-2); margin-top: 6px; line-height: 1.3; padding-inline: 4px; min-height: 2.6em; }
.tp .tool__count { font: 12px var(--font-mono); color: var(--on-dark-2); margin-top: 2px; }
.tp .tool__range { font: 12px var(--font-mono); color: var(--on-dark-muted); margin-top: 3px; }
.tp .tool__types { display: flex; gap: 8px; justify-content: center; margin-top: 10px; min-height: 18px; }
.tp .type { display: inline-flex; align-items: center; gap: 3px; font: 11px var(--font-mono); color: var(--on-dark-2); }
.tp .type--text { color: var(--on-dark-muted); }

/* tool types, aligned to the rack's End mills / Drills split; open style, not boxed cards */
.tp .kinds { display: grid; grid-template-columns: 6fr 3fr; gap: 0 32px; margin-top: 56px; }
.tp .kinds__em, .tp .kinds__dr { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.tp .kinds__em { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp .kind { position: relative; display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--on-dark); border-top: 1px solid rgba(255, 255, 255, 0.28); padding-top: 14px; transition: border-color 200ms var(--ease); }
.tp .kind:focus-visible { border-top-color: var(--bright); }
.tp .kind__stage { position: relative; height: clamp(104px, 8.6vw, 124px); overflow: hidden; background: radial-gradient(110% 100% at 55% 50%, var(--stage-dark-hi) 0%, var(--stage-dark-lo) 80%); }
.tp .kind__stage img { position: absolute; right: 5%; top: 50%; width: 150%; height: auto; max-width: none; transform: translate(0, -50%); transition: transform 480ms var(--ease); }
.tp .kind--drill .kind__stage img { width: 102%; right: 5%; }  /* a little smaller than the end mills, since the wider tile also shows more length; faded end off-frame */
.tp .kind__body { display: grid; gap: 6px; padding-top: 14px; }
.tp .kind__head { display: flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1.35; }
.tp .kind__head .glyph { color: var(--bright); margin-top: 1px; }
.tp .kind__head .arr { color: var(--bright); margin-left: auto; padding-left: 8px; }
.tp .kind:focus-visible .kind__head { color: var(--bright); }
.tp .kind__count { font: 12px/1.5 var(--font-mono); color: var(--on-dark-muted); }
.tp .kind__count b { color: var(--on-dark); font-weight: 600; font-family: var(--font-sans); font-size: 15px; margin-right: 2px; }
.tp .kind__series { font: 12px/1.5 var(--font-mono); color: var(--on-dark-2); }

/* hover effects only where a pointer can hover (no sticky states on touch) */
@media (hover: hover) {
  .tp .tp__all:hover { color: #FFFFFF; }
  .tp .tp__all:hover .arr, .tp .rack__fam:hover .arr, .tp .kind:hover .kind__head .arr { transform: translateX(4px); }
  .tp .rack__fam:hover span:first-child { color: var(--bright); }
  .tp .tool:hover .tool__img img { transform: translateY(-14px); }
  .tp .tool:hover .tool__code { color: var(--bright); }
  .tp .tool:hover .tool__code .arr { opacity: 1; }
  .tp .kind:hover { border-top-color: var(--bright); }
  .tp .kind:hover .kind__head { color: var(--bright); }
  .tp .kind:hover .kind__stage img { transform: translate(2%, -50%); }
}

@media (max-width: 1180px) {
  .tp .rack-scroll { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .tp .rack { min-width: 1200px; }
  .tp .rack__hint { display: block; }
  .tp .tool { scroll-snap-align: start; scroll-margin-inline-start: var(--gutter); }
  .tp .kinds { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tp .kinds__em { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp .kinds__dr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) { .tp { padding-block: 64px 72px; } .tp .rack { --rs: 0.8; } }
@media (max-width: 640px) {
  .tp .kinds__em, .tp .kinds__dr { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tp .kind { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 14px; align-items: center; }
  .tp .kind__stage { height: auto; aspect-ratio: 4 / 3; }
  .tp .kind--drill .kind__stage img { width: 163%; right: 5%; }
  .tp .kind__body { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tp *, .tp *::before, .tp *::after { transition-duration: 0ms !important; }
  .tp .tool:hover .tool__img img, .tp .tool:focus-visible .tool__img img, .tp .kind:hover .kind__stage img { transform: none !important; }
  .tp .kind:hover .kind__stage img { transform: translate(0, -50%) !important; }
  .tp .tp__all .arr, .tp .rack__fam .arr, .tp .kind__head .arr { transform: none !important; }
}
