/* ===================================================
   BedTaxJP Landing Page — Styles
   =================================================== */

/* --- Design Tokens --- */
:root {
  /* Brand colors */
  --dark-navy: #1B2340;
  --navy: #243044;
  --navy-light: #2C3A54;
  --gold: #D4A843;
  --gold-light: #E8C96A;
  --gold-dim: rgba(212, 168, 67, 0.15);
  --slate-blue: #3D5A80;
  --action-blue: #3B8DD6;
  --action-blue-hover: #2D7AC0;
  --teal: #0F6E56;
  --light-teal: #7ECDB8;
  --white: #FFFFFF;
  --off-white: #F8F9FB;
  --gray-light: #E5E7EB;
  --gray-mid: #9CA3AF;
  --text: #2D3748;
  --text-secondary: #6B7280;
  --text-on-dark: rgba(255, 255, 255, 0.8);

  /* Layout — vertical rhythm based on 6rem sections */
  --section-py: 6rem;
  --section-py-mobile: 4rem;
  --nav-height: 72px;
  --container-max: 1140px;
  --container-narrow: 780px;
  --container-px: 2rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease-out;
  --transition-reveal: 400ms ease-out;
}

/* --- Reset & Base --- */
/* Override WordPress/Kadence theme styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Poppins', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif;
  font-size: clamp(1rem, 1vw + 0.75rem, 1.125rem);
  line-height: 1.6;
  color: var(--text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

/* Override Kadence theme heading styles — !important needed to beat theme specificity */
body h1, body h2, body h3, body h4, body h5, body h6 {
  font-family: 'Poppins', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
}

body h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 3.75rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
  font-weight: 600 !important;
}
body h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.75rem) !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
  font-weight: 600 !important;
}
body h3 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem) !important;
  line-height: 1.3 !important;
  font-weight: 600 !important;
}

body p {
  font-family: 'Poppins', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif !important;
  margin: 0 !important;
}

body a {
  font-family: 'Poppins', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP', sans-serif !important;
}

body {
  background: var(--off-white) !important;
  color: var(--text) !important;
}

/* Override Kadence theme layout styles */
.entry-content-wrap,
.content-wrap,
.site-main,
.content-area,
.site-container,
.entry.single-entry,
.entry-content,
.site-inner-content-wrap {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
/* Kill Kadence content area margins */
.content-area {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
/* Kill Kadence header/footer if they leak through */
#masthead, .site-header, .site-footer-wrap {
  display: none !important;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--action-blue); text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--action-blue);
  outline-offset: 2px;
}

/* --- Language Toggle --- */
/* Default: hide Japanese, show English */
span[lang="ja"], p[lang="ja"] { display: none; }
/* When switched to Japanese: hide English, show Japanese */
html.lang-ja span[lang="en"], html.lang-ja p[lang="en"] { display: none; }
html.lang-ja span[lang="ja"] { display: inline; }
html.lang-ja p[lang="ja"] { display: block; }

/* --- Japanese-specific typography adjustments --- */
/* Japanese reads heavier than Latin at the same weight; line-height needs more air */
html.lang-ja body {
  line-height: 1.75;
}
html.lang-ja body h1,
html.lang-ja body h2,
html.lang-ja body h3 {
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}
html.lang-ja .hero__subtitle,
html.lang-ja .changing__body p,
html.lang-ja .pain-card p,
html.lang-ja .step__content p,
html.lang-ja .trust__content p {
  line-height: 1.8;
}
/* Japanese hero needs wider container: title is 13 chars and won't fit 640px at max font size */
html.lang-ja .hero__content {
  max-width: 880px;
}
html.lang-ja .hero__subtitle {
  max-width: 880px;
}

/* Japanese line-break improvements:
   - line-break: strict → proper JP typography rules (no 、。 at line start)
   - text-wrap: pretty → balances last line, reduces orphan characters
   - word-break: auto-phrase → smart phrase-based breaking (Chromium-based browsers) */
html.lang-ja body {
  line-break: strict;
  word-break: auto-phrase;
}
html.lang-ja h1,
html.lang-ja h2,
html.lang-ja h3,
html.lang-ja .hero__subtitle,
html.lang-ja .changing__body p,
html.lang-ja .pain-card p,
html.lang-ja .step__content p,
html.lang-ja .trust__content p,
html.lang-ja .value-prop__text {
  text-wrap: pretty;
}

