:root {
  --primary: #a5232f;
  --primary-strong: #9a1f2d;
  --accent-text: #9f1d2c;
  --accent-fill: #a5232f;
  --primary-muted: #fce6eb;
  --background: #f1faee;
  --surface: #ffffff;
  --surface-subtle: #e8f4f8;
  --text: #264653;
  --text-muted: #6b7280;
  --divider: rgba(38, 70, 83, 0.16);
  --shadow: rgba(38, 70, 83, 0.14);
  --shadow-soft: rgba(38, 70, 83, 0.08);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --max-width: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1a1a;
    --surface: #262626;
    --surface-subtle: #333333;
    --text: #ffffff;
    --text-muted: #d1d5db;
    --primary: #ff8a93;
    --accent-text: #ff8a93;
    --accent-fill: #b42335;
    --primary-muted: #4a111a;
    --divider: rgba(255, 255, 255, 0.15);
    --shadow: rgba(0, 0, 0, 0.45);
    --shadow-soft: rgba(0, 0, 0, 0.28);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Noto Sans TC", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

a { color: inherit; text-decoration: none; }

a:focus-visible,
video:focus-visible,
.comparison:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 48px);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(16px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand__icon { width: 40px; height: 40px; border-radius: var(--radius-md); }
.brand__name, .brand__label { display: block; }
.brand__name { font-family: "Noto Sans JP", "Noto Sans TC", sans-serif; font-size: 16px; font-weight: 700; line-height: 1.2; }
.brand__label { color: var(--text-muted); font-size: 12px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { border-radius: 999px; color: var(--text-muted); font-size: 14px; padding: 7px 12px; }
.site-nav a:hover, .site-nav a:focus-visible { background: var(--primary-muted); color: var(--accent-text); }

.hero, .section { margin: 0 auto; max-width: var(--max-width); padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 48px); }
.hero { display: grid; grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr); gap: clamp(40px, 7vw, 84px); min-height: calc(100svh - 69px); align-items: center; }
.eyebrow { color: var(--accent-text); font-size: 13px; font-weight: 700; margin: 0 0 12px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Noto Sans JP", "Noto Sans TC", sans-serif; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.05; margin-bottom: 20px; max-width: 8em; }
h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; margin-bottom: 14px; }
h3 { font-size: clamp(21px, 2.4vw, 28px); line-height: 1.25; margin-bottom: 10px; }
.hero__lead { color: var(--text-muted); font-size: clamp(17px, 1.8vw, 20px); max-width: 35rem; }
.hero__copy { position: relative; z-index: 3; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { align-items: center; border: 1px solid var(--divider); border-radius: var(--radius-md); display: inline-flex; font-weight: 700; min-height: 48px; padding: 0 18px; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.button:hover, .button:focus-visible { transform: translateY(-1px); }
.button--primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #ffffff; }
.button--primary:hover, .button--primary:focus-visible { background: var(--primary-strong); }
.button--secondary { background: var(--surface); color: var(--text); }

.hero__visual { min-height: 620px; position: relative; }
.phone, .screenshot { background: var(--surface); border: 1px solid var(--divider); box-shadow: 0 20px 48px var(--shadow); overflow: hidden; }
.phone { border-radius: 34px; padding: 10px; position: absolute; }
.phone img, .screenshot img { border-radius: inherit; height: auto; width: 100%; }
.phone--front { left: 0; max-width: 330px; top: 0; z-index: 2; }
.phone--back { bottom: 0; max-width: 380px; right: 0; z-index: 1; }

.intro-strip { border-bottom: 1px solid var(--divider); border-top: 1px solid var(--divider); display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 28px; padding-top: 28px; }
.intro-strip div { align-items: baseline; display: grid; gap: 10px; grid-template-columns: auto 1fr; }
.intro-strip p, .section__header p:not(.eyebrow), .step__copy p, .tax-guide__notice, .video-summary, .official-sources > p, .final-cta > p { color: var(--text-muted); }
.intro-strip p { margin: 0; }
.metric, .tax-guide__facts strong { color: var(--primary); font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 700; }
.section__header { max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }

.tax-guide__facts { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 44px; }
.tax-guide__facts article { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-lg); box-shadow: 0 8px 24px var(--shadow-soft); padding: 22px; }
.tax-guide__facts strong { display: block; margin-bottom: 24px; }
.tax-guide__facts h3 { font-size: 21px; }
.tax-guide__facts p { color: var(--text-muted); margin-bottom: 0; }
.comparison { overflow-x: auto; padding-bottom: 6px; }
.comparison h3 { font-size: 22px; }
.comparison table { width: 100%; min-width: 620px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--divider); }
.comparison th, .comparison td { border: 1px solid var(--divider); padding: 15px 16px; text-align: left; vertical-align: top; }
.comparison thead th { background: var(--surface-subtle); font-weight: 700; }
.comparison tbody th { background: color-mix(in srgb, var(--surface-subtle) 62%, var(--surface)); font-weight: 700; }
.tax-guide__notice { margin: 18px 0 0; max-width: 760px; }

