/* ============================================================
   Gredli: style.css
   Shared stylesheet for all pages
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Variables
   ------------------------------------------------------------ */
:root {
  /* Brand */
  --primary:       #6366F1;
  --primary-dark:  #4F52D3;
  --primary-light: #EEF0FD;
  --primary-mid:   #8486F5;

  /* Neutrals */
  --navy:          #0F172A;
  --navy-mid:      #1E293B;
  --slate:         #334155;
  --body:          #475569;
  --muted:         #94A3B8;
  --border:        #E2E8F0;
  --bg-subtle:     #F8FAFC;
  --white:         #FFFFFF;

  /* Feedback */
  --success:       #10B981;

  /* Typography */
  --font:          'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radii */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow:     0 4px 12px rgba(15,23,42,0.08), 0 2px 4px rgba(15,23,42,0.04);
  --shadow-lg:  0 12px 32px rgba(15,23,42,0.10), 0 4px 8px rgba(15,23,42,0.06);

  /* Transitions */
  --transition: 0.2s ease;

  /* Layout */
  --max-width: 1120px;
  --nav-height: 64px;

  /* Safe area */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--white);
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font);
  font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.3px;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.75px; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); letter-spacing: -0.5px; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
h4 { font-size: 1rem; }

p { max-width: 65ch; }

/* ------------------------------------------------------------
   3. Layout Utilities
   ------------------------------------------------------------ */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-20);
}

.section--sm {
  padding-block: var(--space-12);
}

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

.section--dark {
  background: var(--navy);
  color: var(--white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section__header {
  margin-bottom: var(--space-12);
}

.section__header--center {
  text-align: center;
}

.section__header--center p {
  margin-inline: auto;
}

.section__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.4px;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.section__sub {
  font-size: 1.05rem;
  color: var(--body);
  margin-top: var(--space-3);
  max-width: 52ch;
  line-height: 1.7;
}

.section--dark .section__sub {
  color: rgba(255,255,255,0.65);
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

/* Flex helpers */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Text helpers */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-small  { font-size: 0.875rem; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }

/* ------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn--outline:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: var(--bg-subtle);
}

.btn--outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.btn--outline-white:hover {
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.btn--lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn--text {
  background: transparent;
  border-color: transparent;
  color: var(--body);
  padding: 8px 10px;
  font-weight: 500;
}
.btn--text:hover {
  color: var(--primary);
  background: transparent;
  transform: none;
  box-shadow: none;
}

.btn--text-white {
  background: transparent;
  border-color: transparent;
  color: rgba(255,255,255,0.55);
  padding: 8px 10px;
  font-weight: 500;
}
.btn--text-white:hover {
  color: var(--white);
  background: transparent;
  transform: none;
  box-shadow: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ------------------------------------------------------------
   5. Navigation
   ------------------------------------------------------------ */
.nav {
  position: sticky;
  top: var(--safe-top);
  z-index: 200;
  /* Fully solid -- not translucent-plus-blur. Several pages have a
     dark navy section starting right at the top, and dark nav text
     over a barely-transparent nav bar over dark content behind it
     is what made the menu unreadable. Solid white removes the
     failure mode entirely rather than depending on blur support. */
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav__inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-6);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  text-decoration: none;
  grid-row: 1;
  grid-column: 2;
  justify-self: center;
}

.nav__logo-icon {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav__logo span {
  color: var(--primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  grid-row: 1;
  grid-column: 1;
}

.nav__links a {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-light);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  justify-self: end;
  grid-row: 1;
  grid-column: 3;
}

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu */
.nav__mobile {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6) var(--space-6);
  gap: var(--space-1);
}

.nav__mobile.is-open {
  display: flex;
}

.nav__mobile a {
  display: block;
  padding: 10px var(--space-3);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.nav__mobile a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav__mobile-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) 0;
}

.nav__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------ */
.hero {
  background: var(--navy);
  padding: var(--space-24) var(--space-6) var(--space-20);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(99,102,241,0.12);
  color: var(--primary-mid);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: var(--space-6);
}

.hero h1 {
  color: var(--white);
  margin-bottom: var(--space-5);
}

.hero h1 .highlight {
  color: var(--primary-mid);
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.62);
  margin-inline: auto;
  margin-bottom: var(--space-8);
  max-width: 54ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-12);
}

