/* MatchWords website — matches the app: sky blue, rounded type, four mode colours. */

:root {
  --ink: #24304a;
  --muted: #5d6781;
  --line: #e2e9f1;
  --surface: #ffffff;
  --page: #f3f7fb;
  --sky-1: #badff5;
  --sky-2: #e2eff5;
  --blue: #2f74b2;
  --blue-dark: #245a8e;
  --study: #3fbfa8; --study-soft: #e4f7f3; --study-ink: #1e7f6e;
  --match: #fb8f78; --match-soft: #fff0eb; --match-ink: #b84a35;
  --play: #5aa9ea;  --play-soft: #e8f3fd;  --play-ink: #2f6aa3;
  --quiz: #9d82f5;  --quiz-soft: #f1ecfe;  --quiz-ink: #5f43c0;
  --gold: #e7b44a;  --gold-soft: #fff8e8;  --gold-ink: #7a5300;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(43, 74, 106, 0.1);
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Maru Gothic ProN", sans-serif;
  --jp: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
*:focus, *:focus-visible { outline: none; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 900; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
.lede { font-size: 1.15rem; color: var(--muted); font-weight: 600; }
.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.jp { font-family: var(--jp); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 247, 251, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(226, 233, 241, 0.8);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.15rem; }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 800; font-size: 0.97rem; }
.nav a:hover { color: var(--ink); }
.header-cta { margin-left: 8px; }
.menu-button { display: none; margin-left: auto; width: 44px; height: 44px; border: none; border-radius: 12px; background: var(--surface); box-shadow: 0 2px 6px rgba(43,74,106,.08); font-size: 1.3rem; color: var(--ink); }

@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 20px 16px; background: var(--page); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; font-size: 1.05rem; }
  .menu-button { display: grid; place-items: center; }
  .site-header .header-cta { display: none; }
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 16px;
  font-weight: 900;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-dark); }
