/* ════════════════════════════════════════════════════════════════
   somersaudio — "STUDIO AURORA"
   near-black studio theme · CSS aurora drift · frosted cards
   one electric accent (cyan) reserved for download CTAs
   ════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0a08;
  --card: #17140e;                       /* solid fallback */
  --card-glass: rgba(24, 20, 13, .52);   /* used when backdrop-filter exists */
  --line: rgba(255, 255, 255, .08);
  --line-bright: rgba(255, 255, 255, .18);
  --ink: #f5f2ea;
  --ink-2: #c9c2b2;
  --ink-3: #9a9281;
  --accent: #e8b964;
  --accent-deep: #c08c34;
  --accent-ink: #221603;
  --gold-2: #d4a753;
  --radius: 22px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter,
          "Helvetica Neue", Arial, sans-serif;
  --label: var(--font);   /* small uppercase labels — same sans as body */
  color-scheme: dark;
}

/* ── base ──────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html { scroll-padding-top: 92px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font: 400 1.0625rem/1.65 var(--font);
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint film grain over everything (inline SVG, no requests) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: .045;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.025em; }
p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.defs { display: none; }
.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }

.wrap {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

.skip {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: .6em 1.1em;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  transform: translateY(-300%);
}
.skip:focus { transform: none; }

/* ── aurora backdrop · transform-only animation ───────────────── */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  transition: opacity .15s linear;
  background:
    radial-gradient(120% 90% at 50% -20%, #16140e 0%, var(--bg) 50%);
}
/* black landing: JS holds the aurora hidden over the hero, then fades it
   in on scroll. No JS → it just shows (graceful). */
html.js .aurora { opacity: 0; }
.aurora span {
  position: absolute;
  border-radius: 50%;
}
.aurora .a1 {
  width: 58vmax; height: 58vmax;
  left: -14vmax; top: -20vmax;
  background: radial-gradient(closest-side, rgba(233, 227, 213, .17), transparent 70%);
  animation: drift-a 38s ease-in-out infinite alternate;
}
.aurora .a2 {
  width: 50vmax; height: 50vmax;
  right: -16vmax; top: -12vmax;
  background: radial-gradient(closest-side, rgba(214, 205, 186, .13), transparent 70%);
  animation: drift-b 47s ease-in-out infinite alternate;
}
.aurora .a3 {
  width: 44vmax; height: 44vmax;
  left: 26vw; top: 22vh;
  background: radial-gradient(closest-side, rgba(247, 243, 234, .09), transparent 70%);
  animation: drift-c 56s ease-in-out infinite alternate;
}
@keyframes drift-a {
  to { transform: translate3d(9vw, 7vh, 0) scale(1.18) rotate(18deg); }
}
@keyframes drift-b {
  to { transform: translate3d(-8vw, 9vh, 0) scale(.88) rotate(-22deg); }
}
@keyframes drift-c {
  to { transform: translate3d(-12vw, -7vh, 0) scale(1.25); }
}
/* battery saver: pause the (off-screen) hero EQ once scrolled past.
   The aurora keeps drifting — it's now visible behind the apps. */
body.past-hero .eq span { animation-play-state: paused; }

/* ── header ────────────────────────────────────────────────────── */

