:root {
  color-scheme: light;
  --page: #ebf3ef;
  --surface: #fffdf8;
  --text: #22342f;
  --muted: #5a6c67;
  --accent: #7a6640;
  --gloss: #8b6f3c;
  --line: rgba(60, 100, 90, 0.16);
  --mint: #cfe6df;
  --cream: #fbf1e4;

  --max: 1144px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --zh: "Songti TC", "Noto Serif TC", "PingFang TC", "Heiti TC", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 17px/1.6 var(--sans);
  background: linear-gradient(180deg, #e6f1ec 0, #f4f2ea 900px, #fbf6ee 100%);
  background-color: #f7f4ec;
}

a { color: var(--accent); }

[lang="zh-Hant"] { font-family: var(--zh); }

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Frosted glass, used for the header, cards and panels */

.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 12px 40px rgba(50, 95, 85, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}

/* Header */

header.site {
  position: relative;
  z-index: 10;
  padding: 16px 16px 0;
}

.home header.site {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px 9px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 30px rgba(50, 95, 85, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font: 500 21px/1 var(--serif);
}

.brand img { border-radius: 7px; }

nav a {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-left: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 15px;
}

nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.55); }

/* Hero: the drop on the water */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  background: linear-gradient(180deg, #c6e0d8 0%, #ecf4f0 52%, #fdeedb 62%, #d3e6e0 62.5%, #98c3b8 100%);
}

.scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  min-height: 100svh;
  margin: 0 auto;
  padding: 120px 28px clamp(120px, 20svh, 220px);
  display: grid;
  grid-template-columns: minmax(340px, 5.4fr) 6.6fr;
  grid-template-areas: "copy drop" "card drop";
  column-gap: 40px;
  align-content: center;
}

.hero-copy { grid-area: copy; align-self: end; }

.hero h1 {
  margin: 0;
  font: 300 clamp(44px, 5vw, 72px)/1.04 var(--serif);
  letter-spacing: -0.02em;
  color: #1d302b;
}

.zh-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 0;
  font-size: clamp(16px, 1.7vw, 20px);
  letter-spacing: 0.42em;
  color: #3e5852;
}

