:root {
  --bg: #f8fafc;
  --fg: #1a1f2e;
  --muted: #5a6b7d;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #0d6efd;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --fast: 200ms;
  --easing: cubic-bezier(0.2, 0.6, 0.3, 1);
  --warm-accent: #0b5ed7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --fg: #e8eaed;
    --muted: #a0a8b8;
    --card: #1a1f2e;
    --border: #2a3441;
    --accent: #0d6efd;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    --warm-accent: #0b5ed7;
  }
}

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

html {
  scroll-behavior: smooth;
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Footer below first screen: main is at least one dynamic viewport tall. */
main {
  flex: 0 1 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: top var(--fast) var(--easing);
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* header / nav — surface contrast like empathy-compass Navbar (bg-card on bg-background) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  padding-top: env(safe-area-inset-top, 0);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  transition:
    color var(--fast) var(--easing),
    opacity var(--fast) var(--easing);
}

.brand:hover {
  color: var(--accent);
}

.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  flex-shrink: 0;
}

.brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text {
  line-height: 1.2;
}

@media (max-width: 480px) {
  .brand-text {
    font-size: 0.95rem;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition:
    background var(--fast) var(--easing),
    border-color var(--fast) var(--easing),
    color var(--fast) var(--easing);
}

.nav-menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-menu-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 16px;
}

.nav-menu-bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    background var(--fast) var(--easing),
    border-color var(--fast) var(--easing),
    color var(--fast) var(--easing);
}