.video-section { text-align: center; }
.video-section .section__header { margin-left: auto; margin-right: auto; }
.video-frame { width: min(100%, 360px); margin: 0 auto; overflow: hidden; border: 1px solid var(--divider); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 20px 48px var(--shadow); }
.video-frame video { display: block; width: 100%; height: auto; aspect-ratio: 1206 / 2622; object-fit: contain; }
.video-summary { margin: 20px auto 0; max-width: 620px; }

.walkthrough { display: grid; gap: clamp(48px, 7vw, 88px); }
.step { align-items: center; display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: minmax(260px, 0.74fr) minmax(280px, 1fr); }
.step--reverse { grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.74fr); }
.step--reverse .step__copy { order: 2; }
.step__copy { max-width: 420px; }
.step__number { align-items: center; background: var(--accent-fill); border-radius: 999px; color: #ffffff; display: inline-flex; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 700; height: 36px; justify-content: center; margin-bottom: 18px; width: 36px; }
.screenshot { border-radius: var(--radius-xl); padding: 10px; }

.notes { align-items: start; border-top: 1px solid var(--divider); display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: minmax(260px, 0.7fr) minmax(280px, 1fr); }
.note-list { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }
.note-list li { background: var(--surface); border: 1px solid var(--divider); border-radius: var(--radius-md); box-shadow: 0 8px 24px var(--shadow-soft); color: var(--text-muted); padding: 16px 18px; }
.official-sources { border-top: 1px solid var(--divider); }
.official-sources ul { display: grid; gap: 12px; margin: 0 0 20px; padding-left: 1.25rem; }
.official-sources a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.final-cta { border-top: 1px solid var(--divider); text-align: center; }
.final-cta h2, .final-cta p { margin-left: auto; margin-right: auto; max-width: 680px; }

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

@media (max-width: 900px) {
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 44px; }
  .hero__visual { min-height: clamp(520px, 100vw, 680px); }
  .phone--front { max-width: min(68vw, 310px); }
  .phone--back { max-width: min(74vw, 340px); }
  .intro-strip, .tax-guide__facts, .step, .step--reverse, .notes { grid-template-columns: 1fr; }
  .step--reverse .step__copy { order: 0; }
}

@media (max-width: 560px) {
  .site-header { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 42px; }
  .hero, .section { padding-left: 16px; padding-right: 16px; }
  .hero__visual { min-height: 460px; }
  .phone { border-radius: 26px; padding: 7px; }
  .phone { margin: 0; }
  .phone--front { max-width: min(62vw, 205px); }
  .phone--back { max-width: min(70vw, 210px); }
  .button { justify-content: center; width: 100%; }
  .screenshot { border-radius: var(--radius-lg); padding: 7px; }
  .tax-guide__facts article { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
