/* MyPaw landing — foundations: type ramp, design tokens, base elements, buttons,
   header, footer and section scaffolding.
   Type: the platform system font — SF Pro on iPhone, iPad and Mac, the same face
   the app itself uses — sized on Apple's HIG text styles, with no web-font download.
   Colour: the app's default "coral" palette (ios/App/App/Native/Core/AppPalette.swift);
   every text pair passes WCAG AA. */

:root {
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Apple HIG text styles (pt → px at the default 16px root). */
  --fs-caption: 0.75rem;     /* Caption 1   12 */
  --fs-footnote: 0.8125rem;  /* Footnote    13 */
  --fs-subhead: 0.9375rem;   /* Subheadline 15 */
  --fs-callout: 1rem;        /* Callout     16 */
  --fs-body: 1.0625rem;      /* Body        17 */
  --fs-title3: 1.25rem;      /* Title 3     20 */
  --fs-title2: 1.375rem;     /* Title 2     22 */
  --fs-title1: 1.75rem;      /* Title 1     28 */
  --fs-large: 2.125rem;      /* Large Title 34 */
  /* Web display sizes start from those styles and grow with the viewport. */
  --fs-intro: clamp(1.0625rem, 0.95rem + 0.45vw, 1.25rem);  /* 17 → 20 */
  --fs-h2: clamp(2.125rem, 1.45rem + 2.3vw, 3rem);          /* 34 → 48 */
  --fs-h1: clamp(2.375rem, 1rem + 3.6vw, 4rem);             /* 38 → 64 */

  --bg: #fff8fb;
  --bg-tint: #fdf0f6;
  --surface: #ffffff;
  --surface-2: #faf4fa;
  --glass: rgba(255, 255, 255, 0.72);
  --header-bg: rgba(255, 248, 251, 0.8);
  --ink: #221629;
  --ink-2: #5d4c69;
  --line: rgba(34, 22, 41, 0.08);
  --line-strong: rgba(34, 22, 41, 0.15);
  --accent: #d6336c;
  --accent-strong: #b8285b;
  --accent-soft: #ffe4ee;
  --hl-from: #ec3f74;
  --hl-to: #9d4fd6;
  --deep-grad: linear-gradient(135deg, #c42d63 0%, #9e3a9f 55%, #6d3fc4 100%);
  --blob-warm: rgba(255, 174, 203, 0.55);
  --blob-cool: rgba(205, 180, 255, 0.5);
  --dot: rgba(34, 22, 41, 0.14);

  --shadow-sm: 0 1px 2px rgba(34, 22, 41, 0.05), 0 10px 26px -18px rgba(34, 22, 41, 0.28);
  --shadow-md: 0 2px 6px rgba(34, 22, 41, 0.05), 0 28px 56px -30px rgba(34, 22, 41, 0.4);
  --shadow-art: 0 44px 90px -44px rgba(176, 58, 107, 0.6);
  --radius: 26px;
  --radius-lg: 40px;

  --tone-pink-bg: #ffe4ee;   --tone-pink: #cf2f67;
  --tone-violet-bg: #efe4ff; --tone-violet: #7443c9;
  --tone-green-bg: #daf4e8;  --tone-green: #0d8058;
  --tone-amber-bg: #fff0d6;  --tone-amber: #a95207;
  --tone-blue-bg: #e0ecff;   --tone-blue: #2459d6;
  --tone-teal-bg: #d6f3f2;   --tone-teal: #0d6f68;

  --panel-pink: linear-gradient(160deg, #ffe6ef 0%, #ffcfe0 100%);
  --panel-violet: linear-gradient(160deg, #f1e8ff 0%, #dccbff 100%);
  --panel-amber: linear-gradient(160deg, #fff3de 0%, #ffddb3 100%);
  --panel-blue: linear-gradient(160deg, #e6efff 0%, #cfdcff 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120d17;
    --bg-tint: #18111e;
    --surface: #1f1726;
    --surface-2: #271e2f;
    --glass: rgba(31, 23, 38, 0.72);
    --header-bg: rgba(18, 13, 23, 0.78);
    --ink: #f7eef8;
    --ink-2: #c8b8d3;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #ff8fb0;
    --accent-strong: #ffb3c9;
    --accent-soft: #3a1b2a;
    --hl-from: #ff8fb0;
    --hl-to: #c9a3ff;
    --blob-warm: rgba(120, 40, 72, 0.5);
    --blob-cool: rgba(70, 50, 130, 0.5);
    --dot: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px -18px rgba(0, 0, 0, 0.8);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 28px 56px -30px rgba(0, 0, 0, 0.9);
    --shadow-art: 0 44px 90px -44px rgba(0, 0, 0, 0.9);

    --tone-pink-bg: #3a1b2a;   --tone-pink: #ff8fb0;
    --tone-violet-bg: #2c2143; --tone-violet: #c4a6ff;
    --tone-green-bg: #163426;  --tone-green: #5fd3a4;
    --tone-amber-bg: #3a2a12;  --tone-amber: #f5b454;
    --tone-blue-bg: #1b2a45;   --tone-blue: #8ab4ff;
    --tone-teal-bg: #14312f;   --tone-teal: #5fd0c6;

    --panel-pink: linear-gradient(160deg, #3b1b2b 0%, #2a1420 100%);
    --panel-violet: linear-gradient(160deg, #2d2245 0%, #201833 100%);
    --panel-amber: linear-gradient(160deg, #3d2618 0%, #2a1a12 100%);
    --panel-blue: linear-gradient(160deg, #1e2c49 0%, #151e35 100%);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  /* Looser than SF's 1.29 app leading: Vietnamese stacks tone marks above vowels. */
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
h3 { font-size: var(--fs-title3); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
p, figure { margin: 0; }
p { text-wrap: pretty; }
ul, ol { list-style: none; margin: 0; padding: 0; }
/* accent-strong, not accent: plain accent drops under 4.5:1 on the tinted sections. */
a { color: var(--accent-strong); text-underline-offset: 3px; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Safe-area insets keep content clear of the notch / Dynamic Island in landscape (viewport-fit=cover). */
.container {
  --gutter: 40px;
  width: min(1180px, 100% - var(--gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  margin-inline: auto;
}
@media (min-width: 768px) { .container { --gutter: 64px; } }

.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.hl {
  background: linear-gradient(115deg, var(--hl-from), var(--hl-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Keep a highlighted phrase on one line (balanced wrapping split "nhẹ | nhàng hơn");
   below 360px the longest phrase would not fit, so wrapping stays allowed there. */
@media (min-width: 360px) { h2 .hl { white-space: nowrap; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 24px; border-radius: 16px;
  font: inherit; font-size: var(--fs-body); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon-arrow { transition: transform 0.2s ease; }
.btn-sm { min-height: 44px; padding: 0 18px; border-radius: 13px; font-size: var(--fs-subhead); }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: 0 16px 32px -18px rgba(34, 22, 41, 0.75); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong), var(--shadow-sm); }
.btn-light { background: #fff; color: #9c1f4f; box-shadow: 0 16px 34px -16px rgba(0, 0, 0, 0.5); }
/* Hover lifts only where a pointer can hover; on touch screens they would stick after a tap. */
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn:hover .icon-arrow { transform: translateX(3px); }
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 34px; }
/* Phones: full-width, equal buttons (iOS pattern) instead of two ragged widths. */
@media (max-width: 559px) { .actions .btn { flex: 1 1 100%; } }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 12px; height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto;
  color: var(--ink); font-size: var(--fs-title2); font-weight: 700; letter-spacing: -0.02em; text-decoration: none;
}
.brand img { border-radius: 11px; box-shadow: 0 6px 16px -8px rgba(37, 88, 235, 0.6); }
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--ink-2); font-size: var(--fs-subhead); font-weight: 500; text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.header-cta { margin-left: 8px; }

.menu { position: relative; }
.menu > summary {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  list-style: none; cursor: pointer; color: var(--ink);
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu .icon { width: 22px; height: 22px; }
.menu .icon-close, .menu[open] .icon-open { display: none; }
.menu[open] .icon-close { display: block; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  display: grid; gap: 2px; min-width: 230px; padding: 8px; border-radius: 20px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.menu-panel a { padding: 12px 14px; border-radius: 12px; color: var(--ink); font-weight: 500; text-decoration: none; }
.site-nav a:active, .menu-panel a:active { background: var(--accent-soft); }
@media (hover: hover) {
  .site-nav a:hover { color: var(--ink); background: var(--accent-soft); }
  .menu-panel a:hover { background: var(--accent-soft); }
}
@media (max-width: 939px) { .site-nav, .header-cta { display: none; } }
@media (min-width: 940px) { .menu { display: none; } }

/* ── Sections ─────────────────────────────────────────────────────────── */
.section { position: relative; padding: 72px 0; }
.section-tint { background: var(--bg-tint); }
.section-head { max-width: 700px; margin: 0 auto 48px; text-align: center; }
.section-head h2 + p { margin-top: 16px; color: var(--ink-2); font-size: var(--fs-intro); }
.section-head-left { margin: 0; text-align: left; }
/* Sentence-case eyebrow (Apple style): uppercase Vietnamese with tone marks reads poorly when small. */
.kicker {
  display: inline-flex; align-items: center; margin-bottom: 16px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: var(--fs-subhead); font-weight: 600;
}
@media (min-width: 960px) { .section { padding: 120px 0; } .section-head { margin-bottom: 64px; } }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  padding: 72px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-tint); border-top: 1px solid var(--line); font-size: var(--fs-subhead);
}
.footer-grid { display: grid; gap: 36px; }
.footer-brand p { max-width: 34em; margin-top: 14px; color: var(--ink-2); }
.footer-mail { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.footer-col { display: grid; align-content: start; }
.footer-title { margin-bottom: 4px; font-size: var(--fs-subhead); font-weight: 600; letter-spacing: 0; }
/* Each link is a full 44pt row, per Apple's minimum hit target. */
.footer-col a { display: flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.footer-col a:active { color: var(--accent-strong); }
@media (hover: hover) { .footer-col a:hover { color: var(--accent-strong); } }
/* Pháp nhân: Apple cần thấy tên miền thuộc công ty nào khi duyệt app. */
.footer-legal {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--fs-footnote);
}
.footer-legal address { font-style: normal; line-height: 1.7; max-width: 58ch; }
.footer-legal strong { color: var(--ink); font-weight: 600; }
/* Điện thoại/email cũng là hàng 44pt như các link chân trang. */
.footer-contact { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-contact a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--accent-strong); font-weight: 600; text-decoration: none;
}
.footer-contact a:active { opacity: 0.6; }
@media (hover: hover) { .footer-contact a:hover { text-decoration: underline; } }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 4px; color: var(--ink-2); font-size: var(--fs-footnote);
}
.footer-bottom p { display: inline-flex; align-items: center; gap: 6px; }
.footer-bottom .icon { color: var(--accent); }
/* Phones: the two link lists sit side by side under the brand instead of one long column. */
@media (max-width: 759px) {
  .footer-grid { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }

/* ── Motion (progressive: scroll-driven where supported) ──────────────── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    .site-header { animation: header-shade linear both; animation-timeline: scroll(); animation-range: 0 140px; }
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
@keyframes header-shade { to { box-shadow: 0 14px 34px -26px rgba(34, 22, 41, 0.45); } }

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

/* ── Accessibility settings (Increase Contrast, Reduce Transparency) ──── */
@media (prefers-contrast: more) {
  :root { --ink-2: #3d2e47; --line: rgba(34, 22, 41, 0.32); --line-strong: rgba(34, 22, 41, 0.55); --glass: #fff; --header-bg: #fff8fb; }
  .hl, .facts strong { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent-strong); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --ink-2: #e8ddf0; --line: rgba(255, 255, 255, 0.36); --line-strong: rgba(255, 255, 255, 0.6); --glass: #1f1726; --header-bg: #120d17; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--surface); --header-bg: var(--bg); }
  .site-header, .eyebrow, .facts li { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
