/* Heebo Regular for the large door names (SIL OFL 1.1, assets/fonts/heebo/OFL.txt). */
@font-face {
  font-family: 'Heebo Doors';
  src: url('assets/fonts/heebo/heebo-hebrew-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: 'Heebo Doors';
  src: url('assets/fonts/heebo/heebo-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Home menu doors (#63). Five goals on the home screen, a page of tool cards per goal. */
html:has(#home-doors),
html:has(#home-doors) body {
  height: auto;
  min-height: 100dvh;
}

/* home-menu.css locks body scrolling for the old fit-to-screen menu. Door pages
   are taller than short screens, so let the page scroll vertically. Keep the
   sides clipped (clip, not hidden, so body does not become a scroll box): the
   hidden support menu sits past the edge on phones. */
html:has(#home-doors) body {
  overflow: visible;
  overflow-x: clip;
}

.home-doors {
  display: block;
  margin-top: 4px;
}

.home-doors h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 650;
  line-height: 1.25;
}

.home-doors h2:focus {
  outline: none;
}

.home-doors h2:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 4px;
  border-radius: 6px;
}

.home-doors-hint {
  margin: 0 0 22px;
  max-width: 70ch;
  color: #a9b6cc;
  font-size: 16px;
  line-height: 1.5;
}

/* The home screen opens with the person behind the site and the P motto. */
.home-doors-hero {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  margin: 4px 0 14px;
}

.home-doors-photo-frame {
  position: relative;
  flex: none;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 3px solid #67c5dc;
  border-radius: 50%;
  background: #172235;
}

/* Same crop as the footer portrait: the face sits left of the stage photo's centre. */
.home-doors-photo {
  position: absolute;
  top: calc(50% - 99px);
  left: calc(50% - 92px);
  width: 396px;
  max-width: none;
  height: 264px;
}

.home-doors-hero-text {
  min-width: 0;
}

.home-doors-byline {
  margin: 0 0 8px;
  color: #a9b6cc;
  font-size: 16px;
}

.home-doors-name {
  color: #7dd3fc;
  font-weight: 650;
  text-decoration: none;
}

.home-doors-name:hover {
  text-decoration: underline;
}

.home-doors-name:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 2px;
  border-radius: 4px;
}

.home-doors .home-doors-motto {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  color: #eef2f8;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.3;
}

.home-doors-motto-label {
  margin-inline-end: 6px;
  color: #fbbf24;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
}

.home-doors-motto-step b {
  display: inline-block;
  color: #7dd3fc;
  font-weight: 800;
  transform-origin: center bottom;
  /* The initials light up one after another, Play to Play again (as on the old home bar). */
  animation: home-doors-motto-p 5.6s ease-in-out infinite;
  animation-delay: calc(var(--step, 0) * 0.8s);
}

@keyframes home-doors-motto-p {
  0%,
  14%,
  100% {
    color: #7dd3fc;
    transform: scale(1);
    text-shadow: none;
  }
  5%,
  10% {
    color: #e0f7ff;
    transform: scale(1.3);
    text-shadow:
      0 0 8px #38bdf8,
      0 0 18px #3b82f6;
  }
}

@keyframes home-doors-motto-p-calm {
  0%,
  14%,
  100% {
    color: #7dd3fc;
    text-shadow: none;
  }
  5%,
  10% {
    color: #e0f7ff;
    text-shadow: 0 0 8px #38bdf8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-doors-motto-step b {
    animation-name: home-doors-motto-p-calm;
  }
}

.home-doors-motto-step {
  padding: 0 2px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

/* Each P opens a menu of tools for that step. */
.home-doors-motto-step:hover,
.home-doors-motto-step[aria-expanded='true'] {
  text-decoration: underline;
  text-decoration-color: #7dd3fc;
  text-underline-offset: 6px;
}

.home-doors-motto-step:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}

.home-doors-motto-arrow {
  display: inline-block;
  margin-inline-start: 10px;
  color: #64748b;
  font-weight: 400;
}

/* The home screen: eight doors, two rows of four, large enough to read at a glance. */
.home-doors-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-door {
  --accent: #a78bfa;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #334155);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 10%, #172235);
  color: #eef2f8;
  text-decoration: none;
  transition:
    background-color 0.18s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.18s cubic-bezier(0.25, 1, 0.5, 1);
}

.home-door:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, #172235);
}

.home-door:focus-visible,
.home-doors-back:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}

