/* Joki website: one stylesheet for every page. Mobile first. */

:root {
  --blue: #0055a4;
  --blue-soft: #e8f0fa;
  --accent: #ff8a3d;
  --accent-soft: #fff1e6;
  --red: #ef4135;
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --text: #1a1f2b;
  --muted: #5b6475;
  --line: #e6e9ef;
  --card: #ffffff;
  --phone-frame: #1a1f2b;
  --phone-screen: #ffffff;
  --glow: rgba(0, 85, 164, 0.22);
  --glow-2: rgba(255, 138, 61, 0.18);
  --shadow: 0 20px 50px rgba(16, 24, 40, 0.12);
  --radius: 20px;
  --max: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #5b9dff;
    --blue-soft: #14233a;
    --accent: #ffa25f;
    --accent-soft: #3a2616;
    --bg: #0e1117;
    --bg-alt: #141922;
    --text: #eef1f6;
    --muted: #a3acbd;
    --line: #252c38;
    --card: #171c25;
    --phone-frame: #000000;
    --phone-screen: #171c25;
    --glow: rgba(91, 157, 255, 0.25);
    --glow-2: rgba(255, 162, 95, 0.15);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

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

a {
  color: var(--blue);
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 900;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* Phones: the links fold into a menu under the ☰ button. */
.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  padding: 8px 20px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 30px rgba(16, 24, 40, 0.08);
}

.site-header.is-open .main-nav {
  display: flex;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  padding: 12px 0;
  white-space: nowrap;
}

.main-nav a + a {
  border-top: 1px solid var(--line);
}

.main-nav a:hover {
  color: var(--blue);
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}
.site-header.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

.header-badges {
  display: none;
}

@media (min-width: 900px) {
  .header-inner {
    height: 76px;
  }
  .main-nav,
  .site-header.is-open .main-nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 40px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .main-nav a {
    font-size: 17px;
    padding: 0;
  }
  .main-nav a + a {
    border: 0;
  }
  .menu-toggle {
    display: none;
  }
  .header-badges {
    display: flex;
    gap: 10px;
  }
}

/* ---------- Store badges ---------- */
/* Drawn here rather than using official artwork until the app is listed;
   swap in Apple's and Google's official badges with the real links. */

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 18px 0 14px;
  border-radius: 10px;
  background: #000000;
  color: #ffffff;
  text-decoration: none;
  border: 1.5px solid #a6a6a6;
  /* Store badges use the platforms' own type, not the page font. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Product Sans", Roboto, Arial, sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.badge .logo {
  width: 30px;
  height: 30px;
  flex: none;
}

.badge small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 3px;
}

.badge small.caps {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.badge strong {
  display: block;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge.is-soon {
  cursor: default;
}

.badge.small {
  height: 44px;
  padding: 0 12px 0 10px;
  gap: 7px;
  border-radius: 8px;
}
.badge.small .logo {
  width: 22px;
  height: 22px;
}
.badge.small small {
  font-size: 9px;
  margin-bottom: 2px;
}
.badge.small small.caps {
  font-size: 8.5px;
}
.badge.small strong {
  font-size: 17px;
}

/* Phones: both badges fit on one row, as on the stores' own pages. */
@media (max-width: 480px) {
  .badges {
    gap: 10px;
  }
  .badge {
    height: 50px;
    gap: 7px;
    padding: 0 12px 0 10px;
    border-radius: 9px;
  }
  .badge .logo {
    width: 24px;
    height: 24px;
  }
  .badge small {
    font-size: 10.5px;
  }
  .badge small.caps {
    font-size: 9.5px;
  }
  .badge strong {
    font-size: 19px;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding: 48px 0 64px;
  /* The phone's glow spills past the edges; never let it scroll the page. */
  overflow-x: clip;
}

.hero-inner {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(44px, 14vw, 84px);
  margin-bottom: 20px;
}

.hero h1 .line {
  display: block;
}

.hero h1 .flag {
  display: inline-block;
  font-size: 0.8em;
  vertical-align: 0.05em;
  transform: rotate(-6deg);
}

.hero h1 .brand {
  color: var(--blue);
}

.hero .lead {
  font-size: clamp(18px, 4.6vw, 22px);
  color: var(--muted);
  max-width: 34ch;
  margin: 0 0 28px;
}

@media (min-width: 900px) {
  .hero {
    padding: 72px 0 96px;
  }
  .hero-inner {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 32px;
  }
  .hero h1 {
    font-size: clamp(56px, 5.6vw, 80px);
  }
  .hero h1 .line {
    white-space: nowrap;
  }
}

/* ---------- Phone mockup ---------- */

.phone-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-stage::before {
  content: "";
  position: absolute;
  inset: 5% -10%;
  background:
    radial-gradient(closest-side, var(--glow), transparent 75%),
    radial-gradient(closest-side at 70% 70%, var(--glow-2), transparent 70%);
  filter: blur(20px);
  z-index: 0;
}

.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 82vw);
  aspect-ratio: 9 / 19;
  border-radius: 46px;
  padding: 11px;
  background: var(--phone-frame);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--phone-screen);
  display: flex;
  flex-direction: column;
}