/* Slightly widen key Japanese text containers to reduce orphan characters */
html.lang-ja .changing__body {
  max-width: 860px;
}
html.lang-ja .steps {
  max-width: 800px;
}
html.lang-ja .value-prop__text {
  max-width: 720px;
}

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}
.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Typography --- */
/* Base heading styles defined above with body prefix for specificity */

.overline {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}
.section__header p {
  max-width: 60ch;
  margin: 1rem auto 0;
  color: var(--text-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--action-blue);
  color: var(--white);
  padding: 0.75rem 2rem;
  border-radius: 3px;
}
.btn--primary:hover { background: var(--action-blue-hover); }

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

.btn--white {
  background: var(--white);
  color: var(--action-blue);
  padding: 1rem 2.5rem;
  border-radius: 3px;
  font-size: 1.05rem;
}
.btn--white:hover { background: #F0F4F8; }

.btn--outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
  padding: 0.75rem 2rem;
  border-radius: 3px;
}
.btn--outline:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background var(--transition-base), border-color var(--transition-base);
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(27, 35, 64, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav__logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}
.nav__logo span { color: var(--gold); }

.nav__right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.lang-toggle__btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.lang-toggle__btn.active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
}
.lang-toggle__btn:hover:not(.active) {
  color: rgba(255,255,255,0.8);
}

/* --- Hero --- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--dark-navy) 0%, var(--navy) 100%);
  padding: calc(var(--nav-height) + 5rem) 0 5rem;
  color: var(--white);
  overflow: hidden;
}

.hero__content {
  max-width: 640px;
}
.hero h1 {
  margin-bottom: 1.5rem;
}
.hero__subtitle {
  font-size: clamp(1rem, 1.2vw + 0.6rem, 1.15rem);
  line-height: 1.7;
  color: var(--text-on-dark);
  margin-bottom: 2.5rem;
  max-width: 540px;
}
.hero__cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Date badge */
.date-badge {
  position: absolute;
  top: calc(var(--nav-height) + 3rem);
  right: max(2rem, calc((100vw - var(--container-max)) / 2 + var(--container-px)));
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  text-align: center;
  color: var(--gold);
}
.date-badge__date {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}
.date-badge__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

/* Accent stripe */
.hero__stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--action-blue), var(--teal));
}

/* --- Section Spacing --- */
.section {
  padding: var(--section-py) 0;
}
/* For sections that follow a related section — reduced top, still generous */
.section--compact-top {
  padding-top: 3rem;
}
.section--dark {
  background: linear-gradient(180deg, var(--dark-navy) 0%, var(--navy) 100%);
  color: var(--white);
}
.section--dark .overline { color: var(--gold); }
.section--dark p { color: var(--text-on-dark); }
.section--dark h2, .section--dark h3 { color: var(--white); }

.section--teal {
  background: var(--teal);
  color: var(--white);
}

/* --- What's Changing --- */
.changing__body {
  max-width: 720px;
}
.changing__body p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.changing__callout {
  font-size: clamp(1.05rem, 1.5vw + 0.5rem, 1.2rem);
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
}

/* --- Pain Points --- */
.pain-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.pain-card {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  padding: 2rem;
  transition: box-shadow var(--transition-base);
}
.pain-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.pain-card h3 {
  color: var(--text);
  margin-bottom: 0.75rem;
}
.pain-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Value Prop Bridge --- */
.value-prop {
  text-align: center;
  padding: 4.5rem 0;
  background: var(--off-white);
}
.value-prop__text {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.6rem);
  font-weight: 500;
  color: var(--text);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

/* --- Subsidy Bar --- */
.subsidy-bar {
  background: var(--dark-navy);
  padding: 2.25rem 0;
  text-align: center;
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
}
.subsidy-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}
.subsidy-bar__yen {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.subsidy-bar__text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
}
.subsidy-bar__text strong {
  color: var(--gold);
}