.zh-line::before {
  content: "";
  flex: none;
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.lede {
  margin: 22px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.lede span { margin-left: 6px; white-space: nowrap; }

.drop-slot {
  grid-area: drop;
  align-self: center;
  justify-self: center;
  position: relative;
  width: min(100%, 560px, 62svh);
  aspect-ratio: 1;
  border-radius: 50%;
  container-type: inline-size;
  display: grid;
  place-items: center;
}

.drop-text {
  position: relative;
  width: 74%;
  text-align: center;
}

.passage {
  position: relative;
  z-index: 1;
  margin: 0;
  font: 400 clamp(16px, 4.6cqi, 25px)/2.15 var(--serif);
  color: #213630;
}

.tok { white-space: nowrap; }

.w {
  position: relative;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.w.tappable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: underline dotted rgba(33, 54, 48, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.w.tappable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.gloss {
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: -3px;
  transform: translateX(-50%);
  font: 600 clamp(10px, 2.2cqi, 13px)/1 var(--zh);
  letter-spacing: 0.04em;
  color: var(--gloss);
  white-space: nowrap;
  pointer-events: none;
  animation: rise 0.4s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.glider {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 4px 12px rgba(40, 90, 78, 0.16),
    inset 0 1px 1px #fff,
    inset 0 -3px 6px rgba(120, 180, 165, 0.2);
  transition:
    transform 0.45s cubic-bezier(0.3, 1.3, 0.5, 1),
    width 0.45s cubic-bezier(0.3, 1.3, 0.5, 1),
    height 0.3s ease,
    opacity 0.4s;
}

.glider.shown { opacity: 1; }

.drop-shine {
  position: absolute;
  left: 15%;
  top: 19%;
  width: 34%;
  height: 15%;
  border-radius: 50%;
  transform: rotate(-37deg);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero-card {
  grid-area: card;
  align-self: start;
  margin-top: 30px;
  max-width: 440px;
}

.meaning {
  padding: 18px 22px;
  min-height: 112px;
  border-radius: 26px;
  opacity: 0;
  transition: opacity 0.35s;
}

.meaning.shown { opacity: 1; }
.meaning.fresh { animation: settle 0.45s ease-out; }

@keyframes settle {
  from { transform: translateY(6px) scale(0.985); }
  to { transform: none; }
}

.m-word {
  margin: 0 0 4px;
  font: 500 22px/1.3 var(--serif);
}

.m-pos {
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 13px;
  color: var(--muted);
  vertical-align: 3px;
}

.m-mean {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.04em;
}

.m-note {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.m-note:empty { display: none; }

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
}

.listen {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 15px;
  border-radius: 999px;
  color: var(--text);
  font: 500 16px/1 var(--sans);
  cursor: pointer;
}

.listen-icon {
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.listen.playing .listen-icon {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
}

.example {
  margin: 0;
  font-size: 13px;
  color: #445a54;
}

.hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(230, 241, 236, 0), #e6f1ec);
  pointer-events: none;
}

/* Without WebGL the drop is drawn with CSS */

.no-gl .scene { display: none; }

.no-gl .drop-slot {
  background:
    radial-gradient(ellipse 34% 15% at 32% 26%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 70%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.8) 0 58%, rgba(214, 236, 229, 0.75) 84%, rgba(150, 198, 186, 0.85) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9), inset 0 -30px 60px rgba(255, 250, 240, 0.6), 0 40px 80px rgba(60, 110, 98, 0.18);
}

/* Sections below: frosted glass over floating glass spheres */

main { overflow: hidden; }

@supports (overflow: clip) {
  main { overflow: clip; }
}

.block {
  position: relative;
  padding: 64px 0;
}

.orb {
  position: absolute;
  z-index: 0;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}

.orb-mint {
  background:
    radial-gradient(circle at 33% 28%, rgba(255, 255, 255, 0.95) 0 4%, rgba(255, 255, 255, 0) 20%),
    radial-gradient(circle at 62% 74%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 50% 50%, #dbeee8 0%, #b9dad1 56%, #94c3b6 100%);
  box-shadow:
    inset -18px -26px 50px rgba(60, 125, 110, 0.22),
    inset 14px 18px 34px rgba(255, 255, 255, 0.6),
    0 30px 60px rgba(70, 125, 110, 0.14);
}

.orb-cream {
  background:
    radial-gradient(circle at 33% 28%, rgba(255, 255, 255, 0.95) 0 4%, rgba(255, 255, 255, 0) 20%),
    radial-gradient(circle at 62% 74%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 50% 50%, #fff6ea 0%, #f6e2c8 56%, #e9c9a2 100%);
  box-shadow:
    inset -18px -26px 50px rgba(170, 120, 60, 0.18),
    inset 14px 18px 34px rgba(255, 255, 255, 0.65),
    0 30px 60px rgba(170, 130, 80, 0.12);
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-18px); }
}

.home h2 {
  margin: 0;
  font: 300 clamp(32px, 4.6vw, 52px)/1.1 var(--serif);
  letter-spacing: -0.015em;
}

.head { max-width: 760px; margin-bottom: 32px; }

.sub, .statement p:not(.zh-line), .own-grid p:not(.zh-line):not(.soon) {
  max-width: 38em;
  font-size: 18px;
  color: var(--muted);
}

.sub { margin: 22px 0 0; }

.panel {
  border-radius: 34px;
  padding: clamp(28px, 5vw, 56px);
}

.statement { max-width: 880px; }
.statement .zh-line { margin-bottom: 22px; }
.statement p { margin: 0 0 12px; }

.cards {
  display: grid;
  gap: 18px;
}

.cards.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards.four { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  border-radius: 28px;
  padding: 26px 24px;
}

.card h3 {
  margin: 0;
  font: 400 23px/1.25 var(--serif);
}

.flat .card p { margin: 10px 0 0; color: var(--muted); font-size: 17px; }

.card svg {
  width: 30px;
  height: 30px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zh-small {
  margin: 4px 0 10px;
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.space .card p:last-child { margin: 0; color: var(--muted); font-size: 16px; }

.gains {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 28px;
}

.gains li {
  border-top: 1px solid var(--line);
  padding: 20px 0 6px;
}

.gains .num {
  display: block;
  font: 500 13px/1 var(--sans);
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 12px;
}

.gains strong {
  display: block;
  font: 400 22px/1.3 var(--serif);
  margin-bottom: 4px;
}

.gains li > span:last-child { color: var(--muted); }

.own-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}

.own-grid .zh-line { margin-bottom: 18px; }

.app-icon {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 12px 26px rgba(60, 100, 90, 0.22));
}

.soon {
  display: inline-block;
  margin: 10px 0 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.95);
  font-size: 15px;
}

.questions {
  margin: 28px 0 0;
  color: var(--muted);
}

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

.home footer.site { margin-top: 0; }

footer.site p { margin: 4px 0; }

/* Policy pages */

.doc { max-width: 760px; }

.doc h1 {
  font: 400 clamp(30px, 5vw, 42px)/1.2 var(--serif);
  margin: 48px 0 8px;
}

.doc .updated {
  color: var(--muted);
  margin: 0 0 24px;
}

.doc h2 {
  font: 500 22px/1.3 var(--serif);
  margin: 32px 0 8px;
}

.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 12px 0;
}

.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 8px 0;
}

.table-scroll { overflow-x: auto; }

/* Phones and narrow windows */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "copy" "drop" "card";
    padding: 104px 20px 120px;
    align-content: start;
    text-align: center;
  }
  .hero-copy { align-self: auto; }
  .zh-line { justify-content: center; }
  .hero .zh-line::after {
    content: "";
    flex: none;
    width: 44px;
    height: 1px;
    background: currentColor;
    opacity: 0.45;
  }
  .lede span { display: block; margin: 2px 0 0; }
  .drop-slot { width: min(100%, 440px); margin-top: 26px; }
  .hero-card { justify-self: center; width: 100%; margin-top: 26px; text-align: left; }
  .hero-actions { justify-content: center; }
  .own-grid { grid-template-columns: 1fr; gap: 24px; }
  .app-icon { width: 96px; height: 96px; }
}

@media (max-width: 520px) {
  .block { padding: 48px 0; }
  .hero h1 { font-size: 46px; }
  .zh-line { letter-spacing: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  .glider, .gloss, .meaning, .orb { transition: none; animation: none; }
}
