/* 癲覆日曆 / Hangdate — hangdate.dmhongkong.com
   Apple product-page rhythm + brand jade / tea-ring.
   No tracking. Static only. */

:root {
  color-scheme: light dark;

  --porcelain: #f7f8f7;
  --surface: #ffffff;
  --ink: #1c2421;
  --ink-muted: #5a6561;
  --jade: #0b7a5a;
  --jade-bright: #0b9b6b;
  --jade-soft: #e3efeb;
  --liquor: #c47d1a;
  --liquor-soft: #f8e9d2;
  --granite: #d8dedc;
  --hairline: rgba(28, 36, 33, 0.12);
  --focus: rgba(11, 122, 90, 0.45);
  --scrim: rgba(28, 36, 33, 0.04);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "PingFang HK", "PingFang TC", "Noto Sans TC", "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --max: 980px;
  --max-narrow: 680px;
  --pad-x: clamp(1.25rem, 4vw, 2rem);

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --dur: 480ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --porcelain: #0b0d0c;
    --surface: #161a18;
    --ink: #f2f5f3;
    --ink-muted: #a3aea9;
    --jade: #3dba8e;
    --jade-bright: #4ccf9c;
    --jade-soft: #1a2e27;
    --liquor: #e8a04a;
    --liquor-soft: #3a2e1a;
    --granite: #2a312e;
    --hairline: rgba(242, 245, 243, 0.14);
    --focus: rgba(61, 186, 142, 0.55);
    --scrim: rgba(255, 255, 255, 0.04);
  }
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--jade-soft), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, var(--liquor-soft), transparent 50%),
    var(--porcelain);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--jade-bright);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: var(--pad-x);
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--porcelain);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
}

/* Type scale — Apple-like */
.eyebrow {
  font-size: 12px;
  line-height: 1.333;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.display {
  font-size: clamp(40px, 8vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.headline {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}

.title {
  font-size: 24px;
  line-height: 1.166;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.lede {
  font-size: 21px;
  line-height: 1.381;
  font-weight: 400;
  letter-spacing: 0.011em;
  color: var(--ink-muted);
  margin: var(--space-4) 0 0;
  max-width: 36em;
}

.body {
  font-size: 17px;
  line-height: 1.47059;
}

.body-sm {
  font-size: 14px;
  line-height: 1.428;
  letter-spacing: -0.016em;
  color: var(--ink-muted);
}

.caption {
  font-size: 12px;
  line-height: 1.333;
  color: var(--ink-muted);
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in srgb, var(--porcelain) 78%, transparent);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 52px;
  padding-block: var(--space-2);
}

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

.brand:hover {
  color: var(--ink);
}

.tea-ring {
  width: 18px;
  height: 18px;
  border: 2px solid var(--liquor);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--liquor-soft) 70%, transparent);
  flex-shrink: 0;
  opacity: 0.95;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.8vw, 1.35rem);
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .nav a.nav-home {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav {
    gap: 0.65rem;
  }

  .nav a {
    font-size: 13px;
  }
}

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

.lang-switch {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 11.5rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.lang-switch a {
  padding: 0.3rem 0.45rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  line-height: 1.2;
}

.lang-switch a[aria-current="true"] {
  background: var(--jade-soft);
  color: var(--jade);
}

@media (min-width: 720px) {
  .lang-switch {
    max-width: none;
    flex-wrap: nowrap;
  }

  .lang-switch a {
    padding: 0.35rem 0.55rem;
    font-size: 12px;
  }
}

/* Hero — one composition */
.hero {
  padding: clamp(3rem, 10vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-8);
  }
}

.hero__copy {
  max-width: 28rem;
}

.hero__brand {
  margin-bottom: var(--space-3);
}

.hero__ctas {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.store-badge {
  display: inline-block;
  /* Apple: min height 40px; clear space = 1/4 badge height ≈ 10px */
  padding: 10px;
  line-height: 0;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

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

.store-badge--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .store-badge--light {
    display: none;
  }
  .store-badge--dark {
    display: inline-block;
  }
}

.store-badge.is-placeholder {
  cursor: default;
  opacity: 0.92;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
}

.coming-soon::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--liquor);
}

.hero-device {
  justify-self: center;
  width: min(100%, 320px);
}

