/* ==========================================================================
   VIEWNEX — site.css
   Single stylesheet for the whole site.
   1. Tokens   2. Base   3. Layout   4. Header/Nav   5. Footer
   6. Hero     7. Components   8. Product themes   9. Utilities
   ========================================================================== */

/* 1. Tokens ================================================================ */
:root {
  --pri-900: #020e17;
  --pri-800: #031c2b;
  --pri-700: #073456;
  --pri-500: #0a4775;
  --pri-100: #ecf3f5;
  --white: #fff;
  --gray-200: #b6c3cc;
  --gray-400: #7d8d99;
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .25);

  --bg: var(--pri-900);
  --surface: var(--pri-800);
  --surface-2: #062538;
  --text: var(--white);
  --text-muted: var(--gray-200);

  /* per-product theme hooks (overridden in section 8) */
  --hero-a: var(--pri-700);
  --hero-b: var(--pri-800);
  --accent: #3ba7e0;
  --accent-ink: #041927;

  --radius: 1.25rem;
  --radius-sm: .75rem;
  --container: 1120px;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --header-h: 72px;
  --shadow: 0 12px 28px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

/* 2. Base ================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
/* inline links inside page content only — never nav, breadcrumb or buttons */
main :is(p, li, td, address) a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
main :is(p, li, td, address) a:not(.btn):hover { text-decoration-color: currentColor; }
main .breadcrumb li a:not(.btn) { color: inherit; text-decoration: none; }
main .breadcrumb li a:not(.btn):hover { color: var(--white); }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: .4rem; }
p + p { margin-top: .9rem; }
strong, b { font-weight: 700; }
address { font-style: normal; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  padding: .6rem 1rem; border-radius: .5rem;
  background: var(--white); color: var(--pri-900); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 3. Layout ================================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* .box — a content section rendered as a surface panel */
.box {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--container) - 2 * 1.5rem);
  margin: 2.5rem auto;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.box > :last-child { margin-bottom: 0; }
.box--center { text-align: center; }
.box--center .lead,
.box--center .list { margin-inline: auto; }
.box--center .list { text-align: left; width: fit-content; max-width: 100%; }
.box--plain { background: none; border: 0; padding-inline: 0; }

/* .split — media + text side by side, stacks on mobile */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.5rem);
  align-items: center;
}
.split--narrow-media { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 768px) {
  .split, .split--narrow-media { grid-template-columns: 1fr; }
}

/* 4. Header / Nav ========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  box-shadow: 0 1px 0 rgba(2, 14, 23, .08), 0 6px 20px rgba(0, 0, 0, .18);
  color: var(--pri-700);
}
.nav-container {
  max-width: var(--container);
  min-height: var(--header-h);
  margin: 0 auto;
  padding: .75rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }

.nav-list { list-style: none; display: flex; align-items: center; gap: 2rem; }
.nav-item { position: relative; }
.nav-link,
.nav-button {
  position: relative;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .25rem;
  font: inherit; font-size: 1.02rem; font-weight: 600;
  color: var(--pri-700);
  background: none; border: 0; cursor: pointer;
}
.nav-button::after {
  content: ""; width: .45em; height: .45em; margin-top: -.2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s var(--ease);
}
.nav-item.is-open > .nav-button::after { transform: rotate(-135deg); margin-top: .2em; }
.nav-link::before,
.nav-button::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-link:hover::before, .nav-button:hover::before,
.nav-link[aria-current="page"]::before { transform: scaleX(1); }
.site-header :focus-visible { outline-color: var(--pri-500); }

.sub-menu {
  list-style: none;
  position: absolute; top: calc(100% + .5rem); left: -1rem;
  min-width: 220px; padding: .5rem 0;
  background: var(--white); color: var(--pri-700);
  border-radius: .75rem; box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
/* invisible bridge so the menu doesn't close while the pointer travels to it */
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.75rem; height: .75rem; }
.nav-item.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 861px) {
  .dropdown:hover > .sub-menu { opacity: 1; visibility: visible; transform: none; }
}
.sub-menu { padding: .4rem; }
.sub-menu a {
  display: block; padding: .55rem .8rem; border-radius: .5rem;
  font-size: .95rem; font-weight: 500; color: var(--pri-700); white-space: nowrap;
  transition: background .15s, color .15s;
}
.sub-menu a:hover, .sub-menu a:focus-visible { background: var(--pri-100); color: var(--pri-900); }
.sub-menu a[aria-current="page"] { background: var(--pri-100); color: var(--pri-900); font-weight: 700; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; margin-right: -.5rem;
  align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; color: var(--pri-700);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), background .25s;
}
.nav-toggle span { position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .brand img { height: 32px; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    background: var(--white); border-bottom: 1px solid var(--pri-100);
    box-shadow: 0 16px 24px rgba(0, 0, 0, .15);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1rem; }
  .nav-item { border-bottom: 1px solid var(--pri-100); }
  .nav-item:last-child { border-bottom: 0; }
  .nav-link, .nav-button { width: 100%; justify-content: space-between; padding: .9rem 0; }
  .nav-link::before, .nav-button::before { display: none; }
  .sub-menu {
    position: static; display: none; min-width: 0;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-radius: 0; padding: 0 0 .5rem;
  }
  .sub-menu::before { display: none; }
  .nav-item.is-open > .sub-menu { display: block; }
  .sub-menu a { padding: .55rem 1rem; border-radius: .5rem; }
}