.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background-color .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.site-head.scrolled {
  background: rgba(11, 10, 8, .72);
  border-bottom-color: var(--line);
}
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .site-head.scrolled {
    background: rgba(11, 10, 8, .5);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
  }
}
/* without JS the .scrolled toggle never fires — keep the bar legible */
html:not(.js) .site-head {
  background: rgba(11, 10, 8, .72);
  border-bottom-color: var(--line);
}
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.head-brand {
  font-weight: 750;
  font-size: 1.1rem;
  letter-spacing: -.03em;
  color: var(--ink);
  text-decoration: none;
}
/* gradient wordmark — plain ink where background-clip:text is missing */
.head-brand em, .brand em { font-style: normal; color: var(--ink); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .head-brand em, .brand em {
    background: linear-gradient(100deg, #ecd29a, #d4a753);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.site-head nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
.head-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 550;
  transition: color .25s ease;
}
.head-link:hover { color: var(--ink); }
.head-cta {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55em 1.1em;
  border-radius: 99px;
  background: linear-gradient(135deg, #f2cf82, var(--accent-deep));
  color: var(--accent-ink);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(216, 164, 70, .25);
  transition: box-shadow .3s ease, transform .15s ease-out;
}
.head-cta:hover {
  box-shadow: 0 6px 26px rgba(216, 164, 70, .45);
  transform: translateY(-1px);
}
.head-cta .ic { width: 15px; height: 15px; }

/* ── hero ──────────────────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-block: 120px 80px;
  position: relative;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(18px, 3vh, 28px);
  width: 100%;
}
.hero-inner > * {
  animation: rise .9s var(--ease-out) both;
}
.hero-inner > :nth-child(2) { animation-delay: .08s; }
.hero-inner > :nth-child(3) { animation-delay: .18s; }
.hero-inner > :nth-child(4) { animation-delay: .3s; }
.hero-inner > :nth-child(5) { animation-delay: .42s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(30px); }
}

.brand {
  font-size: clamp(3rem, 11vw, 7.25rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: .95;
}
.lede {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  color: var(--ink-2);
  letter-spacing: -.01em;
}
.hero-note {
  font: 550 .76rem/1.5 var(--label);
  letter-spacing: .08em;
  color: var(--ink-2);
}

/* tiny EQ motif */
.eq {
  display: flex;
  gap: 5px;
  height: 26px;
  align-items: flex-end;
}
.eq span {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #f0d490, var(--gold-2));
  transform-origin: bottom;
  animation: eq 1.05s ease-in-out infinite alternate;
}
.eq span:nth-child(1) { animation-delay: 0s;   animation-duration: .9s; }
.eq span:nth-child(2) { animation-delay: .18s; }
.eq span:nth-child(3) { animation-delay: .32s; animation-duration: 1.2s; }
.eq span:nth-child(4) { animation-delay: .1s;  animation-duration: .85s; }
.eq span:nth-child(5) { animation-delay: .26s; }
@keyframes eq {
  from { transform: scaleY(.22); }
  to   { transform: scaleY(1); }
}

/* ── apps section ──────────────────────────────────────────────── */

.apps { padding-block: clamp(40px, 8vh, 110px) clamp(70px, 12vh, 150px); }

.sec-head { margin-bottom: clamp(28px, 5vh, 52px); }
.kicker {
  font: 600 .78rem/1 var(--label);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.sec-head h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 750; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

/* ── cards · frosted glass with solid fallback ─────────────────── */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card);                /* solid fallback */
  border-radius: var(--radius);
  padding: clamp(26px, 4vw, 44px);
}
@supports ((backdrop-filter: blur(22px)) or (-webkit-backdrop-filter: blur(22px))) {
  .card {
    background: var(--card-glass);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    backdrop-filter: blur(22px) saturate(1.3);
  }
}

.flag {
  font: 600 .74rem/1 var(--label);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); font-weight: 750; }
.ver {
  font: 550 .72rem/1 var(--label);
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: .45em .75em;
  border-radius: 99px;
  white-space: nowrap;
}

/* gradient tagline — plain ink where background-clip:text is missing */
.tagline {
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.12;
  margin: 2px 0 14px;
  color: var(--ink);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tagline {
    background: linear-gradient(105deg, var(--ink) 35%, #d8c496);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
.chips-label {
  font: 600 .72rem/1 var(--label);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
}
.chips li {
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  padding: .4em .85em;
  border-radius: 99px;
  white-space: nowrap;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--ink);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--line-bright);
  padding-bottom: 2px;
  transition: border-color .3s ease;
}
.more:hover { border-color: var(--ink); }
.more .ic { width: 15px; height: 15px; transition: transform .35s var(--ease-out); }
.more:hover .ic { transform: translateX(4px); }

.one-liner {
  color: var(--ink);
  font-weight: 550;
  font-size: 1.08rem;
  margin-bottom: 12px;
}
.note { font-size: .9rem; color: var(--ink-3); }
.note + .note { margin-top: 2px; }
.note + .dl-stack { margin-top: 24px; }

/* ── download CTAs · the only accent on the page ───────────────── */

.dl-label {
  font: 600 .72rem/1 var(--label);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

/* downloads pinned to the bottom edge of every card, so the
   buttons line up across the grid no matter the copy length */
.dl-wrap {
  margin-top: auto;
  padding-top: 24px;
  width: 100%;
}
.dl-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-dl {
  position: relative;
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: 15px;
  background: linear-gradient(135deg, #f2cf82, var(--accent-deep));
  color: var(--accent-ink);
  text-decoration: none;
  letter-spacing: -.01em;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 6px 26px rgba(216, 164, 70, .16),
    inset 0 1px 0 rgba(255, 255, 255, .4);
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform .15s ease-out, box-shadow .35s ease;
}
.btn-dl:hover {
  box-shadow:
    0 10px 38px rgba(216, 164, 70, .38),
    inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-dl:active { transform: translate(var(--mx, 0px), var(--my, 0px)) scale(.985); }
.btn-dl:focus-visible { outline-color: #fff; }

/* sheen sweep */
.btn-dl::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -65%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.btn-dl:hover::after {
  opacity: 1;
  transform: skewX(-18deg) translateX(370%);
  transition: transform .7s var(--ease-out), opacity .1s ease;
}

/* golden wave: a recurring gold sheen sweeps the matched ("for your Mac")
   button so the eye lands on the right download. */
.btn-dl.is-yours::after {
  width: 55%;
  opacity: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 250, 235, .9) 50%, transparent 100%);
  animation: dl-wave 8.5s ease-in-out 1.2s infinite;
}
@keyframes dl-wave {
  0%, 14% { transform: skewX(-18deg) translateX(0);    opacity: 0; }
  20%     {                                            opacity: 1; }
  48%     { transform: skewX(-18deg) translateX(430%); opacity: 0; }
  100%    { transform: skewX(-18deg) translateX(430%); opacity: 0; }
}

.dl-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
  flex: 1;
  min-width: 0;
}
.dl-txt strong { font-size: 1.04rem; font-weight: 750; }
.dl-txt small { font-size: .78rem; font-weight: 550; opacity: .78; }
.dl-arrow { order: 9; width: 19px; height: 19px; }

/* platform match (badge injected by script.js) */
.btn-dl.is-yours {
  box-shadow:
    0 0 0 2px rgba(248, 234, 200, .88),
    0 12px 44px rgba(216, 164, 70, .42);
}
.yours {
  flex: none;
  background: var(--accent-ink);
  color: var(--accent);
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .03em;
  padding: .35em .75em;
  border-radius: 99px;
  white-space: nowrap;
}

/* "Show all downloads" toggle + the collapsed extra platforms */
/* "Download X" label and the "show all" toggle share one line so the
   primary download buttons stay level across cards */
.dl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.dl-head .dl-label { margin-bottom: 0; }

.dl-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: none;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-3);
  font: 600 .68rem/1 var(--label);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 0;
  white-space: nowrap;
  transition: color .25s ease;
}
.dl-toggle:hover { color: var(--ink); }
.dl-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.dl-toggle .ic { width: 13px; height: 13px; transition: transform .3s ease; }
.dl-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }

.dl-extra-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dl-extra-group[hidden] { display: none; }   /* beat the class's display:flex */
.dl-extra-group .btn-dl { animation: dl-in .35s var(--ease-out) both; }
@keyframes dl-in { from { opacity: 0; transform: translateY(-6px); } }

/* ── scroll reveals ────────────────────────────────────────────────
   Hidden states only engage when BOTH are true: JS confirmed running
   (html.js, added by script.js itself) AND the user allows motion.
   JS off, script 404, old browser, reduced motion → content visible. */

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .75s ease, transform .75s var(--ease-out);
  }
  html.js .card.reveal {
    transition: opacity .75s ease, transform .75s var(--ease-out), border-color .4s ease;
  }
  html.js .reveal.in { opacity: 1; transform: none; }
}

/* ── footer ────────────────────────────────────────────────────── */

.site-foot { border-top: 1px solid var(--line); }
.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 30px;
  font-size: .9rem;
  color: var(--ink-3);
}
.foot-row a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  transition: color .25s ease;
}
.foot-row a:hover { color: var(--ink); }
.foot-row .ic { width: 14px; height: 14px; transform: rotate(-45deg); }

/* ── responsive details ────────────────────────────────────────── */

@media (max-width: 480px) {
  .btn-dl { padding: .95rem 1rem; gap: .7rem; }
  .yours { font-size: .62rem; }
  .hero { padding-block: 100px 60px; }
  .head-link { display: none; }   /* GitHub stays in the footer */
}

@media (min-width: 2200px) {
  html { font-size: 19px; }
  .wrap { max-width: 1320px; }
}

/* ── reduced motion · calm everything down ─────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .aurora span, .eq span, .hero-inner > * { animation: none; }
  .btn-dl::after { display: none; }
  .dl-extra-group .btn-dl { animation: none; }
  .btn-dl, .head-cta { transform: none; }
  .more .ic, .btn-dl, .head-cta { transition: none; }
  /* no wave under reduced motion — keep a static gold ring as the cue */
  .btn-dl.is-yours {
    box-shadow:
      0 0 0 2px rgba(232, 185, 100, .85),
      0 12px 44px rgba(216, 164, 70, .30);
  }
}