.device-frame {
  position: relative;
  border-radius: 36px;
  padding: 12px;
  background: linear-gradient(160deg, var(--granite), var(--surface));
  border: 1px solid var(--hairline);
  box-shadow: 0 24px 60px rgba(28, 36, 33, 0.12);
}

@media (prefers-color-scheme: dark) {
  .device-frame {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

.device-frame img {
  border-radius: 26px;
  width: 100%;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
  background: var(--granite);
}

/* Sections */
.section {
  padding: clamp(3.5rem, 9vw, 6rem) 0;
}

.section + .section {
  border-top: 1px solid var(--hairline);
}

.section__head {
  max-width: 36rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section__head .lede {
  margin-top: var(--space-3);
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 860px) {
  .feature-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .feature-row--flip .feature-row__media {
    order: 2;
  }

  .feature-row--flip .feature-row__text {
    order: 1;
  }
}

.feature-row__text h2 {
  margin-bottom: var(--space-3);
}

.feature-row__text p {
  margin: 0 0 var(--space-3);
  color: var(--ink-muted);
  max-width: 34em;
}

.feature-row__text ul {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.feature-row__text li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: var(--space-2);
  color: var(--ink);
}

.feature-row__text li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--jade);
}

.phone-shot {
  width: min(100%, 280px);
  margin-inline: auto;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.phone-shot img {
  width: 100%;
  aspect-ratio: 1206 / 2622;
  object-fit: cover;
}

.placeholder-shot {
  width: min(100%, 280px);
  margin-inline: auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 28px;
  border: 1px dashed var(--ink-muted);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      color-mix(in srgb, var(--ink-muted) 8%, transparent) 8px,
      color-mix(in srgb, var(--ink-muted) 8%, transparent) 16px
    ),
    var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-5);
  color: var(--ink-muted);
}

.placeholder-shot strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-bottom: var(--space-2);
}

.tabs-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (min-width: 720px) {
  .tabs-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tab-block {
  padding: var(--space-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface);
  min-height: 100%;
}

.tab-block h3 {
  margin: 0 0 var(--space-2);
  font-size: 17px;
  font-weight: 600;
}

.tab-block p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.note {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--liquor);
  background: color-mix(in srgb, var(--liquor-soft) 55%, var(--surface));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 15px;
}

/* Legal / support pages */
.page-hero {
  padding: clamp(2.5rem, 7vw, 4.5rem) 0 var(--space-5);
}

.page-hero h1 {
  margin-top: var(--space-2);
}

.prose {
  padding-bottom: var(--space-9);
}

.prose h2 {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: var(--space-7) 0 var(--space-3);
}

.prose h3 {
  font-size: 17px;
  font-weight: 600;
  margin: var(--space-5) 0 var(--space-2);
}

.prose p,
.prose li {
  color: var(--ink);
  max-width: 42em;
}

.prose p {
  margin: 0 0 var(--space-4);
}

.prose ul {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose .muted,
.prose .body-sm {
  color: var(--ink-muted);
}

.mailto-card {
  display: block;
  margin: var(--space-5) 0;
  padding: var(--space-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.mailto-card:hover {
  border-color: color-mix(in srgb, var(--jade) 45%, var(--hairline));
  background: var(--jade-soft);
}

.mailto-card strong {
  display: block;
  font-size: 19px;
  color: var(--jade);
  margin-bottom: var(--space-2);
  word-break: break-all;
}

.faq details {
  border-top: 1px solid var(--hairline);
  padding: var(--space-4) 0;
}

.faq details:last-child {
  border-bottom: 1px solid var(--hairline);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--ink-muted);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: var(--space-3) 0 0;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-6) 0 var(--space-8);
  color: var(--ink-muted);
  font-size: 13px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

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

.site-footer a:hover {
  color: var(--jade);
}

/* Motion — restrained */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: rise var(--dur) var(--ease) both;
  }

  .reveal-delay-1 {
    animation-delay: 80ms;
  }

  .reveal-delay-2 {
    animation-delay: 160ms;
  }

  .reveal-delay-3 {
    animation-delay: 240ms;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3 {
    animation: none;
  }
}

/* Print */
@media print {
  .site-header,
  .lang-switch,
  .store-badge {
    position: static;
    backdrop-filter: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
