/* Moon Shard homepage. Subpages keep style.css. */

:root {
  --bg: #0B0A10;
  --surface: #131219;
  --surface-2: #1A1922;
  --line: #25232E;
  --line-2: #34313E;
  --text: #EEEDF2;
  --soft: #A9A6B5;
  --faint: #8A8795;
  --accent: #9B7AE4;
  --accent-hover: #AA8DEA;
  --accent-ink: #0B0A10;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--soft);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { color: var(--text); font-weight: 400; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
.skip {
  position: absolute; left: 12px; top: -64px; z-index: 100;
  padding: 12px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-weight: 600;
}
.skip:focus { top: 12px; }

/* Type helpers */
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 12.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 15px/1 var(--sans); letter-spacing: -.005em; white-space: nowrap;
  transition: transform .4s var(--spring), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-line { border: 1px solid var(--line-2); color: var(--text); }
.btn-line:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-store { background: var(--text); color: var(--bg); }
.btn-store:hover { background: var(--soft); }
.btn-store .apple { width: 16px; height: 19px; fill: currentColor; margin-top: -3px; }
.btn-sm .apple { width: 14px; height: 17px; }

.link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  color: var(--text); font-size: 15px; font-weight: 500;
}
.link span { border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: border-color .2s; }
.link:hover span { border-color: var(--text); }
.link svg { width: 15px; height: 15px; transition: transform .4s var(--spring); }
.link:hover svg { transform: translateX(3px); }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.nav.scrolled, .nav.menu-open {
  background: rgba(11, 10, 16, .86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em;
}
.brand .ms-logo { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--soft); font-size: 15px; font-weight: 500; transition: color .2s;
}
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links .btn { margin-left: 10px; }
.menu-btn {
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 44px; height: 44px; margin-right: -10px; border-radius: 12px;
}
.menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--text); transition: transform .45s var(--spring); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
.menu { display: none; }

@media (max-width: 760px) {
  .nav-links a:not(.btn) { display: none; }
  .js .nav-links { display: none; }
  .js .menu-btn { display: inline-flex; }
  .js .menu {
    display: flex; flex-direction: column;
    position: absolute; top: calc(var(--nav-h) + 6px);
    left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right));
    padding: 8px; border-radius: 20px;
    background: var(--surface-2); border: 1px solid var(--line-2);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7);
    opacity: 0; visibility: hidden; transform: scale(.96); transform-origin: top right;
    transition: opacity .2s var(--ease), transform .45s var(--spring), visibility 0s linear .45s;
  }
  .js .menu.open {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .2s var(--ease), transform .45s var(--spring), visibility 0s;
  }
  .menu a:not(.btn) {
    display: flex; align-items: center; min-height: 52px; padding: 0 16px; border-radius: 12px;
    color: var(--text); font-size: 18px; font-weight: 500;
  }
  .menu a:not(.btn):hover { background: var(--surface); }
  .menu .btn { margin-top: 8px; min-height: 52px; font-size: 16px; }
}

