/* ============================================
   Reset and Base
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  color: var(--color-brand);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
  border: none;
  outline: none;
}

/* ============================================
   Header — Brand Bar
   ============================================ */
.header {
  background: var(--color-bg-gray);
}

.header__inner {
  width: fit-content;
  margin: 0 auto;
  padding: 0 24px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
}

.header__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.header__title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 400;
  color: var(--color-brand);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ============================================
   Header — App Icon Strip
   ============================================ */
.header__apps {
  display: flex;
  gap: 28px;
  padding: 10px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.header__apps::-webkit-scrollbar {
  display: none;
}

.header__app-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.header__app-link:hover {
  transform: translateY(-2px);
}

.header__app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.header__app-icon--all-apps {
  background: #FFFFFF;
  padding: 14px;
  object-fit: contain;
}

.header__app-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-light);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
}

/* ============================================
   Sub-Navigation
   ============================================ */
.subnav {
  background: #F5F5F5;
  position: relative;
}

.subnav::before {
  content: '';
  display: block;
  height: 6px;
  background: linear-gradient(to bottom, #CACACA, transparent);
}

.subnav::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to bottom, #CACACA, transparent);
  pointer-events: none;
  z-index: 1;
}

.subnav__list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 2px 24px 6px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--font-helvetica);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.subnav__link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-brand);
}

.subnav__link--active {
  color: var(--color-brand);
  font-weight: 500;
}

.subnav__link i {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* Toggle button — hidden on desktop, chevron on mobile */
.subnav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-brand);
  font-size: 18px;
}

.subnav__toggle i {
  display: inline-flex;
  transition: transform var(--transition);
}

.subnav__toggle.active i {
  transform: rotate(180deg);
}

/* ============================================
   Main Content Area
   ============================================ */
.main {
  min-height: 40vh;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

main:not(.main) {
  min-height: 40vh;
}

/* ============================================
   Footer — Container
   ============================================ */
.footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 48px 24px 32px;
}

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

/* ============================================
   Footer — Newsletter
   ============================================ */
.footer__newsletter {
  text-align: center;
  margin-bottom: 36px;
}

.footer__newsletter-text {
  font-size: 15px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto 24px;
  opacity: 0.9;
}

.footer__newsletter-form {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.footer__newsletter-input {
  flex: 1;
  height: 46px;
  padding: 0 24px;
  font-size: 15px;
  box-sizing: border-box;
  color: var(--color-text);
  background: transparent;
}

.footer__newsletter-input::placeholder {
  color: #AAAAAA;
}

.footer__newsletter-btn {
  height: 46px;
  padding: 0 28px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #FFFFFF;
  background: var(--color-cta);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.footer__newsletter-btn:hover {
  background: var(--color-cta-hover);
}

/* ============================================
   Footer — Social Icons
   ============================================ */
.footer__social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-footer-text);
  font-size: 20px;
  transition: background var(--transition), transform var(--transition);
}

.footer__social-link svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.footer__social-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ============================================
   Footer — Links
   ============================================ */
.footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
  font-size: 14px;
}

.footer__link {
  color: var(--color-footer-text);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.footer__link:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer__links-separator {
  opacity: 0.5;
  user-select: none;
}

/* ============================================
   Footer — Values
   ============================================ */
.footer__values {
  text-align: center;
  margin-bottom: 36px;
}

.footer__values-image {
  max-width: 380px;
  margin: 0 auto;
  border-radius: 0;
}

/* ============================================
   Footer — Copyright
   ============================================ */
.footer__copyright {
  text-align: center;
  font-size: 13px;
  opacity: 0.7;
}

/* ============================================
   Utility Classes
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.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;
}

/* ============================================
   Media Queries — 900px
   ============================================ */
@media (max-width: 900px) {
  .header__inner {
    padding: 0 16px;
  }

  .header__apps {
    gap: 20px;
    padding: 12px 0 16px;
  }

  .header__app-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }

  .header__app-label {
    font-size: 11px;
  }
}

/* ============================================
   Media Queries — 768px (Mobile)
   ============================================ */
@media (max-width: 768px) {
  .header__inner {
    width: auto;
    padding: 0 16px;
  }

  .header__brand {
    padding: 12px 0;
  }

  .header__title {
    font-size: 18px;
  }

  .header__apps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 8px;
    padding: 10px 0 14px;
    justify-items: center;
    overflow-x: visible;
  }

  .header__app-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .header__app-label {
    font-size: 10px;
  }

  /* Sub-nav toggle visible */
  .subnav__toggle {
    display: flex;
  }

  .subnav__list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .subnav__list.open {
    display: flex;
  }

  .subnav__link {
    height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 24px;
    border-radius: 0;
    font-size: 15px;
  }

  .main {
    padding: 24px 16px;
  }

  /* Footer */
  .footer {
    padding: 36px 16px 24px;
  }

  .footer__newsletter-text {
    font-size: 14px;
  }

  .footer__newsletter-form {
    flex-direction: column;
    border-radius: var(--radius);
    max-width: 100%;
  }

  .footer__newsletter-input {
    width: 100%;
    text-align: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  }

  .footer__newsletter-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .footer__links {
    flex-direction: column;
    gap: 12px;
  }

  .footer__links-separator {
    display: none;
  }

  .footer__values-image {
    max-width: 280px;
  }
}

/* ============================================
   Media Queries — 480px (Small Mobile)
   ============================================ */
@media (max-width: 480px) {
  .header__inner {
    padding: 0 12px;
  }

  .header__brand {
    padding: 10px 0;
  }

  .header__title {
    font-size: 16px;
    letter-spacing: 1px;
  }

  .header__apps {
    gap: 10px 4px;
    padding: 8px 0 12px;
  }

  .header__app-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
  }

  .footer__social {
    gap: 12px;
  }

  .footer__social-link {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .footer__values-image {
    max-width: 240px;
  }
}