/* Image placeholder */
.hero__visual {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  max-width: 880px;
  margin-inline: auto;
}

.hero__screen {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  min-height: 340px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.hero__screen-placeholder {
  text-align: center;
  color: var(--muted);
  padding: var(--space-8);
}

.hero__screen-placeholder p {
  font-size: 0.85rem;
  margin-inline: auto;
}

/* ------------------------------------------------------------
   7. Feature Cards
   ------------------------------------------------------------ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
  font-size: 1.35rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--body);
  line-height: 1.65;
  max-width: none;
}

/* ------------------------------------------------------------
   8. Steps / Process
   ------------------------------------------------------------ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-8);
  counter-reset: steps;
}

.step {
  position: relative;
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.step h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.step p {
  font-size: 0.875rem;
  color: var(--body);
  max-width: none;
}

/* ------------------------------------------------------------
   9. Cards (generic)
   ------------------------------------------------------------ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   10. Blog Cards
   ------------------------------------------------------------ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  color: inherit;
}

.blog-card__image {
  background: var(--primary-light);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
}

.blog-card__image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card__body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card__tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-2);
}

.blog-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: var(--space-3);
}

.blog-card__excerpt {
  font-size: 0.875rem;
  color: var(--body);
  line-height: 1.6;
  flex: 1;
  max-width: none;
}

.blog-card__meta {
  margin-top: var(--space-4);
  font-size: 0.78rem;
  color: var(--muted);
}

/* Blog empty state */
.blog-empty {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--muted);
}

.blog-empty__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.blog-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.blog-empty p {
  font-size: 0.9rem;
  margin-inline: auto;
}

/* ------------------------------------------------------------
   11. Page Header (inner pages)
   ------------------------------------------------------------ */
.page-header {
  background: var(--navy);
  padding: var(--space-16) var(--space-6) var(--space-12);
  text-align: center;
  color: var(--white);
}

.page-header__breadcrumb {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-4);
}

.page-header__breadcrumb a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.page-header__breadcrumb a:hover {
  color: rgba(255,255,255,0.7);
}

.page-header__breadcrumb span {
  margin-inline: var(--space-2);
}

.page-header h1 {
  color: var(--white);
  margin-bottom: var(--space-4);
}

.page-header__sub {
  color: rgba(255,255,255,0.6);
  font-size: 1.05rem;
  max-width: 50ch;
  margin-inline: auto;
  max-width: none;
}

/* ------------------------------------------------------------
   12. Forms
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: #EF4444;
  margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--navy);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: var(--space-1);
}

/* ------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------ */
.footer {
  background: var(--navy);
  padding: var(--space-16) var(--space-6) var(--space-8);
  color: rgba(255,255,255,0.55);
}

.footer__inner {
  max-width: var(--max-width);
  margin-inline: auto;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer__brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-top: var(--space-3);
  max-width: 260px;
}

.footer__logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.footer__logo span {
  color: var(--primary-mid);
}

.footer__col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: var(--space-4);
  letter-spacing: 0.2px;
}

.footer__col ul {
  list-style: none;
}

.footer__col ul li {
  margin-bottom: var(--space-3);
}

.footer__col ul a {
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color var(--transition);
}

