/*
 * The Cove Sound Studio download page: the app's own look (src/renderer/src/styles/tokens.css):
 * graphite surfaces, one sea-glass teal accent, hairline borders, Inter. Laid out like the app's
 * sign-in screen: a brand panel on the left, the content on the right.
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --font-ui: 'Inter Variable', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;

  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --lh: 1.5;

  --sp-1: 4px;
  --sp-2: 6px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 20px;
  --sp-7: 24px;
  --sp-8: 32px;
  --sp-9: 40px;
  --sp-10: 56px;

  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;

  --h-sm: 28px;
  --h-md: 32px;
  --h-lg: 40px;
  --titlebar-h: 44px;

  --dur-fast: 90ms;
  --dur: 150ms;

  color-scheme: dark;
  --c-bg-app: #0d0e10;
  --c-bg-sunken: #0f1013;
  --c-bg: #131417;
  --c-bg-raised: #17191d;
  --c-bg-overlay: #1c1e23;
  --c-bg-hover: rgba(255, 255, 255, 0.045);
  --c-bg-active: rgba(255, 255, 255, 0.075);
  --c-border: #23252b;
  --c-border-strong: #2f323a;
  --c-text: #e6e8eb;
  --c-text-muted: #a2a7b0;
  --c-text-faint: #6b707a;
  --c-accent: #35c2ae;
  --c-accent-hover: #4dd2be;
  --c-accent-press: #2aa998;
  --c-accent-muted: rgba(53, 194, 174, 0.16);
  --c-accent-text: #5fd6c4;
  --c-on-accent: #031512;
  --c-focus: rgba(53, 194, 174, 0.55);
  --c-scrollbar: rgba(255, 255, 255, 0.1);
  --shadow-window: 0 24px 70px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-dialog: 0 24px 70px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --c-bg-app: #e9ebee;
    --c-bg-sunken: #eef0f2;
    --c-bg: #f6f7f8;
    --c-bg-raised: #ffffff;
    --c-bg-overlay: #ffffff;
    --c-bg-hover: rgba(15, 23, 42, 0.045);
    --c-bg-active: rgba(15, 23, 42, 0.08);
    --c-border: #dcdfe4;
    --c-border-strong: #c9cdd4;
    --c-text: #16181c;
    --c-text-muted: #525862;
    --c-text-faint: #80868f;
    --c-accent: #189685;
    --c-accent-hover: #11867a;
    --c-accent-press: #0e7468;
    --c-accent-muted: rgba(24, 150, 133, 0.13);
    --c-accent-text: #0f7f71;
    --c-on-accent: #ffffff;
    --c-focus: rgba(24, 150, 133, 0.45);
    --c-scrollbar: rgba(15, 23, 42, 0.16);
    --shadow-window: 0 24px 60px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-dialog: 0 24px 70px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur: 0ms;
  }
}

/* --- Base ------------------------------------------------------------------------------------- */

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

html {
  scroll-padding-top: calc(var(--titlebar-h) + var(--sp-5));
  scrollbar-color: var(--c-scrollbar) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

a {
  color: var(--c-accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

::selection {
  background: var(--c-accent-muted);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* --- Buttons (the app's) ---------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--h-md);
  padding: 0 var(--sp-4);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm);
  background: var(--c-bg-raised);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--dur-fast) linear,
    border-color var(--dur-fast) linear,
    color var(--dur-fast) linear;
}

.button:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--c-bg-raised), var(--c-text) 5%);
  border-color: color-mix(in srgb, var(--c-border-strong), var(--c-text) 10%);
}

.button:active {
  background: color-mix(in srgb, var(--c-bg-raised), var(--c-text) 8%);
}

.button .icon {
  width: 15px;
  height: 15px;
}

.button.sm {
  height: var(--h-sm);
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  gap: var(--sp-1);
}

.button.sm .icon {
  width: 14px;
  height: 14px;
}

.button.lg {
  height: var(--h-lg);
  padding: 0 var(--sp-5);
  font-size: var(--fs-base);
}

.button.block {
  width: 100%;
}

.button.primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600;
}

.button.primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
}

.button.primary:active {
  background: var(--c-accent-press);
  border-color: var(--c-accent-press);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-muted);
}

.button.ghost:hover {
  background: var(--c-bg-hover);
  color: var(--c-text);
}

/* --- The title bar (the app's window strip) ---------------------------------------------------- */

.titlebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--titlebar-h);
  padding: 0 var(--sp-4) 0 var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg-app);
}

.titlebar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-text-faint);
  font-size: var(--fs-sm);
}

.titlebar-brand:hover {
  color: var(--c-text-muted);
  text-decoration: none;
}

.titlebar-brand .mark {
  width: 16px;
  height: 16px;
  color: var(--c-accent);
}

.titlebar-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* --- Brand panel | content (the app's sign-in screen) ----------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(340px, 38%) minmax(0, 1fr);
  min-height: calc(100vh - var(--titlebar-h));
}

