/* Home composition, session groups and instrument/language setup. */

#home.home-screen {
  position: relative;
  isolation: isolate;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100dvh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--sa-top) 20px var(--sa-bottom);
  text-align: center;
  background: transparent;
}

#home.home-screen.active { display: flex; }

#home .home-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: min(100%, 440px);
  margin: auto;
}

#home .home-brand,
#home .home-menu { min-width: 0; }

#home .hero-logo {
  display: block;
  width: min(100%, 310px);
  margin: 8px auto 0;
  padding: 0;
  line-height: 0;
}

#home .hero-logo svg { display: block; width: 100%; height: auto; }

#home .tagline {
  margin: 8px 0 0;
  color: #c3c3f2;
  font: 800 14px/1.3 var(--ui-font);
  letter-spacing: .15em;
  text-shadow: 0 0 12px #762dff;
}

#home .home-setup { width: min(100%, 420px); margin: 22px auto 0; }

#home .home-setup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#home .home-section-label {
  margin: 0;
  color: #b8c7df;
  font: 800 12px/1.3 var(--ui-font);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .12em;
}

#home .home-language { min-width: 0; max-width: 55%; }

#home .language-picker { margin: 0; font-size: 14px; }

#home .language-trigger { max-width: 100%; gap: 6px; padding-inline: 8px; }

#home .language-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#home .language-trigger::after { flex: none; margin-left: 2px; }

#home .home-instruments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#home .home-instruments button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  padding: 8px 6px;
  font: 500 14px/1.2 var(--ui-font);
}

#home .instrument-art {
  display: block;
  flex: none;
  width: 30px;
  height: 40px;
  overflow: hidden;
}

#home .home-instruments button[aria-pressed="true"] .instrument-art { filter: drop-shadow(0 0 5px #ff45ed); }

#home .home-menu { align-self: center; width: 100%; display: flex; flex-direction: column; gap: 18px; }

#home .home-actions { display: grid; gap: 18px; width: 100%; }

#home .home-action-group { min-width: 0; }

#home .home-action-group > .home-section-label { margin-bottom: 8px; }

#home .home-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

#home .hero-btn {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 88px;
  padding: 0 10px 0 0;
  overflow: hidden;
  color: #f4f3ff;
  text-align: left;
}

#home .hero-btn .hero-icon {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: inherit;
  border-right: 1px solid color-mix(in srgb, var(--ui-accent) 25%, transparent);
  border-radius: 15px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--ui-accent) 14%, transparent), transparent 75%);
  color: var(--ui-accent);
}

#home .hero-icon img { width: 34px; height: 34px; filter: drop-shadow(0 0 5px var(--ui-accent)); }

#home .home-card-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-block: 10px; }

#home .hero-btn strong {
  margin: 0;
  color: #f5f2ff;
  font: 800 18px/1.15 var(--ui-font);
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

#home .hero-btn small { margin: 0; color: #b8c7df; font: 500 14px/1.2 var(--ui-font); }

#home .home-chevron { display: none; color: var(--ui-accent); font: 500 38px/1 var(--ui-font); text-shadow: 0 0 7px var(--ui-accent); }

#home :is(.routine-card, .tuner-card) {
  grid-column: 1 / -1;
  grid-template-columns: 80px minmax(0, 1fr) 18px;
  gap: 18px;
  min-height: 80px;
  padding-right: 16px;
}

#home :is(.routine-card, .tuner-card) .hero-icon img { width: 48px; height: 48px; }

#home :is(.routine-card, .tuner-card) strong { font-size: 20px; }

#home :is(.routine-card, .tuner-card) small { font-size: 16px; }

#home :is(.routine-card, .tuner-card) .home-chevron { display: block; }

#home .tuner-card { --ui-accent: #27d7ff; --ui-tint: #042d3c; }

#home .tuner-card .tuner-launch-icon { width: 40px; height: 40px; filter: drop-shadow(0 0 5px var(--ui-accent)); }

body #app #home .home-instruments button[aria-pressed="false"] {
  background: var(--ui-gloss),linear-gradient(180deg,#101b2ed9,#060c18ed);
  border-color: #788ca66b;
  box-shadow: inset 0 1px 1px #ffffff12;
  color: #bdcadb;
}

