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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a2332;
  background: #fff;
  line-height: 1.7;
  font-size: 17px;
}

/* === Layout === */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 72px 0;
}

section + section {
  border-top: 1px solid #e8ecf0;
}

/* === Typography === */
h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0f1b2d;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f1b2d;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a2332;
  margin-bottom: 8px;
}

p {
  margin-bottom: 16px;
  color: #374151;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: #1d5fa0;
  text-decoration: underline;
  text-decoration-color: #1d5fa044;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: #1d5fa0;
}

/* === Hero === */
.hero {
  padding: 48px 0 32px;
  text-align: center;
  border-bottom: none;
}

.hero-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-bottom: 28px;
}

.hero-mascot {
  width: 96px;
  height: auto;
  image-rendering: pixelated;
}

.hero-divider {
  width: 1px;
  align-self: stretch;
  background: #d0d8e0;
}

.hero-text {
  text-align: left;
}

.hero-text h1 {
  margin-bottom: 4px;
}

.hero-sub {
  font-size: 1.05rem;
  color: #4b5c6e;
  margin-bottom: 0;
  line-height: 1.5;
}

.hero .cta {
  display: inline-block;
  background: #1d5fa0;
  color: #fff;
  text-decoration: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.15s;
}

.hero .cta:hover {
  background: #174d85;
}

/* === Tab Bar === */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
}

.tab-bar .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7a8d;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.tab-btn:hover {
  color: #1a2332;
}

.tab-btn.active {
  color: #1d5fa0;
  border-bottom-color: #1d5fa0;
}

/* === Tab Panels === */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* === FAQ === */
.faq-item {
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  margin-bottom: 12px;
}

.faq-item summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: #1a2332;
  background: #f4f7fa;
  border-radius: 6px;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  font-weight: 700;
  color: #1d5fa0;
}

.faq-item[open] summary::before {
  content: "\2212";
}

.faq-item[open] summary {
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid #e0e6ed;
}

.faq-item p {
  padding: 16px 20px 16px 40px;
  margin: 0;
  color: #374151;
}

/* === Instruments Grid === */
.instruments-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin-top: 24px;
}

.instruments-grid li {
  background: #f4f7fa;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  padding: 14px 16px;
  text-align: center;
  font-weight: 600;
  color: #1a2332;
  font-size: 0.95rem;
}

/* === Cost Table === */
.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.cost-table th,
.cost-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e6ed;
}

.cost-table th {
  background: #f4f7fa;
  font-weight: 600;
  color: #0f1b2d;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cost-table td {
  color: #374151;
}

.cost-example {
  background: #f0f7ee;
  border: 1px solid #c3ddb8;
  border-radius: 6px;
  padding: 20px 24px;
  margin-top: 24px;
  color: #2d5016;
  font-size: 1.05rem;
}

.cost-example strong {
  color: #1a3d0a;
}

/* === HIPAA Callout === */
.hipaa-callout {
  background: #0f1b2d;
  color: #e8ecf0;
  border-radius: 8px;
  padding: 40px;
  margin-top: 24px;
}

.hipaa-callout h3 {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.hipaa-callout p {
  color: #c0cbda;
  font-size: 1.05rem;
}

.hipaa-callout a {
  color: #7eb8f7;
}

/* === Download Grid === */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 16px;
  border: 2px solid #d0d8e0;
  border-radius: 8px;
  text-decoration: none;
  color: #1a2332;
  transition: border-color 0.15s, background 0.15s;
}

.download-card:hover {
  border-color: #1d5fa0;
  background: #f4f8fc;
}

.download-card strong {
  font-size: 1.1rem;
}

.download-card span {
  font-size: 0.9rem;
  color: #4b5c6e;
}

.download-icon {
  width: 32px;
  height: 32px;
  color: #4b5c6e;
  margin-bottom: 4px;
}

.download-card:hover .download-icon {
  color: #1d5fa0;
}

.download-size {
  font-size: 0.8rem !important;
  color: #8896a7 !important;
  margin-top: 4px;
}

.macos-beta-hint {
  font-size: 0.78rem !important;
  color: transparent !important;
  margin-top: 2px;
  transition: color 0.15s;
}

.macos-card:hover .macos-beta-hint {
  color: #c0392b !important;
}

.mac-note {
  margin-top: 24px;
  border: 1px solid #e0e6ed;
  border-radius: 6px;
  font-size: 0.92rem;
}

.mac-note summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  color: #1a2332;
  background: #f4f7fa;
  border-radius: 6px;
}

.mac-note[open] summary {
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid #e0e6ed;
}

.mac-note p,
.mac-note pre {
  margin: 12px 20px;
}