.island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 24px;
  border-radius: 999px;
  background: #000;
  z-index: 3;
}

/* TODO: replace this drawn scene with a real screenshot or short screen recording of the app. */
.clip {
  position: relative;
  flex: 0 0 62%;
  overflow: hidden;
  background: linear-gradient(180deg, #8ec5ff 0%, #cfe6ff 45%, #f7d9b5 46%, #e9b98a 100%);
  transition: background 0.6s ease;
}

.clip[data-scene="1"] {
  background: linear-gradient(180deg, #ffb07a 0%, #ffd9a8 48%, #6f8bb3 49%, #3e5a85 100%);
}
.clip[data-scene="2"] {
  background: linear-gradient(180deg, #9fd8b8 0%, #d8f1df 48%, #7aa86b 49%, #4f7f45 100%);
}

/* A simple skyline so the clip reads as "a place in France". */
.clip .skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 54%;
  height: 34%;
  opacity: 0.55;
}

.clip .skyline svg {
  width: 100%;
  height: 100%;
}

.clip-meta {
  position: absolute;
  top: 44px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 800;
}

.clip-meta .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 14px;
  text-shadow: none;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.play::before,
.play::after {
  content: "";
  width: 6px;
  height: 22px;
  background: #fff;
  border-radius: 3px;
  grid-area: 1 / 1;
}
.play::before {
  transform: translateX(-6px);
}
.play::after {
  transform: translateX(6px);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--red);
}

.progress span.run {
  animation: progress 4.5s linear forwards;
}

@keyframes progress {
  to {
    width: 100%;
  }
}

.subs {
  position: relative;
  flex: 1;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.subs-meta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.subs-meta .level {
  color: var(--accent);
}

.sentence {
  margin-top: auto;
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  transition: opacity 0.35s ease;
}

.sentence .w {
  position: relative;
  display: inline-block;
  padding: 0 2px;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom: 2px dotted var(--accent);
}

.translation {
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
  transition: opacity 0.35s ease;
}

.fade {
  opacity: 0;
}

.hint {
  position: absolute;
  /* Placed over the highlighted word by script.js; this is the fallback. */
  top: 34px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: pulse 1.8s ease-in-out infinite;
}

.hint span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #1a1f2b;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.15);
  white-space: nowrap;
}

.hint svg {
  width: 16px;
  height: 22px;
  margin-top: 2px;
  color: var(--text);
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(3px) scale(1.06);
  }
}

/* The meaning card that opens over the clip, as in the app's word sheet. */
.popup {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(38% + 8px);
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.25);
  text-align: left;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  z-index: 2;
}

.popup.show {
  opacity: 1;
  transform: translateY(0);
}

.popup .head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 900;
  font-size: 18px;
  color: var(--text);
}

.popup .pos {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 1px 6px;
  border-radius: 6px;
}

.popup .mean {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.phone-caption {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .hint,
  .progress span.run {
    animation: none;
  }
  .sentence,
  .translation,
  .popup {
    transition: none;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 72px 0;
}

.section.alt {
  background: var(--bg-alt);
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section h2 {
  font-size: clamp(30px, 7vw, 44px);
}

.section .intro {
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 40px;
}

.steps {
  display: grid;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.step {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.step .num {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 21px;
}

.step p {
  margin: 0;
  color: var(--muted);
}

@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-grid {
  display: grid;
  gap: 32px;
}

.about-grid p {
  color: var(--muted);
  margin: 0 0 1em;
}

.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.features li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
}

.features li .ico {
  font-size: 22px;
  line-height: 1.3;
}

.features li strong {
  display: block;
}

.features li span {
  color: var(--muted);
  font-size: 15px;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 56px;
  }
}

.contact-card {
  background: var(--blue);
  color: #fff;
  border-radius: 28px;
  padding: 40px 24px;
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  .contact-card {
    background: #0b3a6e;
  }
}

.contact-card h2 {
  color: #fff;
}

.contact-card p {
  margin: 0 auto 24px;
  max-width: 46ch;
  opacity: 0.9;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: #fff;
  color: #0055a4;
  font-weight: 800;
  text-decoration: none;
  word-break: break-all;
}

.button:hover {
  background: var(--accent-soft);
}

/* ---------- Text pages (privacy, support) ---------- */

.page {
  padding: 48px 0 72px;
}

.prose {
  max-width: 720px;
}

.prose h1 {
  font-size: clamp(34px, 8vw, 48px);
}

.prose h2 {
  font-size: 24px;
  margin-top: 2em;
}

.prose h3 {
  font-size: 19px;
  margin-top: 1.5em;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong {
  color: var(--text);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.4em;
}

.updated {
  font-size: 15px;
  color: var(--muted);
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 4px 20px;
  margin-bottom: 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
  padding: 14px 0;
  color: var(--text);
}

.faq details[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.faq details p {
  margin-top: 0;
}

.note {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 16px 20px;
  color: var(--text);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  font-size: 15px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--blue);
}

@media (min-width: 760px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
