/* ==========================================================================
   MemoFace — official site styles
   Palette from the app's ticket skins: paper cream, dark ink, coral accent.
   ========================================================================== */

:root {
  --paper: #f4efe5;
  --paper-soft: #faf7f0;
  --paper-card: #fffdf8;
  --ink: #1c1a16;
  --ink-soft: #4c463c;
  --muted: #7a7264;
  --line: #e3dccb;
  --accent: #ff6847;
  --accent-deep: #d94e2e;
  --accent-soft: #ffe9e2;
  --teal: #1e6f65;
  --dark: #191713;
  --dark-card: #23201a;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 22, 0.06), 0 4px 14px rgba(28, 26, 22, 0.07);
  --shadow-md: 0 2px 6px rgba(28, 26, 22, 0.08), 0 18px 44px rgba(28, 26, 22, 0.14);
  --font: "Avenir Next", "Avenir", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "Yu Gothic UI", "Noto Sans CJK JP",
    "Malgun Gothic", "Noto Sans KR", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
}

h1, h2, h3 { line-height: 1.22; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---------- ticket perforation helpers ---------- */

.perf-top, .perf-bottom {
  --dot: 9px;
  position: relative;
  height: var(--dot);
  background-image: radial-gradient(circle at 50% 50%, var(--paper) 46%, transparent 50%);
  background-size: calc(var(--dot) * 2) var(--dot);
  background-position: 0 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: 600 16px/1.2 var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 104, 71, 0.35);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { background: rgba(28, 26, 22, 0.06); }

.btn[disabled] { opacity: 0.65; cursor: default; transform: none; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 239, 229, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
}
.main-nav a:hover { color: var(--ink); background: rgba(28, 26, 22, 0.06); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--accent-deep); }

.header-cta { display: inline-flex; }

/* language switcher */

.lang-switch { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-card);
  color: var(--ink-soft);
  font: 600 14px/1.2 var(--font);
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--ink-soft); }
.lang-btn .globe { width: 17px; height: 17px; flex: none; }
.lang-btn .caret { width: 10px; height: 10px; flex: none; transition: transform 0.18s ease; }
.lang-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 205px;
  padding: 7px;
  border-radius: 14px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 60;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-soft);
  font: 500 15px/1.3 var(--font);
  cursor: pointer;
  text-align: left;
}
.lang-menu button:hover { background: rgba(28, 26, 22, 0.06); color: var(--ink); }
.lang-menu button[aria-checked="true"] { color: var(--accent-deep); font-weight: 700; }
.lang-menu button[aria-checked="true"]::after { content: "✓"; }

