/* Pet Med Tracker — Push-through design tokens & typography
 * Reference: docs/design/DESIGN.md
 * Self-hosted Atkinson Hyperlegible Next (SIL OFL 1.1, /fonts/OFL.txt)
 */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/AtkinsonHyperlegibleNext-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Light tokens from DESIGN.md */
  --backing: #EDEFF2;
  --label-surface: #FFFFFF;
  --label-separator: #DADEE3;
  --foil: #DFE3E8;
  --foil-edge: #7D8792;
  --button-fill: #E6E9ED;
  --ink: #000000;
  --on-ink: #FFFFFF;
  --ink2: #545B63;
  --given: #12723A;
  --low-bg: #E9ECEF;
  --low-fg: #545B63;
  --icon-backing: #EDEFF2;
  --screen-bg: #EDEFF2;

  /* Radius by meaning (no capsules for buttons/tags) */
  --radius-label: 16px;
  --radius-box: 12px;
  --radius-button-sm: 8px;
  --radius-tag: 4px;

  --font-app: "Atkinson Hyperlegible Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --backing: #000000;
    --label-surface: #1E1B18;
    --label-separator: #34302B;
    --foil: #3A3631;
    --foil-edge: #8E877E;
    --button-fill: #33302B;
    --ink: #F3EFE9;
    --on-ink: #000000;
    --ink2: #ABA59C;
    --given: #4ED487;
    --low-bg: #2A2723;
    --low-fg: #ABA59C;
    --icon-backing: #121110;
    --screen-bg: #121110;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ink2: #3A4047;
    --foil-edge: #5C6670;
    --label-separator: #B5BCC4;
    --low-fg: #3A4047;
  }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --ink2: #C9C3BA;
    --foil-edge: #ABA39A;
    --label-separator: #4A453F;
    --low-fg: #C9C3BA;
  }
}

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

html {
  background-color: var(--backing);
  color: var(--ink);
  font-family: var(--font-app);
  font-size: 17px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--backing);
  color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.78;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-tag);
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--on-ink);
  padding: 8px 14px;
  border-radius: var(--radius-button-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
  z-index: 100;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.container--wide {
  max-width: 1040px;
}

/* Header */
.site-header {
  padding-top: 20px;
  padding-bottom: 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

.brand:hover {
  opacity: 0.85;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--label-separator);
  background-color: var(--icon-backing);
  display: block;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink2);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--ink);
}

/* Main content */
.site-main {
  flex: 1 0 auto;
  padding-top: 8px;
  padding-bottom: 40px;
}

.label-card {
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  padding: 28px 28px;
}

/* Neutral sticker / tag (radius 4, never capsule, never amber) */
.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-tag);
  background-color: var(--low-bg);
  color: var(--low-fg);
  border: 1px solid var(--label-separator);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  vertical-align: middle;
}

.tag--pro {
  background-color: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

/* Buttons (radius 12, never capsule, never amber) */
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  border-radius: var(--radius-box);
  font-family: var(--font-app);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.86;
}

.btn-primary {
  background-color: var(--ink);
  color: var(--on-ink);
}

.btn-secondary {
  background-color: var(--button-fill);
  color: var(--ink);
  border-color: var(--label-separator);
}

.btn-sm {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--radius-button-sm);
  font-size: 0.88rem;
}

.store-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-box);
  background-color: var(--ink);
  color: var(--on-ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.store-status-sub {
  font-weight: 500;
  opacity: 0.82;
}

/* Marketing sections */
.section {
  margin-top: 36px;
}

.section-header {
  margin-bottom: 18px;
  max-width: 680px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.018em;
}

.section-lead {
  margin: 0;
  color: var(--ink2);
  font-size: 1rem;
  line-height: 1.5;
}

/* Hero (marketing landing) */
.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 32px;
  align-items: center;
  padding: 32px;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  border: 1px solid var(--label-separator);
  background-color: var(--icon-backing);
  display: block;
  flex-shrink: 0;
}

.hero-meta-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.hero-meta-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--ink2);
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-size: 2.35rem;
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.024em;
}

.hero-lead {
  margin: 0 0 22px;
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink);
}

.hero-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--given);
}

.hero-disclaimer {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink2);
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-shot-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  padding: 8px;
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  background-color: var(--screen-bg);
  cursor: pointer;
  text-align: center;
}

.hero-shot-btn:hover {
  border-color: var(--ink);
}

.hero-shot-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 660 / 1434;
  border-radius: 10px;
}

.hero-shot-caption {
  margin: 10px 0 0;
  max-width: 300px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ink2);
  text-align: center;
}

.check-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.info-card {
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.3;
  font-weight: 700;
}

.info-card p {
  margin: 0;
  color: var(--ink2);
  font-size: 0.94rem;
  line-height: 1.55;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-button-sm);
  background-color: var(--button-fill);
  border: 1px solid var(--label-separator);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

/* Screenshots gallery */
.screens-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.screen-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 14px;
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  text-align: left;
  font-family: var(--font-app);
  color: var(--ink);
  cursor: pointer;
}

.screen-card:hover {
  border-color: var(--ink);
}

.screen-thumb-wrap {
  width: 100%;
  background-color: var(--screen-bg);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-box);
  overflow: hidden;
  margin-bottom: 12px;
}

.screen-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 440 / 956;
}

.screen-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.screen-summary {
  display: block;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink2);
  margin-bottom: 10px;
  flex: 1 0 auto;
}

