/* === pictan LP — design tokens (Anthropic-derived) === */
:root {
  /* Brand & accent */
  --primary: #cc785c;
  --primary-text-on-soft: #a5563c; /* terracotta text on --surface-soft, 4.63:1 (WCAG AA) */
  --accent-amber: #e8a55a;

  /* Surface */
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elev: #252320;
  --surface-dark-soft: #1f1e1b;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;

  /* Text */
  --ink: #141413;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;

  /* Semantic */
  --success: #5db872;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  /* Type */
  --font-display: "Cormorant Garamond", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Inter", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Korean / Simplified / Traditional Chinese LPs: system CJK fonts for those scripts (Noto Sans JP would draw Chinese with
   Japanese glyph shapes; the TC fonts draw the Taiwan standard forms); Korean breaks lines between words. */
html[lang="ko"] {
  --font-display: "Cormorant Garamond", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif;
  --font-body: "Inter", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  word-break: keep-all;
}
html[lang="zh-Hans"] {
  --font-display: "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", serif;
  --font-body: "Inter", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}
html[lang="zh-Hant"] {
  --font-display: "Cormorant Garamond", "Songti TC", "Noto Serif TC", serif;
  --font-body: "Inter", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  /* Cormorant Garamond defaults to old-style (small) figures; force lining digits everywhere. */
  font-variant-numeric: lining-nums;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* contain decorative bleed without breaking sticky nav */
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 96px 0;
}

