/* Fair Share / La Cuenta site. Colors come from the app icon: clay jar, gold coin, cocoa background. */
:root {
  --bg: #1E1512;
  --bg-2: #2A1D18;
  --cocoa: #4A3328;
  --surface: rgba(255, 240, 225, 0.06);
  --border: rgba(255, 240, 225, 0.13);
  --text: #F7EEE5;
  --muted: #CDB8A8;
  --clay: #E08566;
  --clay-light: #EE9A7A;
  --gold: #F0BE55;
  --radius: 22px;
  --max: 1080px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px at default size, scales with the reader's font setting */
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, var(--cocoa) 0%, transparent 60%),
    var(--bg);
  background-color: var(--bg);
  min-height: 100vh;
}

a { color: var(--clay-light); }
@media (hover: hover) { a:hover { color: var(--gold); } }

/* Press feedback: instant on pointer-down, eased on release */
a, .badge { -webkit-tap-highlight-color: transparent; transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease; }
a:active { opacity: 0.6; transition-duration: 0s; }
.nav .lang:active, a.badge:active { transform: scale(0.96); }

/* Keyboard focus */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
details summary:focus-visible { border-radius: 8px; }

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

/* Header: translucent layer, content scrolls under it */
.site-header {
  position: sticky; top: 0; z-index: 10;
  padding: 12px 0;
  background: rgba(30, 21, 18, 0.62);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255, 240, 225, 0.06);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 22%; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 0.9375rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
@media (hover: hover) { .nav a:hover { color: var(--text); } }
.nav .lang { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--text); }

