/* ==========================================================================
   Warm Editorial Minimalism — Shared Stylesheet
   Zero external CSS/JS dependencies. Mobile-native & high-contrast compliant.
   ========================================================================== */

:root {
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Default (Hub / Neutral Editorial) */
  --bg-canvas: #FAF8F4;
  --surface-box: #FFFFFF;
  --surface-input: #FFFFFF;
  --text-primary: #1D1C19;
  --text-muted: #524E47;
  --text-placeholder: #726C63;
  --accent: #2D6A4F;
  --accent-btn: #265C44;
  --accent-hover: #1E4936;
  --accent-ink: #FFFFFF;
  --secondary: #2D6A4F;
  --secondary-ink: #2D6A4F;
  --highlight-bg: rgba(45, 106, 79, 0.13);
  --border-subtle: rgba(29, 28, 25, 0.12);
  --border-strong: rgba(29, 28, 25, 0.24);
  --focus-ring: rgba(45, 106, 79, 0.32);
  --error-ink: #B42318;
  --error-bg: rgba(180, 35, 24, 0.08);
  --box-shadow: 0 14px 36px -18px rgba(29, 28, 25, 0.14);
  --btn-secondary-bg: rgba(29, 28, 25, 0.05);
  --btn-secondary-hover: rgba(29, 28, 25, 0.1);
}

/* Niche 1: CalmPaws Daily */
body[data-niche="dogs"] {
  --bg-canvas: #FBF8F3;
  --surface-box: #FFFFFF;
  --surface-input: #FFFFFF;
  --text-primary: #1E1B18;
  --text-muted: #544E46;
  --text-placeholder: #736B61;
  --accent: #C2592B;
  --accent-btn: #BA5022;
  --accent-hover: #A2431B;
  --accent-ink: #FFFFFF;
  --secondary: #2D6A4F;
  --secondary-ink: #2D6A4F;
  --highlight-bg: rgba(194, 89, 43, 0.15);
  --border-subtle: rgba(30, 27, 24, 0.11);
  --border-strong: rgba(30, 27, 24, 0.24);
  --focus-ring: rgba(194, 89, 43, 0.28);
  --box-shadow: 0 16px 38px -18px rgba(56, 34, 18, 0.15);
  --btn-secondary-bg: rgba(45, 106, 79, 0.09);
  --btn-secondary-hover: rgba(45, 106, 79, 0.16);
}

/* Niche 2: Eastern Mobility Rituals */
body[data-niche="mobility"] {
  --bg-canvas: #F6F4EE;
  --surface-box: #FFFFFF;
  --surface-input: #FFFFFF;
  --text-primary: #18221D;
  --text-muted: #49564E;
  --text-placeholder: #68756D;
  --accent: #1E4D3B;
  --accent-btn: #1E4D3B;
  --accent-hover: #15392B;
  --accent-ink: #FFFFFF;
  --secondary: #9A6B32;
  --secondary-ink: #7A5222;
  --highlight-bg: rgba(154, 107, 50, 0.16);
  --border-subtle: rgba(24, 34, 29, 0.11);
  --border-strong: rgba(24, 34, 29, 0.24);
  --focus-ring: rgba(30, 77, 59, 0.28);
  --box-shadow: 0 16px 38px -18px rgba(24, 34, 29, 0.14);
  --btn-secondary-bg: rgba(30, 77, 59, 0.08);
  --btn-secondary-hover: rgba(30, 77, 59, 0.15);
}

/* Niche 3: StillNight Rituals (Dark Slate, >= 7:1 contrast) */
body[data-niche="sleep"] {
  --bg-canvas: #111622;
  --surface-box: #1A2234;
  --surface-input: #111725;
  --text-primary: #F3EFE6;
  --text-muted: #C8CEDB;
  --text-placeholder: #9AA4B8;
  --accent: #E5A95C;
  --accent-btn: #E5A95C;
  --accent-hover: #EEB973;
  --accent-ink: #111622;
  --secondary: #E5A95C;
  --secondary-ink: #E5A95C;
  --highlight-bg: rgba(229, 169, 92, 0.19);
  --border-subtle: rgba(243, 239, 230, 0.14);
  --border-strong: rgba(243, 239, 230, 0.28);
  --focus-ring: rgba(229, 169, 92, 0.35);
  --error-ink: #FCA5A5;
  --error-bg: rgba(248, 113, 113, 0.14);
  --box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.58);
  --btn-secondary-bg: rgba(243, 239, 230, 0.09);
  --btn-secondary-hover: rgba(243, 239, 230, 0.16);
}

