/* T-magtech — design system
   Signature: N/S pole color coding (red = North, blue = South), engineering-datasheet typography */

:root {
  --steel-950: #0b1420;
  --steel-900: #101c2c;
  --steel-800: #182842;
  --steel-700: #2a3b52;
  --steel-500: #5a6b80;
  --steel-300: #9aa8b8;
  --paper: #f4f6f8;
  --white: #ffffff;
  --pole-n: #d3222a;
  --pole-s: #2148c0;
  --pole-s-bright: #3b66e8;
  --line: #dbe2e9;
  --line-dark: #24354d;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --maxw: 1180px;
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  color: var(--steel-900);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--pole-s-bright);
  outline-offset: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- signature elements ---------- */
.polebar {
  display: inline-block;
  width: 56px; height: 4px;
  background: linear-gradient(90deg, var(--pole-n) 0 50%, var(--pole-s) 50% 100%);
  border-radius: 2px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel-500);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--pole-n) 0 50%, var(--pole-s) 50% 100%);
}
.grade-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--steel-700);
  background: var(--white);
  white-space: nowrap;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 20, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand img { width: 36px; height: 36px; }
.brand b {
  font-family: var(--font-display);
  font-size: 19px; letter-spacing: 0.02em;
  color: var(--white); font-weight: 700;
}
.brand b span { color: var(--pole-n); }
.brand small {
  display: block; font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--steel-300); text-transform: uppercase;
}
.nav { display: flex; gap: clamp(14px, 2vw, 26px); align-items: center; }
.nav a {
  color: #c9d3e0; font-size: 14.5px; font-weight: 500;
  padding: 6px 2px; border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.nav a:hover { color: var(--white); }
.nav a.active { color: var(--white); border-bottom-color: var(--pole-n); }
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600; font-size: 14.5px;
  padding: 11px 22px; border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-n { background: var(--pole-n); color: var(--white); }
.btn-n:hover { background: #b81c23; }
.btn-ghost { border-color: var(--steel-300); color: var(--white); background: transparent; }
.btn-ghost:hover { border-color: var(--white); }
.btn-outline { border-color: var(--steel-700); color: var(--steel-900); background: transparent; }
.btn-outline:hover { border-color: var(--pole-s); color: var(--pole-s); }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); font-size: 26px; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--steel-950);
  color: var(--white);
  overflow: hidden;
}
.hero-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center right;
  opacity: 0.38;
}
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--steel-950) 34%, rgba(11,20,32,0.55) 70%, rgba(11,20,32,0.25) 100%);
}
.hero-field { position: absolute; inset: 0; pointer-events: none; }
.hero .wrap { position: relative; padding-top: 96px; padding-bottom: 60px; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08; font-weight: 700;
  letter-spacing: -0.015em;
  max-width: 13em;
  margin: 18px 0 22px;
}
.hero h1 em { font-style: normal; color: var(--pole-n); }
.hero p.lede { max-width: 560px; color: #b9c5d4; font-size: 17.5px; margin-bottom: 34px; }
.hero .eyebrow { color: var(--steel-300); }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dark);
  margin-top: 72px;
}
.hero-stats > div { padding: 22px 18px 4px 0; }
.hero-stats b {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px); color: var(--white);
  display: block;
}
.hero-stats b i { font-style: normal; color: var(--pole-n); }
.hero-stats span { font-size: 13px; color: var(--steel-300); }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--paper); }
.section.dark { background: var(--steel-950); color: var(--white); }
.section-head { max-width: 720px; margin-bottom: 46px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.15; font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head p { margin-top: 12px; color: var(--steel-500); font-size: 16.5px; }
.section.dark .section-head p { color: var(--steel-300); }

/* grade strip */
.grade-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 14px 0;
}
.grade-strip .wrap {
  display: flex; gap: 10px; align-items: center;
  overflow-x: auto; scrollbar-width: none;
}
.grade-strip .wrap::-webkit-scrollbar { display: none; }
.grade-strip .lbl {
  font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--steel-500); white-space: nowrap; margin-right: 8px;
}

/* cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
}
.card h3 {
  font-family: var(--font-display); font-size: 19px;
  margin: 14px 0 10px; font-weight: 600;
}
.card p { color: var(--steel-500); font-size: 14.5px; }
.card .tech-idx {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--pole-s); letter-spacing: 0.1em;
}

/* product cards */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(16, 28, 44, 0.12);
}
.product-card .ph {
  aspect-ratio: 4 / 3;
  background: var(--paper);
  overflow: hidden;
}
.product-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.product-card .bd { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.product-card .cat {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--pole-s); margin-bottom: 8px;
}
.product-card h3 { font-family: var(--font-display); font-size: 19.5px; font-weight: 600; margin-bottom: 8px; }
.product-card p { color: var(--steel-500); font-size: 14px; flex: 1; }
.product-card .go {
  margin-top: 16px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--steel-900); font-weight: 500;
}
.product-card .go::after { content: " →"; color: var(--pole-n); }

/* applications */
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.app-tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 300px; display: flex; align-items: flex-end;
  background: var(--steel-900);
}
.app-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.66; transition: transform 0.4s, opacity 0.3s; }
.app-tile:hover img { transform: scale(1.04); opacity: 0.5; }
.app-tile .bd {
  position: relative; padding: 26px;
  background: linear-gradient(0deg, rgba(11,20,32,0.92) 20%, transparent);
  width: 100%; color: var(--white); padding-top: 70px;
}
.app-tile h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.app-tile p { color: #c2cddb; font-size: 14px; margin-top: 6px; max-width: 460px; }

/* about split */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.split .img-frame { position: relative; }
.split .img-frame img { border-radius: var(--radius); }
.split .img-frame::after {
  content: ""; position: absolute; left: -14px; bottom: -14px;
  width: 120px; height: 90px;
  border-left: 4px solid var(--pole-n); border-bottom: 4px solid var(--pole-s);
  border-radius: 0 0 0 6px;
}
.checklist { list-style: none; margin-top: 20px; display: grid; gap: 14px; }
.checklist li { padding-left: 30px; position: relative; color: var(--steel-700); font-size: 15.5px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 14px; height: 7px; border-radius: 4px 4px 0 0;
  border: 2.5px solid var(--pole-n); border-bottom: 0;
}
.checklist li b { color: var(--steel-900); }

/* service band */
.service-band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-band .card { background: var(--steel-900); border-color: var(--line-dark); color: var(--white); }
.service-band .card h3 { color: var(--white); }
.service-band .card p { color: var(--steel-300); }
.service-band .metric {
  font-family: var(--font-mono); font-size: 30px; font-weight: 500;
  color: var(--white);
}
.service-band .metric i { font-style: normal; color: var(--pole-n); font-size: 18px; }

/* CTA */
.cta-band {
  background: linear-gradient(115deg, var(--steel-950) 55%, var(--steel-800));
  color: var(--white);
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--pole-n) 0 50%, var(--pole-s) 50% 100%) 1;
}
.cta-band .wrap {
  padding: 64px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); max-width: 560px; }
.cta-band p { color: var(--steel-300); margin-top: 8px; }

/* ---------- product detail ---------- */
.page-head {
  background: var(--steel-950); color: var(--white);
  padding: 64px 0 54px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.01em;
}
.page-head .crumb {
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--steel-300); margin-bottom: 16px; display: block;
}
.page-head .crumb a:hover { color: var(--white); }
.detail-grid { display: grid; grid-template-columns: 460px 1fr; gap: 52px; align-items: start; }
.detail-grid .photo {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--paper);
  position: sticky; top: 90px;
}
.detail-body { min-width: 0; }
.detail-body h2 { font-family: var(--font-display); font-size: 24px; margin: 34px 0 14px; font-weight: 600; }
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { color: var(--steel-700); margin-bottom: 14px; }
.feature-list { list-style: none; display: grid; gap: 10px; margin: 8px 0 6px; }
.feature-list li { padding-left: 26px; position: relative; color: var(--steel-700); font-size: 15px; }
.feature-list li::before {
  content: "▪"; position: absolute; left: 2px; color: var(--pole-n);
}