.footer__col ul a:hover {
  color: rgba(255,255,255,0.9);
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer__bottom p,
.footer__bottom a {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

.footer__bottom a {
  text-decoration: none;
}

.footer__bottom a:hover {
  color: rgba(255,255,255,0.65);
}

.footer__dev a {
  color: var(--primary-mid);
  text-decoration: none;
  font-weight: 600;
}

/* ------------------------------------------------------------
   14. Dividers & Misc
   ------------------------------------------------------------ */
.divider {
  height: 1px;
  background: var(--border);
  margin-block: var(--space-10);
}

.image-placeholder {
  background: var(--bg-subtle);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  min-height: 200px;
}

/* Portrait app screenshots (screenshot-about / -reports / -marks):
   capped so a tall phone screenshot never stretches to the full width
   of its grid column and inflates the section's height. */
.screenshot-card {
  display: block;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tag-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-pill--primary {
  background: var(--primary-light);
  color: var(--primary);
}

.tag-pill--dark {
  background: rgba(99,102,241,0.15);
  color: var(--primary-mid);
}

/* Check list */
.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: var(--body);
}

.check-list li::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.check-list--white li {
  color: rgba(255,255,255,0.8);
}

.check-list--white li::before {
  color: var(--primary-mid);
}

/* Inline notice */
.notice {
  background: var(--primary-light);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  font-size: 0.875rem;
  color: var(--primary-dark);
  line-height: 1.6;
}

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   15. Responsive Breakpoints
   ------------------------------------------------------------ */

/* Tablet */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .nav__inner {
    grid-template-columns: auto 1fr auto;
  }

  .section {
    padding-block: var(--space-12);
  }

  .nav__links,
  .nav__actions {
    display: none;
  }

  .nav__hamburger {
    display: flex;
    justify-self: end;
    grid-column: 3;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--space-16) var(--space-5) var(--space-12);
  }

  .hero__screen {
    min-height: 220px;
    height: 220px;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn {
    text-align: center;
    justify-content: center;
  }

  .section__header {
    margin-bottom: var(--space-8);
  }

  .page-header {
    padding: var(--space-12) var(--space-5) var(--space-8);
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

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

/* Small mobile */
@media (max-width: 480px) {
  .footer__top {
    grid-template-columns: 1fr;
  }

  .footer__brand {
    grid-column: auto;
  }

  .container {
    padding-inline: var(--space-5);
  }
}

/* ------------------------------------------------------------
   Scroll-reveal animation
   Progressive enhancement: only hides content once `.js` is
   confirmed on <html> (see inline script in <head>), so the
   page is fully visible if JavaScript never runs. Hooked onto
   existing component classes -- no extra markup needed.
   ------------------------------------------------------------ */
.js .hero__visual,
.js .section__header,
.js .feature-card,
.js .blog-card,
.js .screenshot-card,
.js .step,
.js .card,
.js .price-tier-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .hero__visual.is-visible,
.js .section__header.is-visible,
.js .feature-card.is-visible,
.js .blog-card.is-visible,
.js .screenshot-card.is-visible,
.js .step.is-visible,
.js .card.is-visible,
.js .price-tier-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---- Guide page ---- */
.guide{display:grid;grid-template-columns:220px minmax(0,1fr);gap:48px;align-items:start}
.guide-toc{position:sticky;top:96px;font-size:.9rem}
.guide-toc a{display:block;padding:6px 0;color:var(--muted)}
.guide-toc a:hover{color:var(--primary)}
.guide-sec{margin-bottom:56px;scroll-margin-top:96px}
.guide-sec h3{margin:8px 0 12px}
.guide-sec h4{margin:24px 0 8px}
.guide-sec ol,.guide-sec ul{padding-left:1.25rem;margin:0 0 16px}
.guide-sec ul.check-list{padding-left:0}
.guide-sec li{margin-bottom:8px}
.guide-split{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:32px;align-items:start;margin-bottom:8px}
.guide-table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius-lg)}
.guide-table{width:100%;border-collapse:collapse;font-size:.92rem}
.guide-table th,.guide-table td{padding:12px 16px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border)}
.guide-table tr:last-child td{border-bottom:0}
.guide-table th{background:var(--bg-subtle)}
.guide-faq details{border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 18px;margin-bottom:10px}
.guide-faq summary{cursor:pointer;font-weight:600}
.guide-faq details p{margin:10px 0 0}
@media (max-width:900px){.guide{grid-template-columns:1fr;gap:24px}.guide-toc{position:static;border-bottom:1px solid var(--border);padding-bottom:12px}.guide-split{grid-template-columns:1fr}}

/* ============================================================
   Smart APK download: sheet + toast
   Shown by js/main.js when someone taps any [data-apk-download]
   button. Gives instant feedback on weak connections.
   ============================================================ */
.dl-lock { overflow: hidden; }

.dl-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.dl-sheet.is-open { display: flex; }

