/* BIONIC AI INC. — Brand styles (#0D4DA1 / #0A2342) */

:root {
  --blue-primary: #0d4da1;
  --blue-primary-hover: #0b3d82;
  --navy-dark: #0a2342;
  --navy-mid: #123456;
  --blue-tint: #e6f0fa;
  --off-white: #f5f7fa;
  --gray-muted: #617488;
  --text: #0a2342;
  --border: #d4e2f0;
  --shadow: 0 8px 32px rgba(10, 35, 66, 0.1);
  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --max-width: 1140px;
  --header-height: 80px;
  --page-gutter: 1.5rem;
  --touch-min: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--blue-primary);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover {
  color: var(--navy-dark);
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(13, 77, 161, 0.06);
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.92;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--navy-dark);
}

.brand-inc {
  font-weight: 700;
  font-size: 0.85em;
}

.brand-tag {
  margin-top: 0.15rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-muted);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 35, 66, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-backdrop.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0 0.85rem;
  background: var(--blue-tint);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy-dark);
  border-radius: 8px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--blue-primary);
  border-bottom-color: var(--blue-primary);
}

main {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  padding-left: max(var(--page-gutter), env(safe-area-inset-left));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right));
}

.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: #fff;
}

.section-tint {
  background: var(--blue-tint);
}

.section-heading {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--navy-dark);
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 2.5rem;
  max-width: 36rem;
  color: var(--gray-muted);
}

/* Hero (home) */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0d3568 45%, var(--blue-primary) 100%);
  color: #fff;
  padding: 4.5rem 0 5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 85% 50%, rgba(13, 77, 161, 0.45) 0%, transparent 55%),
    linear-gradient(180deg, transparent 60%, rgba(10, 35, 66, 0.4) 100%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr minmax(200px, 340px);
  gap: 2rem;
  align-items: center;
}

.hero-content h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.9rem, 4.5vw, 2.65rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-content .lead {
  margin: 0 0 2rem;
  font-size: 1.12rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  max-width: 34rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual img {
  width: min(100%, 320px);
  opacity: 0.85;
  filter: drop-shadow(0 0 40px rgba(110, 179, 247, 0.35));
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.8rem 1.65rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}

.btn-primary:hover {
  background: var(--blue-primary-hover);
  border-color: var(--blue-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

.btn-on-light.btn-secondary {
  color: var(--navy-dark);
  border-color: var(--blue-primary);
}

.btn-on-light.btn-secondary:hover {
  background: var(--blue-primary);
  color: #fff;
}

/* Intro strip */
.intro-strip {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}

.intro-strip p {
  margin: 0 0 1.1rem;
  color: var(--gray-muted);
  max-width: 52rem;
}

.intro-strip p:last-child {
  margin-bottom: 0;
}

.intro-strip em {
  color: var(--navy-dark);
  font-style: normal;
  font-weight: 600;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border-top: 3px solid var(--blue-primary);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(13, 77, 161, 0.14);
  border-color: #b8d4f0;
}

.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1.1rem;
  color: var(--blue-primary);
}

.card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.card p {
  margin: 0;
  font-size: 0.975rem;
  color: var(--gray-muted);
  line-height: 1.6;
}

/* Page hero (inner pages) */
.page-hero {
  background: linear-gradient(120deg, var(--navy-dark) 0%, var(--blue-primary) 100%);
  color: #fff;
  padding: 3.25rem 0;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: "";
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  background: url("../assets/hero-brain.svg") center / contain no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

.page-hero .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-hero-emblem {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0.5rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 36rem;
}

/* Prose */
.content-section {
  padding: 3.5rem 0 4.5rem;
  background: #fff;
}

.prose h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.prose p {
  margin: 0 0 1.25rem;
  color: var(--gray-muted);
}

.prose ul {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  color: var(--gray-muted);
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--blue-primary);
}

.prose .formula,
.formula {
  font-family: ui-monospace, monospace;
  font-size: 1.05rem;
  color: var(--navy-dark);
  background: var(--blue-tint);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--blue-primary);
  border-radius: 0 6px 6px 0;
  margin: 1rem 0 1.25rem;
}

/* About layout */
.about-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 2.5rem;
  align-items: start;
}

.about-aside {
  padding: 1.5rem;
  background: var(--blue-tint);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.about-aside img {
  width: 100%;
  opacity: 0.9;
}

.compliance-note {
  margin-top: 2.5rem;
  padding: 1.35rem 1.5rem;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--gray-muted);
}

/* Research list */
.research-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.research-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.75rem 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(10, 35, 66, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.research-item:hover {
  border-color: #b8d4f0;
  box-shadow: var(--shadow);
}

.research-item-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--blue-primary);
  padding: 0.5rem;
  background: var(--blue-tint);
  border-radius: 8px;
}

.research-item-body h2 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.research-item-body p {
  margin: 0 0 0.65rem;
  color: var(--gray-muted);
}

.research-item-body p:last-child {
  margin-bottom: 0;
}

.disclaimer {
  margin-top: 2.5rem;
  padding: 1.35rem 1.5rem;
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--gray-muted);
}