/* 5. Footer ================================================================ */
.site-footer {
  margin-top: 4rem;
  padding: 2.75rem var(--gutter) 3rem;
  border-top: 1px solid var(--surface);
  background: #030c14;
  color: var(--text-muted);
  font-size: .9rem;
  text-align: center;
}
.site-footer address { font-style: normal; margin: .5rem 0; }
.site-footer p + p { margin-top: .35rem; }
.site-footer strong { color: var(--white); }
.site-footer a { color: var(--gray-200); }
.site-footer a:hover { color: var(--white); }

/* 6. Hero ================================================================== */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6rem) var(--gutter) clamp(3rem, 8vw, 5rem);
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; letter-spacing: -.02em; }
.hero__lead { margin-top: 1rem; font-size: clamp(1rem, 2.2vw, 1.15rem); color: var(--pri-100); }
.hero__actions { margin-top: 2rem; display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.hero__img { margin: 1.75rem auto 0; max-height: 300px; width: auto; border-radius: var(--radius-sm); }
.hero__eyebrow {
  display: inline-block; margin-bottom: .9rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pri-100); opacity: .85;
}

.hero__img--wide { max-height: none; width: 100%; max-width: 820px; box-shadow: 0 18px 40px rgba(0, 0, 0, .4); }

.hero--simple { padding-block: clamp(2.75rem, 6vw, 4rem); }

/* split hero: image beside text (Smart Paper) */
.hero--split .hero__inner {
  max-width: var(--container);
  display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center;
  text-align: left;
}
.hero--split .hero__img { margin: 0; max-width: 220px; }
@media (max-width: 768px) {
  .hero--split .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero--split .hero__img { margin: 0 auto; max-width: 160px; }
}

/* full-bleed video hero (home) */
.hero--video {
  padding: 0;
  height: min(80vh, 760px);
  min-height: 480px;
  background: var(--pri-900);
}
.hero--video video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero--video .hero__overlay {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .55) 100%);
}

/* 7. Components ============================================================ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.4rem;
  border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none;
  background: var(--pri-700); color: var(--white);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--pri-500); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--white); }
.btn--ghost { background: transparent; border-color: var(--line-strong); }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); }

/* Text */
.lead { max-width: 760px; color: var(--pri-100); font-size: 1.05rem; }
.note { margin-top: .75rem; font-size: .88rem; color: var(--text-muted); }
.section-title { text-align: center; margin: 3.5rem auto 1.5rem; padding-inline: var(--gutter); }

/* Lists */
.list { padding-left: 1.25rem; max-width: 820px; }
.list li { margin: .45rem 0; color: var(--pri-100); }
.list li::marker { color: var(--accent); }
ol.list li { padding-left: .25rem; }
ol.list li::marker { font-weight: 700; }

/* Figures */
.figure { margin: 1.5rem auto 0; max-width: 900px; }
.figure img { width: 100%; border-radius: var(--radius-sm); }
.figure figcaption { margin-top: .75rem; font-size: .92rem; color: var(--text-muted); text-align: center; }
.box > .figure:first-child { margin-top: 0; }
.figure + p, .figure + .lead { margin-top: 1.25rem; }
.figure--sm { max-width: 560px; }
.figure--product { max-width: 420px; }
.figure--product img { max-height: 320px; width: auto; margin: 0 auto; }

/* Card grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1.25rem;
}
.cards--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.box > .cards { margin-top: 1.25rem; }
.box > h2 + .cards { margin-top: 0; }
/* standalone card grid (outside .box) */
.container > .cards { margin-block: 2.5rem; }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
}
.container > .cards > .card { background: var(--surface); box-shadow: var(--shadow); }
.card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #0b1620; }
.card__img--contain { object-fit: contain; padding: 1rem; background: rgba(255, 255, 255, .03); }
.card__body { flex: 1; padding: 1.25rem 1.25rem 1.5rem; }
.card h3 { color: var(--pri-100); }
.card p { font-size: .92rem; color: var(--text-muted); }
.cards--center .card { text-align: center; }

a.card { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
a.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 20px 40px rgba(0, 0, 0, .55); }
a.card:hover .card__img { filter: brightness(1.05); }
.card__more {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .75rem;
  font-size: .88rem; font-weight: 600; color: var(--accent);
}
.card__more::after { content: "→"; transition: transform .2s; }
a.card:hover .card__more::after { transform: translateX(3px); }