/* spec tables */
.spec-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0 8px; }
table.spec {
  border-collapse: collapse; width: 100%; min-width: 760px;
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--white);
}
table.spec caption {
  text-align: left; font-family: var(--font-display);
  font-size: 15px; font-weight: 600; padding: 14px 14px 10px;
  color: var(--steel-900);
}
table.spec th {
  background: var(--steel-900); color: #dfe6ee;
  font-weight: 500; padding: 9px 12px; text-align: left;
  white-space: nowrap; border-right: 1px solid var(--line-dark);
}
table.spec td {
  padding: 7px 12px; border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--steel-700); white-space: nowrap;
}
table.spec tr td:first-child { font-weight: 600; color: var(--steel-900); background: var(--paper); }
table.spec tr:nth-child(even) td { background: #fafbfc; }
table.spec tr:nth-child(even) td:first-child { background: var(--paper); }

/* ---------- application rows ---------- */
.app-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 48px 0; border-bottom: 1px solid var(--line); }
.app-row:last-child { border-bottom: 0; }
.app-row img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.app-row.rev > .txt { order: -1; }
.app-row h3 { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 10px 0 12px; }
.app-row p { color: var(--steel-700); }
.app-row .uses { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 840px) { .app-row { grid-template-columns: 1fr; gap: 22px; } .app-row.rev > .txt { order: 0; } }