/* Featured / publishing */
.featured {
  background: linear-gradient(180deg, var(--blue-tint) 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.25rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.featured-label {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-primary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.featured h3 {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1.35;
}

.status-box {
  margin-top: 1.5rem;
  padding: 1.15rem 1.35rem;
  background: #fff;
  border-left: 4px solid var(--blue-primary);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
  color: var(--gray-muted);
  box-shadow: 0 2px 8px rgba(10, 35, 66, 0.06);
}

.status-box strong {
  color: var(--navy-dark);
}

/* Publishing catalog cards */
.catalog-section {
  margin: 2.5rem 0 2rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
}

.catalog-heading {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.catalog-lead {
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
  color: var(--gray-muted);
  max-width: 40rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.book-card {
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  padding: 1rem 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 6px rgba(10, 35, 66, 0.08),
    0 12px 28px rgba(10, 35, 66, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .book-card:hover {
    transform: translateY(-4px);
    box-shadow:
      0 8px 16px rgba(10, 35, 66, 0.12),
      0 20px 40px rgba(13, 77, 161, 0.28);
  }
}

.book-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 20% 15%, rgba(110, 179, 247, 0.4) 0%, transparent 55%);
  pointer-events: none;
}

.book-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(10, 35, 66, 0.75) 100%);
  pointer-events: none;
}

.book-card__pattern {
  position: absolute;
  inset: 0;
  opacity: 0.85;
  pointer-events: none;
}

.book-card__pattern svg {
  width: 100%;
  height: 100%;
}

.book-card__imprint {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.book-card__badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  padding: 0.28rem 0.55rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--blue-primary);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(10, 35, 66, 0.25);
}

.book-card__badge--muted {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.book-card__icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  margin: auto 0 0.5rem;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}

.book-card__icon svg {
  width: 100%;
  height: 100%;
}

.book-card__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.book-card__title {
  margin: 0 0 0.35rem;
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
  letter-spacing: -0.01em;
}

.book-card__subtitle {
  margin: 0;
  font-size: clamp(0.62rem, 1.8vw, 0.7rem);
  font-weight: 500;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

/* Card variants */
.book-card--featured {
  background: linear-gradient(155deg, #061a33 0%, var(--navy-dark) 35%, var(--blue-primary) 100%);
  border-color: rgba(110, 179, 247, 0.45);
  box-shadow:
    0 0 0 2px rgba(13, 77, 161, 0.35),
    0 12px 32px rgba(13, 77, 161, 0.35);
}

.book-card--featured .book-card__imprint {
  color: rgba(110, 179, 247, 0.95);
}

.book-card--monograph {
  background: linear-gradient(160deg, #0a1f3d 0%, #0d3568 50%, #1a5a9e 100%);
}

.book-card--education {
  background: linear-gradient(165deg, var(--navy-dark) 0%, #134a7a 55%, var(--blue-primary) 100%);
}

.book-card--digital {
  background: linear-gradient(150deg, #081c36 0%, var(--navy-dark) 40%, #2a6cb8 100%);
}

.book-card--digital .book-card__pattern {
  opacity: 1;
}

.imprint-note {
  padding: 1rem 1.25rem;
  background: var(--blue-tint);
  border-radius: 8px;
  border-left: 3px solid var(--blue-primary);
  color: var(--gray-muted);
  font-size: 0.95rem;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-card {
  background: var(--blue-tint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
}

.contact-card .brand-emblem {
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
}

.contact-info dl {
  display: grid;
  gap: 1.25rem;
  margin: 0;
}

.contact-info dt {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-primary);
}

.contact-info dd {
  margin: 0.35rem 0 0;
  color: var(--navy-dark);
  font-weight: 500;
}

.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--off-white);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(13, 77, 161, 0.15);
  background: #fff;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  text-align: left;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-logo {
  width: 200px;
  height: auto;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  margin: 0;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  max-width: 22rem;
}

.footer-col h4 {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.footer-col p,
.footer-col a {
  margin: 0 0 0.5rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.footer-col a:hover {
  color: #fff;
}

.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  margin-bottom: 0.4rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-bottom p {
  margin: 0;
}

/* Mercury page */
.mercury-page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  background: #fff;
}

.mercury-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--blue-primary);
}

.mercury-header img {
  width: 56px;
  height: 56px;
}

.mercury-page h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy-dark);
}

.mercury-page .tagline {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 1.5rem;
}

.mercury-page h2 {
  font-size: 1.05rem;
  color: var(--navy-dark);
  margin: 2rem 0 0.75rem;
}

.mercury-page p,
.mercury-page li {
  color: var(--gray-muted);
}

.mercury-page a {
  color: var(--blue-primary);
}

@media (max-width: 1024px) and (min-width: 769px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ——— Responsive: tablet ——— */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-visual {
    order: -1;
    max-height: 220px;
  }

  .hero-visual img {
    width: min(240px, 70vw);
    margin: 0 auto;
  }

  .about-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .about-aside {
    max-width: 320px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ——— Responsive: mobile ——— */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --page-gutter: 1.125rem;
  }

  body {
    font-size: 1rem;
  }

  .site-header {
    position: sticky;
    top: 0;
    padding-top: env(safe-area-inset-top);
  }

  .header-inner {
    min-height: var(--header-height);
    padding-left: max(var(--page-gutter), env(safe-area-inset-left));
    padding-right: max(var(--page-gutter), env(safe-area-inset-right));
    gap: 0.75rem;
  }

  .brand {
    min-width: 0;
    flex: 1;
  }

  .brand-emblem {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 0.92rem;
    letter-spacing: 0.03em;
  }

  .brand-tag {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  #main-nav {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 95;
    margin: 0;
    padding: 0.5rem max(var(--page-gutter), env(safe-area-inset-right))
      calc(1rem + env(safe-area-inset-bottom))
      max(var(--page-gutter), env(safe-area-inset-left));
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(10, 35, 66, 0.14);
    max-height: min(70dvh, calc(100dvh - var(--header-height) - env(safe-area-inset-top)));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
  }

  #main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .main-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .main-nav li {
    border-bottom: 1px solid var(--border);
  }

  .main-nav li:last-child {
    border-bottom: none;
  }

  .main-nav a {
    display: flex;
    align-items: center;
    min-height: var(--touch-min);
    padding: 0.65rem 0.25rem;
    font-size: 1rem;
    border-bottom: none;
  }

  .main-nav a.active {
    color: var(--blue-primary);
    font-weight: 700;
  }

  .hero {
    padding: 2.75rem 0 3rem;
  }

  .hero-content h1 {
    font-size: clamp(1.55rem, 6.5vw, 2rem);
  }

  .hero-content .lead {
    font-size: 1.02rem;
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .hero-visual {
    max-height: 160px;
    margin-bottom: 0.25rem;
  }

  .hero-visual img {
    width: min(180px, 55vw);
  }

  .intro-strip {
    padding: 2.25rem 0;
  }

  .section {
    padding: 2.75rem 0;
  }

  .content-section {
    padding: 2.25rem 0 3rem;
  }

  .section-heading {
    font-size: 1.4rem;
  }

  .section-lead {
    margin-bottom: 1.75rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem 1.35rem;
  }

  .page-hero {
    padding: 2.25rem 0;
  }

  .page-hero .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .page-hero-emblem {
    width: 52px;
    height: 52px;
  }

  .page-hero h1 {
    font-size: clamp(1.5rem, 6vw, 1.85rem);
  }

  .page-hero p {
    font-size: 0.98rem;
  }

  .page-hero::after {
    display: none;
  }

  .about-aside {
    max-width: none;
    padding: 1.25rem;
  }

  .about-aside img {
    max-width: 200px;
    margin: 0 auto;
  }

  .featured {
    padding: 1.5rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 10px;
  }

  .featured h3 {
    font-size: 1.2rem;
  }

  .catalog-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .book-card {
    padding: 0.85rem 0.85rem 1rem;
    border-radius: 12px;
  }

  .book-card__icon {
    width: 32px;
    height: 32px;
  }

  .book-card__badge {
    top: 0.65rem;
    right: 0.65rem;
    font-size: 0.52rem;
  }

  .research-item {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.35rem 1.15rem;
  }

  .research-item-icon {
    width: 36px;
    height: 36px;
  }

  .research-item-body h2 {
    font-size: 1.1rem;
  }

  .formula {
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
    overflow-x: auto;
  }

  .contact-layout {
    gap: 1.5rem;
  }

  .contact-card,
  .contact-form {
    padding: 1.35rem 1.15rem;
  }

  .contact-info dd {
    word-break: break-word;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
  }

  .footer-logo {
    width: min(200px, 75vw);
  }

  .footer-brand p {
    max-width: none;
  }

  .footer-nav a,
  .footer-col a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
  }

  .site-footer {
    padding: 2.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  }

  .mercury-page {
    padding: 2rem max(var(--page-gutter), env(safe-area-inset-right))
      calc(2.5rem + env(safe-area-inset-bottom))
      max(var(--page-gutter), env(safe-area-inset-left));
  }
}

/* ——— Responsive: small phones ——— */
@media (max-width: 480px) {
  :root {
    --page-gutter: 1rem;
  }

  .brand-name {
    font-size: 0.82rem;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .book-card__title {
    font-size: 0.72rem;
  }

  .book-card__subtitle {
    font-size: 0.58rem;
    line-height: 1.35;
  }

  .compliance-note,
  .disclaimer,
  .status-box,
  .imprint-note {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .prose ul {
    padding-left: 1.15rem;
  }
}

/* Desktop: ensure nav panel styles never leak */
@media (min-width: 769px) {
  #main-nav {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    border: none;
    background: transparent;
  }

  .main-nav li {
    border-bottom: none;
  }

  .main-nav a {
    display: inline;
    min-height: 0;
    padding: 0.35rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #main-nav,
  .nav-backdrop,
  .btn,
  .card {
    transition: none;
  }
}

/* Reduce hover motion on touch devices */
@media (hover: none) {
  .card:hover,
  .book-card:hover {
    transform: none;
  }
}

/* Tablet-only: 2-column cards */
@media (min-width: 481px) and (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card:last-child {
    grid-column: 1 / -1;
  }
}
