/* PianoAnyway marketing — refined, bilingual-ready */
:root {
  --bg0: #0b0f14;
  --bg1: #121820;
  --ink: #f2f4f7;
  --muted: #9aa6b5;
  --line: rgba(255, 255, 255, 0.09);
  --gold: #dcc56f;
  --gold-soft: #e8d7a0;
  --max: 40rem;
  --content-max: 46rem;
  --font-display: "Fraunces", "Noto Serif TC", "Noto Serif SC", "Songti TC", "Songti SC", serif;
  --font-body: "Source Sans 3", "Noto Sans TC", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR",
    "PingFang TC", "PingFang SC", "Hiragino Sans", "Apple SD Gothic Neo", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-pad: max(1.125rem, calc((100vw - min(100vw - 2.25rem, 64rem)) / 2));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.65;
  letter-spacing: 0.01em;
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* CJK: slightly tighter tracking, clearer rhythm */
:lang(zh),
:lang(zh-Hant),
:lang(zh-Hans) {
  letter-spacing: 0.02em;
  line-height: 1.75;
  font-weight: 400;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(95, 140, 185, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 95% 5%, rgba(180, 140, 90, 0.08), transparent 50%),
    linear-gradient(180deg, #0b0f14 0%, #10161e 48%, #0b0f14 100%);
}

a {
  color: var(--gold);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--gold-soft);
}

.wrap {
  width: min(100% - 2.25rem, var(--content-max));
  margin-inline: auto;
}

.content-col {
  width: 100%;
}

.top {
  padding: 1.35rem 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  width: 1.65rem;
  height: 1.65rem;
  /* Pre-rounded PNG + CSS radius: Safari often ignores radius alone on <img>. */
  border-radius: 22.37%;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.nav {
  display: none;
}

.lang-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.75rem 0 0;
}

.lang-pick label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.lang-pick select {
  appearance: none;
  font: inherit;
  font-size: 0.88rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 2rem 0.4rem 0.9rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa6b5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-pick select:hover,
.lang-pick select:focus {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 26rem) minmax(0, 17rem);
  justify-content: space-between;
  align-items: center;
  gap: 1.75rem 2.75rem;
  padding: 2.25rem 0 2.75rem;
  width: 100%;
}

.hero-copy {
  grid-column: 1;
  max-width: 26rem;
  min-width: 0;
}

.hero h1 {
  margin: 0 0 1.15rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

:lang(zh) .hero h1,
:lang(zh-Hant) .hero h1,
:lang(zh-Hans) .hero h1 {
  letter-spacing: -0.01em;
}

.hero .line {
  margin: 0;
  max-width: 22rem;
  color: color-mix(in srgb, var(--ink) 90%, var(--muted));
  font-size: clamp(1.05rem, 2.2vw, 1.18rem);
  line-height: 1.45;
  font-weight: 450;
}

.hero .line.hero-lead {
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 24rem;
}

.hero .line.hero-lead-2 {
  margin-top: 0.1rem;
}

.hero .line.hero-lead-2:empty {
  display: none;
}

.hero .line + .line {
  margin-top: 0.35rem;
}

/* CJK hero: two lines = one sentence; tight leading, no gap between lines */
:lang(zh) .hero .line.hero-lead + .hero-lead-2,
:lang(zh-Hant) .hero .line.hero-lead + .hero-lead-2,
:lang(zh-Hans) .hero .line.hero-lead + .hero-lead-2,
:lang(ja) .hero .line.hero-lead + .hero-lead-2 {
  margin-top: 0;
}

:lang(zh) .hero .line,
:lang(zh-Hant) .hero .line,
:lang(zh-Hans) .hero .line,
:lang(ja) .hero .line {
  line-height: 1.38;
  max-width: 24rem;
}

.hero .sub {
  margin: 0.85rem 0 0;
  max-width: 24rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

.hero .sub .hero-keep {
  white-space: nowrap;
}

.hero .sub.hero-audience {
  margin-top: 0.45rem;
  font-size: 0.98rem;
}

.hero .sub.hero-langs {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  max-width: 28rem;
}

.hero-visual {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin: 0;
  width: min(100%, 17rem);
}

/* Clip on the wrapper — Safari drops border-radius when the <img> itself is
   transformed by the float animation. */
.hero-visual .hero-icon {
  border-radius: 22.37%;
  overflow: hidden;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: hero-float 5.5s var(--ease) infinite alternate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

@keyframes hero-float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-6px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay {
  transition-delay: 0.12s;
}

.reveal-delay-2 {
  transition-delay: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-in,
  .hero-visual .hero-icon {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}

/* Large vertical feature sections — title, then image (clean stack) */
.features {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 8vw, 5.75rem);
  padding: 1.5rem 0 2.5rem;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
}

.feature-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.feature-copy p {
  margin: 0.65rem 0 0;
  max-width: 100%;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Mini Rec chip — matches app jam-rec look, inline in marketing copy */
.inline-rec {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  vertical-align: middle;
  margin: 0 0.12em;
  padding: 0.18em 0.55em 0.2em 0.45em;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #f8e8e6;
  background: linear-gradient(180deg, #6a3a3a 0%, #4a2428 100%);
  border: 1px solid rgba(226, 110, 100, 0.45);
  box-shadow:
    0 2px 0 #2a1214,
    0 3px 8px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 200, 190, 0.18);
  white-space: nowrap;
}

.inline-rec-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #e85a4f;
  box-shadow: 0 0 0 1.5px rgba(255, 180, 170, 0.35);
  flex-shrink: 0;
}

.feature-text .feature-copy p {
  max-width: 40rem;
}

.feature-shot {
  margin: 0.35rem 0 0;
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.05), transparent 55%),
    #07090d;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  padding: clamp(0.85rem, 2vw, 1.25rem);
}

.feature-shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  transform: translateY(10px) scale(0.98);
  opacity: 0.72;
  transition:
    transform 0.85s var(--ease),
    opacity 0.85s var(--ease);
}

.feature.is-in .feature-shot img {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.feature-shot-slim {
  padding-block: clamp(1rem, 2.5vw, 1.5rem);
}

.feature-shot-paste {
  padding: clamp(0.5rem, 1.5vw, 0.85rem);
  background:
    radial-gradient(90% 70% at 18% 30%, rgba(220, 197, 111, 0.07), transparent 55%),
    radial-gradient(80% 60% at 88% 40%, rgba(110, 176, 232, 0.08), transparent 50%),
    #07090d;
}

.feature-shot-paste img {
  border-radius: 14px;
}

.feature-shot-tall img {
  object-fit: contain;
}

/* Optional detail rail — swipe for FAQ-style extras, not main features */
.detail-rail-section {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 2rem 0 0.5rem;
  border-top: 1px solid var(--line);
}

.detail-rail-head {
  padding: 0 var(--rail-pad) 1rem;
}

.detail-rail-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
  letter-spacing: -0.02em;
}

.detail-rail-head .muted {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-rail-wrap {
  position: relative;
}

.detail-rail {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--rail-pad);
  padding: 0.25rem var(--rail-pad) 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.detail-rail::-webkit-scrollbar {
  display: none;
}

.detail-card {
  flex: 0 0 min(78vw, 18rem);
  scroll-snap-align: start;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.detail-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.detail-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-rail-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.15rem var(--rail-pad) 0;
}

.detail-rail-foot {
  margin: 0.85rem 0 0;
  padding: 0 var(--rail-pad);
  font-size: 0.92rem;
}

.detail-rail-foot a {
  text-decoration: none;
}

.rail-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.cap-table {
  padding: clamp(2.5rem, 6vw, 4rem) 0 0;
  width: 100%;
}

.cap-table h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.45rem, 2.8vw, 1.95rem);
  letter-spacing: -0.03em;
}

