/* Layout */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-body);
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 1000;
  padding: var(--space-xs) var(--space-sm);
  background: var(--text);
  color: var(--bg);
  font-size: var(--text-small);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast);
}

.skip-link:focus { top: var(--space-sm); }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

/* ---- Nav ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: border-color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background-color: var(--bg);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* ---- Sections ---- */
.section {
  padding-block: var(--space-section);
  position: relative;
}

.section--hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--nav-height);
  text-align: center;
}

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

/* ---- Feature Section (text + phone) ---- */
.feature {
  padding-block: var(--space-section);
  overflow: hidden;
}

.feature__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: center;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.feature__text {
  max-width: 440px;
}

.feature--reverse .feature__text {
  justify-self: end;
}

/* ---- Dual-Device Showcase ---- */
.feature__devices {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 580px;
}

.feature__devices .desktop {
  position: relative;
  z-index: 2;
}

.feature__devices .phone {
  position: absolute;
  z-index: 1;
  right: -20px;
  bottom: 0;
  transform: scale(0.85);
  transform-origin: bottom right;
}

.feature--reverse .feature__devices .phone {
  right: auto;
  left: -20px;
  transform-origin: bottom left;
}

/* ---- App Preview (centered dual-device) ---- */
.feature__devices--preview {
  max-width: 700px;
  margin-inline: auto;
  min-height: 380px;
}

.feature__devices--preview .desktop {
  position: relative;
  z-index: 2;
}

.feature__devices--preview .phone {
  position: absolute;
  z-index: 1;
  right: -20px;
  bottom: 0;
  transform: scale(0.85);
  transform-origin: bottom right;
}

@media (max-width: 767px) {
  .feature__devices--preview {
    min-height: auto;
    justify-content: center;
  }

  .feature__devices--preview .phone {
    position: relative;
    right: auto;
    transform: none;
    width: 260px;
    height: 530px;
  }
}

/* ---- Footer ---- */
.footer {
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer__links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
  .nav__links {
    display: none;
  }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--bg);
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    z-index: 101;
    font-size: var(--text-h2);
  }

  .feature__text {
    max-width: 100%;
  }

  .feature--reverse .feature__text {
    justify-self: start;
  }

  .footer__top,
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .hamburger { display: none; }

  .feature__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }

  .feature--reverse .feature__phone {
    order: -1;
  }

  .feature--reverse .feature__devices {
    order: -1;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .feature__devices {
    min-height: 480px;
  }

  .feature__devices .phone {
    transform: scale(0.8);
  }
}

@media (max-width: 767px) {
  .feature__devices {
    min-height: auto;
    justify-content: center;
  }

  .feature__devices .phone {
    position: relative;
    right: auto;
    left: auto;
    transform: none;
  }

  .feature--reverse .feature__devices .phone {
    left: auto;
  }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--space-xl); }
}