.brand {
  position: sticky;
  top: var(--titlebar-h);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-8);
  height: calc(100vh - var(--titlebar-h));
  overflow: hidden;
  padding: var(--sp-9) var(--sp-9) var(--sp-8);
  border-right: 1px solid var(--c-border);
  background: var(--c-bg-sunken);
}

.brand .mark-large {
  width: 34px;
  height: 34px;
  color: var(--c-accent);
}

.brand-name {
  margin-top: var(--sp-5);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.014em;
}

.brand-line {
  margin-top: var(--sp-2);
  max-width: 34ch;
  color: var(--c-text-muted);
  font-size: var(--fs-lg);
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30%;
  width: 100%;
  height: 120px;
  color: var(--c-accent);
  opacity: 0.22;
  pointer-events: none;
}

.brand-facts {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--sp-4);
  padding: 0;
  list-style: none;
}

.brand-facts li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: var(--sp-3);
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}

.brand-facts .icon {
  margin-top: 2px;
  color: var(--c-accent-text);
}

.brand-facts strong {
  display: block;
  color: var(--c-text);
  font-weight: 500;
}

.content {
  min-width: 0;
  background: var(--c-bg);
}

.column {
  display: grid;
  gap: var(--sp-9);
  max-width: 820px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-9) var(--sp-8);
}

h1 {
  font-size: var(--fs-3xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lede {
  margin-top: var(--sp-3);
  color: var(--c-text-muted);
  font-size: var(--fs-lg);
}

/* --- Download cards (the app's weapon cards) -------------------------------------------------- */

.downloads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-7);
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
  padding: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-bg-raised);
}

.card-featured {
  border-color: var(--c-border-strong);
}

.card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.card-head .icon {
  width: 18px;
  height: 18px;
  color: var(--c-accent-text);
}

.card-head h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: var(--r-xs);
  background: var(--c-accent-muted);
  color: var(--c-accent-text);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.card-text {
  flex: 1;
  color: var(--c-text-muted);
  font-size: var(--fs-md);
}

.file {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--c-text-faint);
  font-size: var(--fs-sm);
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- The app, as a window --------------------------------------------------------------------- */

.window {
  overflow: hidden;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-bg-app);
  box-shadow: var(--shadow-window);
}

.window img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Getting started -------------------------------------------------------------------------- */

.section-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.steps {
  display: grid;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 24px;
  padding: 1px 0 0 36px;
  color: var(--c-text-muted);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-accent-muted);
  color: var(--c-accent-text);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.steps strong {
  color: var(--c-text);
  font-weight: 500;
}

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

.footer {
  display: grid;
  gap: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-faint);
  font-size: var(--fs-sm);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
}

.footer a {
  color: var(--c-text-muted);
}

.footer a:hover {
  color: var(--c-text);
}

/* --- Terms and Privacy Policy (the app's legal dialog) ---------------------------------------- */

.dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-bg-overlay);
  color: var(--c-text);
  box-shadow: var(--shadow-dialog);
}

.dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--c-border);
}

.dialog-head h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.dialog-head .button {
  margin-left: auto;
  width: var(--h-sm);
  padding: 0;
}

.dialog-body {
  overflow: auto;
  padding: var(--sp-5) var(--sp-6) var(--sp-7);
  color: var(--c-text-muted);
  font-size: var(--fs-md);
}

.dialog-body > * + * {
  margin-top: var(--sp-3);
}

.dialog-body h3 {
  margin-top: var(--sp-6);
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 600;
}

.dialog-body ul {
  display: grid;
  gap: var(--sp-2);
  padding-left: var(--sp-6);
}

.dialog-body .updated {
  color: var(--c-text-faint);
  font-size: var(--fs-sm);
}

/* --- Narrow windows and phones ---------------------------------------------------------------- */

@media (max-width: 1100px) {
  .split {
    grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
  }

  .brand {
    padding: var(--sp-8) var(--sp-7);
  }

  .downloads {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .split {
    display: block;
  }

  .brand {
    position: relative;
    top: 0;
    height: auto;
    padding: var(--sp-8) var(--sp-5);
    border-right: 0;
    border-bottom: 1px solid var(--c-border);
  }

  /* Between the name and the facts, edge to edge, as on the app's sign-in screen. */
  .wave {
    position: static;
    width: calc(100% + 2 * var(--sp-5));
    height: 72px;
    margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-5));
  }

  .brand-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-5);
  }

  .column {
    gap: var(--sp-8);
    padding: var(--sp-8) var(--sp-5) var(--sp-7);
  }

  h1 {
    font-size: var(--fs-2xl);
  }
}

@media (max-width: 560px) {
  .titlebar-links .button.ghost span {
    display: none;
  }

  .brand-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .lede {
    font-size: var(--fs-base);
  }
}
