* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); font-weight: 800; letter-spacing: -0.01em; }

a { color: var(--blue); text-decoration: none; }
a:hover, a:focus { color: var(--cyan); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ---------------- Header ---------------- */
header.site-header {
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color .25s ease, backdrop-filter .25s ease;
}
header.site-header.scrolled {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 30% 30%, #6fb3ff, #2E7CE4 45%, #00B4E0 75%, #7B5CE6 100%);
  box-shadow: 0 0 10px rgba(46, 124, 228, 0.35);
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}
nav.main-nav > ul > li { position: relative; }
nav.main-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
nav.main-nav a:hover, nav.main-nav a:focus { color: var(--blue); }
nav.main-nav .choose-link { font-weight: 800; }

.has-dropdown .dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(13, 27, 46, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu li a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
}
.dropdown-menu li a:hover, .dropdown-menu li a:focus { background: var(--ice-1); }
.dropdown-menu li:first-child a { color: var(--pink); }
.dropdown-menu li:last-child a { color: var(--purple); }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  border: 2px solid var(--navy);
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover, .btn:focus { border-color: var(--blue); color: var(--blue); }
.btn-navy {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-navy:hover, .btn-navy:focus { background: #142943; color: #fff; }

/* ---------------- Homepage ice-network background ---------------- */
/* The gradient lives on the canvas element itself (not on body/html) so it
   paints in the same stacking step as the canvas's own drawing — a
   background on `body` paints as a normal in-flow box, which is a LATER
   paint step than a z-index:0 fixed descendant and would cover it. */
body.home-page footer.site-footer {
  /* No background box — stays transparent over the canvas. Still needs its
     own stacking position so its text renders above the z-index:0 canvas,
     same reasoning as main#main below. */
  position: relative;
  z-index: 2;
  background: transparent;
}
body.home-page main#main {
  position: relative;
  z-index: 1;
  background: transparent;
}
#hero-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
  background: linear-gradient(180deg, var(--ice-1), var(--ice-2) 55%, var(--ice-3));
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-content {
  position: relative;
  text-align: center;
  padding: 40px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-content h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 16px;
}
.hero-content p.subtitle {
  font-size: 1.15rem;
  color: var(--navy-soft);
  margin: 0 0 30px;
}

/* ---------------- How it works (homepage) ---------------- */
.how-it-works {
  position: relative;
  padding: 40px 24px 110px;
  text-align: center;
}
.how-it-works h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--navy);
  margin: 0 0 48px;
}
.steps {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}
.step {
  max-width: 260px;
  display: block;
  text-decoration: none;
  color: inherit;
}
.step-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  font-family: var(--font-display);
}
.step-circle-1 { background: var(--navy); }
.step-circle-2 { background: var(--node-blue); }
.step-circle-3 { background: var(--purple); }
.step h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--navy);
}
.step p {
  margin: 0;
  color: var(--navy-soft);
  font-size: 0.95rem;
}
a.step:hover h3, a.step:focus h3 { color: var(--blue); }
.facts-value a { font-weight: 700; }

/* ---------------- Editorial inner pages ---------------- */
section { padding: 48px 0; }
.section-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page-title { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 0 0 14px; }
.page-lede { font-size: 1.1rem; color: var(--navy-soft); max-width: 68ch; }

.grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.card-tilt {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .1s ease;
  will-change: transform;
}
.card-tilt:hover, .card-tilt:focus-within {
  box-shadow: 0 22px 40px rgba(13, 27, 46, 0.14);
}
.card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: linear-gradient(160deg, var(--ice-1), var(--white));
  display: block;
}
.card-body { padding: 20px; }
.card-body h3 { margin: 10px 0 8px; font-size: 1.15rem; }
.card-body p { color: var(--navy-soft); font-size: 0.95rem; }

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-desktop { color: var(--pink); background: rgba(232, 76, 155, 0.12); }
.tag-server { color: var(--blue); background: rgba(46, 124, 228, 0.12); }
.tag-datacenter { color: var(--purple); background: rgba(123, 92, 230, 0.12); }

.spec-list { list-style: none; padding: 0; margin: 18px 0; }
.spec-list li { padding: 12px 0; border-bottom: 1px solid var(--gray-line); }
.spec-list .spec-value { font-weight: 700; color: var(--navy); }
.spec-list .spec-explain { display: block; font-size: 0.88rem; color: var(--gray); margin-top: 4px; }