.screen-open-hint {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Native <dialog> lightbox */
.lightbox-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  background-color: var(--label-surface);
  color: var(--ink);
  overflow: hidden;
}

.lightbox-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.68);
}

.lightbox-shell {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  max-height: calc(100vh - 28px);
}

.lightbox-media {
  background-color: var(--screen-bg);
  border-right: 1px solid var(--label-separator);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-img {
  display: block;
  max-height: calc(100vh - 72px);
  width: auto;
  max-width: 100%;
  border-radius: var(--radius-box);
}

.lightbox-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.lightbox-counter {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink2);
}

.lightbox-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  line-height: 1.22;
  font-weight: 800;
}

.lightbox-pro-note {
  margin: 0 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink2);
}

.lightbox-paragraphs {
  flex: 1 0 auto;
}

.lightbox-paragraphs p {
  margin: 0 0 12px;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--ink);
}

.lightbox-sample-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--ink2);
}

.lightbox-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--label-separator);
}

/* Privacy highlight card */
.privacy-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.privacy-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--given);
  font-weight: 700;
  font-size: 0.98rem;
}

.privacy-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--label-separator);
}

.privacy-point h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 700;
}

.privacy-point p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink2);
}

/* Free vs Pro comparison & pricing */
.plan-card {
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.plan-card--pro {
  border-color: var(--ink);
}

.plan-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--label-separator);
}

.plan-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.plan-sub {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink2);
}

.plan-list {
  margin: 0;
  padding: 0 0 0 20px;
  font-size: 0.94rem;
  line-height: 1.55;
}

.plan-list li {
  margin-bottom: 8px;
}

.plan-list li:last-child {
  margin-bottom: 0;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.price-card {
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-box);
  padding: 18px 20px;
}

.price-name {
  margin: 0 0 4px;
  font-size: 0.96rem;
  font-weight: 700;
}

.price-amount {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.price-desc {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.48;
  color: var(--ink2);
}

.pricing-footnote {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink2);
}

/* FAQ */
.faq-list {
  background-color: var(--label-surface);
  border: 1px solid var(--label-separator);
  border-radius: var(--radius-label);
  padding: 8px 24px;
}

.faq-item {
  padding: 16px 0;
  border-top: 1px solid var(--label-separator);
}

.faq-item:first-child {
  border-top: none;
}

.faq-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}

.faq-item p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink2);
}

.section-footer-link {
  margin-top: 14px;
}

/* Bottom CTA card */
.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.cta-card h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.cta-card p {
  margin: 0;
  color: var(--ink2);
  font-size: 0.94rem;
}

/* Document pages (/privacy, /support, /404) */
.doc-content h1 {
  margin: 0 0 12px;
  font-size: 1.88rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.doc-content h1 + p.effective-date {
  margin: 0 0 20px;
  color: var(--ink2);
  font-size: 0.94rem;
  font-weight: 600;
}

.doc-content h2 {
  margin: 28px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--label-separator);
  font-size: 1.24rem;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.doc-content p {
  margin: 0 0 14px;
}

.doc-content p:last-child,
.doc-content ul:last-child,
.doc-content ol:last-child {
  margin-bottom: 0;
}

.doc-content ul,
.doc-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc-content li {
  margin-bottom: 8px;
}

.doc-content li:last-child {
  margin-bottom: 0;
}

.doc-content strong {
  font-weight: 700;
}

.doc-content .qa-question {
  margin: 18px 0 6px;
  font-weight: 700;
}

.doc-content h2 + .qa-question {
  margin-top: 8px;
}

/* Footer */
.site-footer {
  padding-top: 8px;
  padding-bottom: 36px;
  color: var(--ink2);
  font-size: 0.82rem;
  line-height: 1.6;
}

.footer-inner {
  border-top: 1px solid var(--label-separator);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-links a {
  color: var(--ink2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.footer-links a:hover {
  color: var(--ink);
  opacity: 1;
}

.footer-link-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-app);
  font-size: inherit;
  line-height: inherit;
  color: var(--ink2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.footer-link-btn:hover {
  color: var(--ink);
}

.footer-meta {
  margin: 0;
  color: var(--ink2);
}

/* Cookie consent banner (Push-through card, no capsules, no amber) */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  max-width: 720px;
  margin: 0 auto;
  background-color: var(--label-surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-label);
  padding: 16px 20px;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  margin: 0;
  flex: 1 1 320px;
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--ink);
}

.cookie-banner-text strong {
  font-weight: 700;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: 1.95rem;
  }

  .grid-3,
  .screens-grid,
  .privacy-points,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .lightbox-media {
    border-right: none;
    border-bottom: 1px solid var(--label-separator);
    padding: 14px;
  }

  .lightbox-img {
    max-height: 52vh;
  }
}

@media (max-width: 560px) {
  .label-card,
  .hero-card {
    padding: 20px 18px;
  }

  .hero-copy h1 {
    font-size: 1.68rem;
  }

  .section-header h2 {
    font-size: 1.42rem;
  }

  .doc-content h1 {
    font-size: 1.58rem;
  }

  .grid-3,
  .grid-2,
  .screens-grid,
  .privacy-points,
  .price-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .store-status,
  .action-group .btn {
    width: 100%;
    justify-content: center;
  }

  .faq-list {
    padding: 4px 18px;
  }
}
