:root {
  color-scheme: light;
  --ink: #0d2438;
  --muted: #5d6e7d;
  --paper: #f2f3ef;
  --card: #ffffff;
  --navy: #071a2f;
  --navy-2: #0c3552;
  --teal: #0f766e;
  --teal-bright: #2a9d8f;
  --teal-soft: #dff3ee;
  --gold: #c9951e;
  --gold-soft: #f6eccf;
  --line: #dce4e4;
  --shadow: 0 22px 60px rgba(8, 35, 54, 0.1);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgba(42, 157, 143, 0.13), transparent 28rem),
    radial-gradient(circle at 95% 35%, rgba(201, 149, 30, 0.09), transparent 25rem),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", "PingFang TC", sans-serif;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar,
main,
footer {
  width: min(1400px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  min-height: 84px;
  padding-block: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--navy-2), var(--teal));
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.24);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.brand > span:last-child {
  min-width: 0;
  display: grid;
}

.brand small {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
}

.brand strong {
  line-height: 1.25;
}

.home-link,
.play-button,
.talk-track button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-link:hover,
.play-button:hover,
.talk-track button:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 9px 25px rgba(8, 35, 54, 0.08);
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

main > * {
  min-width: 0;
  max-width: 100%;
}

.hero {
  min-height: 430px;
  padding: clamp(34px, 5.3vw, 78px);
  border-radius: 34px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  align-items: center;
  gap: clamp(30px, 6vw, 92px);
  color: white;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 78% 28%, rgba(42, 157, 143, 0.35), transparent 23rem),
    linear-gradient(135deg, #061426, #0b304b);
  background-size: 42px 42px, 42px 42px, auto, auto;
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-card {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #7de0d4;
}

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

h1 {
  margin-bottom: 20px;
  max-width: 900px;
  font-size: clamp(2.55rem, 5.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h3 {
  line-height: 1.3;
}

.hero-intro {
  max-width: 800px;
  margin-bottom: 26px;
  color: #d5e2ea;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-tags span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #e9f5f4;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  font-weight: 750;
}

.hero-card {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px);
}

.hero-card-label {
  display: block;
  margin-bottom: 14px;
  color: #7de0d4;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.35;
}

.hero-card p {
  margin-bottom: 0;
  color: #d5e2ea;
}

.logic-grid,
.metric-grid,
.question-grid {
  display: grid;
  gap: 14px;
}

.logic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logic-grid article,
.metric-grid article,
.question-grid article,
.curve-section,
.example-section,
.sell-section,
.sources,
.boundary-section,
.talk-track {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 36px rgba(8, 35, 54, 0.055);
}

.logic-grid article {
  position: relative;
  min-height: 210px;
  padding: 26px;
  border-radius: 22px;
  overflow: hidden;
}

.logic-grid article::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: 140px;
  height: 140px;
  border: 22px solid var(--teal-soft);
  border-radius: 50%;
}

.step-number {
  display: block;
  margin-bottom: 20px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.logic-grid h2 {
  margin-bottom: 9px;
  font-size: 1.45rem;
}

.logic-grid p:last-child,
.question-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.curve-section,
.example-section,
.sell-section,
.sources,
.boundary-section,
.talk-track {
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius);
}

.section-heading {
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.curve-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.45fr);
  gap: 18px;
}

.chart-card {
  min-width: 0;
  padding: 16px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(223, 243, 238, 0.42), transparent 45%),
    #fbfcfb;
}

#smileChart {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid line {
  stroke: #dce7e5;
  stroke-width: 1;
  stroke-dasharray: 5 8;
}

.axis-labels {
  fill: #73848f;
  font-size: 14px;
  font-weight: 700;
}