.mac-note pre {
  background: #1a2332;
  color: #e8ecf0;
  padding: 12px 16px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.mac-note code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* === Workflow Steps === */
.workflow-steps {
  display: flex;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 32px 0;
  counter-reset: step;
}

.workflow-steps li {
  flex: 1;
  text-align: center;
  padding: 20px 12px;
  position: relative;
  counter-increment: step;
}

.workflow-steps li::before {
  content: counter(step);
  display: block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  background: #1d5fa0;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 auto 12px;
}

.workflow-steps li::after {
  content: "";
  position: absolute;
  top: 40px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: #d0d8e0;
  z-index: -1;
}

.workflow-steps li:last-child::after {
  display: none;
}

.workflow-steps li span {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.4;
}

/* === Data Flow Diagram === */
.data-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.data-flow-node {
  background: #f4f7fa;
  border: 2px solid #d0d8e0;
  border-radius: 8px;
  padding: 20px 28px;
  text-align: center;
  font-weight: 600;
  color: #1a2332;
  min-width: 160px;
}

.data-flow-node.highlight {
  border-color: #1d5fa0;
  background: #eaf2fb;
}

.data-flow-arrow {
  font-size: 1.6rem;
  color: #1d5fa0;
  font-weight: 700;
}

.data-flow-excluded {
  text-align: center;
  margin-top: 16px;
  padding: 12px 20px;
  background: #fef3f2;
  border: 1px solid #f0bbb5;
  border-radius: 6px;
  color: #9b2c20;
  font-weight: 600;
  font-size: 0.95rem;
}

/* === Getting Started Steps === */
.getting-started ol {
  padding-left: 0;
  list-style: none;
  counter-reset: gs-step;
}

.getting-started ol > li {
  counter-increment: gs-step;
  margin-bottom: 32px;
  padding-left: 48px;
  position: relative;
}

.getting-started ol > li::before {
  content: counter(gs-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  background: #1d5fa0;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.getting-started ol > li h3 {
  margin-bottom: 8px;
}

.getting-started ul {
  margin-top: 8px;
  padding-left: 20px;
  color: #4b5c6e;
}

.getting-started ul li {
  margin-bottom: 4px;
}

/* === Screenshot Gallery === */
.screenshot-feature {
  margin: 32px 0;
}

.screenshot-feature img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d0d8e0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.screenshot-caption {
  margin-top: 16px;
  text-align: center;
}

.screenshot-caption strong {
  display: block;
  font-size: 1.1rem;
  color: #0f1b2d;
  margin-bottom: 4px;
}

.screenshot-caption span {
  font-size: 0.95rem;
  color: #4b5c6e;
  line-height: 1.5;
}

.screenshot-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.screenshot-grid.two-up {
  grid-template-columns: 1fr 1fr;
}

.screenshot-grid.three-up {
  grid-template-columns: 1fr 1fr 1fr;
}

.screenshot-group {
  margin-top: 40px;
}

.screenshot-group:first-child {
  margin-top: 16px;
}

.screenshot-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a8a9e;
  margin-bottom: 12px;
}

.screenshot-card {
  margin: 0;
}

.screenshot-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #d0d8e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}

.screenshot-card img:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.screenshot-card figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #4b5c6e;
  text-align: center;
  line-height: 1.4;
}

/* === Carousel Lightbox === */
.carousel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-overlay[hidden] {
  display: none;
}

.carousel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.carousel-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.carousel-caption {
  margin-top: 20px;
  text-align: center;
  max-width: 600px;
}

.carousel-title {
  display: block;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.carousel-desc {
  color: #a0aec0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.carousel-counter {
  margin-top: 12px;
  color: #6b7a8d;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.carousel-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1001;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
  padding: 4px 8px;
}

.carousel-close:hover {
  opacity: 1;
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  padding: 16px;
  line-height: 1;
  user-select: none;
}

.carousel-prev:hover,
.carousel-next:hover {
  opacity: 1;
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

@media (max-width: 768px) {
  .carousel-prev,
  .carousel-next {
    font-size: 2rem;
    padding: 8px;
  }

  .carousel-prev { left: 4px; }
  .carousel-next { right: 4px; }
}

/* === Technical Details === */
.tech-list {
  list-style: none;
  padding: 0;
}

.tech-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: #374151;
}

.tech-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: #27854a;
  font-weight: 700;
}

/* === Footer === */
footer {
  padding: 40px 0;
  border-top: 1px solid #e8ecf0;
  text-align: center;
  color: #8896a7;
  font-size: 0.85rem;
}

footer a {
  color: #8896a7;
}

/* === Responsive === */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .hero-split {
    gap: 20px;
  }

  .hero-mascot {
    width: 72px;
  }

  .hero-sub {
    font-size: 0.95rem;
  }

  .tab-btn {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  section {
    padding: 48px 0;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

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

  .workflow-steps {
    flex-direction: column;
    gap: 0;
  }

  .workflow-steps li::after {
    display: none;
  }

  .workflow-steps li {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
  }

  .workflow-steps li::before {
    margin: 0;
    flex-shrink: 0;
  }

  .data-flow {
    flex-direction: column;
  }

  .data-flow-arrow {
    transform: rotate(90deg);
  }

  .screenshot-grid.two-up,
  .screenshot-grid.three-up {
    grid-template-columns: 1fr;
  }

  .hipaa-callout {
    padding: 28px 24px;
  }

  .cost-table {
    font-size: 0.85rem;
  }

  .cost-table th,
  .cost-table td {
    padding: 10px 8px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .instruments-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}