/* Accent heading color for themed card titles */
.cards--accent .card h3 { color: var(--accent); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.box > h2 + .table-wrap { margin-top: 0; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.spec-table th,
.spec-table td { padding: .65rem .8rem; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.spec-table thead th { background: rgba(255, 255, 255, .08); font-weight: 700; white-space: nowrap; }
.spec-table tbody th { width: 34%; background: rgba(255, 255, 255, .04); font-weight: 600; color: var(--pri-100); }
.spec-table tbody th[colspan] {
  width: auto; padding-top: .8rem;
  background: rgba(255, 255, 255, .09); color: var(--accent);
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
}
.spec-table:has(thead) tbody th { width: auto; }
.spec-table tr.is-highlight td { background: rgba(255, 255, 255, .06); font-weight: 600; }
.spec-table td:first-child:not(:only-child) { color: var(--pri-100); }
@media (max-width: 600px) {
  .spec-table { font-size: .88rem; }
  .spec-table th, .spec-table td { padding: .55rem .6rem; }
}

/* Key figures strip */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin-top: 2.5rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats > div { flex: 1 1 160px; padding: 1.1rem 1.25rem; background: var(--surface); text-align: center; }
.stats dt { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.stats dd { margin-top: .3rem; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.stats small { font-size: .78rem; font-weight: 500; color: var(--text-muted); }

/* Partner logos */
.logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem 2.5rem; margin-top: 1rem; }
.logos img { height: 160px; width: auto; border-radius: var(--radius-sm); }
@media (max-width: 600px) { .logos img { height: 110px; } }

/* Breadcrumb (sub-product pages) */
/* sits flush on top of the hero, in the hero's own start colour */
.breadcrumb {
  padding: 1rem max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))) 0;
  background: var(--hero-a);
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; opacity: .6; }
.breadcrumb a { transition: color .15s; }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb [aria-current="page"] { color: var(--white); font-weight: 600; }
.breadcrumb + .hero { background: linear-gradient(180deg, var(--hero-a) 0%, transparent 40%), linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); padding-top: clamp(2.5rem, 6vw, 4rem); }

/* Map embed */
.map { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; background: #0b1620; }
.map iframe { width: 100%; height: clamp(300px, 50vw, 440px); border: 0; }

/* Contact block */
.contact-list { list-style: none; display: grid; gap: .75rem; margin: 0 0 1.75rem; }
.contact-list strong { display: inline-block; min-width: 5.5rem; color: var(--white); }
.contact-list span { color: var(--text-muted); }

/* CEO message */
.portrait { width: 100%; border-radius: var(--radius); object-fit: cover; }
.quote { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.4; margin-bottom: 1.25rem; }
.signature { margin-top: 1.5rem; font-weight: 600; color: var(--white); }

/* 8. Product themes ========================================================
   Each page sets <body class="theme-xxx">. Only tokens change here —
   every component reads --hero-a / --hero-b / --accent.            */
.theme-uam        { --hero-a: #0c3e75; --hero-b: #2980ca; --accent: #6cc0ff; }
.theme-tedung     { --hero-a: #42250a; --hero-b: #7f4b0c; --accent: #f0b062; --bg: #0f0d0b; --surface: #1d190f; --surface-2: #27211a; }
.theme-mantis     { --hero-a: #0b2815; --hero-b: #146433; --accent: #8bf68c; }
.theme-dot        { --hero-a: #67190d; --hero-b: #bb3d10; --accent: #ff9a6b; }
.theme-smartpaper { --hero-a: #0d4fb6; --hero-b: #0073d9; --accent: #7cc4ff; }
.theme-xdr        { --hero-a: #041927; --hero-b: #02766e; --accent: #2fd6c5; }
.theme-thermal    { --hero-a: #0d1117; --hero-b: #0b6c7b; --accent: #09c0d1; }
.theme-v600       { --hero-a: #0a1a2b; --hero-b: #3d6e8f; --accent: #9fd4f5; }

/* XDR models */
.theme-mc58  { --hero-a: #01394a; --hero-b: #089c8d; --accent: #2fd6c5; }
.theme-mc212 { --hero-a: #03303d; --hero-b: #0a8c7d; --accent: #2fd6c5; }
.theme-dv1   { --hero-a: #022835; --hero-b: #0b7c70; --accent: #2fd6c5; }
.theme-f16   { --hero-a: #002a38; --hero-b: #0a728d; --accent: #3fc6e6; }
.theme-f36   { --hero-a: #002238; --hero-b: #006f99; --accent: #3fc6e6; }
.theme-sp5   { --hero-a: #001e32; --hero-b: #005d7f; --accent: #3fc6e6; }

/* Thermal models */
.theme-sg23  { --hero-a: #262626; --hero-b: #7635f5; --accent: #b896ff; }
.theme-sg30  { --hero-a: #1a1d2b; --hero-b: #08a89e; --accent: #3fe0d4; }
.theme-sg1k  { --hero-a: #141b24; --hero-b: #c7353e; --accent: #ff8a8f; }

/* 9. Utilities ============================================================= */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