/* Type utilities */
.display-lg {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; height: 44px;
  border-radius: var(--r-md);
  font-weight: 500; font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn--on-dark {
  background: var(--canvas); color: var(--ink);
}
.btn--on-dark:hover { background: #fff; }
.btn--lg { height: 52px; padding: 14px 26px; font-size: 15px; }

/* Top nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: 64px;
  background: rgba(250, 249, 245, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-soft);
}
.nav__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 500; font-size: 22px;
  letter-spacing: -0.01em;
}
/* Cormorant Garamond はベースラインが行ボックス内で低く、隣の Inter テキスト（nav リンク）や
   ロゴより約2px下にグリフが描画される。光学的に揃えるための補正（leading では直らない種類のズレ）。*/
.nav__brand span, .footer__brand span {
  position: relative;
  top: -2px;
}
.nav__brand-logo, .footer__brand-logo {
  width: 32px; height: 32px;
  border-radius: 7px;
  flex-shrink: 0;
}
.nav__links {
  display: flex; gap: 28px;
  font-size: 14px; font-weight: 500;
  color: var(--body);
}
.nav__links a:hover { color: var(--ink); }
@media (max-width: 768px) {
  .nav__links { display: none; }
}

/* Language menu: one button, the LP languages listed by app.js LP_LANGUAGES (single source). */
.nav__lang {
  position: relative;
  margin-right: 10px;
  font-size: 13px; font-weight: 500;
  color: var(--body);
}
.nav__lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 10px;
  border-radius: var(--r-md);
  color: var(--body);
  white-space: nowrap;
}
.nav__lang-toggle:hover, .nav__lang-toggle[aria-expanded="true"] { color: var(--ink); background: var(--surface-card); }
.nav__lang-globe { width: 18px; height: 18px; flex-shrink: 0; }
.nav__lang-caret { width: 12px; height: 12px; flex-shrink: 0; }
.nav__lang-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.nav__lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 176px; margin: 0; padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 40px -18px rgba(20, 20, 19, 0.35);
  /* Seven 44px items fit below the 64px sticky nav on any portrait phone; on a shorter viewport (landscape phone) the
     list scrolls instead of running off the screen, where the sticky nav would make it unreachable. */
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
}
.nav__lang-list[hidden] { display: none; }
.nav__lang-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 15px; color: var(--ink);
}
.nav__lang-item:hover, .nav__lang-item:focus-visible { background: var(--surface-soft); }
.nav__lang-item[aria-current="page"] { font-weight: 600; color: var(--primary-text-on-soft); }
.nav__lang-item[aria-current="page"]::after { content: "✓"; }
@media (max-width: 560px) {
  .nav__lang { margin-right: 4px; }
  .nav__lang-toggle { gap: 4px; padding: 0 8px; }
}
/* Narrow phones (under 380px): globe + caret only (the current language stays in the accessible name). */
@media (max-width: 379px) {
  .nav__lang-current { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .nav__lang-toggle { min-width: 44px; justify-content: center; padding: 0 6px; }
}
/* High-contrast App Store CTA (header and first view of every LP page). Uses the dark surface
   tokens; the header variant stays visible on phones with a short label. */
.btn--store {
  background: var(--surface-dark); color: var(--on-dark);
  font-weight: 600;
}
.btn--store:hover { background: var(--surface-dark-elev); }
.nav__store { flex-shrink: 0; }
.nav__store-short { display: none; }
/* Screen-reader-only tail for the short header label ("Get Pictan" + " on the App Store"). */
.nav__store-sr {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .nav__store-long { display: none; }
  .nav__store-short { display: inline; }
}
@media (max-width: 360px) {
  .lp-v4 .nav .btn.nav__store { padding: 10px 8px; }
  .nav:has(.nav__store) .nav__lang { margin-right: 2px; }
}

/* LP first view (every LP page): headline, the phone frame with the app's review screens in the "stack" area (.fvp in
   v4-lp.css, fv-shots.js), and the actions. Japanese headline sizing is in the html[lang="ja"] rules after this block. */
.fvc { padding: 24px 0 28px; }
.fvc__grid {
  display: grid;
  grid-template-areas: "copy" "stack" "actions";
  justify-items: center;
  text-align: center;
}
.fvc__grid > * { min-width: 0; }
.fvc__copy { grid-area: copy; }
.fvc__actions { grid-area: actions; width: 100%; display: flex; flex-direction: column; align-items: center; }
.fvc__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600; font-size: 40px; line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.fvc__sub { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--body); }
.fvc__toggle {
  position: absolute; right: 18px; top: 18px; z-index: 5;
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(24, 23, 21, 0.72); color: var(--on-dark);
}
.fvc__toggle[hidden] { display: none; }
.fvc__toggle::before { content: ""; position: absolute; inset: -6px; }
.fvc__toggle svg { width: 14px; height: 14px; fill: currentColor; }
.fvc__toggle .fvc__icon-play { display: none; }
.fvc__toggle.is-paused .fvc__icon-pause { display: none; }
.fvc__toggle.is-paused .fvc__icon-play { display: block; }
.lp-v4 .fvc__store {
  margin-top: 22px;
  width: 100%; max-width: 335px; height: 54px;
  justify-content: center; gap: 10px;
  border-radius: var(--r-lg);
  font-size: 16px;
}
.fvc__store svg { width: 20px; height: 20px; flex-shrink: 0; }
.fvc__chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
  margin: 14px 0 0; padding: 0; list-style: none;
  max-width: 335px;
}
.fvc__chips li {
  font-size: 12px; font-weight: 500; color: var(--body);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px 8px;
  white-space: nowrap;
}
.fvc__chips li:nth-child(-n+2) { color: var(--primary-text-on-soft); }
@media (max-width: 340px) {
  .fvc__title { font-size: 34px; }
}
@media (min-width: 900px) {
  .fvc { padding: 72px 0 80px; }
  .fvc__grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-rows: auto auto;
    grid-template-areas: "copy stack" "actions stack";
    column-gap: 64px;
    justify-items: start;
    align-items: end;
    text-align: left;
  }
  .fvc__actions { align-items: flex-start; align-self: start; }
  .fvc__title { font-size: clamp(56px, 5.4vw, 72px); }
  .fvc__sub { margin-top: 16px; font-size: 19px; }
  .lp-v4 .fvc__store { margin-top: 32px; width: auto; padding: 0 28px; }
  .fvc__chips { justify-content: flex-start; max-width: none; }
  .fvc__chips li { font-size: 13px; padding: 5px 10px; }
}
html.lp-translated .fvc__title { font-size: 28px; line-height: 1.3; letter-spacing: -0.01em; }
html.lp-translated .fvc__sub { font-size: 14px; }
html:is([lang="es"], [lang="pt"]) .fvc__title { font-size: 26px; }
@media (max-width: 340px) {
  html.lp-translated .fvc__title { font-size: 24px; }
}
@media (min-width: 900px) {
  html.lp-translated .fvc__title { font-size: clamp(40px, 4vw, 52px); }
  html.lp-translated .fvc__sub { font-size: 18px; }
}
/* ja.html: the Japanese headline is set smaller so each line of the catchphrase stays on one line. */
html[lang="ja"] .fvc__title { font-size: 30px; line-height: 1.35; letter-spacing: -0.01em; }
@media (max-width: 340px) {
  html[lang="ja"] .fvc__title { font-size: 26px; }
}
@media (min-width: 900px) {
  html[lang="ja"] .fvc__title { font-size: clamp(42px, 4.2vw, 54px); }
}