/* Hero */
.hero { text-align: center; padding: 56px 0 72px; }
.hero-icon { width: 148px; height: 148px; border-radius: 22%; box-shadow: 0 18px 40px rgba(224, 133, 102, 0.3); }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.05; margin: 28px 0 14px; letter-spacing: -0.025em; }
.hero h1 span { color: var(--clay); }
.hero p.lead { font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.45; color: var(--muted); max-width: 620px; margin: 0 auto 32px; }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg);
  border-radius: 14px; padding: 12px 22px;
  font-weight: 700; text-decoration: none;
}
@media (hover: hover) { a.badge:hover { color: var(--bg); background: #fff; } }
.badge svg { width: 22px; height: 22px; }
/* Not a link yet, so it shouldn't look pressable: a quiet label, not a button */
.badge.soon { background: none; color: var(--text); padding: 4px 0; border-radius: 0; font-weight: 600; cursor: default; }
.badge.soon svg { width: 18px; height: 18px; opacity: 0.8; }
.hero .note { display: block; margin-top: 8px; color: var(--muted); font-size: 0.875rem; letter-spacing: 0.01em; }

/* ---------- App screenshots ---------- */

/* iPhone frame built in CSS so screenshots stay swappable per language. The bezel is the
   screen's margin: % margins on the child are relative to the phone's width. */
.phone {
  position: relative;
  width: 100%;
  display: flow-root;
  border-radius: 14.5% / 6.8%;
  background: #141010;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 225, 0.22),
    0 40px 80px -20px rgba(0, 0, 0, 0.7),
    0 18px 36px -18px rgba(0, 0, 0, 0.5);
}
.phone > img,
.phone > video {
  display: block;
  margin: 1.8%;
  width: 96.4%;
  height: auto;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  border-radius: 13% / 6%;
  background: #F2F2F7;
}

/* Hero: three phones fanned out */
.hero-phones {
  position: relative;
  height: clamp(380px, 62vw, 640px);
  max-width: 820px;
  margin: 56px auto 0;
}
.hero-phones .phone {
  position: absolute;
  bottom: 0;
  width: clamp(170px, 27vw, 280px);
  left: 50%;
  transform-origin: 50% 100%;
  transition: transform 0.9s cubic-bezier(.2, .8, .2, 1), opacity 0.6s ease;
}
.hero-phones .phone.center { transform: translateX(-50%); z-index: 2; bottom: 4%; }
.hero-phones .phone.left   { transform: translateX(-118%) rotate(-7deg) scale(0.88); z-index: 1; opacity: 0.9; }
.hero-phones .phone.right  { transform: translateX(18%) rotate(7deg) scale(0.88); z-index: 1; opacity: 0.9; }
.hero-phones::after {
  content: "";
  position: absolute; inset: auto 10% -30px; height: 120px;
  background: radial-gradient(closest-side, rgba(224, 133, 102, 0.3), transparent);
  filter: blur(10px);
  z-index: 0;
}
.js .hero-phones:not(.in) .phone.left  { transform: translateX(-50%) rotate(0) scale(0.88); opacity: 0; }
.js .hero-phones:not(.in) .phone.right { transform: translateX(-50%) rotate(0) scale(0.88); opacity: 0; }
.js .hero-phones:not(.in) .phone.center { transform: translate(-50%, 40px); opacity: 0; }

/* Screen recording in a frame */
.peek { text-align: center; padding: 0 0 96px; }
.peek .lead { color: var(--muted); font-size: clamp(1.0625rem, 2.2vw, 1.25rem); line-height: 1.45; max-width: 560px; margin: -16px auto 40px; }
.demos { display: flex; justify-content: center; gap: clamp(24px, 6vw, 72px); flex-wrap: wrap; }
.demos figure { margin: 0; width: min(280px, 70vw); }
.demos figcaption { margin-top: 18px; color: var(--muted); font-size: 0.9375rem; font-weight: 600; }

/* Showcase tiles: a phone rising out of a coloured panel */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-bottom: 80px; }
.tile {
  display: flex; flex-direction: column;
  overflow: hidden;
  border-radius: 28px; border: 1px solid var(--border);
  padding: 28px 28px 0;
  background: radial-gradient(120% 80% at 50% 0%, #e0856640, transparent 60%), linear-gradient(170deg, #4a2c22, #241814);
}
.tile:nth-child(2) { background: radial-gradient(120% 80% at 50% 0%, #f0be5533, transparent 60%), linear-gradient(170deg, #43331d, #221812); }
.tile:nth-child(3) { background: radial-gradient(120% 80% at 50% 0%, #cdb8a833, transparent 60%), linear-gradient(170deg, #3a2a22, #1e1512); }
.tile h3 { margin: 0 0 8px; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.2; letter-spacing: -0.015em; }
.tile p { margin: 0; color: var(--muted); }
.tile .phone { width: min(240px, 78%); margin: 32px auto -28%; transition: transform 0.5s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) { .tile:hover .phone { transform: translateY(-10px); } }
@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .tile .phone { width: min(240px, 64%); }
}

/* Features */
.section-title { text-align: center; font-size: clamp(1.75rem, 4vw, 2.375rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 32px; }
.section-title span { color: var(--gold); }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 80px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card .emoji { font-size: 1.875rem; line-height: 1; }
.card h3 { margin: 14px 0 6px; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); }

/* Two ways to split: large panels */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 80px; }
.mode { border-radius: 28px; border: 1px solid var(--border); padding: 32px; }
.mode h3 { margin: 0 0 8px; font-size: clamp(1.375rem, 2.6vw, 1.75rem); line-height: 1.15; letter-spacing: -0.015em; }
.mode p { margin: 0 0 16px; color: rgba(247, 238, 229, 0.8); }
.mode ul { margin: 0; padding-left: 20px; color: var(--muted); }
.mode li { margin: 4px 0; }
.mode.clay { background: radial-gradient(120% 90% at 0% 0%, #e0856655, transparent 60%), linear-gradient(160deg, #4a2c22, #241814); }
.mode.gold { background: radial-gradient(120% 90% at 100% 0%, #f0be5544, transparent 60%), linear-gradient(160deg, #43331d, #221812); }

/* Prose pages */
.prose { max-width: 720px; margin: 0 auto; padding: 32px 20px 80px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.875rem); line-height: 1.1; letter-spacing: -0.02em; margin: 16px 0 8px; }
.prose .updated { color: var(--muted); margin: 0 0 32px; }
.prose h2 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; margin: 36px 0 8px; color: var(--clay-light); }
.prose p, .prose li { line-height: 1.6; color: #E8DCD1; } /* long-form reading keeps a little more leading */
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .card { margin: 28px 0; }

details { border-bottom: 1px solid var(--border); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; -webkit-tap-highlight-color: transparent; transition: opacity 0.2s ease; }
details summary:active { opacity: 0.6; transition-duration: 0s; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--clay); font-size: 1.375rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 0.875rem; letter-spacing: 0.01em; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .site-footer a:hover { color: var(--text); } }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .8, .2, 1); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .modes { grid-template-columns: 1fr; }
  .mode { padding: 28px 24px; }
}

@media (max-width: 560px) {
  /* Keep every destination reachable on phones: smaller brand, tighter nav */
  .brand { font-size: 1rem; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .nav { gap: 12px; font-size: 0.875rem; }
  .nav .lang { padding: 3px 10px; }
  .hero { padding-top: 32px; }
}
@media (max-width: 360px) {
  .brand { font-size: 0; gap: 0; } /* icon only on the narrowest screens */
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { transition: none; opacity: 1; transform: none; }
  .hero-phones .phone, .tile .phone { transition: none; }
  .js .hero-phones:not(.in) .phone { opacity: 0.9; }
  .js .hero-phones:not(.in) .phone.center { transform: translateX(-50%); opacity: 1; }
  .js .hero-phones:not(.in) .phone.left { transform: translateX(-118%) rotate(-7deg) scale(0.88); }
  .js .hero-phones:not(.in) .phone.right { transform: translateX(18%) rotate(7deg) scale(0.88); }
  @media (hover: hover) { .tile:hover .phone { transform: none; } }
  a, .badge, details summary { transition: none; }
  .nav .lang:active, a.badge:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--border); }
}

@media (prefers-contrast: more) {
  :root { --border: rgba(255, 240, 225, 0.45); --muted: #E8DCD1; --surface: #3A2A22; }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--border); }
  .mode p { color: var(--text); }
}
