:root {
  --primary: #e63946;
  --primary-strong: #d32f3f;
  --primary-muted: #fce6eb;
  --background: #f1faee;
  --surface: #ffffff;
  --surface-subtle: #e8f4f8;
  --text: #264653;
  --text-muted: #6b7280;
  --text-tertiary: #9ca3af;
  --divider: rgba(38, 70, 83, 0.16);
  --shadow: rgba(38, 70, 83, 0.14);
  --shadow-soft: rgba(38, 70, 83, 0.08);
  --radius-sm: 8px;
  --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;
    --text-tertiary: #9ca3af;
    --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;
}

.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(--primary-strong);
  outline: none;
}

.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(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Noto Sans JP", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

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__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);
  outline: none;
}

.button--primary {
  background: var(--primary);
  border-color: var(--primary);
  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,
.widget-flow figure {
  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,
.widget-flow 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 {
  color: var(--text-muted);
  margin: 0;
}

.metric {
  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);
}

.section__header--wide {
  max-width: 780px;
}

.section__header p:not(.eyebrow),
.step__copy p,
.notes p {
  color: var(--text-muted);
}

.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(--primary);
  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;
}

.screenshot--cropped {
  max-height: 620px;
}

.screenshot--cropped img {
  object-fit: cover;
  object-position: top center;
  max-height: 600px;
}

.widget-section {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.widget-section .section__header {
  margin-left: auto;
  margin-right: auto;
  max-width: var(--max-width);
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

.widget-flow {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1180px;
  padding: 0 clamp(20px, 5vw, 48px);
}

.widget-flow figure {
  border-radius: var(--radius-xl);
  margin: 0;
  padding: 10px;
}

.widget-flow figcaption {
  color: var(--text-muted);
  font-size: 14px;
  padding: 12px 4px 2px;
  text-align: center;
}

.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;
}

@media (max-width: 900px) {
  .site-nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 44px;
  }

  .hero__visual {
    min-height: 560px;
  }

  .phone--front {
    max-width: min(68vw, 310px);
  }

  .phone--back {
    max-width: min(74vw, 340px);
  }

  .intro-strip,
  .step,
  .step--reverse,
  .notes {
    grid-template-columns: 1fr;
  }

  .step--reverse .step__copy {
    order: 0;
  }

  .widget-flow {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

@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--front {
    max-width: 62vw;
  }

  .phone--back {
    max-width: 70vw;
  }

  .button {
    justify-content: center;
    width: 100%;
  }

  .screenshot,
  .widget-flow figure {
    border-radius: var(--radius-lg);
    padding: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
