.site-header {
  position: sticky;
    z-index: 30;
    top: 0;
    isolation: isolate;
    padding-top: env(safe-area-inset-top, 0px);
    background: transparent;
    transition: background-color 180ms ease;
}

.site-header::after {
  position: absolute;
    z-index: -1;
    inset: 100% 0 -30px;
    background: linear-gradient(
      to bottom,
      color-mix(in srgb, var(--canvas) 92%, transparent) 0%,
      color-mix(in srgb, var(--canvas) 44%, transparent) 52%,
      transparent 100%
    );
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--canvas) 99%, transparent);
}

.site-header.is-scrolled::after {
  opacity: 1;
}

.header-inner {
  display: flex;
    width: min(calc(100% - 40px), var(--max));
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin: 0 auto;
}

.brand {
  display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand img {
  width: 105px;
    height: auto;
}

:root[data-theme='dark'] .brand img,
:root[data-theme='dark'] .footer-brand img {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand img,
  :root:not([data-theme]) .footer-brand img {
    filter: invert(1);
  }
}

.brand-label {
  border-left: 1px solid var(--line);
    padding-left: 12px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 560;
    letter-spacing: 0.01em;
}

.header-nav,
.header-actions {
  display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav {
  margin-left: auto;
}

.header-nav a {
  display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0 12px;
    color: var(--soft);
    font-size: 14px;
    font-weight: 560;
    text-decoration: none;
}

.header-nav a:hover {
  color: var(--ink);
}

.login-button {
  display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    padding: 0 18px;
    font-size: 13px;
    font-weight: 620;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.login-button:hover {
  background: var(--surface-strong);
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.back-link .lucide {
  width: 16px;
  height: 16px;
}

.theme-toggle {
  display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.theme-toggle .moon,
:root[data-theme='dark'] .theme-toggle .sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .moon {
  display: block;
}

.site-footer {
  background: var(--canvas);
    padding: 0 20px 20px;
}

.footer-panel {
  width: min(100%, 1320px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 22px;
    background: #18141d;
    color: #f7f4f8;
}

.footer-grid,
.footer-meta {
  width: min(calc(100% - 96px), var(--max));
    margin: 0 auto;
}

.footer-grid {
  display: grid;
    grid-template-columns: minmax(280px, 1.35fr) repeat(2, minmax(120px, .64fr)) minmax(170px, .75fr);
    align-items: start;
    gap: clamp(28px, 4vw, 58px);
    padding: 54px 0 42px;
}

.footer-brand {
  display: inline-flex;
    width: fit-content;
    min-height: 44px;
    align-items: center;
    text-decoration: none;
}

.footer-brand img {
  width: 124px;
    height: auto;
    filter: invert(1);
}

.footer-statement {
  max-width: 330px;
    margin: 18px 0 0;
    color: #b8b0bc;
    font-size: 14px;
    line-height: 1.65;
}

.footer-socials {
  display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    color: #8f8794;
}

.footer-social-mark {
  display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
}

.footer-social-mark svg {
  width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.footer-social-mark .social-fill {
  fill: currentColor;
    stroke: none;
}

.footer-group {
  display: grid;
    align-content: start;
    gap: 4px;
}

.footer-group h2 {
  margin: 8px 0 16px;
    color: #f7f4f8;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .02em;
}

.footer-group > a {
  display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: #b8b0bc;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 160ms ease, transform 160ms ease;
}

.footer-group > a:hover {
  color: #f7f4f8;
    transform: translateX(1px);
}

.footer-store-links {
  display: grid;
    justify-items: start;
    gap: 8px;
}

.store-badge {
  position: relative;
    display: inline-flex;
    height: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border-radius: 8px;
    transition: opacity 160ms ease, transform 160ms ease;
}

.store-badge:hover {
  opacity: .9;
    transform: translateY(-1px) !important;
}

.store-badge:focus-visible {
  outline: 2px solid #c3a5f5;
    outline-offset: 3px;
}

.store-badge img {
  position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    max-width: none;
    transform: translate(-50%, -50%);
}

.store-badge.is-apple {
  width: 120px;
}

.store-badge.is-apple img {
  width: 120px;
    height: 40px;
}

.store-badge.is-google {
  width: 135px;
}

.store-badge.is-google img {
  width: 135px;
    height: auto;
}

.footer-meta {
  display: flex;
    min-height: calc(82px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    color: #8f8794;
    font-size: 12px;
}

.footer-legal {
  line-height: 1.5;
}

.footer-meta-actions {
  display: flex;
    align-items: center;
    gap: 26px;
}

.footer-top-button {
  display: inline-flex;
    width: auto;
    min-height: 44px;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: #aaa2ae;
    font: inherit;
    font-size: 12px;
    padding: 0;
    cursor: pointer;
}

.footer-top-button svg {
  width: 16px;
    height: 16px;
    stroke-width: 1.9;
}

.footer-top-button:hover {
  color: #f7f4f8;
}

.footer-top-button:focus-visible {
  outline: 2px solid #c3a5f5;
    outline-offset: 2px;
}

.footer-signature {
  display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    color: #b8b0bc;
    font-size: 12px;
    text-decoration: none;
    transition: color 160ms ease;
}

.footer-signature:hover {
  color: #f7f4f8;
}

.footer-signature:focus-visible {
  border-radius: 4px;
    outline: 2px solid #c3a5f5;
    outline-offset: 3px;
}

.footer-signature-symbol {
  width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: currentColor;
    -webkit-mask: url('/brand/arconite-symbol.svg') center / contain no-repeat;
    mask: url('/brand/arconite-symbol.svg') center / contain no-repeat;
}

@media (max-width: 1040px) {
  .footer-grid {
    grid-template-columns: minmax(230px, 1.3fr) repeat(2, minmax(100px, .6fr)) minmax(150px, .7fr);
        gap: 28px;
  }
}

@media (max-width: 820px) {
  .header-nav {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 24px;
  }

  .footer-intro,
  .footer-access {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .header-inner {
    width: min(calc(100% - 32px), var(--max));
  }

  .header-inner {
    min-height: 58px;
  }

  .brand img {
    width: 92px;
  }

  .brand-label {
    display: none;
  }

  .login-button {
    padding: 0 15px;
  }

  .site-footer {
    padding: 0 8px 8px;
  }

  .footer-panel {
    border-radius: 16px;
  }

  .footer-grid,
  .footer-meta {
    width: calc(100% - 40px);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 24px;
        padding: 40px 0 34px;
  }

  .footer-intro,
  .footer-access {
    grid-column: 1 / -1;
  }

  .footer-statement {
    max-width: 290px;
  }

  .footer-meta {
    min-height: auto;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px 18px;
        padding-top: 24px;
        padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .footer-legal {
    width: 100%;
  }

  .footer-meta-actions {
    width: 100%;
        justify-content: flex-end;
        gap: 22px;
  }
}

@media (max-width: 370px) {
  .header-actions {
    gap: 4px;
  }

  .login-button {
    padding: 0 12px;
  }

  .back-link {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .back-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-group > a:hover {
    transform: none;
  }
}

@media print {
  .site-header {
    display: none !important;
  }
}
