/* ============================================
   Accessible Resources - Custom Styles
   Built with accessibility-first principles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a2e;
  background-color: #fff;
}

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

a {
  color: #1a56db;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus {
  color: #0e3fa1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.2;
  color: #1a1a2e;
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 700; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); font-weight: 600; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 1.5rem;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: #1a1a2e;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  color: #fff;
}

/* --- Focus Styles --- */
:focus-visible {
  outline: 3px solid #1a56db;
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 800px;
}

/* --- Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.site-nav__brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.site-nav__brand:hover,
.site-nav__brand:focus {
  color: #1a56db;
}

.site-nav__brand-icon {
  font-size: 1.4rem;
}

.site-nav__toggle {
  display: none;
  background: none;
  border: 2px solid #1a1a2e;
  border-radius: 0.375rem;
  padding: 0.5rem;
  cursor: pointer;
  color: #1a1a2e;
}

.site-nav__toggle svg {
  display: block;
  width: 24px;
  height: 24px;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav__links a:hover,
.site-nav__links a:focus,
.site-nav__links a[aria-current="page"] {
  color: #1a56db;
  border-bottom-color: #1a56db;
}

/* --- Hero Section --- */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 50%, #f5f0ff 100%);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__badge {
  display: inline-block;
  background: #1a56db;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  margin-bottom: 1rem;
  color: #1a1a2e;
}