/* iPhone frame */
.phone {
  position: relative;
  width: 320px;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 320 / 660;
  background: #0a0a0a;
  border-radius: 48px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 30px 60px -20px rgba(20, 20, 19, 0.25),
    0 10px 30px -15px rgba(20, 20, 19, 0.15);
}

/* Levels */
.levels {
  background: var(--surface-soft);
}

/* Privacy */
.privacy {
  background: var(--surface-dark);
  color: var(--on-dark);
}
.privacy .display-lg { color: var(--on-dark); }
.privacy__lead {
  color: var(--on-dark-soft);
  margin-top: 16px;
  max-width: 620px;
  font-size: 16px; line-height: 1.7;
}

/* FAQ */
.faq {
  background: var(--canvas);
}
.faq__list {
  margin-top: 40px;
  border-top: 1px solid var(--hairline);
}
.faq-item {
  border-bottom: 1px solid var(--hairline);
}
.faq-item__q {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0;
  font-family: var(--font-body);
  font-size: 17px; font-weight: 500;
  color: var(--ink);
  text-align: left;
}
.faq-item__icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.faq-item--open .faq-item__icon { transform: rotate(45deg); }
.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--body);
  font-size: 15px; line-height: 1.7;
  padding-right: 60px;
}
.faq-item--open .faq-item__a {
  max-height: 500px;
  padding-bottom: 24px;
}

/* Final CTA */
.final-cta {
  padding: 96px 0;
  background: var(--canvas);
}
.final-cta__card {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-xl);
  padding: 80px 48px;
  text-align: center;
}
@media (max-width: 720px) {
  .final-cta__card { padding: 56px 28px; }
}
.final-cta__title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500; line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--on-primary);
  margin: 0 0 20px;
}
.final-cta__sub {
  font-size: 17px; line-height: 1.6;
  color: rgba(255,255,255,0.92);
  max-width: 540px;
  margin: 0 auto 36px;
}

/* Footer */
.footer {
  background: var(--surface-dark);
  color: var(--on-dark-soft);
  padding: 56px 0 40px;
}
.footer__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.footer__brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 22px; color: var(--on-dark);
}
.footer__links {
  display: flex; gap: 28px;
  font-size: 14px;
  flex-wrap: wrap;
}
.footer__links a:hover { color: var(--on-dark); }
.footer__bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #2c2a27;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted-soft);
  flex-wrap: wrap; gap: 12px;
}

/* Section header */
.section-header {
  max-width: 780px;
}
.section-header__sub {
  margin-top: 18px;
  font-size: 17px; line-height: 1.65;
  color: var(--body);
}

/* #try section (LP pages): the app's review screens and the letter-hint examples. */
.demo-live { background: var(--surface-soft); }
.demo-live__layout {
  margin-top: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .demo-live__layout { grid-template-columns: 1fr; gap: 32px; justify-items: center; }
}

/* No-JS fallback for the language menu (noscript in the footer of every LP). */
.footer__langs { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 20px; font-size: 14px; }
.footer__langs a { color: inherit; text-decoration: underline; }