/* Door icons: pencil colour and a wavering line, like a hand drawing. */
.home-doors-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.home-door-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, #b9b3a6);
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
  background: none;
  color: color-mix(in srgb, var(--accent) 35%, #ddd6c8);
}

.home-door-icon svg {
  width: 28px;
  height: 28px;
  filter: url(#home-doors-sketch);
}

.home-door-title {
  font-family: 'Heebo Doors', 'Segoe UI', Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.25;
}

.home-door-line {
  color: #a9b6cc;
  font-size: 14px;
  line-height: 1.5;
}

.home-door-topics {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  color: color-mix(in srgb, var(--accent) 65%, #eef2f8);
  font-size: 18px;
  line-height: 1.6;
}

/* A door page: topics, each with its tool cards. */
.home-doors-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 6px;
  padding: 0 4px;
  color: #a9b6cc;
  font-size: 15px;
  text-decoration: none;
}

.home-doors-back:hover {
  color: #eef2f8;
}

.home-doors-page > h2 {
  color: color-mix(in srgb, var(--accent) 70%, #eef2f8);
}

.home-doors-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 28px 20px;
}

.home-doors-topic {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

.home-doors-topic-wide {
  grid-column: 1 / -1;
}

/* Single cards line up at the bottom even when the descriptions differ in length. */
.home-doors .home-doors-topic:not(.home-doors-topic-wide) > .tool-list.home-doors-tools {
  grid-template-columns: 1fr;
  margin-top: auto;
}

.home-doors-topic-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  color: color-mix(in srgb, var(--accent) 75%, #eef2f8);
  font-size: 19px;
  font-weight: 650;
}

.home-doors-topic-title .category-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
}

.home-doors-topic-title .category-icon :is(svg, img) {
  width: 100%;
  height: 100%;
}

/* Topic icons: calmer colour, same sketched line. */
.home-doors-topic-title .category-icon {
  color: color-mix(in srgb, var(--accent) 40%, #ddd6c8);
  filter: url(#home-doors-sketch) saturate(0.45);
}

.home-doors-topic-description {
  margin: 0 0 12px;
  max-width: 75ch;
  color: #a9b6cc;
  font-size: 14px;
  line-height: 1.5;
}

/* Tool cards keep their home-menu.css look; only the list layout is new. */
.home-doors .tool-list.home-doors-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  min-height: 0;
  overflow: visible;
  border: 0;
}

.home-doors .tool-list.home-doors-tools > .tool {
  height: 116px;
  min-height: 0;
}

/* Instrument cards: brand wordmarks on one line, sized to the card width. */
.home-doors .tool-list.home-doors-tools > .tool {
  container-type: inline-size;
}

.home-doors .tool-list.home-doors-instruments > .tool {
  height: 132px;
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Learn, explore and read: calmer pictures. Practice and play keep full colour. */
.home-doors-page:is([data-door='learn'], [data-door='explore'], [data-door='read'])
  .tool-artwork-frame {
  filter: saturate(0.55) brightness(0.85);
}

.home-doors
  .tool-list.home-doors-tools
  :is(
    .theremany-menu-name,
    .bandboard-menu-name,
    .noise-room-menu-name,
    .familytone-menu-name,
    .altair-menu-name,
    .nevet-menu-name
  ) {
  width: auto;
  font-size: min(28px, 7cqw) !important;
  line-height: 1.2;
  text-align: start;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.home-doors .tool-list.home-doors-tools .tsavta-wordmark {
  width: auto;
  height: min(30px, 9cqw);
}

.home-doors h2 {
  color: #eef2f8;
}

@media (max-width: 1100px) {
  .home-doors-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-door {
    min-height: 0;
  }

  /* Five doors in two columns: the last one takes the whole row. */
  .home-door:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .home-doors-hero {
    align-items: flex-start;
  }

  .home-doors-photo-frame {
    width: 84px;
    height: 84px;
  }

  .home-doors-photo {
    top: calc(50% - 63px);
    left: calc(50% - 59px);
    width: 252px;
    height: 168px;
  }

  .home-doors .home-doors-motto {
    font-size: 17px;
    gap: 2px 6px;
  }

  .home-doors-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Door icons are hidden, so the name takes the whole card width. */
  .home-door {
    padding: 14px 18px;
  }

  .home-door-title {
    font-size: 24px;
  }

  .home-door-topics {
    display: none;
  }

  .home-doors .tool-list.home-doors-tools > .tool {
    height: 96px;
  }
}

/* Noise Room's wordmark font runs wider than the others. */
.home-doors .tool-list.home-doors-tools .noise-room-menu-name {
  font-size: min(26px, 6cqw) !important;
}

/* No icons on instrument cards, including the ALTAIR tree beside its name. */
.home-doors .tool-list.home-doors-instruments .altair-name-tree {
  display: none;
}

/* #64: one clean top bar. The bar takes the middle column that the old
   search row used; home-menu.css keeps placing the logo and the links. */
.home-bar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.home-bar #search {
  flex: 1 1 320px;
  min-width: 0;
  max-width: 460px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #1e293b;
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.home-bar #search:focus-visible,
.home-quick a:focus-visible,
.home-quick button:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 2px;
}

/* Quick tools: each its own button. The row runs left to right in both
   languages: MIDI, its ?, tuner, metronome. */
.home-quick {
  position: relative;
  flex: none;
}

.home-quick .header-tool-shortcuts {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 8px;
}

html .home-quick .header-tool-shortcuts > a,
html .home-quick .header-tool-shortcuts > #platformMidiToggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #475569;
  border-radius: 10px;
  background: #172235;
  color: #eef2f8;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

html .home-quick .header-tool-shortcuts > a:hover,
html .home-quick .header-tool-shortcuts > #platformMidiToggle:hover {
  border-color: #7dd3fc;
}

.home-quick .header-tool-shortcuts .header-tool-caption,
.home-quick .header-tool-shortcuts .platform-midi-label {
  display: inline;
  font-size: 14px;
  font-weight: 600;
}

.home-quick .header-tool-shortcuts svg {
  width: 22px;
  height: 22px;
}

.home-quick #platformMidiToggle {
  order: 0;
}

.home-quick .home-midi-help {
  order: 1;
}

.home-quick .header-tuner {
  order: 2;
}

.home-quick .header-metronome {
  order: 3;
}

/* The ? beside MIDI: red, like the guide button inside each app. */
.home-midi-help {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-inline-start: -4px;
  padding: 0;
  border: 1px solid #f87171;
  border-radius: 50%;
  background: #7f1d1d;
  color: #fff;
  font: 700 16px/1 system-ui, sans-serif;
  box-shadow: 0 0 0 2px #ef444455, 0 0 10px #ef444466;
  cursor: pointer;
}

.home-midi-help:hover {
  background: #b91c1c;
}

.home-midi-help-text:not([hidden]) {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(320px, 86vw);
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #4f666b;
  border-radius: 12px;
  background: #1b2c31;
  color: #f1f6ff;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 18px 40px rgb(2 6 23 / 0.6);
}

/* Phones: logo and links on the first row; search and the quick-tools
   icon on the second. The menu label stays readable to screen readers. */
@media (max-width: 700px) {
  html:has(#home-doors) header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 12px;
  }

  html:has(#home-doors) header > .brand {
    grid-column: 2;
    grid-row: 1;
    width: auto;
  }

  html:has(#home-doors) header > .brand > svg {
    width: auto;
    height: 46px;
    max-width: 130px;
  }

  html:has(#home-doors) header > .header-actions {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-content: flex-start;
    width: auto;
    border-top: 0;
    padding-top: 0;
  }

  .home-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .home-bar #search {
    flex: 1 1 auto;
    max-width: none;
  }

  /* Phones: icons only; names stay readable to screen readers. */
  html .home-quick .header-tool-shortcuts > a,
  html .home-quick .header-tool-shortcuts > #platformMidiToggle {
    justify-content: center;
    width: 44px;
    padding: 0;
  }

  .home-quick .header-tool-shortcuts .header-tool-caption,
  .home-quick .header-tool-shortcuts .platform-midi-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .home-quick .header-tool-shortcuts {
    gap: 6px;
  }

  .home-midi-help-text:not([hidden]) {
    right: 0;
    left: auto;
  }
}