/* Niche 4: PureHabits Daily */
body[data-niche="wellness"] {
  --bg-canvas: #F7FAF8;
  --surface-box: #FFFFFF;
  --surface-input: #FFFFFF;
  --text-primary: #172424;
  --text-muted: #465858;
  --text-placeholder: #647676;
  --accent: #0F5C5C;
  --accent-btn: #0F5C5C;
  --accent-hover: #0B4747;
  --accent-ink: #FFFFFF;
  --secondary: #0F5C5C;
  --secondary-ink: #0F5C5C;
  --highlight-bg: rgba(15, 92, 92, 0.13);
  --border-subtle: rgba(23, 36, 36, 0.11);
  --border-strong: rgba(23, 36, 36, 0.24);
  --focus-ring: rgba(15, 92, 92, 0.28);
  --box-shadow: 0 16px 38px -18px rgba(15, 60, 60, 0.13);
  --btn-secondary-bg: rgba(15, 92, 92, 0.08);
  --btn-secondary-hover: rgba(15, 92, 92, 0.15);
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body[data-niche="dogs"],
body[data-niche="mobility"],
body[data-niche="sleep"],
body[data-niche="wellness"] {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body[data-niche="dogs"] main,
body[data-niche="mobility"] main,
body[data-niche="sleep"] main,
body[data-niche="wellness"] main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

a {
  color: inherit;
  touch-action: manipulation;
}

button,
[role="button"] {
  font-family: inherit;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Accessibility */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Container */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

/* Flat Editorial Header (1 single row) */
.site-header {
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.92rem, 2.5vw, 1rem);
  letter-spacing: -0.015em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

.header-link {
  font-size: clamp(0.82rem, 2.2vw, 0.9rem);
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.nowrap {
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .header-link:hover {
    color: var(--text-primary);
    background-color: var(--btn-secondary-bg);
  }
}

/* Hero Section — Zero Outer Card Boxing */
.hero {
  padding-top: clamp(10px, 2.4vw, 32px);
  padding-bottom: clamp(24px, 4.5vw, 44px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 3.8vw, 56px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  }
}

/* Left Column: Naked on --bg-canvas */
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary-ink);
  letter-spacing: 0.01em;
}

.eyebrow-bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--secondary);
  flex-shrink: 0;
}

.hero-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 4.1vw, 2.95rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-title .hl {
  background-color: var(--highlight-bg);
  padding: 0.03em 0.26em;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero-lead {
  margin: 0 0 18px;
  max-width: 58ch;
  font-size: clamp(0.98rem, 1.4vw, 1.0625rem);
  line-height: 1.55;
  color: var(--text-muted);
}

/* THE ONE Interactive Surface Box */
.optin-box {
  background-color: var(--surface-box);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: clamp(16px, 3vw, 22px);
  box-shadow: var(--box-shadow);
}

.optin-head {
  margin: 0 0 12px;
}

.optin-kicker {
  margin: 0 0 2px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--secondary-ink);
}

.optin-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.optin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-primary);
  background-color: var(--surface-input);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
  appearance: none;
}

.email-input::placeholder {
  color: var(--text-placeholder);
}

.email-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.email-input[aria-invalid="true"] {
  border-color: var(--error-ink);
}

.field-error {
  margin: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background-color: var(--error-bg);
  color: var(--error-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
}

.field-error[hidden] {
  display: none;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  background-color: var(--accent-btn);
  color: var(--accent-ink);
  font-size: clamp(0.85rem, 3.55vw, 1rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 130ms var(--ease-out), background-color 150ms var(--ease-out), opacity 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .cta-btn:hover {
    background-color: var(--accent-hover);
  }
}

.cta-btn:active {
  transform: scale(0.97);
}

.cta-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}

.form-note {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Preview Mode In-Place Confirmation (?preview=1) */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: panelReveal 220ms var(--ease-out) both;
}

.preview-panel[hidden] {
  display: none;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: var(--highlight-bg);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary-ink);
}

.preview-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}

.preview-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.preview-meta strong {
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.preview-url-box {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background-color: var(--btn-secondary-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-url-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.preview-hoplink {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gift-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border-strong);
  background-color: transparent;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 130ms var(--ease-out), background-color 150ms var(--ease-out);
}

.gift-download-btn[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .gift-download-btn:hover {
    background-color: var(--btn-secondary-bg);
  }
}

.gift-download-btn:active {
  transform: scale(0.97);
}

/* 3 Naked Checkmark Commitments Directly on --bg-canvas */
.trust-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.925rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.trust-check {
  color: var(--secondary-ink);
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1.45;
}

/* Right Column: Single Editorial Hero Image */
.hero-media {
  min-width: 0;
}

.hero-figure {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--box-shadow);
  background-color: var(--surface-box);
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 1200 / 670;
  object-fit: cover;
}

/* Hub Page Specifics */
.hub-hero {
  padding-top: clamp(16px, 3vw, 36px);
  padding-bottom: 24px;
}

.hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-bottom: 48px;
}

@media (min-width: 760px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background-color: var(--surface-box);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--box-shadow);
}

.hub-thumb {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.hub-thumb img {
  width: 100%;
  aspect-ratio: 1200 / 670;
  object-fit: cover;
}

.hub-card-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hub-card-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.825rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background-color: transparent;
  transition: transform 130ms var(--ease-out), background-color 140ms var(--ease-out);
}

.hub-pill.primary {
  background-color: var(--accent-btn);
  border-color: var(--accent-btn);
  color: var(--accent-ink);
}

@media (hover: hover) and (pointer: fine) {
  .hub-pill:hover {
    background-color: var(--btn-secondary-bg);
  }
  .hub-pill.primary:hover {
    background-color: var(--accent-hover);
  }
}

.hub-pill:active {
  transform: scale(0.97);
}

/* Legal Pages */
.legal-main {
  padding-top: clamp(16px, 3vw, 36px);
  padding-bottom: 56px;
  max-width: 72ch;
}

.legal-main h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.2;
}

.legal-main h2 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.legal-main p,
.legal-main li {
  color: var(--text-muted);
  line-height: 1.65;
}

/* Clean Editorial Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 22px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

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

.footer-brand {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

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

.footer-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover {
    color: var(--text-primary);
  }
}

.footer-disclosure {
  margin: 0;
  max-width: 78ch;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .preview-panel {
    animation: fadeOnly 180ms ease both;
  }
  @keyframes fadeOnly {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .cta-btn:active,
  .gift-download-btn:active,
  .hub-pill:active {
    transform: none;
  }
}

[hidden] {
  display: none !important;
}