.product-photo-large {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--ice-1), var(--white));
  padding: 20px;
  display: block;
  object-fit: contain;
}

/* Pull-quote memory math */
.math-pullquote {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--navy);
  border-left: 6px solid var(--pink);
  padding: 18px 26px;
  margin: 28px 0;
  background: var(--ice-1);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}
.math-pullquote .result { color: var(--pink); }
.math-box {
  font-family: var(--font-mono);
  background: var(--navy);
  color: #DCEBFF;
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.math-box .result { color: #7EF2FF; font-weight: 700; }

table { width: 100%; border-collapse: collapse; margin: 18px 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--gray-line); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray); }

form.stack { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
form.stack label { font-weight: 700; display: block; margin-bottom: 6px; color: var(--navy); }
form.stack input:not([type="radio"]):not([type="checkbox"]),
form.stack select,
form.stack textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--gray-line);
  font: inherit;
  background: var(--white);
}
form.stack input:focus, form.stack select:focus, form.stack textarea:focus { border-color: var(--blue); }

.radio-group { display: flex; flex-direction: column; gap: 0; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--navy-soft);
}
.radio-option input[type="radio"],
.radio-option input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
  flex: none;
  accent-color: var(--blue);
}

.error-box { background: #FFE9F2; border: 1px solid var(--pink); color: #9c1a5c; padding: 14px 18px; border-radius: 12px; }
.notice-box {
  background: var(--ice-1);
  border: 1px solid var(--ice-3);
  padding: 18px 22px;
  border-radius: var(--radius);
}

.flowchart {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 28px 0;
}
.flow-box {
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  color: var(--navy);
  box-shadow: 0 8px 20px rgba(46, 124, 228, 0.12);
}
.flow-arrow { font-size: 1.5rem; color: var(--blue); }
.flow-col { display: flex; flex-direction: column; gap: 10px; }

footer.site-footer {
  padding: 36px 24px 70px;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--navy);
  background: transparent;
  border: none;
  box-shadow: none;
}

.badge-license {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: #E6FFF5;
  color: #0a7a4b;
  border: 1px solid #0a7a4b33;
}

/* ---------------- Models page: GPU visualizer + compare mode ---------------- */
.interactive-section {
  padding: 20px 0 56px;
  background: linear-gradient(180deg, var(--ice-1), var(--ice-2));
  border-radius: var(--radius);
  margin-top: 20px;
}
.interactive-section .section-inner { padding: 40px 24px; }
.interactive-section h2 { margin: 0 0 8px; }

.chip-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 8px;
}
.chip {
  --chip-color: var(--navy);
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  background: var(--white);
  border: 2px solid var(--chip-color);
  color: var(--chip-color);
  cursor: pointer;
  font-family: inherit;
  transition: background-color .15s ease, color .15s ease;
}
.chip:hover, .chip:focus { background: var(--chip-color); color: #fff; }
.chip.active { background: var(--chip-color); color: #fff; }

.gpu-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 16px;
  min-height: 60px;
}
.gpu-tile {
  --tile-color: var(--blue);
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 2px solid var(--gray-line);
  background: var(--white);
  overflow: hidden;
  flex: none;
}
.gpu-tile-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--tile-color);
  transition: width .4s ease;
}
.gpu-caption {
  font-weight: 600;
  color: var(--navy);
  margin-top: 6px;
  font-size: 1.02rem;
  min-height: 1.5em;
}
.gpu-caption .ok { color: #0a7a4b; font-weight: 800; }
.gpu-caption .warn { color: var(--pink); font-weight: 800; }

.compare-bars { margin: 26px 0 8px; display: flex; flex-direction: column; gap: 24px; }
.compare-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.compare-bar-track {
  height: 30px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--gray-line);
  overflow: hidden;
}
.compare-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width .5s ease;
}
.compare-note {
  font-weight: 600;
  color: var(--navy);
  margin-top: 4px;
  min-height: 1.5em;
}

@media (prefers-reduced-motion: reduce) {
  .gpu-tile-fill, .compare-bar-fill, .chip { transition: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