.curve-area {
  fill: url(#areaGradient);
}

.curve-line {
  fill: none;
  stroke: url(#curveGradient);
  stroke-width: 9;
  stroke-linecap: round;
  filter: url(#pointShadow);
}

.point-halo {
  fill: transparent;
  stroke: transparent;
  stroke-width: 3;
}

.point-dot {
  fill: white;
  stroke: var(--teal);
  stroke-width: 6;
  filter: url(#pointShadow);
  transition: r 180ms ease, fill 180ms ease, stroke 180ms ease;
}

.point-label {
  fill: #4d6473;
  font-size: 15px;
  font-weight: 900;
  text-anchor: middle;
}

.chart-point.is-active .point-halo {
  fill: rgba(201, 149, 30, 0.11);
  stroke: rgba(201, 149, 30, 0.45);
}

.chart-point.is-active .point-dot {
  fill: var(--gold);
  stroke: white;
}

.chart-point.is-active .point-label {
  fill: var(--ink);
}

.chart-caption {
  padding: 4px 10px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-caption span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  width: 24px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy-2), var(--teal), var(--gold));
}

.legend-dot {
  width: 10px;
  height: 10px;
  border: 3px solid var(--teal);
  border-radius: 50%;
  background: white;
}

.stage-card {
  min-width: 0;
  padding: 28px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 90% 8%, rgba(42, 157, 143, 0.33), transparent 13rem),
    var(--navy);
}

.stage-count {
  margin-bottom: 30px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #79d8cd;
}

.stage-count span {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.stage-count small {
  color: #9fb2bf;
  font-weight: 800;
}

.stage-card .eyebrow {
  color: #79d8cd;
}

.stage-card h3 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.stage-card > p:not(.eyebrow):not(.stage-action) {
  color: #cfdae2;
}

.stage-card dl {
  margin: 26px 0;
  display: grid;
  gap: 10px;
}

.stage-card dl div {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.stage-card dt {
  color: #9fb2bf;
  font-size: 0.85rem;
}

.stage-card dd {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 850;
}

.stage-action {
  margin-bottom: 0;
  padding: 13px 14px;
  border: 1px solid rgba(121, 216, 205, 0.24);
  border-radius: 13px;
  color: #e5f7f4;
  background: rgba(42, 157, 143, 0.12);
  font-size: 0.9rem;
  font-weight: 750;
}

.stage-tabs {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.stage-tabs button {
  min-height: 74px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  background: #f9fbfa;
  cursor: pointer;
}

.stage-tabs button span {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
}

.stage-tabs button strong {
  font-size: 0.82rem;
}

.stage-tabs button.is-active {
  color: white;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.stage-tabs button.is-active span {
  color: #cbf2ec;
}

.example-heading {
  align-items: center;
}

.amount-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.amount-input-wrap {
  min-height: 46px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  background: white;
}

.amount-input-wrap input {
  width: 104px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 850;
}

.amount-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-grid article {
  min-width: 0;
  padding: 20px;
  border-radius: 18px;
}

.metric-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.2;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 14px 16px;
  color: var(--muted);
  background: #f7f9f8;
  text-align: left;
  font-size: 0.78rem;
}

th,
td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  color: var(--muted);
  background: #f7f9f8;
  font-size: 0.78rem;
}

tbody th,
tbody td {
  font-size: 0.9rem;
}

tbody tr.is-current {
  color: #0c5e57;
  background: var(--teal-soft);
}

.example-note {
  margin: 15px 2px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.question-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question-grid article {
  padding: 24px;
  border-radius: 18px;
}

.question-grid span {
  display: inline-flex;
  margin-bottom: 20px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #815f0d;
  background: var(--gold-soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.question-grid strong {
  display: block;
  margin-bottom: 9px;
  font-size: 1.18rem;
}

.talk-track {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  color: white;
  border-color: transparent;
  background:
    radial-gradient(circle at 84% 30%, rgba(201, 149, 30, 0.23), transparent 22rem),
    linear-gradient(135deg, var(--navy), #133d58);
}

.talk-track .eyebrow {
  color: #79d8cd;
}

.talk-track h2 {
  margin-bottom: 18px;
}

.talk-track blockquote {
  margin-bottom: 0;
  color: #dce7ec;
  font-size: clamp(1rem, 1.4vw, 1.16rem);
}

.talk-track button {
  color: var(--navy);
  border-color: white;
  background: white;
}

.copy-status {
  position: absolute;
  right: 48px;
  bottom: 18px;
  color: #b7e8e2;
  font-size: 0.78rem;
}

.boundary-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.35fr) minmax(0, 0.65fr);
  gap: 36px;
  align-items: start;
  border-color: #ead9aa;
  background: #fffaf0;
}

.boundary-section ul {
  margin: 0;
  padding-left: 1.25rem;
  color: #5e543c;
}

.boundary-section li + li {
  margin-top: 9px;
}

.sources {
  display: grid;
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 0.7fr);
  gap: 32px;
}

.source-links {
  display: grid;
  gap: 10px;
}

.source-links a {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 2px;
  text-decoration: none;
  background: #f9fbfa;
}

.source-links a:hover {
  border-color: rgba(15, 118, 110, 0.5);
}

.source-links span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.source-links strong {
  font-size: 0.92rem;
}

footer {
  min-height: 100px;
  padding-block: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.84rem;
}

footer p {
  margin-bottom: 0;
}

footer a {
  font-weight: 800;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.34);
  outline-offset: 3px;
}

@media (max-width: 1000px) {
  .hero,
  .curve-layout,
  .boundary-section,
  .sources {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .logic-grid,
  .question-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .logic-grid article,
  .question-grid article {
    scroll-snap-align: start;
  }

  .stage-tabs {
    grid-template-columns: repeat(7, minmax(112px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    width: min(calc(100% - 24px), 1400px);
  }

  .topbar {
    min-height: 72px;
  }

  .brand small {
    display: none;
  }

  .home-link {
    min-height: 40px;
    padding-inline: 12px;
    font-size: 0.82rem;
  }

  .hero {
    padding: 28px 22px;
    border-radius: 24px;
  }

  h1 {
    font-size: clamp(2.35rem, 14vw, 4rem);
  }

  .section-heading,
  .example-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .play-button,
  .amount-control {
    width: 100%;
  }

  .amount-control {
    justify-content: space-between;
  }

  .curve-section,
  .example-section,
  .sell-section,
  .sources,
  .boundary-section,
  .talk-track {
    padding: 22px;
    border-radius: 20px;
  }

  .chart-card {
    padding: 8px 6px 6px;
  }

  .chart-caption {
    font-size: 0.74rem;
  }

  .stage-card {
    padding: 22px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .metric-grid article {
    padding: 16px;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .talk-track {
    grid-template-columns: 1fr;
  }

  .talk-track button {
    width: 100%;
  }

  .copy-status {
    position: static;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

@media print {
  body {
    background: white;
  }

  .topbar,
  .home-link,
  .play-button,
  .stage-tabs,
  .talk-track button,
  footer,
  .source-links {
    display: none !important;
  }

  main {
    width: 100%;
  }

  .hero,
  .stage-card,
  .talk-track {
    color: var(--ink);
    background: white;
    box-shadow: none;
  }

  .hero-intro,
  .hero-card p,
  .stage-card > p,
  .talk-track blockquote {
    color: var(--muted) !important;
  }

  .curve-section,
  .example-section,
  .sell-section,
  .boundary-section,
  .talk-track,
  .hero {
    break-inside: avoid;
    box-shadow: none;
  }
}