/* --- How It Works (Steps) --- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 680px;
  margin: 0 auto;
}
.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.step__number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--slate-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}
.step__content h3 {
  margin-bottom: 0.4rem;
}
.step__content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* --- Showcase Placeholder --- */
.showcase {
  padding: var(--section-py) 0;
}
.showcase__frame {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 3rem auto 0;
  aspect-ratio: 16 / 10; /* Must match .showcase-wrapper in bedtaxjp_showcase.html */
  overflow: hidden;
  border-radius: 12px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 10px 30px -5px rgba(0, 0, 0, 0.12),
    0 25px 60px -12px rgba(27, 35, 64, 0.2);
}
.showcase__frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  overflow: hidden;
}
.showcase__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-on-dark);
  gap: 1rem;
}
.showcase__placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.showcase__placeholder-icon svg {
  width: 28px;
  height: 28px;
  opacity: 0.5;
}
.showcase__placeholder-text {
  font-size: 0.9rem;
  opacity: 0.4;
}

/* --- Tax Tiers --- */
.tiers-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  font-size: 0.9rem;
}
.tiers-table th,
.tiers-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tiers-table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.tiers-table td {
  color: var(--text-on-dark);
}
.tiers-table .tier-exempt {
  color: var(--light-teal);
  font-style: italic;
}
.tiers-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 700px;
  margin: 0 auto;
}
.tiers-table-note {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

/* --- Checklist --- */
.checklist {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 1.25rem 4rem;
  justify-content: center;
  max-width: 740px;
  margin: 0 auto;
}
.checklist__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.checklist__check {
  flex-shrink: 0;
  color: var(--action-blue);
  width: 20px;
  height: 20px;
}
.section--dark .checklist__check {
  color: var(--light-teal);
}

/* --- PMS Grid --- */
.pms-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pms-tag {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 3px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color var(--transition-fast);
}
.pms-tag:hover {
  border-color: var(--action-blue);
}
.pms-tag--fallback {
  background: var(--off-white);
  border-style: dashed;
  color: var(--text-secondary);
}

/* --- Trust / Designed Locally --- */
.trust__content {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.trust__content p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.trust__bold {
  font-size: clamp(1.1rem, 1.5vw + 0.5rem, 1.25rem);
  font-weight: 600;
  color: var(--text);
}

/* --- Final CTA --- */
.cta-final {
  background: linear-gradient(135deg, var(--dark-navy) 0%, var(--navy) 100%);
  padding: var(--section-py) 0;
  text-align: center;
  color: var(--white);
}
.cta-final h2 {
  margin-bottom: 1rem;
}
.cta-final__sub {
  color: var(--text-on-dark);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}
.cta-final__buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Footer --- */
.footer {
  background: var(--dark-navy);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2.5rem 0;
  color: var(--text-on-dark);
  font-size: 0.85rem;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer__logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}
.footer__logo span { color: var(--gold); }
.footer__links {
  display: flex;
  gap: 1.5rem;
}
.footer__links a {
  color: var(--text-on-dark);
  transition: color var(--transition-fast);
}
.footer__links a:hover { color: var(--white); }

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 50ms; }
.reveal:nth-child(3) { transition-delay: 100ms; }
.reveal:nth-child(4) { transition-delay: 150ms; }
.reveal:nth-child(5) { transition-delay: 200ms; }
.reveal:nth-child(6) { transition-delay: 250ms; }
.reveal:nth-child(7) { transition-delay: 300ms; }
.reveal:nth-child(8) { transition-delay: 350ms; }

/* --- Mobile Sticky CTA --- */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(27, 35, 64, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem var(--container-px);
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: translateY(100%);
  transition: transform 300ms ease;
}
.mobile-cta.visible {
  transform: translateY(0);
}
.mobile-cta .btn {
  width: 100%;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  .date-badge {
    position: relative;
    top: auto;
    right: auto;
    display: inline-flex;
    flex-direction: column;
    margin-bottom: 2rem;
  }
  .checklist {
    grid-template-columns: 1fr;
    max-width: 340px;
    gap: 1rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --section-py: var(--section-py-mobile);
    --container-px: 1.25rem;
  }
  .hero {
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 3rem;
  }
  .value-prop {
    padding: 3rem 0;
  }
  .nav__cta-desktop { display: none; }
  .mobile-cta { display: block; }
  .pain-cards {
    grid-template-columns: 1fr;
  }
  .step {
    gap: 1rem;
  }
  .step__number {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
  .subsidy-bar__inner {
    flex-direction: column;
    gap: 0.5rem;
  }
  .section--compact-top {
    padding-top: 2rem;
  }
  .footer .container {
    flex-direction: column;
    text-align: center;
  }
  .footer__links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