/* Hero */
.hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: calc(var(--nav-h) + clamp(32px, 5vh, 64px));
  padding-bottom: clamp(32px, 4.5vh, 56px);
}
.hero-mark { width: clamp(60px, 5vw, 72px); height: auto; aspect-ratio: 1; margin-bottom: 20px; }
.js .hero-mark path { opacity: 0; animation: mark-show 0s linear 2.8s forwards; }
@keyframes mark-show { to { opacity: 1; } }
.pill {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; max-width: 100%;
  padding: 6px 18px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  color: var(--text); font-size: 14.5px; font-weight: 500; line-height: 1.3; text-align: left;
  transition: border-color .2s;
}
.pill:hover { border-color: var(--faint); }
.pill b {
  flex: none; padding: 7px 11px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
}
.hero h1 {
  margin-top: 24px;
  font-family: var(--serif); font-size: clamp(2.3rem, min(10.4vw, 9.2vh), 5.75rem);
  line-height: .98; letter-spacing: -.015em;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { margin-top: 22px; max-width: 44ch; font-size: clamp(17px, 1.5vw, 19px); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.hero + .sec { padding-top: clamp(8px, 2vw, 24px); }

/* Sections */
.sec { padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(40px, 6vw, 88px); }
.sec h2 { font-family: var(--serif); font-size: clamp(2.25rem, 4.6vw, 3.75rem); line-height: 1.04; letter-spacing: -.01em; }

/* Each app card wears its own app's colours. */
.th-clarity {
  --c-bg: #F5FAFF; --c-line: rgba(16, 28, 64, .10); --c-ink: #101C40; --c-soft: #586B8D;
  --c-acc: #1F63FD; --c-btn: #101C40; --c-btn-ink: #FFFFFF; --c-tile: #ECF2FC;
  --c-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, 'Segoe UI', Roboto, sans-serif;
}
.th-tl {
  --c-bg: #1A1A1A; --c-line: #262626; --c-ink: #F5F5F5; --c-soft: #A3A3A3;
  --c-acc: #C6FF4D; --c-btn: #C6FF4D; --c-btn-ink: #0A1604; --c-tile: #0A0A0A;
  --c-display: 'Playfair Display', Georgia, serif;
}
.th-munchr {
  --c-bg: #F4EEE4; --c-line: #E4DCCD; --c-ink: #1A1613; --c-soft: #54514A;
  --c-acc: #1A1613; --c-btn: #1A1613; --c-btn-ink: #FAF7F2; --c-tile: #1E1C1A;
  --c-display: 'Playfair Display', Georgia, serif;
}
.th-void {
  --c-bg: #000000; --c-line: #221A33; --c-ink: #FFFFFF; --c-soft: #A0A0A0;
  --c-acc: #A370FF; --c-btn: #A370FF; --c-btn-ink: #000000; --c-tile: #030308;
  --c-display: var(--sans);
}
.th-cos {
  --c-bg: #0D0D0C; --c-line: rgba(239, 237, 232, .14); --c-ink: #EFEDE8; --c-soft: #A8A6A0;
  --c-acc: #FF5B14; --c-btn: #FF5B14; --c-btn-ink: #0D0D0C; --c-tile: #0D0D0C;
  --c-display: 'Bodoni Moda', Georgia, serif;
}
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) {
  background: var(--c-bg); border: 1px solid var(--c-line); color: var(--c-soft);
}
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) :is(h2, h3, .app-name) { color: var(--c-ink); }
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) .link { color: var(--c-ink); }
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) .link span { border-color: var(--c-line); }
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) .link:hover span { border-color: var(--c-ink); }
:is(.th-clarity, .th-tl, .th-munchr, .th-void, .th-cos) :focus-visible { outline-color: var(--c-acc); }
.th-munchr :focus-visible, .th-clarity :focus-visible { outline-color: var(--c-ink); }
.btn-app { background: var(--c-btn); color: var(--c-btn-ink); }
.btn-app:hover { filter: brightness(1.08); }
.app-icon { flex: none; width: 64px; height: 64px; }

/* Clarity launch */
.launch {
  --lp: clamp(20px, 4.5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head cta" "shots shots";
  column-gap: 40px; row-gap: clamp(28px, 4vw, 48px);
  padding: var(--lp); border-radius: 32px;
}
.launch-head { grid-area: head; }
.launch-cta { grid-area: cta; align-self: end; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.th-clarity .label { color: var(--c-soft); }
.th-clarity .dot { background: var(--c-acc); }
.app-id { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.app-name { font-size: 18px; font-weight: 600; line-height: 1.25; }
.app-plat { font-size: 14px; color: var(--c-soft); }
.launch h2 {
  margin-top: 20px; font-family: var(--c-display); font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 3.75rem); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance;
}
.launch-body { margin-top: 16px; max-width: 44ch; }

/* The App Store screenshots, as shipped. A swipe row below desktop, the way the App Store shows them. */
.shots {
  grid-area: shots; list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px);
}
.shots img { width: 100%; height: auto; border-radius: clamp(14px, 1.5vw, 20px); background: var(--c-tile, var(--surface-2)); box-shadow: 0 0 0 1px var(--c-line, var(--line)); }
@media (max-width: 1099px) {
  .shots {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(28vw, 250px);
    gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--lp);
    margin-inline: calc(-1 * var(--lp)); padding-inline: var(--lp); padding-bottom: 4px;
    scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shots > li { scroll-snap-align: start; }
  .js .shots .rv { opacity: 1; transform: none; }
  .shelf:focus-visible, .shots:focus-visible { outline-offset: -2px; }
}
@media (max-width: 720px) {
  .launch { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "shots" "cta"; row-gap: 28px; border-radius: 28px; }
  .launch-cta { align-self: start; }
  .shots { grid-auto-columns: min(60vw, 250px); gap: 10px; }
}

/* Apps shelf */
.sec-head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 40px; }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.app-card { display: flex; flex-direction: column; gap: 16px; padding: 24px 24px 0; overflow: hidden; border-radius: 28px; }
.app-top { display: flex; align-items: center; gap: 14px; }
.app-top h3 { font-family: var(--c-display); font-weight: 700; font-size: 28px; line-height: 1.1; letter-spacing: -.01em; }
.th-void .app-top h3 { font-weight: 600; font-size: 22px; letter-spacing: .32em; }
.app-kind { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 13.5px; font-weight: 500; color: var(--c-soft); }
.app-desc { font-size: 15.5px; line-height: 1.55; }
.app-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.tile {
  margin: auto -24px 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--c-tile);
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-phone { align-items: flex-end; }
.tile-phone img { width: auto; height: 90%; object-fit: contain; }