.site-nav a:hover {
  background: var(--bg);
  border-color: var(--border);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav a[aria-current="page"] {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 767px) {
  .nav-menu-toggle {
    display: inline-flex;
  }

  .nav-actions {
    position: relative;
  }

  .site-nav {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: min(240px, calc(100vw - 40px));
    padding: 10px;
    margin: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .nav-actions.is-open .site-nav {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .site-nav a {
    width: 100%;
    text-align: left;
    border-radius: 12px;
  }
}

/* footer — layout aligned with empathy-compass Footer.tsx */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.footer-inner {
  max-width: 64rem; /* ~max-w-5xl */
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-col h2 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.footer-col li {
  margin: 0;
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  transition: color var(--fast) var(--easing);
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-col a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.footer-bottom {
  margin-top: 1rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

.footer-bottom a {
  color: inherit;
  text-decoration: none;
  transition: color var(--fast) var(--easing);
}

.footer-bottom a:hover {
  color: var(--fg);
}

.footer-bottom a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* page shell */
.page-main {
  padding: 32px 0 64px;
}

/* hero */
.hero {
  margin-bottom: 40px;
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.15;
}

.hero .tagline {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
  max-width: 42rem;
}

/* sections */
.section-title {
  font-size: 1.35rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* product grid */
.product-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: inherit;
  transition:
    transform var(--fast) var(--easing),
    border-color var(--fast) var(--easing),
    box-shadow var(--fast) var(--easing);
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-2px);
  border-color: var(--warm-accent);
  box-shadow: 0 12px 32px rgba(13, 110, 253, 0.15);
}

.product-card-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  width: 100%;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.product-card-main:hover {
  color: inherit;
}

.product-card-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.product-card-main h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  align-self: stretch;
  width: 100%;
}

.product-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  align-self: stretch;
  width: 100%;
  text-wrap: balance;
}

.product-card-footer {
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.product-card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.product-card-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.product-card-links a:hover {
  text-decoration: underline;
}

.product-card-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.product-card-sep {
  color: var(--muted);
  user-select: none;
  pointer-events: none;
  padding: 0 2px;
}

.product-card-soon {
  color: var(--muted);
  font-weight: 500;
  cursor: default;
}

.product-thumb {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: contain;
  background: color-mix(in srgb, var(--border) 35%, transparent);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* about */
.prose {
  max-width: 72ch;
}

.prose p {
  margin: 0 0 16px;
}

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

.page-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.bio-section {
  margin-top: 40px;
}

.bio-section h2 {
  font-size: 1.35rem;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.bio-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 720px;
}

@media (min-width: 600px) {
  .bio-card {
    flex-direction: row;
    align-items: flex-start;
  }
}

.bio-avatar {
  width: min(200px, 45vw);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--border) 40%, transparent);
}

.bio-name {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bio-card p {
  margin: 0;
  color: var(--fg);
}

.bio-card .bio-card-footer {
  margin-top: 14px;
  padding-top: 12px;
}

.bio-card .bio-card-footer .product-card-links {
  justify-content: flex-start;
}

/* product detail */
.product-detail {
  max-width: 100%;
}

.product-hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Mobile: title → logo → headline → body (desktop uses grid areas; order reset below) */
.product-hero-brand {
  order: 1;
  padding: 12px 0 0;
  text-align: center;
}

.product-hero-title {
  margin: 0;
  font-size: clamp(1.45rem, 4.2vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg);
}

.product-hero-stack {
  order: 4;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.product-hero-visual {
  order: 2;
  align-self: stretch;
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-hero-headline {
  order: 3;
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  color: var(--accent);
  text-align: center;
}

.product-hero-stack .about-block {
  width: 100%;
  max-width: 42rem;
}

.product-hero-stack .about-block h2 {
  font-size: 0.8rem;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 72%, transparent);
}

.product-hero-stack .about-block p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.product-hero-stack .about-block p + p {
  margin-top: 0.85rem;
}

.product-hero-stack .about-block ul {
  margin: 0.85rem 0;
  padding-left: 1.35rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.product-hero-stack .about-block li {
  margin: 0.25rem 0;
}

.product-hero-stack .cta-row {
  justify-content: center;
  margin-top: 0.25rem;
}

.product-hero-stack .product-detail-store-links {
  margin-top: 0.35rem;
}

/* Stacked layout only — wide layout overrides below in min-width:768px */
.product-detail-logo {
  display: block;
  width: min(50%, 260px);
  max-width: 100%;
  height: auto;
  border-radius: 22px;
  object-fit: contain;
  background: color-mix(in srgb, var(--border) 28%, transparent);
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .product-hero {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.15fr);
    grid-template-areas:
      "brand headline"
      "logo stack";
    align-items: start;
    column-gap: clamp(28px, 5vw, 64px);
    row-gap: 1.35rem;
    padding: 8px 0 clamp(24px, 4vw, 40px);
  }

  .product-hero-brand,
  .product-hero-visual,
  .product-hero-headline,
  .product-hero-stack {
    order: unset;
  }

  .product-hero-brand {
    grid-area: brand;
    padding: 0 0 12px;
    text-align: left;
  }

  .product-hero-title {
    color: var(--fg);
  }

  .product-hero-headline {
    grid-area: headline;
    text-align: left;
    align-self: start;
    padding: 0;
  }

  .product-hero-visual {
    grid-area: logo;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    align-self: start;
  }

  .product-hero-stack {
    grid-area: stack;
    padding: 0;
    text-align: left;
    align-items: stretch;
    gap: 1.35rem;
  }

  .product-hero-stack .about-block h2 {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    text-transform: none;
    margin: 0 0 10px;
    font-weight: 600;
    color: var(--fg);
  }

  .product-hero-stack .about-block p {
    font-size: 1rem;
  }

  .product-hero-stack .about-block ul {
    font-size: 1rem;
  }

  .product-hero-stack .cta-row {
    justify-content: flex-start;
  }

  .product-hero-stack .product-detail-store-links {
    justify-content: flex-start;
  }

  .product-detail-logo {
    width: 75%;
    max-width: 75%;
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  transition:
    transform var(--fast) var(--easing),
    border-color var(--fast) var(--easing),
    box-shadow var(--fast) var(--easing),
    background var(--fast) var(--easing);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--warm-accent);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.12);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--warm-accent);
  border-color: var(--warm-accent);
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.35);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: none;
}

.cta-hint {
  margin: 12px 0 0;
  max-width: 52ch;
  font-size: 0.95rem;
}

.product-detail > .cta-hint {
  margin-top: 1.25rem;
}

.cta-hint code {
  font-size: 0.88em;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
