@layer base, shell, apps;

@import url('../apps/voice/voice.css') layer(apps);
@import url('../apps/karaoke/karaoke.css') layer(apps);
@import url('../apps/guitar/guitar.css') layer(apps);

@layer base {
  :root {
    --ink: #f8f5ed;
    --muted: #a8a6b5;
    --line: rgba(255, 255, 255, 0.11);
    --panel: rgba(25, 25, 35, 0.8);
    --panel-strong: #20202d;
    --night: #101018;
    --night-2: #171724;
    --coral: #f48b72;
    --gold: #f2c66e;
    --mint: #8fe0c1;
    --blue: #87b5ff;
  }

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

  body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
      radial-gradient(circle at 12% -10%, rgba(244, 139, 114, 0.18), transparent 34%),
      radial-gradient(circle at 88% 4%, rgba(135, 181, 255, 0.13), transparent 33%),
      var(--night);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  button,
  select,
  input {
    font: inherit;
  }

  button {
    cursor: pointer;
  }

  button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  :where(button, summary, select, input, a:any-link):focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
  }

  .sr-only,
  .visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  [aria-expanded="true"] .expand,
  [aria-expanded="false"] .collapse {
    display: none;
  }

  .route-page[hidden] {
    display: none;
  }
}

@layer shell {
  .shell {
    max-width: 1240px;
    margin-inline: auto;
    padding: 28px 24px 52px;
  }

  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-block-end: 24px;
  }

  .page-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-block-end: 20px;
  }

  .page-header h1 {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 30px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-weight: 750;
  }

  .page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  .brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--coral);
    color: #21151a;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(244, 139, 114, 0.28);
  }

  .brand-copy strong {
    display: block;
    letter-spacing: -0.02em;
    font-size: 15px;
  }

  .brand-copy span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-block-start: 3px;
  }

  .top-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
  }

  .top-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 13px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
  }

  .top-nav a:hover:not([aria-current="page"]) {
    color: var(--ink);
  }

  .top-nav a[aria-current="page"] {
    color: #21151a;
    background: var(--gold);
    border-color: var(--gold);
  }

  @media (max-width: 700px) {
    .topbar {
      align-items: flex-start;
      flex-wrap: wrap;
      margin-block-end: 28px;
    }

    .top-nav {
      order: 3;
      width: 100%;
    }

    .top-nav a {
      flex: 1;
      text-align: center;
    }
  }

  @media (max-width: 560px) {
    .shell {
      padding: 20px 14px 38px;
    }
  }

  @media (forced-colors: active) {
    .top-nav a[aria-current="page"] {
      outline: 2px solid Highlight;
      outline-offset: -2px;
    }
  }
}
