/* 精進麻雀 — public site
   Apple product-page tone: SF stack, generous whitespace, light/dark. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    system-ui, "PingFang HK", "PingFang TC", "Noto Sans TC", "Helvetica Neue",
    sans-serif;
  --bg: #f5f7f4;
  --bg-elevated: #ffffff;
  --bg-soft: #e8efe9;
  --fg: #14201a;
  --fg-muted: #4a5c52;
  --fg-faint: #6b7d72;
  --accent: #c45f12;
  --accent-soft: rgba(196, 95, 18, 0.12);
  --felt: #1a3d2f;
  --felt-deep: #0c201a;
  --line: rgba(20, 32, 26, 0.12);
  --shadow: 0 24px 60px rgba(12, 32, 26, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --max: 1080px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07140f;
    --bg-elevated: #0f2419;
    --bg-soft: #122a1f;
    --fg: #f4f7f4;
    --fg-muted: #a8b8ae;
    --fg-faint: #7d9086;
    --accent: #f0a035;
    --accent-soft: rgba(240, 160, 53, 0.16);
    --felt: #143528;
    --felt-deep: #081812;
    --line: rgba(244, 247, 244, 0.12);
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-soft), transparent 55%),
    radial-gradient(900px 500px at 0% 20%, rgba(26, 61, 47, 0.12), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: var(--pad);
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2 * var(--pad), var(--max));
  margin-inline: auto;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(1.2) blur(16px);
  -webkit-backdrop-filter: saturate(1.2) blur(16px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a[aria-current="page"],
.nav-links a:hover {
  color: var(--fg);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .lang-switch button[aria-pressed="true"] {
    color: #1a1208;
  }
}

/* —— Hero —— */
.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}

.hero-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.hero-lead {
  margin: 0 0 1.75rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 34ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--fg);
}

.coming-soon::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.store-badge {
  display: none;
  line-height: 0;
}

.store-badge.is-visible {
  display: inline-block;
}

.store-badge img {
  height: 40px;
  width: auto;
}

.store-badge:focus-visible {
  border-radius: 8px;
}

.hero-note {
  margin: 1.1rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-faint);
}

/* Landscape phone frame — generic device, not an Apple product simulation */
.device {
  --device-bezel: #1c1c1e;
  --device-rim: #2c2c2e;
  margin: 0 auto;
  width: min(100%, 560px);
  aspect-ratio: 19.5 / 9;
  border-radius: 1.65rem;
  padding: 0.55rem;
  background:
    linear-gradient(145deg, #3a3a3c, var(--device-bezel) 40%, #0a0a0a);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
}

.device::before {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-radius: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 1.15rem;
  overflow: hidden;
  background: var(--felt-deep);
}

.device-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* —— Sections —— */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section-alt {
  background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 38rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-head h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 1.05rem;
}

.feature-list {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .feature-list {
    grid-template-columns: 1fr 1fr;
  }
}

.feature {
  padding: 1.35rem 1.4rem 1.45rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.feature p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.98rem;
}

.feature-kicker {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.rules-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--fg);
}

.gallery {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }
}

.shot-card {
  margin: 0;
}

.shot-card .device {
  width: 100%;
}

.shot-card figcaption {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--fg-muted);
  text-align: center;
}

.privacy-points {
  display: grid;
  gap: 0.85rem;
  max-width: 40rem;
}

.privacy-points li {
  margin: 0;
}

.names {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .names {
    grid-template-columns: 1fr 1fr;
  }
}

.name-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.name-row dt {
  color: var(--fg-faint);
  font-size: 0.85rem;
}

.name-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* —— Legal / support pages —— */
.page {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(4rem, 8vw, 6rem);
}

.page h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.03em;
}

.page .meta {
  margin: 0 0 2rem;
  color: var(--fg-faint);
  font-size: 0.95rem;
}

.prose {
  max-width: 42rem;
}

.prose h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.prose p,
.prose li {
  color: var(--fg-muted);
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.45rem;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.65rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
}

.faq details p {
  margin: 0.65rem 0 0;
  color: var(--fg-muted);
}

.mail-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
}

@media (prefers-color-scheme: dark) {
  .mail-cta {
    color: #1a1208;
  }
}

.mail-cta:hover {
  filter: brightness(1.05);
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.75rem;
  color: var(--fg-faint);
  font-size: 0.9rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
}

.legal-note {
  margin-top: 1.25rem;
  max-width: 52rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-faint);
}

/* —— Motion —— */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.8s var(--ease) forwards;
  }

  .reveal-delay-1 { animation-delay: 0.08s; }
  .reveal-delay-2 { animation-delay: 0.16s; }
  .reveal-delay-3 { animation-delay: 0.24s; }

  .device {
    transition: transform 0.5s var(--ease);
  }

  .device:hover {
    transform: translateY(-4px);
  }

  .feature {
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
  }

  .feature:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    transform: translateY(-2px);
  }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

[hidden],
.lang-en,
html[lang="en"] .lang-yue,
html:not([lang="en"]) .lang-en {
  display: none !important;
}

html[lang="en"] .lang-en {
  display: revert !important;
}

html[lang="en"] .lang-en.inline,
.lang-yue.inline {
  display: inline !important;
}

html[lang="en"] .lang-yue.inline {
  display: none !important;
}
