/* Orbit Screw: Bolt Puzzle — tokens, base typography, header, store buttons, footer.
   Mobile-first: base rules target screens <= 768px, wider screens enhance progressively. */

:root {
  /* Lunar bone white with lilac & brass */
  --bone: #F6F4F1;
  --surface: #FFFFFF;
  --surface-sunk: #EFECE6;
  --hairline: #E2DED8;
  --ink: #1B2030;
  --body: #3A4157;
  --muted: #5A6178;
  --lilac: #6D4AC8;
  --lilac-deep: #4E33A0;
  --teal: #177C7A;
  --brass: #C08A2E;
  --night: #141828;
  --night-soft: #232941;
  --on-night: #F6F4F1;
  --on-night-muted: #A9B1C6;
  --disabled-bg: #2A2A2A;

  --shell: 1120px;
  --radius-card: 18px;
  --radius-pill: 999px;
  --header-h: 56px;

  --font-display: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease-turn: cubic-bezier(0.22, 0.68, 0.24, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  /* Room for the mobile sticky download bar so it never covers the last line of the footer. */
  padding-bottom: 84px;
  overflow-x: hidden;
}

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

a { color: var(--lilac-deep); }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.18;
  margin: 0 0 12px;
}

h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 19px; letter-spacing: -0.005em; line-height: 1.3; }
p { margin: 0 0 16px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

.eyebrow {
  font-family: var(--font-display);
  text-transform: lowercase;
  letter-spacing: 0.16em;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 10px;
}

.eyebrow--onDark { color: #7FD3D0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Sticky header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 244, 241, 0.94);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(10px);
  padding-top: env(safe-area-inset-top);
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand__icon { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--hairline); }

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.site-nav { display: none; }

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-pill);
  background: var(--lilac);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.25s var(--ease-turn), transform 0.25s var(--ease-turn);
}

.header-cta__glyph { width: 20px; height: 20px; }
.header-cta__label { display: none; }

.header-cta:hover { background: var(--lilac-deep); }
.header-cta:active { background: var(--lilac-deep); transform: scale(0.96); }
.header-cta:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--lilac);
  outline-offset: 3px;
}

/* ---------- Store buttons: filled capsule with a bolt-slot detail ---------- */

.store-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
}

.store-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  text-align: left;
  text-decoration: none;
}

.store-btn__slot {
  flex: 0 0 auto;
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

/* The slot line reads as a screw head and turns 90 degrees on interaction. */
.store-btn__slot::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform: rotate(-30deg);
  transition: transform 0.5s var(--ease-turn);
}

.store-btn__text { display: flex; flex-direction: column; line-height: 1.2; }
.store-btn__line1 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.92; }
.store-btn__line2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; }

.store-btn--live {
  background: var(--lilac);
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(109, 74, 200, 0.22);
  transition: background-color 0.25s var(--ease-turn), transform 0.25s var(--ease-turn), box-shadow 0.25s var(--ease-turn);
}

.store-btn--live:hover { background: var(--lilac-deep); box-shadow: 0 14px 30px rgba(78, 51, 160, 0.3); }
.store-btn--live:hover .store-btn__slot::after { transform: rotate(60deg); }
.store-btn--live:active { background: var(--lilac-deep); transform: translateY(1px) scale(0.99); }
.store-btn--live:active .store-btn__slot::after { transform: rotate(60deg); }

/* App Store has no live link yet: disabled control, neutral grey, never brand-coloured. */
.store-btn--soon {
  background: var(--disabled-bg);
  color: #FFFFFF;
  opacity: 0.55;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.store-btn__tag {
  position: absolute;
  top: -9px;
  right: 14px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: #0B0B0B;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--night);
  color: var(--on-night-muted);
  padding: 40px 0 36px;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.site-footer__brand img { border-radius: 11px; }

.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--on-night);
  margin: 0;
}

.site-footer__tagline { font-size: 15px; margin: 2px 0 0; }

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 22px;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-night);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  align-self: flex-start;
}

.site-footer__links a:hover { border-bottom-color: var(--brass); }
.site-footer__links a:active { color: var(--brass); }

.site-footer__legal { font-size: 14px; margin: 0; }

/* ---------- Desktop enhancement ---------- */

@media (min-width: 768px) {
  :root { --header-h: 64px; }

  body { padding-bottom: 0; font-size: 17px; }
  h1 { font-size: 48px; }
  h2 { font-size: 34px; }
  h3 { font-size: 20px; }

  .shell { padding: 0 32px; }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
    margin-right: 28px;
  }

  .site-nav a {
    font-family: var(--font-display);
    text-transform: lowercase;
    letter-spacing: 0.08em;
    font-size: 15px;
    font-weight: 600;
    color: var(--body);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 2px solid transparent;
  }

  .site-nav a:hover { color: var(--lilac-deep); border-bottom-color: var(--lilac); }

  .header-cta { padding: 0 20px; min-height: 46px; }
  .header-cta__label { display: inline; font-family: var(--font-display); font-size: 15px; }

  .store-row { flex-direction: row; flex-wrap: wrap; }
  .store-btn { width: auto; min-width: 232px; }

  .site-footer { padding: 56px 0 48px; }

  .site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand links"
      "legal legal";
    align-items: center;
    row-gap: 26px;
  }

  .site-footer__brand { grid-area: brand; margin-bottom: 0; }
  .site-footer__links { grid-area: links; flex-direction: row; gap: 26px; margin-bottom: 0; }
  .site-footer__legal { grid-area: legal; border-top: 1px solid rgba(169, 177, 198, 0.22); padding-top: 22px; }
}

@media (min-width: 1024px) {
  h1 { font-size: 56px; }
  h2 { font-size: 38px; }
}
