:root {
  color-scheme: light dark;
  --navy: #0a1628;
  --navy-2: #13233a;
  --teal: #00d4aa;
  --teal-dark: #009b82;
  --white: #ffffff;
  --ink: #122033;
  --muted: #5d6b7e;
  --line: #dbe4ef;
  --surface: #ffffff;
  --surface-2: #f5f8fb;
  --surface-3: #eaf3f6;
  --gold: #f0a202;
  --blue: #2f80ed;
  --violet: #7c5cff;
  --coral: #e85d75;
  --green: #008f72;
  --red: #c7364c;
  --shadow: 0 22px 60px rgba(10, 22, 40, 0.14);
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef7ff;
    --muted: #b8c6d8;
    --line: #2f415b;
    --surface: #101d31;
    --surface-2: #0a1628;
    --surface-3: #172940;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface-2);
}

body::selection {
  color: var(--navy);
  background: var(--teal);
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

@media (prefers-color-scheme: dark) {
  a {
    color: var(--teal);
  }
}

a:hover {
  color: var(--navy);
}

@media (prefers-color-scheme: dark) {
  a:hover {
    color: var(--white);
  }
}

img,
svg {
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.65rem 1rem;
  color: var(--navy);
  background: var(--teal);
  border-radius: var(--radius);
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  color: var(--white);
  background: rgba(10, 22, 40, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  width: min(1120px, calc(100% - 2rem));
  min-height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--navy);
  background: var(--teal);
  border-radius: 6px;
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.site-nav a {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  color: rgba(255, 255, 255, 0.86);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--navy);
  background: var(--teal);
}

.hero {
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(10, 22, 40, 0.96), rgba(19, 35, 58, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 72px);
}

.hero-inner,
.section-inner,
.page-shell,
.article-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero-inner {
  padding: 4rem 0 3.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  line-height: 1.16;
  margin: 0;
}

h1 {
  max-width: 830px;
  font-size: 2.35rem;
}

h2 {
  font-size: 1.85rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0;
}

.hero-copy {
  max-width: 760px;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.06rem;
}

.decoder-form {
  margin-top: 2rem;
}

.input-row {
  display: grid;
  gap: 0.75rem;
}

.vin-label {
  font-weight: 850;
}

.input-control {
  display: grid;
  gap: 0.75rem;
}

.vin-input-wrap {
  position: relative;
}

.vin-input {
  width: 100%;
  min-height: 4.25rem;
  padding: 0.8rem 5.6rem 0.8rem 1rem;
  color: var(--navy);
  background: var(--white);
  border: 3px solid transparent;
  border-radius: var(--radius);
  font-size: 1.18rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.vin-input:focus {
  border-color: var(--teal);
  outline: none;
}

.char-counter {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  min-width: 4rem;
  padding: 0.3rem 0.5rem;
  color: var(--navy);
  background: #eef3f7;
  border-radius: 999px;
  font-weight: 900;
  text-align: center;
}

.char-counter.is-valid {
  color: var(--navy);
  background: var(--teal);
}

.char-counter.is-invalid {
  color: var(--white);
  background: var(--red);
}

.input-hint {
  min-height: 1.5rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
}

.button-row,
.sample-row,
.result-actions,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  color: var(--white);
  background: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  color: var(--navy);
  background: var(--teal);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button-primary {
  color: var(--navy);
  background: var(--teal);
  border-color: var(--teal);
}

.button-primary:hover {
  color: var(--white);
  background: transparent;
  border-color: var(--white);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover {
  color: var(--navy);
  background: var(--teal);
  border-color: var(--teal);
}

.samples {
  margin-top: 1.5rem;
}

.samples p {
  margin-bottom: 0.7rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 750;
}

.sample-chip {
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.sample-chip:hover {
  color: var(--navy);
  background: var(--teal);
  transform: translateY(-1px);
}

.status-message {
  min-height: 1.6rem;
  margin-top: 1rem;
  font-weight: 800;
}

.status-error {
  color: #ffd2dc;
}

.status-success {
  color: var(--teal);
}

.status-loading {
  color: #ffdf8a;
}

/* Advertisement placeholders: side rails are desktop-only, while banner slots stay responsive. */
.ad-rail {
  display: none;
}

.ad-band {
  padding: 1rem 0;
  background: var(--surface-2);
}

.ad-band .section-inner,
.ad-band .article-shell {
  padding-top: 0;
  padding-bottom: 0;
}

.ad-banner {
  margin: 1.4rem 0;
}

.ad-slot {
  width: 100%;
  display: grid;
  place-items: center;
  gap: 0.2rem;
  padding: 0.9rem;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(47, 128, 237, 0.08)),
    var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.ad-slot > * {
  max-width: 100%;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.ad-slot-horizontal {
  min-height: 90px;
}

.ad-slot-vertical {
  min-height: 600px;
}

.ad-label {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ad-size,
.ad-note {
  font-size: 0.82rem;
  font-weight: 750;
}

.results-section,
.content-section,
.faq-section,
.blog-list-section {
  padding: 3rem 0;
}

.results-section[hidden] {
  display: none;
}

.fade-in {
  animation: fadeIn 280ms ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.section-heading p {
  max-width: 760px;
  color: var(--muted);
}

.section-heading-compact {
  margin-bottom: 1rem;
}

.plain-summary,
.result-disclaimer,
.result-module,
.parts-note {
  margin-bottom: 1rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(10, 22, 40, 0.05);
}

.plain-summary {
  border-left: 5px solid var(--teal);
}

.plain-summary h3 {
  margin-bottom: 0.45rem;
}

.plain-summary p,
.result-disclaimer,
.parts-note {
  color: var(--muted);
}

.result-disclaimer {
  display: grid;
  gap: 0.65rem;
}

.result-disclaimer h3 {
  color: var(--ink);
}

.result-disclaimer strong {
  color: var(--ink);
}

.source-note {
  font-size: 0.94rem;
}

.result-source-block {
  margin-bottom: 1.25rem;
}

.result-source-block .section-heading {
  margin-bottom: 0.9rem;
}

.api-status {
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.summary-item {
  min-height: 7.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(10, 22, 40, 0.05);
}

.summary-item[hidden] {
  display: none;
}

.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-value {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  word-break: break-word;
}

.summary-item-wide {
  min-height: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 900;
}

.badge-success {
  color: var(--navy);
  background: var(--teal);
}

.badge-danger {
  color: var(--white);
  background: var(--red);
}

.breakdown-wrap {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.vin-group-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.vin-group {
  min-height: 5rem;
  display: grid;
  align-content: center;
  gap: 0.15rem;
  padding: 0.8rem;
  color: var(--navy);
  border-radius: var(--radius);
}

.vin-group-label,
.vin-group-name {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.78;
}

.vin-group-code {
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.vin-legend,
.resource-list,
.checklist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.vin-legend {
  color: var(--muted);
  font-size: 0.92rem;
}

.vin-legend span {
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.vin-diagram {
  display: grid;
  grid-template-columns: repeat(17, minmax(2.6rem, 1fr));
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.vin-cell {
  min-width: 2.6rem;
  min-height: 4.4rem;
  display: grid;
  align-content: center;
  gap: 0.15rem;
  color: var(--navy);
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.vin-cell:hover,
.vin-cell.is-active {
  border-color: var(--navy);
  transform: translateY(-2px);
  filter: saturate(1.1);
}

@media (prefers-color-scheme: dark) {
  .vin-cell:hover,
  .vin-cell.is-active {
    border-color: var(--white);
  }
}

.vin-index {
  font-size: 0.72rem;
  font-weight: 900;
  opacity: 0.76;
}

.vin-letter {
  font-size: 1.1rem;
  font-weight: 950;
}

.group-wmi {
  background: var(--teal);
}

.group-vds {
  background: #9ee7ff;
}

.group-check {
  background: #ffcf66;
}

.group-year {
  background: #bba7ff;
}

.group-plant {
  background: #ffa5b5;
}

.group-serial {
  background: #c8e6c9;
}

.diagram-note,
.copy-status {
  min-height: 1.5rem;
  color: var(--muted);
}

.position-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.model-year-helper {
  margin-top: 1rem;
}

.buyer-checklist,
.recall-links,
.parts-note {
  margin-top: 1rem;
}

.checklist-item {
  min-height: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 750;
}

.checklist-item input {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  margin-top: 0.2rem;
  accent-color: var(--teal-dark);
}

.resource-link {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}

.resource-link:hover {
  color: var(--navy);
  background: var(--teal);
  border-color: var(--teal);
}

.resource-link span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.resource-link:hover span {
  color: var(--navy);
}

details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

summary {
  min-height: 3rem;
  padding: 0.85rem 1rem;
  font-weight: 900;
  cursor: pointer;
}

details p {
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.info-grid,
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.content-section-alt {
  background: var(--surface);
}

.info-panel,
.blog-card {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-panel h3,
.blog-card h3 {
  margin-bottom: 0.5rem;
}

.blog-card p,
.info-panel p {
  color: var(--muted);
}

.page-hero {
  padding: 3.5rem 0 2.5rem;
  color: var(--white);
  background: var(--navy);
}

.page-hero p {
  max-width: 780px;
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.84);
}

.page-shell,
.article-shell {
  padding: 2.5rem 0 3.5rem;
}

.article-shell {
  max-width: 820px;
}

.content-block {
  display: grid;
  gap: 1.4rem;
}

.content-block h2 {
  margin-top: 0.8rem;
}

.content-block h3 {
  margin-top: 0.4rem;
}

.content-block p,
.content-block li {
  color: var(--muted);
}

.content-block ul,
.content-block ol {
  margin: 0;
  padding-left: 1.3rem;
}

.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--surface-3);
  font-weight: 900;
}

td {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.article-meta {
  margin-top: 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 750;
}

.article-actions {
  margin-top: 2rem;
}

.site-footer {
  color: rgba(255, 255, 255, 0.78);
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
  display: grid;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.footer-links a {
  color: var(--white);
  font-weight: 750;
}

.footer-note {
  max-width: 760px;
}

@media (min-width: 620px) {
  h1 {
    font-size: 3.05rem;
  }

  .input-control {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .button-primary {
    min-height: 4.25rem;
    padding-inline: 1.35rem;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .vin-group-strip {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .vin-group:first-child,
  .vin-group:nth-child(2),
  .vin-group:last-child {
    grid-column: span 2;
  }

  .vin-group-code {
    font-size: 1.1rem;
  }

  .vin-legend,
  .checklist-grid,
  .resource-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-item-wide {
    grid-column: 1 / -1;
  }

  .info-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .hero-inner {
    padding: 5.25rem 0 4.5rem;
  }

  h1 {
    font-size: 3.7rem;
  }

  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-item-wide {
    grid-column: span 2;
  }

  .info-grid,
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-grid-five {
    grid-template-columns: repeat(5, 1fr);
  }

  .position-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 1280px) {
  .nav-wrap,
  .hero-inner,
  .section-inner,
  .page-shell,
  .footer-inner {
    width: min(980px, calc(100% - clamp(17rem, 24vw, 22rem)));
  }

  .ad-rail {
    position: fixed;
    top: 4.25rem;
    bottom: 0;
    z-index: 4;
    width: clamp(7.25rem, 10vw, 10rem);
    display: block;
    padding: clamp(0.55rem, 0.8vw, 1rem) clamp(0.35rem, 0.58vw, 0.65rem);
    background: var(--surface);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 42px rgba(10, 22, 40, 0.08);
    overflow: hidden;
  }

  .ad-rail-left {
    left: 0;
    border-right: 1px solid var(--line);
  }

  .ad-rail-right {
    right: 0;
    border-left: 1px solid var(--line);
  }

  .ad-rail .ad-slot {
    min-height: 0;
    height: min(37.5rem, calc(100vh - 6.25rem));
    max-height: 100%;
    align-content: center;
    padding: clamp(0.45rem, 0.65vw, 0.85rem);
  }

  .ad-rail .ad-label {
    font-size: clamp(0.58rem, 0.58vw, 0.72rem);
    line-height: 1.2;
    letter-spacing: clamp(0.02em, 0.18vw, 0.06em);
  }

  .ad-rail .ad-size,
  .ad-rail .ad-note {
    font-size: clamp(0.56rem, 0.56vw, 0.72rem);
    line-height: 1.28;
  }

  .ad-rail .ad-note {
    max-width: 14ch;
    text-wrap: balance;
  }
}

@media (min-width: 1500px) {
  .nav-wrap,
  .hero-inner,
  .section-inner,
  .page-shell,
  .footer-inner {
    width: min(1120px, calc(100% - 22rem));
  }

  .ad-rail .ad-note {
    max-width: 18ch;
  }
}

@media (max-width: 520px) {
  .nav-wrap {
    min-height: auto;
    padding: 0.85rem 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero-inner {
    padding: 3rem 0 2.75rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .button,
  .sample-chip {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