.button-primary:hover { color: #fff; background: #3580c2; }
.button-ghost { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(43,74,106,.08); }
.button-ghost:hover { color: var(--ink); }
.button-small { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 0.92rem; }

/* App Store badge: uses Apple's official badge if images/app-store-badge.svg exists */
.store-badge { display: inline-block; line-height: 0; border-radius: 12px; }
.store-badge img { height: 54px; width: auto; }
.store-badge.is-missing img { display: none; }
.store-badge .store-fallback { display: none; }
.store-badge.is-missing .store-fallback {
  display: inline-flex; align-items: center; gap: 10px; line-height: 1.1;
  height: 54px; padding: 0 20px; border-radius: 12px; background: #000; color: #fff; text-decoration: none;
}
.store-fallback small { display: block; font-size: 0.7rem; font-weight: 700; opacity: 0.85; }
.store-fallback strong { display: block; font-size: 1.15rem; font-weight: 800; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, #c8e7f8 45%, var(--sky-2) 85%, var(--page) 100%);
  padding: 64px 0 72px;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero-logo { width: min(260px, 70%); margin: 0 0 22px -6px; }
.hero h1 { margin-bottom: 18px; }
.hero .lede { max-width: 34em; margin-bottom: 26px; color: #3f4a63; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-note { margin-top: 16px; font-size: 0.92rem; font-weight: 700; color: #4f5a73; }
.hero-phones { position: relative; display: flex; justify-content: flex-start; padding: 0 0 14% 4%; }
.hero-phones .shot:first-child { width: 78%; }
.hero-phones .shot:nth-child(2) { position: absolute; width: 60%; right: 0; bottom: 2%; transform: rotate(6deg); }
.cloud { position: absolute; background: #fff; border-radius: 999px; opacity: 0.85; filter: blur(0.3px); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud.c1 { width: 160px; height: 46px; top: 60px; left: -40px; }
.cloud.c1::before { width: 70px; height: 70px; top: -34px; left: 30px; }
.cloud.c1::after { width: 50px; height: 50px; top: -22px; left: 84px; }
.cloud.c2 { width: 200px; height: 52px; top: 120px; right: -60px; opacity: 0.7; }
.cloud.c2::before { width: 90px; height: 90px; top: -46px; left: 40px; }
.cloud.c2::after { width: 60px; height: 60px; top: -28px; left: 110px; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero-logo { margin: 0 auto 18px; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-phones { max-width: 360px; margin: 10px auto 10px; }
}

/* ---------- Phone screenshot frames (with placeholders) ---------- */
/* The frame takes its shape from the screenshot (700 x 1515), so nothing is
   ever cropped. Border and corners scale with the frame's width, so it looks
   the same on a phone as on a big screen. */
.shot {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 300px;
  border-radius: 13% / 6%;
  padding: 3%;
  background: #1f2433;
  box-shadow: 0 24px 50px rgba(30, 50, 80, 0.22);
}
.shot img, .shot video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 700 / 1515;
  object-fit: contain;
  border-radius: 10.5% / 4.9%;
  background: #dfe8f2;
}
.shot-label { display: none; }
.shot.is-missing img, .shot.is-missing video { display: none; }
.shot.is-missing .shot-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; aspect-ratio: 700 / 1515; padding: 18px; border-radius: 10.5% / 4.9%; text-align: center;
  background: repeating-linear-gradient(135deg, #eef3f8 0 14px, #e4ecf4 14px 28px);
  color: var(--muted); font-size: 0.85rem; font-weight: 800;
}
.shot-label code { font-size: 0.75rem; font-weight: 700; background: #fff; padding: 2px 6px; border-radius: 6px; color: var(--ink); }
.shot.is-wide { aspect-ratio: 1 / 1; max-width: 420px; border-radius: 28px; padding: 0; background: none; box-shadow: var(--shadow); }
.shot.is-wide img, .shot.is-wide video, .shot.is-wide .shot-label { aspect-ratio: 1 / 1; border-radius: 28px; }

/* ---------- Sections ---------- */
section.block { padding: 88px 0; }
section.block.tight { padding: 64px 0; }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head .lede { margin-top: 14px; }

/* Why it's different */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-card { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.why-card .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; font-size: 1.4rem; }
.why-card h3 { margin-bottom: 8px; }
.why-card p { color: var(--muted); font-weight: 600; }
@media (max-width: 860px) { .why-grid { grid-template-columns: 1fr; } }

/* Modes */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.mode { border-radius: 26px; padding: 22px 20px 26px; color: #fff; display: flex; flex-direction: column; gap: 16px; }
.mode.study { background: linear-gradient(180deg, #5fd0bb, var(--study)); }
.mode.match { background: linear-gradient(180deg, #ffab97, var(--match)); }
.mode.play  { background: linear-gradient(180deg, #7cbcf2, var(--play)); }
.mode.quiz  { background: linear-gradient(180deg, #bba4ff, var(--quiz)); }
.mode h3 { font-size: 1.4rem; }
.mode p { font-weight: 700; opacity: 0.96; }
.mode .shot { max-width: 220px; margin: 0 auto; box-shadow: 0 16px 34px rgba(30,50,80,.25); }
@media (max-width: 1000px) { .modes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } }

/* Split feature rows */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.reverse .split-media { order: -1; }
.split-media { display: flex; justify-content: center; }
.split-copy h2 { margin-bottom: 16px; }
.split-copy .lede { margin-bottom: 22px; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; }
.ticks li span { color: var(--muted); font-weight: 600; display: block; }
.tick { position: relative; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; margin-top: 1px; font-size: 0; color: transparent; }
.tick::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split.reverse .split-media { order: 0; }
}

.night { background: linear-gradient(180deg, #1e2a55 0%, #33457f 100%); color: #fff; }
.night .lede, .night .ticks li span { color: #c9d4f2; }
.night .kicker { color: #fce3a4; }

.medals { background: linear-gradient(180deg, var(--gold-soft), #fff 70%); }
.medals .kicker { color: var(--gold-ink); }
.medal-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.medal-chip { background: #fff; border: 2px solid #f1e3c2; border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 0.95rem; }

/* Levels */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.level { background: var(--surface); border-radius: 20px; padding: 22px 18px; box-shadow: var(--shadow); text-align: center; }
.level strong { display: block; font-size: 2rem; font-weight: 900; }
.level span { display: block; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.level em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: #eef3f8; color: var(--muted); }
.level.is-now { background: var(--blue); color: #fff; }
.level.is-now span { color: #dbe9f7; }
.level.is-now em { background: #fff; color: var(--blue); }
@media (max-width: 860px) { .levels { grid-template-columns: repeat(2, 1fr); } .level.is-now { grid-column: span 2; } }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--surface); border-radius: 26px; padding: 28px 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.plan.is-featured { background: linear-gradient(160deg, #3d7fd1, #6e63d9); color: #fff; transform: translateY(-8px); }
.plan.is-featured .plan-price small, .plan.is-featured .ticks li span { color: #dfe4fb; }
.plan h3 { font-size: 1.3rem; }
.plan-price { font-size: 2.3rem; font-weight: 900; line-height: 1; }
.plan-price small { font-size: 1rem; font-weight: 700; color: var(--muted); }
.plan-badge { align-self: flex-start; font-size: 0.78rem; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: #fce3a4; color: #6b4a00; }
.plan .ticks li { font-size: 0.97rem; }
.plan-foot { margin-top: 26px; text-align: center; color: var(--muted); font-size: 0.92rem; font-weight: 600; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } .plan.is-featured { transform: none; } }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--surface); border-radius: 18px; padding: 18px 22px; box-shadow: 0 2px 8px rgba(43,74,106,.06); }
.faq summary { cursor: pointer; font-weight: 800; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--muted); font-weight: 600; }

/* Final call to action */
.cta { text-align: center; background: linear-gradient(180deg, var(--page), var(--sky-1)); }
.cta img.cat { width: 120px; margin: 0 auto 18px; }
.cta .lede { margin: 14px auto 26px; max-width: 32em; }

/* Footer */
.site-footer { background: #1f2638; color: #c6cde0; padding: 44px 0 36px; font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: center; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 800; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer .brand { color: #fff; }

/* Simple text pages (support, privacy) */
.page-hero { background: linear-gradient(180deg, var(--sky-1), var(--page)); padding: 56px 0 30px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 10px; }
.prose { max-width: 760px; margin: 0 auto; padding: 20px 20px 80px; }
.prose h2 { font-size: 1.45rem; margin: 36px 0 10px; }
.prose h3 { font-size: 1.1rem; margin: 22px 0 6px; }
.prose p, .prose li { color: #3f4a63; font-weight: 500; margin-bottom: 10px; }
.prose ul { padding-left: 20px; }
.prose .card { background: var(--surface); border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow); margin: 18px 0; }
.prose .muted { color: var(--muted); }