.hero__subtitle {
  font-size: 1.15rem;
  color: #4b5563;
  margin-bottom: 2rem;
  max-width: 540px;
  line-height: 1.7;
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero__image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__image img {
  max-width: 100%;
  border-radius: 1rem;
}

/* --- Store Badges --- */
.store-badge {
  display: inline-block;
  transition: transform 0.2s, opacity 0.2s;
}

.store-badge:hover,
.store-badge:focus {
  transform: scale(1.05);
  opacity: 0.9;
}

.store-badge img {
  height: 48px;
  width: auto;
}

.store-badge--large img {
  height: 56px;
}

/* --- Section --- */
.section {
  padding: 5rem 0;
}

.section--gray {
  background-color: #f9fafb;
}

.section--dark {
  background-color: #1a1a2e;
  color: #e5e7eb;
}

.section--dark h2,
.section--dark h3 {
  color: #fff;
}

.section--dark a {
  color: #93b4f4;
}

.section--accent {
  background: linear-gradient(135deg, #1a1a2e 0%, #23286b 100%);
  color: #e5e7eb;
}

.section--accent h2,
.section--accent h3 {
  color: #fff;
}

.section__header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section__header p {
  color: #6b7280;
  font-size: 1.1rem;
}

.section--dark .section__header p,
.section--accent .section__header p {
  color: #d1d5db;
}

/* --- Feature Cards (3 across) --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  background: #eef2ff;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.section--dark .feature-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.section--dark .feature-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.section--dark .feature-card__icon {
  background: rgba(255, 255, 255, 0.1);
}

.feature-card h3 {
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: #6b7280;
  margin-bottom: 0;
  line-height: 1.6;
}

.section--dark .feature-card h3 {
  color: #fff;
}

.section--dark .feature-card p {
  color: #d1d5db;
}

/* --- App Showcase Grid --- */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.app-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  text-decoration: none;
  color: #1a1a2e;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.app-card:hover,
.app-card:focus {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
  color: #1a1a2e;
}

.app-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.app-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.app-card p {
  color: #6b7280;
  font-size: 0.95rem;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

.app-card__link {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a56db;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.app-card__link::after {
  content: '\2192';
}

/* --- Two Column Layout --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.two-col--reverse {
  direction: rtl;
}

.two-col--reverse > * {
  direction: ltr;
}

.two-col__image img {
  border-radius: 1rem;
  width: 100%;
}

.two-col__content h2 {
  margin-bottom: 1rem;
}

.two-col__content p {
  color: #4b5563;
  margin-bottom: 1.5rem;
}

/* --- CTA Section --- */
.cta-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #23286b 100%);
  text-align: center;
  color: #fff;
}

.cta-section h2 {
  color: #fff;
  margin-bottom: 1rem;
}

.cta-section p {
  color: #d1d5db;
  font-size: 1.15rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .store-badge img {
  height: 56px;
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.about-grid__image img {
  border-radius: 1rem;
  width: 100%;
}

/* --- Blog Post Article --- */
.post-header {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 50%, #f5f0ff 100%);
  padding: 3rem 0 2.5rem;
}

.post-header h1 {
  margin-bottom: 0.75rem;
  max-width: 700px;
}

.post-header__meta {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.post-content {
  padding: 3rem 0 5rem;
}

.post-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.post-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.post-content p {
  color: #374151;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  color: #374151;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content li ul,
.post-content li ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.post-content a {
  color: #1a56db;
}

.post-content a:hover {
  color: #0e3fa1;
}

.post-content strong {
  color: #1a1a2e;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.post-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #1a56db;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.post-nav__back:hover {
  text-decoration: underline;
}

.post-nav__back::before {
  content: '\2190';
}

/* --- Blog Cards --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  transition: box-shadow 0.2s;
}

.blog-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.blog-card__date {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.blog-card h3 {
  margin-bottom: 0.75rem;
}

.blog-card h3 a {
  color: #1a1a2e;
  text-decoration: none;
}

.blog-card h3 a:hover,
.blog-card h3 a:focus {
  color: #1a56db;
  text-decoration: underline;
}

.blog-card p {
  color: #6b7280;
  font-size: 0.95rem;
}

/* --- Footer --- */
.site-footer {
  background: #1a1a2e;
  color: #d1d5db;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-brand-desc {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-col h3 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.6rem;
}

.footer-col a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover,
.footer-col a:focus {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}

/* --- App Landing Page --- */
.app-hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 50%, #f5f0ff 100%);
}

.app-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.app-hero__icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.app-hero h1 {
  margin-bottom: 0.75rem;
}

.app-hero__tagline {
  font-size: 1.25rem;
  color: #4b5563;
  margin-bottom: 2rem;
}

.app-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.app-hero__image {
  display: flex;
  justify-content: center;
}

.app-hero__image img {
  max-height: 500px;
  border-radius: 1rem;
}

/* Screenshots gallery */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.screenshots-grid img {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  width: 100%;
}

/* --- Device Frames --- */
.device-frame {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* iPhone Frame */
.iphone-frame {
  position: relative;
  background: #1a1a2e;
  border-radius: 3rem;
  padding: 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  max-width: 280px;
  width: 100%;
}

.iphone-frame::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 35%;
  height: 1.5rem;
  background: #1a1a2e;
  border-radius: 0 0 1rem 1rem;
  z-index: 2;
}

.iphone-frame img {
  width: 100%;
  border-radius: 2.25rem;
  display: block;
}

/* MacBook Frame */
.macbook-frame {
  position: relative;
  max-width: 520px;
  width: 100%;
}

.macbook-frame__screen {
  background: #1a1a2e;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 1.25rem 1.25rem 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.macbook-frame__screen img {
  width: 100%;
  display: block;
  border-radius: 0.25rem;
}

.macbook-frame__base {
  background: linear-gradient(to bottom, #c4c4c4, #d4d4d4);
  height: 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  position: relative;
}

.macbook-frame__base::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20%;
  height: 0.25rem;
  background: #b0b0b0;
  border-radius: 0 0 0.25rem 0.25rem;
}

/* App card icons (real images) */
.app-card__icon-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

/* App hero icon (real image) */
.app-hero__icon-img {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
  .iphone-frame {
    max-width: 220px;
  }

  .macbook-frame {
    max-width: 100%;
  }
}

/* --- Privacy page --- */
.privacy-header {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 50%, #f5f0ff 100%);
  padding: 3rem 0 2.5rem;
}

.privacy-header h1 {
  margin-bottom: 0.5rem;
}

.privacy-header__meta {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.privacy-content {
  padding: 3rem 0 5rem;
}

.privacy-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.privacy-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.privacy-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.privacy-content p {
  color: #4b5563;
  line-height: 1.7;
}

.privacy-content ul {
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.privacy-content ul li {
  margin-bottom: 0.35rem;
}

.privacy-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #1a56db;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 2.5rem;
}

.privacy-back:hover {
  text-decoration: underline;
}

.privacy-back::before {
  content: '\2190';
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background-color: #1a56db;
  color: #fff;
  border-color: #1a56db;
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: #0e3fa1;
  border-color: #0e3fa1;
  color: #fff;
}

.btn--outline {
  background-color: transparent;
  color: #1a56db;
  border-color: #1a56db;
}

.btn--outline:hover,
.btn--outline:focus {
  background-color: #1a56db;
  color: #fff;
}

.btn--white {
  background-color: #fff;
  color: #1a1a2e;
  border-color: #fff;
}

.btn--white:hover,
.btn--white:focus {
  background-color: #f3f4f6;
  border-color: #f3f4f6;
  color: #1a1a2e;
}

/* --- Accessibility stat cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-card {
  padding: 2rem;
}

.stat-card__number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a56db;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.section--dark .stat-card__number {
  color: #93b4f4;
}

.stat-card__label {
  font-size: 1rem;
  color: #6b7280;
}

.section--dark .stat-card__label {
  color: #d1d5db;
}

/* --- Breadcrumb --- */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #1a56db;
  text-decoration: underline;
}

.breadcrumb span {
  color: #9ca3af;
  margin: 0 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .hero__grid,
  .app-hero__grid,
  .two-col,
  .two-col--reverse,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .two-col--reverse {
    direction: ltr;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .hero__image {
    order: -1;
  }

  .hero__image img,
  .app-hero__image img {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .section {
    padding: 3.5rem 0;
  }

  .hero,
  .app-hero {
    padding: 3rem 0;
  }

  .features-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-nav__toggle {
    display: block;
  }

  .site-nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .site-nav__links--open {
    display: flex;
  }

  .site-nav__links a {
    padding: 0.5rem 0;
  }

  .site-nav {
    position: relative;
  }

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

@media (max-width: 479px) {
  .container {
    padding: 0 1rem;
  }

  .screenshots-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Utility classes --- */
.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;
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* --- Print Styles --- */
@media print {
  .site-header,
  .site-footer,
  .cta-section {
    display: none;
  }
}
