/* a-plugins on top of site.css (taken over from the Nitida site), in Audiotool's look: the colours, type and buttons
   of tribe (src/lib/css/imported-vars.css, typography.css, buttons/common-button.svelte), so the page can move into
   audiotool.com's main menu as it is. */

@font-face {
  font-family: "Lexend Deca";
  src: url("https://cdn.audiotool.com/tribe-media/fonts/lexend-deca/LexendDeca-VariableFont_wght.ttf") format("truetype");
  font-weight: 1 1000;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("https://cdn.audiotool.com/tribe-media/fonts/geist-mono/GeistMono-VariableFont_wght.ttf") format("truetype");
  font-weight: 1 1000;
  font-display: swap;
}
@font-face {
  font-family: "ES Build";
  src: url("https://cdn.audiotool.com/tribe-media/ewc/fonts/ES_Build/ES-Build-Bold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --color-gray-20: #121116;
  --color-gray-30: #15151a;
  --color-gray-50: #1d1e26;
  --color-gray-60: #23252f;
  --color-gray-70: #292d3a;
  --color-gray-80: #323a49;
  --color-gray-90: #3f4b5d;
  --color-gray-100: #5f6b7c;
  --color-gray-110: #8e9aa9;
  --color-gray-120: #b8c1cd;
  --color-gray-130: #d5dce5;
  --color-gray-150: #f7fbff;
  --color-brand-110: #6ad0e5;
  --color-brand-130: #cbedff;
  --color-brand-140: #eaf9ff;
  --color-brand-150: #f7feff;
  --base-print-key: #e1b03c;

  /* site.css's names, set to the tokens above. */
  --brand: var(--color-brand-130);
  --brand-ink: var(--color-gray-30);
  --accent: var(--color-brand-110);
  --bg: var(--color-gray-20);
  --bg-2: var(--color-gray-50);
  --panel: var(--color-gray-50);
  --text: var(--color-gray-150);
  --muted: var(--color-gray-110);
  --faint: var(--color-gray-100);
  --line: var(--color-gray-70);
  --line-2: var(--color-gray-80);
  --serif: "Lexend Deca", system-ui, sans-serif;
  --sans: "Lexend Deca", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

body { font-size: 16px; }
.wrap { max-width: 1080px; padding: 0 24px; }

/* The header (as Audiotool's main menu, tribe: navigation/global-nav.svelte): the mark and the two dropdowns on the
 * left, the shown device in the middle, the claim beside it. */
.nav { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 24px; max-width: none; min-height: 54px; margin: 0; padding: 8px 24px; background: var(--color-gray-20); }
.nav-start { display: flex; align-items: center; gap: 8px 24px; min-width: 0; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 8px; color: var(--color-gray-150); text-decoration: none; }
.brand-mark { width: 26px; height: 26px; }
.brand-word { width: auto; height: 20px; }
.nav-device { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--color-gray-150); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav-device img { flex: none; width: 22px; height: 22px; border-radius: 4px; }
.nav-claim { justify-self: start; margin: 0; color: var(--color-gray-110); font-size: 12px; font-weight: 500; white-space: nowrap; }
@media (max-width: 1080px) {
  .nav { display: flex; gap: 8px 16px; }
  .nav-device { margin-left: auto; }
  .nav-claim { font-size: 11px; }
}
@media (max-width: 760px) {
  .nav-claim { display: none; }
}
@media (max-width: 560px) {
  .nav-device { display: none; }
}
.nav-menus { display: flex; gap: 6px; }
.nav-menu { position: relative; }
.nav-menu summary { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 6px; background: var(--color-gray-60); font-size: 13px; font-weight: 500; color: var(--color-gray-120); cursor: pointer; list-style: none; user-select: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ""; width: 5px; height: 5px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.nav-menu summary:hover,
.nav-menu[open] summary { background: var(--color-gray-80); color: var(--color-gray-150); }
.nav-menu[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.nav-menu-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 2px; width: max-content; max-width: min(560px, calc(100vw - 40px)); max-height: min(70vh, 640px); overflow: auto; padding: 6px; border: 1px solid var(--color-gray-80); border-radius: 8px; background: var(--color-gray-60); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55); }
.nav-menu-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: var(--text); }
.nav-menu-list a:hover,
.nav-menu-list a:focus-visible { background: var(--color-gray-80); }
.nav-menu-list a[aria-current="page"] { background: var(--color-gray-70); }
.nav-menu-list a[aria-current="page"] b { color: var(--base-print-key); }
.nav-menu-list img { flex: none; width: 28px; height: 28px; border-radius: 4px; }
.nav-menu-list b { display: block; font-weight: 500; font-size: 14px; line-height: 1.2; }
.nav-menu-list span span { display: block; color: var(--muted); font-size: 12px; line-height: 1.25; }
@media (max-width: 560px) {
  .nav-menu-list { grid-template-columns: 1fr; }
  .nav-menus .nav-menu:last-child .nav-menu-list { left: auto; right: 0; }
}

/* Type and buttons */
h1 { font-weight: 500; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.02em; line-height: 1.05; }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.12em; color: var(--accent); }
.lede { font-size: 18px; }
.btn { gap: 8px; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--color-brand-130); color: var(--color-gray-30); font-weight: 500; font-size: 14px; letter-spacing: 0; transition: background-color 50ms, color 50ms; }
.btn:hover { background: var(--color-brand-140); color: var(--color-gray-20); }
.btn:active { background: var(--color-brand-150); }
.btn.ghost { border: 0; background: var(--color-gray-80); color: var(--color-brand-130); }
.btn.ghost:hover { background: var(--color-gray-90); color: var(--color-brand-140); }
.hero-actions { gap: 8px; }
.section-head h2 { font-weight: 500; font-size: 24px; letter-spacing: -0.01em; }