.dl-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  animation: dl-fade 0.2s ease both;
}

.dl-sheet__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px calc(24px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: dl-rise 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  outline: none;
}

@media (min-width: 600px) {
  .dl-sheet { align-items: center; padding: 24px; }
  .dl-sheet__panel { border-radius: var(--radius-xl); padding-bottom: 28px; }
}

.dl-sheet__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 6px;
}

.dl-sheet__msg {
  max-width: none;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--body);
  margin-bottom: 20px;
}

.dl-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
}
.dl-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--muted);
}
.dl-steps li::before {
  content: '';
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.dl-steps li.is-active { color: var(--navy); font-weight: 600; }
.dl-steps li.is-active::before {
  border-color: var(--primary);
  border-top-color: transparent;
  animation: dl-spin 0.8s linear infinite;
}
.dl-steps li.is-done { color: var(--slate); }
.dl-steps li.is-done::before {
  border-color: var(--success);
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.dl-steps li.is-failed { color: #B91C1C; font-weight: 600; }
.dl-steps li.is-failed::before {
  border-color: #DC2626;
  background: #FEE2E2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.dl-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  overflow: hidden;
  margin-bottom: 20px;
}
.dl-bar > span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: dl-slide 1.3s ease-in-out infinite;
}
.dl-sheet[data-phase="started"] .dl-bar > span {
  width: 100%;
  background: var(--success);
  animation: none;
}

/* Info-only phases (iPhone, computer, in-app browser) and failures hide the progress parts */
.dl-sheet[data-phase="ios"] .dl-steps,
.dl-sheet[data-phase="desktop"] .dl-steps,
.dl-sheet[data-phase="inapp"] .dl-steps,
.dl-sheet[data-phase="ios"] .dl-bar,
.dl-sheet[data-phase="desktop"] .dl-bar,
.dl-sheet[data-phase="inapp"] .dl-bar,
.dl-sheet[data-phase="offline"] .dl-bar,
.dl-sheet[data-phase="failed"] .dl-bar,
.dl-sheet[data-phase="timeout"] .dl-bar { display: none; }

.dl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dl-actions .btn { justify-content: center; flex: 1 1 auto; white-space: normal; text-align: center; }

.dl-note {
  max-width: none;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Buttons that already started a download */
[data-apk-download].is-busy { opacity: 0.65; pointer-events: none; }

/* Compact "download in progress" toast shown after the sheet closes */
.dl-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 999;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  margin-inline: auto;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--navy-mid);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--white);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.25);
}
.dl-toast.is-open { display: flex; animation: dl-rise 0.25s ease both; }
.dl-toast__icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--primary-mid);
  border-top-color: transparent;
  animation: dl-spin 0.8s linear infinite;
}
.dl-toast[data-phase="started"] .dl-toast__icon {
  animation: none;
  border-color: var(--success);
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.dl-toast__text { flex: 1; min-width: 0; font-size: 0.85rem; line-height: 1.45; color: rgba(255, 255, 255, 0.72); }
.dl-toast__text strong { display: block; font-size: 0.92rem; color: var(--white); }
.dl-toast__text a { color: var(--primary-mid); font-weight: 600; }
.dl-toast__close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes dl-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes dl-rise  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dl-spin  { to { transform: rotate(360deg); } }
@keyframes dl-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }

@media (prefers-reduced-motion: reduce) {
  .dl-bar > span { width: 100%; opacity: 0.55; animation: none; }
  .dl-steps li.is-active::before { animation: none; border-top-color: var(--primary); }
  .dl-toast__icon { animation: none; border-top-color: var(--primary-mid); }
}

/* ---- Download page ---- */
.install-steps {
  max-width: 720px;
  list-style: decimal outside;
  padding-left: 1.4rem;
  display: grid;
  gap: 14px;
  color: var(--body);
  line-height: 1.7;
}
.install-steps li::marker { color: var(--primary); font-weight: 700; }
.install-help { max-width: 720px; }
.install-help h3 { margin: 28px 0 6px; }
.install-help h3:first-child { margin-top: 0; }
.install-help p { max-width: none; }