/* Content OS, in its own identity */
.next {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); align-items: center;
  gap: clamp(24px, 4vw, 56px); margin-top: 20px; padding: clamp(24px, 4vw, 48px); border-radius: 28px;
}
.next-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.next-copy h3 { font-family: var(--c-display); font-weight: 500; font-size: 30px; line-height: 1.05; letter-spacing: -.01em; }
.next-copy h3 i { font-style: italic; }
.next-copy .app-icon { border-radius: 15px; }
.next-copy p:not(.app-kind) { max-width: 40ch; }
.next-copy .btn { margin-top: 6px; }
.tally { width: 8px; height: 8px; border-radius: 50%; background: var(--c-acc); flex: none; }
.btn-tally { background: var(--c-btn); color: var(--c-btn-ink); }
.btn-tally:hover { filter: brightness(1.08); }
.next-pic { display: block; overflow: hidden; border-radius: 14px; }
.next-pic img { width: 100%; height: auto; }

/* Below desktop the shelf becomes a swipe row too. */
@media (max-width: 980px) {
  .shelf {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(80vw, 340px);
    gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    --g: max(20px, env(safe-area-inset-left));
    margin-inline: calc(-1 * var(--g)); padding-inline: var(--g); scroll-padding-inline: var(--g);
    padding-bottom: 4px; scrollbar-width: none;
  }
  .shelf::-webkit-scrollbar { display: none; }
  .app-card { scroll-snap-align: start; padding: 20px 20px 0; gap: 14px; }
  .tile { margin-inline: -20px; aspect-ratio: 5 / 4; }
  .js .shelf .rv { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .next { grid-template-columns: minmax(0, 1fr); padding: 20px; }
}

/* Studio */
.studio { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.studio-head { position: sticky; top: calc(var(--nav-h) + 32px); display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.studio-head p:not(.label) { max-width: 40ch; }
.services { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.services a {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; align-items: center; column-gap: 12px; row-gap: 4px;
  min-height: 88px; padding: 20px 4px; border-bottom: 1px solid var(--line);
}
.svc-n { grid-row: 1 / 3; align-self: start; padding-top: 4px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.svc-t { color: var(--text); font-size: 18px; font-weight: 600; line-height: 1.3; }
.svc-d { grid-column: 2; font-size: 15px; }
.services svg { grid-column: 3; grid-row: 1 / 3; width: 16px; height: 16px; color: var(--faint); transition: color .2s, transform .4s var(--spring); }
.services a:hover svg { color: var(--accent); transform: translateX(3px); }
@media (max-width: 860px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-head { position: static; }
}

/* Contact */
.contact { text-align: center; }
.contact-in { display: flex; flex-direction: column; align-items: center; padding-block: clamp(16px, 4vw, 48px); }
.contact h2 { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }
.contact p { margin-top: 20px; max-width: 40ch; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.hero + .sec { padding-top: clamp(8px, 2vw, 24px); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-top: 56px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.foot-brand a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-weight: 600; }
.foot-brand .ms-logo { width: 26px; height: 26px; }
.foot-brand p { font-size: 15px; color: var(--faint); }
.foot-h { margin-bottom: 6px; font: 600 12.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.foot ul { list-style: none; padding: 0; }
.foot li a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 15px; color: var(--soft); transition: color .2s; }
.foot li a:hover { color: var(--text); }
.foot-copy { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--faint); }
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}

/* Reveal: hidden only once JS is known to run, so a failed script never blanks the page */
.js .rv { opacity: 0; transform: scale(.975); transition: opacity .8s var(--ease) var(--d, 0ms), transform 1s var(--spring) var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv { transform: none; transition: opacity .3s linear; }
  .btn, .link svg, .services svg, .menu-btn span { transition: none; }
}
@media print {
  .js .rv, .js .hero-mark path { opacity: 1 !important; transform: none !important; animation: none !important; }
  .nav { position: static; }
  .menu, .menu-btn { display: none !important; }
}