/* The device grows or shrinks smoothly when another one takes its place. */
.player { margin-top: 18px; }
.player-box { transition: height 0.25s ease, width 0.25s ease; }
/* Effects: the loops above the device, a big Play and one button per loop. */
.player-loops { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px; background: var(--color-gray-50); border-bottom: 1px solid var(--color-gray-70); font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--color-gray-110); }
.player-loops[hidden] { display: none; }
.player-loop-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 8em; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--color-brand-130); color: var(--color-gray-30); font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer; }
.player-loop-play::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.player-loop-play[aria-pressed="true"]::before { width: 10px; height: 10px; border: 0; border-radius: 1px; background: currentColor; }
.player-loop-play:hover,
.player-loop-play:focus-visible { background: var(--color-brand-140); }
.player-loop-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.player-loop-choice { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--color-gray-60); color: var(--color-gray-120); font: inherit; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.player-loop-choice:hover,
.player-loop-choice:focus-visible { background: var(--color-gray-80); color: var(--color-gray-150); }
.player-loop-choice[aria-pressed="true"] { background: var(--color-gray-80); color: var(--color-gray-150); box-shadow: inset 0 0 0 1px var(--accent); }

/* Every page ends with the way to more plugins. */
.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 72px 0 0; padding: 18px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.more p { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }

/* Device pages */
.about { margin: var(--space) 0 0; max-width: 760px; }
.about p { margin: 0 0 14px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.facts dd { color: var(--color-gray-130); }

/* The next device, beside the title (the card of the Nitida Stage page). */
.device-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding-top: 48px; }
.device-intro-text { min-width: 0; }
.stage-device { border-radius: 8px; }
.stage-device:hover,
.stage-device:focus-within { border-color: var(--color-gray-90); background: var(--color-gray-60); }
.stage-device b { font-weight: 500; font-size: 17px; }
.next-device { flex: none; width: 260px; margin-top: 30px; text-decoration: none; color: inherit; }
.next-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 760px) {
  .device-intro { flex-direction: column; }
  .next-device { width: 100%; margin-top: 0; }
}

/* Audiotool's footer (tribe: footer/global-footer.svelte). */
.at-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 48px; margin-top: 72px; padding: 12px 24px; border: 0; background: var(--color-gray-60); font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; }
.at-footer-logo img { width: 117px; height: 18px; }
.at-footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }
.at-footer-links span { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.at-footer-links span + span { padding-left: 18px; border-left: 1px solid var(--color-gray-80); }
.at-footer-links a { color: var(--color-gray-100); text-decoration: none; }
.at-footer-links a:hover { color: var(--color-gray-130); }

/* "Add to project" needs Audiotool's sign-in, which only returns to registered addresses (player/open.js). */
.add-project { display: none; }
.can-login .add-project { display: inline-flex; }

/* The project dialog (player/studio.js). */
.at-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--color-gray-60); color: var(--text); }
.at-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.at-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.at-dialog-head h2 { margin: 0; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.at-dialog-close { width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.at-dialog-close:hover { color: var(--text); }
.at-dialog-body { display: grid; gap: 14px; padding: 18px; }
.at-dialog-body .btn { justify-self: start; }
.at-dialog-note { margin: 0; color: var(--muted); line-height: 1.5; }
.at-projects { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin: -6px; padding: 0; list-style: none; }
.at-project { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.at-project:hover,
.at-project:focus-visible { background: var(--color-gray-80); }
.at-project b { font-weight: 500; }
.at-project span { flex: none; color: var(--muted); font-size: 13px; }

/* The tab coming back from Audiotool's sign-in: only a note until the device page moves it on to Studio. */
.returning body > * {
  display: none;
}
.returning body::before {
  content: "Opening Audiotool …";
  display: grid;
  place-items: center;
  height: 100vh;
}

/* Quiet arrows to the previous and next device at the window's edges, only where they fit beside the page. */
.side-arrow { display: none; position: fixed; top: 50%; z-index: 20; width: 40px; height: 96px; margin-top: -48px; border-radius: 8px; color: var(--color-gray-100); text-decoration: none; transition: color 0.15s, background-color 0.15s; }
.side-arrow::before { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.side-prev { left: 12px; }
.side-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.side-next { right: 12px; }
.side-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.side-arrow:hover,
.side-arrow:focus-visible { color: var(--color-gray-150); background: var(--color-gray-50); }
@media (min-width: 1152px) {
  .side-arrow { display: block; }
}