/* ---------- blog article ---------- */
.article-meta {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--steel-300); margin-top: 14px;
}
.article { max-width: 780px; }
.article-gallery { position: relative; margin-bottom: 38px; outline: none; }
.article-gallery:focus-visible { outline: 3px solid var(--pole-s-bright); outline-offset: 4px; }
.article-gallery-viewport { overflow: hidden; border-radius: var(--radius); background: var(--steel-100); }
.article-gallery-track { display: flex; transition: transform 0.35s ease; }
.article-gallery-slide { flex: 0 0 100%; aspect-ratio: 16 / 9; margin: 0; }
.article-gallery-slide img,
.article .article-gallery-slide img { width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: cover; }
.article-gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 1px solid rgba(255,255,255,0.55); border-radius: 3px;
  background: rgba(11,20,32,0.82); color: var(--white); cursor: pointer;
  font-size: 22px; line-height: 1;
}
.article-gallery-btn:hover { background: var(--steel-950); }
.article-gallery-btn:focus-visible { outline: 2px solid var(--pole-s-bright); outline-offset: 2px; }
.article-gallery-btn.prev { left: 14px; }
.article-gallery-btn.next { right: 14px; }
.article-gallery-status {
  position: absolute; right: 14px; bottom: 14px;
  padding: 5px 9px; border-radius: 3px;
  background: rgba(11,20,32,0.82); color: var(--white); font: 12px var(--font-mono);
}
.article-gallery-dots { display: flex; justify-content: center; gap: 7px; margin-top: 13px; }
.article-gallery-dots button {
  width: 26px; height: 4px; padding: 0; border: 0; border-radius: 0;
  background: var(--steel-300); cursor: pointer;
}
.article-gallery-dots button[aria-current="true"] { background: var(--pole-n); }
.article-gallery-dots button:focus-visible { outline: 2px solid var(--pole-s); outline-offset: 3px; }
.article h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 38px 0 14px; letter-spacing: -0.01em; }
.article h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 30px 0 12px; }
.article p { color: var(--steel-700); margin-bottom: 16px; font-size: 16.5px; }
.article ul, .article ol { margin: 0 0 16px 24px; color: var(--steel-700); display: grid; gap: 8px; }
.article img { border-radius: var(--radius); margin: 10px 0 18px; }
.article a { color: var(--pole-s); text-decoration: underline; text-underline-offset: 3px; }
.article blockquote {
  border-left: 4px solid; margin: 22px 0; padding: 4px 0 4px 20px;
  border-image: linear-gradient(180deg, var(--pole-n) 0 50%, var(--pole-s) 50% 100%) 1;
  color: var(--steel-500); font-size: 17px;
}
.article pre, .article .ql-code-block-container {
  background: var(--steel-950); color: #dfe6ee; border-radius: var(--radius);
  padding: 18px 20px; font-family: var(--font-mono); font-size: 13.5px;
  overflow-x: auto; margin: 0 0 18px;
}
.article table { border-collapse: collapse; margin: 0 0 18px; }
.article td, .article th { border: 1px solid var(--line); padding: 8px 12px; }
.article .ql-align-center { text-align: center; }
.article .ql-align-right { text-align: right; }
.article-cta {
  margin-top: 44px; padding: 24px 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--pole-n) 0 50%, var(--pole-s) 50% 100%) 1;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--paper);
}
.article-cta b { font-family: var(--font-display); font-size: 17px; }
.article-cta p { margin: 2px 0 0; font-size: 14px; color: var(--steel-500); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
label.f { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--steel-700); }
input.f, textarea.f, select.f {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--font-body); font-size: 15px;
  background: var(--white); color: var(--steel-900);
}
input.f:focus, textarea.f:focus, select.f:focus { border-color: var(--pole-s); outline: none; }
textarea.f { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--steel-500); }
.alert { padding: 12px 16px; border-radius: 4px; font-size: 14.5px; margin: 14px 0; }
.alert.ok { background: #e8f6ec; color: #1c6b34; border: 1px solid #bfe3cb; }
.alert.err { background: #fdeaea; color: #a11a20; border: 1px solid #f2c6c8; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 380px 1fr; gap: 52px; align-items: start; }
.contact-info { display: grid; gap: 4px; }
.contact-info .item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-info .k {
  font-family: var(--font-mono); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--steel-500);
}
.contact-info .v { font-size: 16px; font-weight: 500; margin-top: 4px; }
.contact-info .v a:hover { color: var(--pole-s); }

/* ---------- footer ---------- */
.site-footer { background: var(--steel-950); color: var(--steel-300); }
.site-footer .top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px;
  padding: 60px 0 44px;
}
.site-footer h4 {
  font-family: var(--font-mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--white); margin-bottom: 16px; font-weight: 500;
}
.site-footer ul { list-style: none; display: grid; gap: 9px; font-size: 14px; }
.site-footer ul a:hover { color: var(--white); }
.site-footer .blurb { font-size: 14px; max-width: 300px; margin-top: 14px; }
.site-footer .bottom {
  border-top: 1px solid var(--line-dark);
  padding: 20px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px;
}
.site-footer .bottom .pole { font-family: var(--font-mono); font-size: 12px; }
.site-footer .bottom .pole b { color: var(--pole-n); font-weight: 500; }
.site-footer .bottom .pole i { color: var(--pole-s-bright); font-style: normal; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .grid-4, .product-grid, .service-band { grid-template-columns: repeat(2, 1fr); }
  .split, .detail-grid, .contact-grid { grid-template-columns: 1fr; }
  .detail-grid .photo { position: static; max-width: 480px; }
  .site-footer .top { grid-template-columns: 1fr 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav {
    position: fixed; inset: 66px 0 auto 0;
    background: var(--steel-950);
    flex-direction: column; align-items: flex-start;
    padding: 18px 24px 24px; gap: 16px;
    border-bottom: 1px solid var(--line-dark);
    display: none;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4, .product-grid, .app-grid, .form-grid, .service-band { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .section { padding: 60px 0; }
  .hero .wrap { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .article-gallery-track { transition: none; }
}