/* hamburger */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-card);
  cursor: pointer;
  position: relative;
}
.nav-toggle .bar {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.nav-toggle .bar:nth-child(1) { top: 15px; }
.nav-toggle .bar:nth-child(2) { top: 21px; }
.nav-toggle .bar:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- hero ---------- */

.hero { padding: 72px 0 30px; position: relative; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.hero h1 { font-size: clamp(34px, 5.2vw, 56px); margin-bottom: 18px; }
.hero .sub {
  font-size: clamp(16.5px, 1.7vw, 19px);
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 15px; height: 15px; color: var(--teal); flex: none; }

/* phone mockup */

.phone {
  position: relative;
  border-radius: 40px;
  background: #0e0d0b;
  padding: 11px;
  box-shadow: var(--shadow-md), 0 30px 70px rgba(28, 26, 22, 0.28);
  transform: rotate(2.2deg);
}
.phone::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 17px;
  transform: translateX(-50%);
  width: 92px;
  height: 26px;
  border-radius: 999px;
  background: #0e0d0b;
  z-index: 2;
}
.phone img { border-radius: 30px; width: 100%; height: auto; }

.hero-visual { position: relative; }

.hero-chip {
  position: absolute;
  z-index: 3;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-chip small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.hero-chip.chip-a { top: 14%; left: -28px; transform: rotate(-4deg); }
.hero-chip.chip-b { bottom: 12%; right: -20px; transform: rotate(3deg); }
.hero-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- stat band ---------- */

.stat-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 44px 0 0;
}
.stat {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: clamp(22px, 2.6vw, 30px); color: var(--accent-deep); letter-spacing: -0.01em; }
.stat span { color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---------- sections ---------- */

.section { padding: 84px 0; }
.section.dark { background: var(--dark); color: #f3ede2; }
.section.dark h2, .section.dark h3 { color: #fbf8f1; }
.section.alt { background: var(--paper-soft); }

.section-head { max-width: 640px; margin: 0 auto 46px; text-align: center; }
.section-head h2 { font-size: clamp(27px, 3.6vw, 38px); }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.section.dark .section-head p { color: #b3aa99; }

/* features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.feature .ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 16px;
}
.feature .ico svg { width: 23px; height: 23px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* showcase */

.showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 3.4vw, 42px);
  align-items: end;
  justify-items: center;
}
.showcase figure { margin: 0; text-align: center; }
.showcase .phone { transform: none; }
.showcase figure:nth-child(1) .phone { transform: rotate(-2deg) translateY(14px); }
.showcase figure:nth-child(3) .phone { transform: rotate(2deg) translateY(14px); }
.showcase figcaption { margin-top: 20px; font-weight: 700; font-size: 15px; color: #e8e1d2; }
.showcase figcaption small { display: block; font-weight: 500; color: #a89f8d; margin-top: 3px; }

/* privacy blurb on dark */

.privacy-blurb {
  margin: 60px auto 0;
  max-width: 720px;
  background: var(--dark-card);
  border: 1px solid #353026;
  border-radius: var(--radius);
  padding: 26px 28px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  color: #d9d1c0;
  font-size: 15px;
}
.privacy-blurb svg { width: 24px; height: 24px; color: #7fd0c2; flex: none; margin-top: 2px; }
.privacy-blurb a { color: #ffb8a5; }

/* faq */

.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px 22px;
  box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 0;
  font-weight: 700;
  font-size: 16.5px;
  min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 11px;
  height: 11px;
  flex: none;
  border-right: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  margin-top: -4px;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.faq details p { color: var(--ink-soft); font-size: 15.5px; padding-bottom: 16px; margin: 0; }

/* download CTA */

.cta-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
  padding: 56px 32px;
  text-align: center;
  overflow: hidden;
}
.cta-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  pointer-events: none;
}
.cta-card h2 { font-size: clamp(26px, 3.4vw, 36px); }
.cta-card p { color: var(--muted); max-width: 34em; margin: 0 auto 30px; }
.store-buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--dark);
  color: #b7ae9c;
  padding: 46px 0 38px;
  margin-top: 84px;
}
.section.dark + .site-footer, .cta-wrap + .site-footer { margin-top: 0; }

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: #f3ede2; font-weight: 700; font-size: 18px; }
.footer-brand img { width: 30px; height: 30px; border-radius: 8px; }
.footer-tag { margin-top: 10px; max-width: 30em; font-size: 14px; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.footer-nav a { color: #cfc6b4; font-size: 15px; font-weight: 600; }
.footer-nav a:hover { color: #fff; }

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #322d24;
  font-size: 13.5px;
  color: #8f877a;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ---------- legal pages ---------- */

.legal-main { padding: 64px 0 90px; }

.doc-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.doc-head {
  padding: 40px 48px 30px;
  border-bottom: 2px dashed var(--line);
  background: var(--paper-soft);
}
.doc-head h1 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 8px; }
.doc-head .meta { color: var(--muted); font-size: 14.5px; }

.doc-body { padding: 36px 48px 48px; }
.doc-body h2 {
  font-size: 19.5px;
  margin: 34px 0 10px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body p, .doc-body li { color: var(--ink-soft); font-size: 15.5px; }
.doc-body ul { margin: 0 0 14px; padding-left: 22px; }
.doc-body li { margin-bottom: 7px; }
.doc-body a { word-break: break-word; }

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.legal-links a {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-card);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14.5px;
}
.legal-links a:hover { border-color: var(--ink-soft); color: var(--ink); text-decoration: none; }

/* ---------- feedback page ---------- */

.feedback-main { padding: 64px 0 90px; }

.feedback-card {
  max-width: 660px;
  margin: 0 auto;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.feedback-head {
  padding: 36px 36px 26px;
  border-bottom: 2px dashed var(--line);
  background: var(--paper-soft);
  text-align: center;
}
.feedback-head h1 { font-size: clamp(24px, 3.2vw, 30px); margin-bottom: 6px; }
.feedback-head p { color: var(--muted); margin: 0; font-size: 15.5px; }

.feedback-body { padding: 30px 36px 36px; }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }

.field textarea,
.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px 16px;
  font: 500 15.5px/1.55 var(--font);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 150px; resize: vertical; }
.field textarea:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 104, 71, 0.16);
}

.field.invalid textarea { border-color: #c0392b; box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.12); }

.field-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
  min-height: 20px;
}
.field-error { color: #c0392b; font-size: 13.5px; font-weight: 600; display: none; }
.field.invalid .field-error { display: block; }
.char-count { color: var(--muted); font-size: 13px; margin-left: auto; }

.feedback-actions { margin-top: 26px; }
.btn-submit { width: 100%; min-height: 54px; font-size: 17px; }

.spinner {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* success panel */

.success-panel { text-align: center; padding: 34px 10px 18px; display: none; }
.feedback-card.sent .feedback-body { display: none; }
.feedback-card.sent .success-panel { display: block; }

.success-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.success-badge svg { width: 36px; height: 36px; color: var(--accent-deep); }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.success-panel h2 { font-size: 24px; }
.success-panel p { color: var(--muted); margin-bottom: 26px; }

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 90px);
  background: var(--ink);
  color: #fdfbf6;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
  z-index: 100;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 46px; }
  .hero-visual { max-width: 400px; margin: 0 auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 36px); }

  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper-card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 10px 18px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 13px 14px; font-size: 16px; }
  .header-cta { display: none; }
  .main-nav .header-cta { display: inline-flex; margin-top: 10px; justify-content: center; }

  .hero { padding: 46px 0 20px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-chip.chip-a { left: -6px; }
  .hero-chip.chip-b { right: -6px; }

  .stat-band { grid-template-columns: 1fr; gap: 10px; margin-top: 34px; }
  .stat { display: flex; align-items: baseline; gap: 14px; text-align: left; padding: 14px 20px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 13.5px; }

  .section { padding: 60px 0; }
  .section-head { margin-bottom: 34px; }

  .feature-grid { grid-template-columns: 1fr; }

  .showcase { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .showcase figure:nth-child(2) { grid-column: 2; z-index: 2; }
  .showcase figure:nth-child(1) { grid-column: 1; grid-row: 1; }
  .showcase figure:nth-child(3) { grid-column: 3; grid-row: 1; }
  .showcase .phone { border-radius: 26px; padding: 7px; }
  .showcase .phone img { border-radius: 20px; }
  .showcase .phone::after { top: 11px; width: 60px; height: 18px; }
  .showcase figcaption { font-size: 12.5px; }
  .showcase figcaption small { display: none; }

  .privacy-blurb { flex-direction: column; padding: 22px 20px; }

  .cta-card { padding: 42px 22px; }

  .doc-head { padding: 30px 24px 24px; }
  .doc-body { padding: 26px 24px 36px; }
  .doc-body h2 { font-size: 18px; }

  .feedback-head { padding: 28px 22px 20px; }
  .feedback-body { padding: 24px 22px 28px; }

  .footer-grid { flex-direction: column; }
  .footer-bottom { flex-direction: column; gap: 6px; }
}

@media (max-width: 400px) {
  .showcase figcaption { display: none; }
  .hero-chip { font-size: 12.5px; padding: 8px 12px; }
}

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

@media print {
  .site-header, .site-footer, .legal-links, .toast { display: none !important; }
  body { background: #fff; }
  .doc-card { box-shadow: none; border: 0; }
}