.cap-lede {
  margin: 0.55rem 0 1.15rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 38rem;
}

.cap-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

table.cap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

table.cap th,
table.cap td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}

table.cap th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

table.cap td {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

table.cap td:last-child {
  color: #e8f0e4;
  font-weight: 600;
  white-space: nowrap;
}

table.cap tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

@media (max-width: 640px) {
  table.cap td:last-child {
    white-space: normal;
  }
}

.closer {
  text-align: left;
  padding: clamp(3rem, 8vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  width: 100%;
}

.closer h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.closer-lede {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 38rem;
}

@media (max-width: 820px) {
  .feature-copy p {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 1.35rem;
    padding-top: 1.5rem;
  }

  .hero-copy {
    grid-column: 1;
    max-width: none;
  }

  .hero-visual {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
    width: min(38vw, 9.5rem);
    margin: 0.25rem 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-shot img,
  .feature.is-in .feature-shot img {
    transform: none;
    opacity: 1;
    transition: none;
  }

  .feature-rail,
  .detail-rail {
    scroll-behavior: auto;
  }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.85rem;
  margin-top: 2rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn-primary {
  color: #1a1610;
  background: linear-gradient(180deg, #edd98a, #c9a84c);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.btn-primary:hover {
  color: #1a1610;
  filter: brightness(1.04);
}

.btn-ghost {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: rgba(237, 217, 138, 0.65);
  background: rgba(255, 255, 255, 0.14);
}

.cta-note {
  margin: 0;
  width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
}

[data-lang-panel][hidden] {
  display: none !important;
}

.shot-placeholder {
  padding: 1.15rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.shot,
.shot-pending {
  margin: 1rem 0 1.25rem;
}

.shot img,
.shot-pending img {
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.page {
  padding: 1.75rem 0 4rem;
}

.page h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page .lede {
  margin: 0 0 1.35rem;
  color: var(--muted);
  max-width: 34rem;
  font-size: 0.98rem;
}

.page .lang-pick {
  margin: 0 0 1.75rem;
}

.toc {
  margin: 0 0 2.25rem;
  padding: 1.05rem 1.15rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.toc strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 650;
}

.toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  list-style: decimal;
}

.toc li + li {
  margin-top: 0.4rem;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.faq-list {
  counter-reset: faq;
}

.faq-block {
  margin: 0 0 2.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.25rem;
  counter-increment: faq;
}

.faq-block h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.6vw, 1.48rem);
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.faq-block h2::before {
  content: counter(faq) ". ";
  color: var(--gold);
  font-weight: 700;
}

.faq-block p,
.faq-block li {
  color: color-mix(in srgb, var(--ink) 80%, var(--muted));
}

.faq-block p {
  margin: 0 0 0.75rem;
}

.faq-block p:last-child {
  margin-bottom: 0;
}

.faq-block ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.2rem;
}

.faq-block li + li {
  margin-top: 0.35rem;
}

.faq-block table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.75rem 0 1rem;
}

.faq-block th,
.faq-block td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.faq-block th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-weight: 600;
}

.foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  width: 100%;
}

.foot-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.foot-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.foot-nav a:hover {
  color: var(--gold);
}

.foot-copy {
  margin: 0;
  max-width: 36rem;
}

.back-top {
  position: fixed;
  right: max(1rem, calc((100vw - var(--content-max)) / 2 - 3rem));
  bottom: 1.25rem;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11, 15, 20, 0.88);
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.35rem);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.2);
}

.foot a {
  color: var(--muted);
  text-decoration: none;
}

.foot a:hover {
  color: var(--gold);
}

.foot-legal .foot-copy {
  display: block;
  max-width: 38rem;
  line-height: 1.55;
}

.foot-legal .foot-copy .foot-entity {
  display: block;
  margin-top: 0.2rem;
}

@media (max-width: 520px) {
  .wrap {
    width: min(100% - 1.5rem, var(--content-max));
  }

  .back-top {
    right: 1rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .cta-note {
    text-align: center;
  }
}

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

  .btn,
  .nav a,
  .lang-pick select {
    transition: none;
  }
}
