/* ── Sorted Website — Shared Styles ─────────────────────────────────────── */

:root {
  --orange:       #F97316;
  --orange-dark:  #EA6C00;
  --orange-light: #FFF7ED;
  --sage:         #6B8F71;
  --sage-light:   #EEF3EE;
  --choc:         #1C0800;   /* brand dark — replaces black everywhere */
  --text:         #1C0800;
  --text-secondary: #7A5C52;
  --surface:      #FFFFFF;
  --bg:           #FAFAF8;
  --border:       #E8E8E4;
  --radius:       14px;
  --radius-lg:    24px;
  --shadow:       0 2px 16px rgba(28,8,0,0.08);
  --shadow-lg:    0 8px 40px rgba(28,8,0,0.12);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

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

/* ── Layout ──────────────────────────────────────────────────────────────── */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 80px 0; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--orange); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249,115,22,0.35);
}

/* Nav Download button: dark text, white on hover */
.nav-links .btn-primary { color: var(--choc); }
.nav-links .btn-primary:hover { color: #fff; }

/* Prose pages: prevent orange link colour bleeding into buttons */
.prose-body .btn-primary { color: #fff; }
.prose-body .btn-primary:hover { color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--orange);
  border: 1.5px solid var(--orange);
}

.btn-outline:hover {
  background: var(--orange-light);
  color: var(--orange);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: 96px 0 80px;
  text-align: center;
  background: linear-gradient(160deg, var(--orange-light) 0%, var(--bg) 60%);
}

/* ── H1 cycling text ──────────────────────────────────────────────────────── */

.h1-cycle {
  display: inline-block;
  height: 1.12em;
  overflow: hidden;
  vertical-align: middle;
}

.h1-track {
  display: block;
  will-change: transform;
  animation: h1-scroll 8s linear infinite;
  -webkit-animation: h1-scroll 8s linear infinite;
}

.h1-track span {
  display: block;
  height: 1.12em;
  line-height: 1.12em;
  white-space: nowrap;
  text-align: center;
  color: var(--text);
}

@keyframes h1-scroll {
  0%      { transform: translateY(0);       animation-timing-function: linear; }
  13.75%  { transform: translateY(0);       animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  18.75%  { transform: translateY(-1.12em); animation-timing-function: linear; }
  32.5%   { transform: translateY(-1.12em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  37.5%   { transform: translateY(-2.24em); animation-timing-function: linear; }
  51.25%  { transform: translateY(-2.24em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  56.25%  { transform: translateY(-3.36em); animation-timing-function: linear; }
  70%     { transform: translateY(-3.36em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  75%     { transform: translateY(-4.48em); animation-timing-function: linear; }
  95%     { transform: translateY(-4.48em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100%    { transform: translateY(-5.6em); }
}
@-webkit-keyframes h1-scroll {
  0%      { -webkit-transform: translateY(0);       animation-timing-function: linear; }
  13.75%  { -webkit-transform: translateY(0);       animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  18.75%  { -webkit-transform: translateY(-1.12em); animation-timing-function: linear; }
  32.5%   { -webkit-transform: translateY(-1.12em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  37.5%   { -webkit-transform: translateY(-2.24em); animation-timing-function: linear; }
  51.25%  { -webkit-transform: translateY(-2.24em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  56.25%  { -webkit-transform: translateY(-3.36em); animation-timing-function: linear; }
  70%     { -webkit-transform: translateY(-3.36em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  75%     { -webkit-transform: translateY(-4.48em); animation-timing-function: linear; }
  95%     { -webkit-transform: translateY(-4.48em); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100%    { -webkit-transform: translateY(-5.6em); }
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 .sorted-word { color: var(--orange); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.appstore-badge {
  display: inline-block;
  transition: transform 0.15s, opacity 0.15s;
}

.appstore-badge:hover { transform: translateY(-2px); opacity: 0.9; }

.appstore-badge img { height: 52px; width: auto; }

/* Hero phone mockup */
.hero-phone {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.hero-phone-frame {
  width: 272px;
  max-width: 272px;
  flex-shrink: 0;
  border-radius: 50px;
  background: var(--choc);
  padding: 10px;
  overflow: hidden;        /* hard clip — image cannot escape the frame */
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 24px 64px rgba(28,8,0,0.28),
    0 8px 24px rgba(249,115,22,0.18);
}

.hero-phone-frame img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 42px;
  display: block;
}

@media (max-width: 640px) {
  .hero-phone-frame { width: 220px; max-width: 220px; border-radius: 40px; padding: 8px; }
  .hero-phone-frame img { border-radius: 34px; }
}

/* ── How it works ─────────────────────────────────────────────────────────── */

.how { background: var(--surface); }

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 56px;
}

.step {
  text-align: center;
  padding: 32px 24px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 50%;
  margin-bottom: 20px;
}

.step-icon { font-size: 2rem; margin-bottom: 14px; line-height: 1; color: var(--orange); }

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Features ─────────────────────────────────────────────────────────────── */

.features { background: var(--bg); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 56px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
  line-height: 1;
  color: var(--orange);
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */

.cta {
  background: linear-gradient(135deg, var(--orange) 0%, #FB923C 100%);
  text-align: center;
  color: #fff;
  padding: 80px 0;
}

.cta h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.cta p {
  font-size: 1.05rem;
  opacity: 0.88;
  margin-bottom: 36px;
}

.btn-white {
  background: #fff;
  color: var(--orange);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  display: inline-block;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(28,8,0,0.15);
  color: var(--orange-dark);
}

/* ── CTA cycling word ─────────────────────────────────────────────────────── */

.cta-cycle-wrap {
  display: inline-block;
  position: relative;
}

.cta-cycle {
  display: inline-block;
  height: 1.2em;
  overflow: hidden;
  vertical-align: middle;
}

.cta-cycle-track {
  display: flex;
  flex-direction: column;
  animation: cta-scroll 7.5s linear infinite;
  will-change: transform;
}

.cta-cycle-track span {
  display: block;
  height: 1.2em;
  line-height: 1.2em;
  white-space: nowrap;
  color: rgba(255,255,255,0.95);
}

@keyframes cta-scroll {
  0%      { transform: translateY(0);       animation-timing-function: linear; }
  14.667% { transform: translateY(0);       animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  20%     { transform: translateY(-1.2em);  animation-timing-function: linear; }
  34.667% { transform: translateY(-1.2em);  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  40%     { transform: translateY(-2.4em);  animation-timing-function: linear; }
  54.667% { transform: translateY(-2.4em);  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  60%     { transform: translateY(-3.6em);  animation-timing-function: linear; }
  74.667% { transform: translateY(-3.6em);  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  80%     { transform: translateY(-4.8em);  animation-timing-function: linear; }
  94.667% { transform: translateY(-4.8em);  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100%    { transform: translateY(-6em); }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  background: var(--choc);
  color: rgba(255,255,255,0.55);
  padding: 40px 0;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}

.footer-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  color: rgba(255,255,255,0.55);
  transition: color 0.15s;
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

/* ── Prose (privacy / support pages) ─────────────────────────────────────── */

.prose-hero {
  background: linear-gradient(160deg, var(--orange-light) 0%, var(--bg) 50%);
  padding: 72px 0 56px;
  text-align: center;
}

.prose-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 10px;
}

.prose-hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.prose-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.prose-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.prose-body h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.prose-body p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
  font-size: 0.95rem;
}

.prose-body ul {
  margin: 0 0 16px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.prose-body li { margin-bottom: 6px; }

.prose-body a { color: var(--orange); }

.info-box {
  background: var(--orange-light);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  color: var(--orange-dark);
  line-height: 1.6;
}

/* Support page */
.faq { margin-top: 48px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
}

.faq-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.65;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  margin-top: 48px;
}

.contact-card .icon { font-size: 2.5rem; margin-bottom: 14px; }

.contact-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.contact-card p {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 2rem;
  padding: 8px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  section { padding: 56px 0; }
  .hero { padding: 64px 0 56px; }

  .nav-toggle { display: flex; }

  .h1-cycle { width: 100%; }

  /* Nav becomes a column so the menu expands below the logo row */
  nav { flex-direction: column; align-items: stretch; }

  .nav-inner { flex-wrap: wrap; }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    list-style: none;
    border-top: 1px solid var(--border);
    padding: 8px 0 16px;
  }

  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 14px 24px;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child a { border-bottom: none; }

  .nav-links .btn-primary {
    margin: 12px 24px 0;
    display: block;
    text-align: center;
    border-radius: 50px;
  }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  .phone-frame { width: 220px; height: 440px; }
}
