/* Homemade Apps — styles */

:root {
  --orange: #D97A2C;
  --orange-dark: #B9611E;
  --navy: #2E3A59;
  --blush: #F4CFC6;
  --mint: #B7D8C6;
  --cream: #FBF7F2;
  --cream-warm: #F5EDE1;
  --ink: #2B2B2F;
  --muted: #6B6B73;
  --card: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(46,58,89,.06), 0 2px 8px rgba(46,58,89,.06);
  --shadow-md: 0 4px 12px rgba(46,58,89,.08), 0 12px 32px rgba(46,58,89,.08);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --max-width: 1120px;
  --gutter: clamp(20px, 5vw, 40px);

  /* Per-app accent colours */
  --stories-bg:   #FFF0E6;
  --stories-fg:   #B9611E;
  --charades-bg:  #EBF4EC;
  --charades-fg:  #3A7A4A;
  --breathing-bg: #E6F0FA;
  --breathing-fg: #2F5C8F;
  --word-bg:      #F5EEF8;
  --word-fg:      #7C4A9E;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-dark); text-decoration: none; transition: color .15s; }
a:hover { color: var(--orange); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.2; }
h3 { font-size: 1.2rem; line-height: 1.3; }
p  { margin: 0 0 1em; }
p.lead { font-size: 1.15rem; color: var(--muted); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: clamp(56px, 9vw, 104px) 0; }

/* ── Header ── */
.site-header {
  padding: 20px 0;
  background: rgba(251,247,242,.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid rgba(46,58,89,.06);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wrap instead of squashing: nav labels vary a lot across the 11
     languages, so the header needs anywhere from ~600px to ~780px. */
  flex-wrap: wrap;
  gap: 10px 16px;
}
.brand {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.brand .brand-orange { color: var(--orange); }
.nav { display: flex; flex-wrap: wrap; gap: clamp(12px,3vw,28px); align-items: center; }
.nav a { color: var(--navy); font-weight: 500; font-size: .97rem; }
.nav a:hover { color: var(--orange); }

/* "All apps" up-link back to the Homemade Apps hub */
.nav-up {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(46, 58, 89, 0.16);
  background: rgba(46, 58, 89, 0.04);
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-up:hover {
  background: rgba(217, 122, 44, 0.1);
  border-color: var(--orange);
  color: var(--orange-dark);
}
.nav-up svg { width: 14px; height: 14px; flex-shrink: 0; }
html[dir="rtl"] .nav-up svg { transform: scaleX(-1); }

/* ── Hero ── */
.hero {
  padding: clamp(56px,8vw,96px) 0;
  text-align: center;
  background:
    radial-gradient(circle at 80% 20%, rgba(183,216,198,.35) 0%, transparent 50%),
    radial-gradient(circle at 15% 85%, rgba(244,207,198,.4) 0%, transparent 50%),
    var(--cream);
}
.hero .eyebrow {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--orange); }
.hero .lead { max-width: 540px; margin: 0 auto 32px; }
.promise-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid rgba(46,58,89,.1);
  font-size: .88rem;
  font-weight: 500;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.chip svg { width: 14px; height: 14px; color: var(--orange); flex-shrink: 0; }

/* ── Apps grid ── */
.apps { background: var(--cream); }
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.app-card {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(46,58,89,.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.app-card--dimmed { opacity: .72; }
.app-card--dimmed:hover { opacity: 1; }

/* Logo banner at the top of each app card */
.app-logo-banner {
  padding: 28px 24px 20px;
  display: grid;
  place-items: center;
  min-height: 180px;
}
.app-logo-banner--stories  { background: var(--stories-bg);  }
.app-logo-banner--charades { background: var(--charades-bg); }
.app-logo-banner--clues    { background: var(--stories-bg);  }

.app-logo {
  width: auto;
  height: auto;
  max-height: 152px;
  max-width: 88%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(46,58,89,.14));
}
/* Square app-icon style logos get rounded corners + a lift */
.app-logo--icon {
  max-height: 132px;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  filter: none;
}

.app-meta { margin-bottom: 4px; }
.app-name {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 4px;
}
.status-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.status-badge--live {
  background: #E6F6EC;
  color: #28703F;
}
.status-badge--soon {
  background: #F0F0F5;
  color: var(--muted);
  border: 1px dashed rgba(107,107,115,.3);
}

.app-card-body {
  padding: 22px 28px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.app-name + .status-badge { margin-top: 2px; }
.app-card-body .app-meta + p { margin-top: 14px; }
.app-card-body p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 20px;
  flex: 1;
}

.app-links { display: flex; flex-wrap: wrap; gap: 10px; }
/* App cards stack their buttons so every card lines up the same way,
   whatever the button labels translate to. */
.app-card .app-links { flex-direction: column; align-items: flex-start; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  transition: transform .15s, background .15s, box-shadow .15s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #1f2843; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid rgba(46,58,89,.2);
}
.btn-outline:hover { background: rgba(46,58,89,.05); color: var(--navy); }

.btn-disabled {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed rgba(107,107,115,.3);
  cursor: default;
  pointer-events: none;
}
.apple-icon { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ── Philosophy strip ── */
.philosophy {
  background: linear-gradient(135deg, var(--navy) 0%, #3B4A6F 100%);
  color: #fff;
  text-align: center;
}
.philosophy h2 { color: #fff; }
.philosophy .lead { color: rgba(255,255,255,.8); max-width: 600px; margin: 0 auto 40px; }
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  text-align: left;
  margin-top: 40px;
}
.pillar {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 24px;
}
.pillar-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: var(--mint);
}
.pillar-icon svg { width: 20px; height: 20px; }
.pillar h3 { color: #fff; font-size: 1rem; margin-bottom: 6px; }
.pillar p  { color: rgba(255,255,255,.65); font-size: .9rem; margin: 0; }

/* ── Footer ── */
.site-footer {
  padding: 40px 0 56px;
  background: var(--cream);
  border-top: 1px solid rgba(46,58,89,.06);
  color: var(--muted);
  font-size: .93rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--navy); }

/* ── Accessibility utility ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Language switcher ── */
.lang-switcher {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: var(--navy);
  background-color: var(--card);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232E3A59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 1px solid rgba(46,58,89,.15);
  border-radius: 999px;
  padding: 7px 32px 7px 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.lang-switcher:hover { border-color: rgba(46,58,89,.35); }
.lang-switcher:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ── Back link (app pages) ── */
.back-link {
  display: inline-block;
  font-weight: 500;
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--orange); }

/* ── App hero (Charades / Clues) ── */
.app-hero {
  padding: clamp(40px,6vw,72px) 0 clamp(48px,7vw,80px);
  background:
    radial-gradient(circle at 82% 15%, rgba(183,216,198,.3) 0%, transparent 55%),
    radial-gradient(circle at 12% 90%, rgba(244,207,198,.35) 0%, transparent 55%),
    var(--cream);
}
.app-hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(28px,5vw,64px);
  flex-wrap: wrap;
}
.app-hero-logo {
  flex: 0 0 auto;
  width: clamp(140px, 30vw, 220px);
}
.app-hero-logo img {
  width: 100%;
  border-radius: 32px;
  box-shadow: var(--shadow-md);
}
.app-hero-copy { flex: 1 1 320px; }
.app-hero-copy .status-badge { margin-bottom: 14px; }
.app-hero-copy h1 { margin: 0 0 .3em; }
.app-hero-copy .app-links { margin-top: 22px; }
.app-tagline {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--orange-dark);
  font-weight: 500;
  margin: 0 0 .7em;
}
.soon-note {
  display: inline-block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 0;
}

/* ── Steps (How it works) ── */
.steps-section { background: var(--cream); }
.steps-section h2 { text-align: center; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 44px;
}
.step {
  background: var(--card);
  border: 1px solid rgba(46,58,89,.06);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px 26px;
}
.step-num {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .97rem; margin: 0; }

/* ── Privacy section (app pages) ── */
.privacy-section { background: var(--cream-warm); }
.privacy-section .container { max-width: 760px; }
.privacy-section h2 { margin-bottom: .6em; }
.privacy-section h3 {
  margin-top: 1.6em;
  color: var(--navy);
  font-size: 1.1rem;
}
.privacy-section p { color: var(--ink); }
.privacy-section .notice {
  background: #FFF6EE;
  border: 1px solid rgba(217,122,44,.25);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 8px 0 8px;
  color: var(--ink);
}

/* ── RTL overrides (Arabic) ── */
html[dir="rtl"] .site-header .container,
html[dir="rtl"] .nav,
html[dir="rtl"] .site-footer .container,
html[dir="rtl"] .site-footer nav,
html[dir="rtl"] .app-hero-inner { direction: rtl; }
html[dir="rtl"] .brand { flex-direction: row-reverse; }
html[dir="rtl"] .lang-switcher {
  background-position: left 12px center;
  padding: 7px 14px 7px 32px;
}
html[dir="rtl"] .back-link { display: inline-block; }
html[dir="rtl"] .chip svg { transform: scaleX(-1); }

/* Sub-page content (app support pages) */
.page {
  padding: clamp(48px, 7vw, 88px) 0;
  background: var(--cream);
}
.page .container { max-width: 760px; }
.page h1 { margin-bottom: 16px; }
.page h2 { margin-top: 2em; font-size: 1.5rem; }
.page h3 { margin-top: 1.6em; }
.page p, .page li { color: var(--ink); }
.page a { color: var(--orange-dark); text-decoration: underline; text-underline-offset: 3px; }

.faq {
  margin-top: 40px;
  display: grid;
  gap: 16px;
}
.faq details {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(46, 58, 89, 0.05);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--orange);
  flex-shrink: 0;
}
.faq details[open] summary::after { content: '–'; }
.faq details[open] { box-shadow: var(--shadow-md); }
html[dir="rtl"] .faq summary { flex-direction: row-reverse; }

/* Support call-to-action on app pages */
.support-cta {
  background: var(--cream);
  text-align: center;
  padding: clamp(48px, 7vw, 80px) 0;
}
.support-cta h2 { margin-bottom: .35em; }
.support-cta p { color: var(--muted); margin: 0 auto 26px; max-width: 460px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .apps-grid { grid-template-columns: 1fr; }
  .pillars   { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .site-footer .container { justify-content: center; text-align: center; }
  /* Once the header has wrapped, centre the rows rather than leaving
     the nav stranded against one edge, and keep it compact — it's sticky. */
  .site-header { padding: 12px 0; }
  .site-header .container { justify-content: center; gap: 8px 14px; }
  .nav { justify-content: center; gap: 8px 14px; }
  .brand { font-size: 1.15rem; }
  .lang-switcher { padding: 5px 30px 5px 12px; font-size: .9rem; }
  .app-hero-inner { flex-direction: column; text-align: center; align-items: center; }
  .app-hero-copy .status-badge { margin-inline: auto; }
  .app-hero-copy .app-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
