/* Qija v12 — type-led, generously spaced. Mirrors DESIGN.md (third pass). */

:root {
  --red:        #FF0000;
  --red-deep:   #cc0000;
  --red-tint:   rgba(255, 0, 0, 0.06);
  --red-edge:   rgba(255, 0, 0, 0.18);

  --ink:        #111;
  --ink-2:      #555;
  --ink-3:      #999;

  --bg:         #f8f8f6;
  --surface:    #ffffff;
  --border:     rgba(0, 0, 0, 0.08);
  --rule:       rgba(0, 0, 0, 0.04);

  --font: Menlo, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --max:       1060px;
  --gutter:    clamp(20px, 4vw, 40px);
  --radius:    16px;
  --radius-sm: 10px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.06);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --section-gap: clamp(96px, 14vh, 160px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --red:      #FF3333;
    --red-deep: #FF3333;
    --red-tint: rgba(255, 51, 51, 0.10);
    --red-edge: rgba(255, 51, 51, 0.24);

    --ink:      #e6e6e6;
    --ink-2:    #a8a8a8;
    --ink-3:    #6e6e6e;

    --bg:       #0e0e0e;
    --surface:  #1a1a1a;
    --border:   rgba(255, 255, 255, 0.10);
    --rule:     rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.40);
    --shadow:    0 4px 16px rgba(0,0,0,0.40);
  }
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.7;
  font-size: 0.95rem;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--ink);
}
p  { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
small, .foot { font-size: 0.72rem; color: var(--ink-3); }
.sub { font-size: 0.82rem; color: var(--ink-2); }

a.inline { color: var(--red); }
a.inline:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Page wrapper ── */
.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Fade-in on intersection ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── TestFlight ribbon ── */
.tf-ribbon {
  position: relative;
  z-index: 90;
  background: var(--red-tint);
  border-bottom: 1px solid var(--red-edge);
  color: var(--ink-2);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 10px 44px 10px var(--gutter);
}
.tf-ribbon strong { color: var(--red); font-weight: 700; }
.tf-ribbon .close {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-size: 1rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.tf-ribbon .close:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
@media (prefers-color-scheme: dark) {
  .tf-ribbon .close:hover { background: rgba(255,255,255,0.06); }
}

/* ── Navigation ── */
nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}
nav.site-nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 12px rgba(0,0,0,0.04);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
  color: var(--ink);
}
.nav-logo:hover { background: rgba(0,0,0,0.03); }
@media (prefers-color-scheme: dark) {
  .nav-logo:hover { background: rgba(255,255,255,0.04); }
}
.nav-logo svg, .nav-logo img { width: 26px; height: 26px; }
.nav-logo span { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-link {
  color: var(--ink-3);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 0;
  position: relative;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }

.lang-select {
  font-family: var(--font); font-size: 0.74rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s ease;
  cursor: pointer;
  border: none;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}
@media (prefers-color-scheme: dark) {
  .btn-primary:hover { background: #fff; color: #000; }
}

/* ── Main layout ── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  padding: var(--section-gap) 0;
}

/* ── Hero / tab showcase ── */
.hero {
  padding: 0 var(--gutter);
}

/* The "app window": a single rounded frame with a sliding content area
   and an app-style tab bar pinned to the bottom. Replaces the video hero. */
.showcase {
  width: min(960px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.showcase-viewport {
  position: relative;
  overflow: hidden;
  height: clamp(440px, 56vh, 600px);
}
.showcase-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}

.show-panel {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 4vw, 52px);
}

/* Portrait screenshot, cropped to hide the app's own bottom tab bar. */
.show-shot {
  flex: 0 0 auto;
  height: min(100%, 460px);
  aspect-ratio: 9 / 17;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg);
}
.show-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Home / Music / Social: a fanned deck of full-screen phone shots.
   The 3rd card is upright/selected by default; hovering any card makes it
   the selected one. There is always exactly one selected card. */
.phone-fan {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 6px;
}
.phone-fan .phone {
  flex: 0 0 auto;
  width: clamp(108px, 13vw, 146px);
  aspect-ratio: 9 / 19.5;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(0,0,0,0.20);
  transform-origin: bottom center;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.phone-fan .phone:not(:first-child) { margin-left: clamp(-60px, -5.5vw, -46px); }
.phone-fan .phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Resting fan positions. */
.phone-fan .phone:nth-child(1) { transform: rotate(-8deg) translateY(12px); z-index: 1; }
.phone-fan .phone:nth-child(2) { transform: rotate(-3deg) translateY(-1px); z-index: 3; }
.phone-fan .phone:nth-child(4) { transform: rotate(8deg)  translateY(12px); z-index: 2; }

/* Selected/upright look — the 3rd card carries it by default, and whichever
   card is hovered takes it over. */
.phone-fan .phone:nth-child(3),
.phone-fan .phone:hover {
  transform: rotate(0deg) translateY(-16px) scale(1.05);
  box-shadow: 0 26px 50px rgba(0,0,0,0.30);
  z-index: 10;
}

/* When another card is hovered, the 3rd drops back into the fan so there is
   never more than one — nor fewer than one — card selected. */
.phone-fan:has(.phone:hover) .phone:nth-child(3):not(:hover) {
  transform: rotate(2deg) translateY(-6px) scale(1);
  box-shadow: 0 14px 34px rgba(0,0,0,0.20);
  z-index: 4;
}

.show-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.show-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.show-copy h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}
.show-copy p {
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  color: var(--ink-2);
  line-height: 1.6;
  max-width: 44ch;
  margin-bottom: 22px;
}
.show-feats {
  list-style: none;
}
.show-feats li {
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  color: var(--ink-2);
  line-height: 1.7;
}
.show-feats li::before {
  content: "·";
  margin-right: 8px;
  color: var(--red);
}

/* App-style tab bar pinned to the bottom of the frame. */
.showcase-tabbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.show-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 4px 7px;
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  transition: color 0.25s ease, background 0.25s ease;
}
.show-tab svg { width: 22px; height: 22px; }
.show-tab img.tab-avatar { width: 22px; height: 22px; border-radius: 50%; }
.show-tab:hover { color: var(--ink-2); background: rgba(0,0,0,0.03); }
@media (prefers-color-scheme: dark) {
  .show-tab:hover { background: rgba(255,255,255,0.04); }
}
.show-tab.is-active { color: var(--red); }