body #app #home .home-instruments button[aria-pressed="true"] {
  position: relative;
  background: var(--ui-gloss),linear-gradient(125deg,#780b77eb,#290d48f2 72%,#110b25);
  border-color: #ff75ee;
  box-shadow: inset 0 0 0 1px #ffb5f480,inset 0 0 24px #e927ff26,0 0 15px #e927ff75;
  color: #fff;
}

body #app #home .home-instruments button[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: var(--instrument-check-offset, -6px);
  right: var(--instrument-check-offset, -6px);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #790970;
  font: 800 13px/1 system-ui;
  pointer-events: none;
}

@media (max-width: 359px) {
  #home.home-screen { padding-inline: 14px; }

  #home .hero-btn { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; padding-right: 8px; }

  #home .hero-icon img { width: 28px; height: 28px; }

  #home .hero-btn strong { font-size: 17px; }

  #home .hero-btn small { font-size: 13px; }

  #home :is(.routine-card, .tuner-card) { grid-template-columns: 62px minmax(0, 1fr) 12px; gap: 12px; }

  #home :is(.routine-card, .tuner-card) strong { font-size: 19px; }

  #home .home-instruments button { gap: 2px; padding-inline: 3px; font-size: 13px; }

  #home .instrument-art { width: 26px; height: 36px; }
}

@media (min-width: 600px) and (orientation: portrait) {
  #home .home-content { width: min(560px, 100%); gap: 28px; }

  #home .hero-logo { width: 410px; }

  #home .hero-btn { min-height: 100px; grid-template-columns: 62px minmax(0, 1fr); gap: 16px; }

  #home .hero-icon img { width: 42px; height: 42px; }

  #home .hero-btn strong { font-size: 22px; }

  #home .hero-btn small { font-size: 17px; }

  #home :is(.routine-card, .tuner-card) { grid-template-columns: 90px minmax(0, 1fr) 22px; gap: 24px; min-height: 92px; }

  #home :is(.routine-card, .tuner-card) strong { font-size: 25px; }

  #home :is(.routine-card, .tuner-card) small { font-size: 19px; }
}

@media (min-width: 700px) and (orientation: landscape) {
  #home .home-content {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 28px 44px;
    width: min(1120px, 100%);
  }

  #home .home-brand { align-self: center; }

  #home .hero-logo { width: min(100%, 520px); }

  #home .tagline { font-size: 18px; }

  #home .home-setup { margin-top: 28px; }

  #home .home-instruments { --instrument-check-offset: 6px; }

  #home .home-instruments button { flex-direction: column; padding: 7px 3px 9px; font-size: 16px; }

  #home .instrument-art { width: 42px; height: 56px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  #home .home-content { gap: 12px 28px; }

  #home .home-menu,
  #home .home-actions { gap: 12px; }

  #home .hero-btn { min-height: 66px; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding-right: 8px; }

  #home .hero-icon img { width: 30px; height: 30px; }

  #home .hero-btn strong { font-size: 17px; }

  #home .hero-btn small { font-size: 13px; }

  #home :is(.routine-card, .tuner-card) { grid-template-columns: 56px minmax(0, 1fr) 14px; gap: 12px; min-height: 62px; }

  #home :is(.routine-card, .tuner-card) .hero-icon img { width: 38px; height: 38px; }

  #home :is(.routine-card, .tuner-card) strong { font-size: 18px; }

  #home .home-setup { margin-top: 14px; }

  #home .home-instruments button { flex-direction: row; font-size: 14px; }

  #home .instrument-art { width: 26px; height: 36px; }
}

@media (min-width: 700px) and (orientation: landscape) and (max-height: 600px) {
  #home .home-content { grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); }
}

@media (min-width: 740px) and (orientation: landscape) and (max-height: 500px) {
  #home .home-content { grid-template-columns: minmax(180px, .65fr) minmax(430px, 1.35fr); gap: 12px 24px; }

  #home .tagline { font-size: 13px; }

  #home .home-setup-heading { flex-wrap: wrap; justify-content: center; gap: 2px; }

  #home .home-language { max-width: 100%; }

  #home .home-instruments { gap: 4px; }

  #home .home-instruments button { flex-direction: column; padding-block: 5px; }
}