/* The footer keeps the AI development note as plain text; the photo lives at the top. */
.creator-ai-note {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

/* Phones: without the photo, name and links take the first line; the note
   and the terms of use wrap below instead of squeezing the name to nothing. */
@media (max-width: 700px) {
  html:has(#home-doors) .creator-credit {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  html:has(#home-doors) .creator-copy {
    flex: 1 1 100%;
  }

  html:has(#home-doors) .creator-ai-note {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Tools that are not open yet (coming as VST): greyed so they read as inactive. */
.home-doors .tool-list.home-doors-tools > .tool:has(> .tool-pro-soon:not(.tool-open-trial)) {
  filter: grayscale(0.9);
  opacity: 0.55;
  transition: opacity 0.2s, filter 0.2s;
}

.home-doors .tool-list.home-doors-tools > .tool:has(> .tool-pro-soon:not(.tool-open-trial)):is(:hover, :focus-visible) {
  filter: grayscale(0.6);
  opacity: 0.8;
}

/* A card that opens a group of tools shows how many it holds. */
.home-doors .tool-list.home-doors-tools > .tool {
  position: relative;
}

.home-doors-tool-count {
  position: absolute;
  inset-block-end: 8px;
  /* The text side of the card: left in Hebrew, right in English, away from the picture. */
  inset-inline-end: 12px;
  padding: 1px 9px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #dbe4f0;
  font: 600 11px/1.6 system-ui, 'Segoe UI', Arial, sans-serif;
  pointer-events: none;
}

/* Category titles on the door pages: text only, no small icon; the clefs category keeps its treble clef and the note games keep their smiley. */
.home-doors-topic-title .category-icon:not(:has(use[href='#i-key'], img[src*='musical-emoji-note-games'])) {
  display: none;
}

/* Door cards on the doors screen: title, line and topics only, no icon. */
.home-door-icon {
  display: none;
}

/* A door page's own name uses the same light face as the door card. */
.home-doors-page > h2 {
  font-family: 'Heebo Doors', 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
}

/* Two gates (students, teachers) above the doors. */
.home-doors-gates {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 20px;
}

.home-doors-gate {
  min-width: 150px;
  padding: 9px 22px;
  border: 1px solid #3b4a63;
  border-radius: 999px;
  background: #172235;
  color: #cbd5e1;
  font: 600 17px/1.2 'Segoe UI', Arial, sans-serif;
  text-align: center;
  text-decoration: none;
}

.home-doors-gate:hover {
  border-color: #5eead4;
  color: #f1f6ff;
}

.home-doors-gate[aria-current='page'] {
  border-color: #2dd4bf;
  background: color-mix(in srgb, #2dd4bf 24%, #172235);
  color: #ecfeff;
}

.home-doors-gate:focus-visible {
  outline: 3px solid #5eead4;
  outline-offset: 2px;
}

/* Students: six doors in two rows of three. Teachers: two doors side by side. */
.home-doors-grid[data-gate='students'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-doors-grid[data-gate='teachers'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  margin-inline: auto;
}

@media (max-width: 1100px) {
  .home-doors-grid[data-gate] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-doors-grid[data-gate] {
    grid-template-columns: 1fr;
  }

  .home-doors-gate {
    min-width: 0;
    flex: 1;
    padding: 8px 10px;
    font-size: 15px;
  }
}

/* Hero: the school's name and its saying; the My Way motto sits under the doors. */
.home-doors .home-doors-school {
  margin: 0 0 6px;
  font-family: 'Heebo Doors', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  color: #f1f6ff;
}

.home-doors-quote {
  margin: 0;
  max-width: 64ch;
  color: #a5f3fc;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
}

.home-doors .home-doors-screen > .home-doors-motto {
  justify-content: center;
  margin: 28px 0 6px;
}

@media (max-width: 560px) {
  .home-doors .home-doors-school {
    font-size: 26px;
  }

  .home-doors-quote {
    font-size: 15px;
  }
}

/* Yaron's signature beside the saying. */
.home-doors-saying {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.home-doors-signature {
  width: auto;
  height: 30px;
  opacity: 0.95;
}

@media (max-width: 560px) {
  .home-doors-signature {
    height: 22px;
  }
}


/* Page background: deep teal fading to near black. */
:root:root {
  min-height: 100%;
  background: linear-gradient(to bottom, #243b40, #111c21) fixed;
}

:root:root body {
  background: transparent;
}

/* Door cards: the door name in the door's colour, the topics in white. */
.home-doors .home-door-title {
  color: var(--accent);
}

.home-doors .home-door-topics {
  color: #f1f6ff;
}

/* Inside a door: topic names in the door's colour, text in white, tool cards in the door's colour. */
.home-doors .home-doors-topic-title {
  color: var(--accent);
}

.home-doors .home-doors-topic-description {
  color: #e2e8f0;
}

.home-doors .home-doors-topic .tool {
  --accent: inherit !important;
}

.home-doors .home-doors-page > h2 {
  color: var(--accent);
}

.home-doors .home-doors-page > .home-doors-hint {
  color: #e2e8f0;
}