@media (max-width: 720px) {
  /* Stacked vertically, the fan + title + 5 feats are taller than any fixed
     height, so let the viewport grow to fit. The flex-row track stretches all
     panels to the tallest, so switching tabs won't jump the height. */
  .showcase-viewport { height: auto; }
  .showcase-track { height: auto; align-items: stretch; }
  .show-panel {
    height: auto;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 28px 22px 36px;
    text-align: center;
  }
  .show-shot { height: clamp(240px, 36vh, 320px); }
  .show-copy p { margin-left: auto; margin-right: auto; }
  .show-feats { justify-content: center; }

  .phone-fan { padding: 6px 0; }
  .phone-fan .phone { width: clamp(86px, 25vw, 112px); border-radius: 18px; }
  .phone-fan .phone:not(:first-child) { margin-left: -34px; }
  .phone-fan .phone:nth-child(1) { transform: rotate(-7deg) translateY(8px); }
  .phone-fan .phone:nth-child(4) { transform: rotate(7deg)  translateY(8px); }
}

/* ── Tagline band ── */
.tagline {
  text-align: center;
  padding: 0 var(--gutter);
}
.tagline p {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.0rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  max-width: 22ch;
  margin: 0 auto;
  color: var(--ink);
}

/* ── CTA band ── */
.cta {
  text-align: center;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cta .fine-print {
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin: 0;
}

/* ── FAQ band ── */
.faq {
  padding: 0 var(--gutter);
}
.faq-inner {
  max-width: 720px;
  margin: 0 auto;
}
.faq dt {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  letter-spacing: -0.04em;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
}
.faq dd {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 48px;
}
.faq dd:last-child { margin-bottom: 0; }
.faq dd a {
  color: var(--red);
}
.faq dd a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.faq dd em {
  font-style: normal;
  color: var(--ink-3);
}
@media (max-width: 560px) {
  .faq dd { margin-bottom: 32px; }
}

/* ── CD ripper icon hero ── */
.icon-hero {
  text-align: center;
  padding: 0 var(--gutter);
}
.icon-hero img {
  width: clamp(160px, 22vw, 240px);
  height: clamp(160px, 22vw, 240px);
  margin: 0 auto;
  border-radius: 28%;
  box-shadow: var(--shadow);
}

/* ── Legal pages (privacy / eula / moderation) ── */
.legal-hero {
  text-align: center;
  padding: 0 var(--gutter);
  max-width: 720px;
  margin: 0 auto;
}
.legal-hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  margin-bottom: 14px;
}
.legal-hero .lead {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  color: var(--ink-2);
  line-height: 1.8;
}

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--ink-2);
}
.legal p { margin: 0 0 16px; }
.legal .updated {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}
.legal .legal-binding {
  font-size: 0.74rem;
  color: var(--ink-3);
  font-style: italic;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.legal h2 {
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  margin: 48px 0 14px;
  color: var(--ink);
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 {
  font-size: 1rem;
  margin: 28px 0 10px;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.legal ul, .legal ol {
  margin: 0 0 16px 0;
  padding-left: 22px;
}
.legal li { margin: 6px 0; }
.legal strong { color: var(--ink); font-weight: 700; }
.legal a {
  color: var(--red);
}
.legal a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 0.85rem;
}
.legal th, .legal td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.legal th {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--border);
}
.legal .callout {
  background: var(--red-tint);
  border: 1px solid var(--red-edge);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.7;
}
.legal .callout strong { color: var(--red); }

/* ── Footer ── */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 28px;
  font-size: 0.78rem;
  color: var(--ink-2);
  margin-top: var(--section-gap);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--ink-3);
}
.footer-inner ul {
  list-style: none;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-inner a:hover { color: var(--red); }
.footer-inner .made-eu { color: var(--ink-2); }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }
@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
}
