/* ==================================================
   RESPONSIVE
   Breakpoints:
   1350px — Smaller Desktop
   1100px — Tablet / Collapsed Navigation
    700px — Phone
   ================================================== */

/* ==================================================
   1350px — SMALLER DESKTOP
   ================================================== */

@media (max-width: 1350px) {
  /* ==================================================
     SHARED HEADER
     ================================================== */

  body > header .brand {
    left: 18px;
  }

  body > header .brand strong {
    font-size: 14px;
  }

  body > header .brand small {
    font-size: 10px;
  }

  body > header nav button {
    padding: 0 13px;
    font-size: 12px;
  }

  body > header .top-tools {
    right: 18px;
  }

  body > header .top-tools > a {
    font-size: 11px;
  }
}

/* ==================================================
   1100px — TABLET / COLLAPSED NAVIGATION
   ================================================== */

@media (max-width: 1100px) {
  /* ==================================================
     SHARED HEADER
     ================================================== */

  body > header {
    top: 16px;
  }

  /* ---------- BRAND ---------- */

  body > header .brand {
    top: 0;
    left: 16px;
  }

  /* ---------- RIGHT CONTROLS ---------- */

  body > header .top-tools {
    top: 0;
    right: 16px;

    align-items: center;
  }

  /* ---------- MENU BUTTON ---------- */

  .menu-toggle {
    display: block;
  }

  /* ---------- NAV DROPDOWN ---------- */

  body > header nav {
    position: absolute;

    top: 58px;
    right: 16px;

    width: 230px;

    display: grid;

    overflow: hidden;

    border: 1px solid rgba(117, 188, 255, 0.35);
    border-radius: 9px;

    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 30%),
      rgba(5, 18, 43, 0.94);

    box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.4),
      inset 0 1px rgba(255, 255, 255, 0.08),
      0 0 20px rgba(64, 158, 255, 0.12);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    pointer-events: none;

    transition:
      opacity 180ms ease,
      transform 180ms ease,
      visibility 180ms ease;
  }

  body > header nav.open {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
  }

  body > header nav button {
    width: 100%;
    min-height: 48px;

    justify-content: flex-start;

    padding: 0 16px;

    border-radius: 0;

    font-size: 12px;
  }

  body > header nav button + button {
    border-left: 0;

    border-top: 1px solid rgba(117, 188, 255, 0.1);
  }

  body > header nav button[aria-current="page"] {
    box-shadow: inset 2px 0 var(--blue);
  }

  /* ---------- MENU OPEN STATE ---------- */

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* ---------- HELP TOOLTIP ---------- */

  body > header .help > div {
    display: none;
  }

  /* ==================================================
     HOME PAGE
     ================================================== */

  body > main:not(.view-all-page) {
    min-height: 100svh;

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    grid-template-areas:
      "logo logo"
      "featured featured"
      "library library"
      "rosetta guides"
      "data data";

    gap: 18px;

    padding: 100px 18px 90px;

    overflow: visible;

    background:
      linear-gradient(rgba(2, 7, 18, 0.16), rgba(2, 7, 18, 0.42)),
      url("sandbox-background.png") center top / cover fixed no-repeat;
  }

  /* ---------- HOME PANELS ---------- */

  body > main:not(.view-all-page) .glass-panel {
    position: relative;

    top: auto;
    right: auto;
    bottom: auto;
    left: auto;

    width: 100%;
    min-width: 0;
  }

  body > main:not(.view-all-page) .featured {
    grid-area: featured;

    max-width: 760px;

    margin-inline: auto;
  }

  body > main:not(.view-all-page) .library {
    grid-area: library;
  }

  body > main:not(.view-all-page) .rosetta {
    grid-area: rosetta;
  }

  body > main:not(.view-all-page) .guides {
    grid-area: guides;
  }

  body > main:not(.view-all-page) .data {
    grid-area: data;
  }

  /* ---------- HOME HOLOGRAM ---------- */

  body > main:not(.view-all-page) .logo-stage {
    grid-area: logo;

    position: relative;

    top: auto;
    left: auto;

    width: 250px;

    margin: 20px auto 30px;

    transform: none;
  }

  body > main:not(.view-all-page) .logo-stage::after {
    bottom: -15%;
  }

  /* ---------- HOME PROJECT LIBRARY ---------- */

  body > main:not(.view-all-page) .projects {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* ---------- HOME RIGHT PANELS ---------- */

  body > main:not(.view-all-page) .stones,
  body > main:not(.view-all-page) .guide-list,
  body > main:not(.view-all-page) .data-list {
    width: 100%;
  }

  /* ==================================================
     INNER PAGES — TABLET
     ================================================== */

  .view-all-page {
    grid-template-columns:
      minmax(220px, 270px)
      minmax(0, 1fr);

    gap: 24px;

    padding: 110px 24px 90px;
  }

  /* ---------- INNER ASIDE ---------- */

  .type-menu h1 {
    font-size: 24px;
  }

  .type-menu > header p {
    font-size: 11px;
    line-height: 1.5;
  }

  .project-types {
    gap: 10px;
  }

  .project-types button {
    grid-template-columns:
      46px
      minmax(0, 1fr);

    gap: 10px;

    padding: 11px;
  }

  .project-types button > span:first-child {
    width: 42px;
    height: 42px;

    font-size: 18px;
  }

  .project-types strong {
    font-size: 11px;
  }

  .project-types small {
    font-size: 9px;
  }

  /* ---------- INNER RIGHT CONTENT ---------- */

  .project-content {
    padding: 18px;
  }

  /* ---------- PROJECT LIBRARY ---------- */

  .project-group {
    grid-template-columns:
      120px
      minmax(0, 1fr);
  }

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

  /* ---------- REFERENCE COMMANDS ---------- */

  .project-command {
    grid-template-columns:
      minmax(85px, 110px)
      minmax(0, 1fr);

    gap: 14px;
  }

  /* ==================================================
     SHARED FOOTER
     ================================================== */

  body > footer {
    position: relative;

    bottom: auto;
    left: auto;

    width: 100%;

    padding: 0 18px 20px;

    transform: none;

    background: var(--background);
  }

  body > footer nav {
    width: min(680px, 100%);

    margin-inline: auto;

    justify-content: center;
  }
}

/* ==================================================
   700px — PHONE
   ================================================== */

@media (max-width: 700px) {
  /* ==================================================
     SHARED HEADER
     ================================================== */

  body > header {
    top: 12px;
  }

  /* ---------- BRAND ---------- */

  body > header .brand {
    left: 12px;

    gap: 7px;
  }

  body > header .brand img {
    width: 32px;
    height: 32px;
  }

  body > header .brand strong {
    font-size: 11px;
  }

  body > header .brand small {
    font-size: 9px;
  }

  /* ---------- RIGHT CONTROLS ---------- */

  body > header .top-tools {
    right: 12px;

    gap: 7px;
  }

  .menu-toggle {
    width: 36px;
    height: 36px;

    padding: 7px;
  }

  body > header .help > button {
    width: 36px;
    height: 36px;
  }

  body > header .close {
    width: 36px;
    height: 36px;

    font-size: 21px;
  }

  body > header .top-tools > a {
    display: none;
  }

  /* ---------- NAV DROPDOWN ---------- */

  body > header nav {
    top: 48px;

    right: 12px;
    left: 12px;

    width: auto;
  }

  body > header nav button {
    min-height: 46px;

    font-size: 11px;
  }

  /* ==================================================
     HOME PAGE
     ================================================== */

  body > main:not(.view-all-page) {
    display: grid;

    grid-template-columns: 1fr;

    grid-template-areas:
      "logo"
      "featured"
      "library"
      "rosetta"
      "guides"
      "data";

    gap: 14px;

    padding: 82px 12px 30px;

    background:
      linear-gradient(rgba(2, 7, 18, 0.22), rgba(2, 7, 18, 0.55)),
      url("sandbox-background.png") center top / cover fixed no-repeat;
  }

  /* ---------- HOME PANELS ---------- */

  body > main:not(.view-all-page) .glass-panel {
    width: 100%;

    padding: 14px;
  }

  body > main:not(.view-all-page) .glass-panel h2 {
    margin-bottom: 12px;

    font-size: 13px;
  }

  /* ---------- HOME HOLOGRAM ---------- */

  body > main:not(.view-all-page) .logo-stage {
    width: 205px;

    margin: 20px auto 28px;
  }

  body > main:not(.view-all-page) .logo-stage::after {
    bottom: -12%;

    opacity: 0.15;
  }

  /* ---------- FEATURED PROJECT ---------- */

  body > main:not(.view-all-page) .featured-content {
    grid-template-columns:
      24px
      minmax(0, 1fr)
      24px;

    gap: 5px;
  }

  body > main:not(.view-all-page) .featured .arrow {
    width: 24px;
    height: 24px;

    font-size: 18px;
  }

  body > main:not(.view-all-page) .card-stack {
    min-height: 355px;
  }

  body > main:not(.view-all-page) .card-stack > span {
    display: none;
  }

  body > main:not(.view-all-page) .card-stack article {
    grid-template-columns: 1fr;

    gap: 10px;

    padding: 10px;
  }

  body > main:not(.view-all-page) .project-image {
    min-height: 160px;
  }

  body > main:not(.view-all-page) .project-info h3 {
    font-size: 18px;
  }

  body > main:not(.view-all-page) .project-info p {
    font-size: 11px;
  }

  body > main:not(.view-all-page) .project-info a {
    margin-top: 8px;
  }

  /* ---------- HOME PROJECT LIBRARY ---------- */

  body > main:not(.view-all-page) .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 7px;
  }

  body > main:not(.view-all-page) .projects > a {
    padding: 9px 5px;
  }

  body > main:not(.view-all-page) .project-icon {
    width: 46px;
    height: 46px;
  }

  /* ---------- HOME ROSETTA ---------- */

  body > main:not(.view-all-page) .stones {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;

    overflow: visible;
  }

  body > main:not(.view-all-page) .stones button {
    width: 100%;

    display: grid;

    grid-template-columns:
      64px
      minmax(0, 1fr);

    align-items: center;
    justify-items: start;

    text-align: left;
  }

  body > main:not(.view-all-page) .stones small {
    width: auto;

    text-align: left;
  }

  /* ---------- HOME REFERENCE GUIDES ---------- */

  body > main:not(.view-all-page) .guide-list {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;

    overflow: visible;
  }

  body > main:not(.view-all-page) .guide-list > a {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 9px;

    text-align: left;
  }

  /* ---------- HOME DATA VISUALIZATION ---------- */

  body > main:not(.view-all-page) .data-list {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 8px;

    overflow: visible;
  }

  body > main:not(.view-all-page) .data-list > a {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 9px;

    text-align: left;
  }

  /* ==================================================
     INNER PAGES — PHONE
     ================================================== */

  .view-all-page {
    display: grid;

    grid-template-columns: 1fr;
    grid-template-areas: none;

    gap: 18px;

    align-items: start;

    padding: 82px 12px 90px;

    overflow: visible;

    background:
      linear-gradient(rgba(2, 7, 18, 0.22), rgba(2, 7, 18, 0.48)),
      url("innerPg.png") center top / cover fixed no-repeat;
  }

  /* ==================================================
     INNER PAGE ASIDE
     ================================================== */

  .type-menu {
    width: 100%;
    min-width: 0;
  }

  .type-menu > header {
    margin-bottom: 12px;
  }

  .type-menu h1 {
    font-size: 22px;
  }

  .type-menu > header p {
    max-width: none;

    font-size: 11px;
    line-height: 1.5;
  }

  /* ---------- TYPES / SUBJECTS ---------- */

  .project-types {
    display: flex;

    gap: 8px;

    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 2px 2px 8px;

    scrollbar-width: thin;
    scrollbar-color: rgba(95, 200, 255, 0.25) transparent;
  }

  .project-types button {
    flex: 0 0 min(245px, 80vw);

    grid-template-columns:
      42px
      minmax(0, 1fr);

    gap: 10px;

    padding: 10px;
  }

  .project-types button > span:first-child {
    width: 40px;
    height: 40px;

    font-size: 16px;
  }

  .project-types strong {
    font-size: 11px;
  }

  .project-types small {
    font-size: 9px;
    line-height: 1.4;
  }

  /* ==================================================
     INNER PAGE CONTENT
     ================================================== */

  .project-content {
    width: 100%;
    min-width: 0;

    padding: 12px;
  }

  /* ---------- CONTENT HEADER ---------- */

  .project-content > header,
  .project-detail-header {
    display: flex;

    flex-direction: column;

    align-items: flex-start;
    justify-content: flex-start;

    gap: 8px;

    margin-bottom: 16px;
  }

  .project-content > header > div,
  .project-detail-header > div {
    width: 100%;
  }

  .project-content > header h2,
  .project-detail-header h2 {
    font-size: 23px;
  }

  .project-content > header p,
  .project-detail-header > p {
    width: 100%;
    max-width: none;

    font-size: 11px;
    line-height: 1.5;

    text-align: left;
  }

  /* ==================================================
     PROJECT LIBRARY PAGE
     ================================================== */

  .project-group {
    grid-template-columns: 1fr;
  }

  .project-group > header {
    flex-direction: row;

    justify-content: flex-start;
    align-items: center;

    gap: 10px;

    padding: 11px 12px;

    border-right: 0;
    border-bottom: 1px solid rgba(95, 170, 255, 0.18);
  }

  .project-group > header > span {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    font-size: 15px;
  }

  .project-group > header small {
    margin-top: 2px;
  }

  /* ---------- PROJECT CARDS ---------- */

  .project-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));

    gap: 7px;

    padding: 9px;
  }

  .project-grid > a {
    min-width: 0;

    padding: 9px;
  }

  .project-content .project-icon {
    flex: 0 0 40px;

    width: 40px;
    height: 40px;

    font-size: 10px;
  }

  .project-grid strong {
    white-space: normal;

    overflow: visible;
    text-overflow: clip;

    font-size: 10px;
  }

  /* ==================================================
     REFERENCE DOCUMENTATION PAGE
     ================================================== */

  .project-doc-nav {
    flex-wrap: nowrap;

    gap: 6px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 8px 0 10px;
  }

  .project-doc-nav a {
    flex: 0 0 auto;

    white-space: nowrap;
  }

  .project-doc {
    gap: 14px;
  }

  /* ---------- DOCUMENT SECTION HEADER ---------- */

  .project-doc-section > header {
    display: grid;

    gap: 7px;

    align-items: start;

    padding: 11px 12px;
  }

  .project-doc-section > header > div {
    align-items: center;
  }

  .project-doc-section > header > p {
    max-width: none;

    text-align: left;
  }

  /* ---------- COMMAND ROWS ---------- */

  .project-command {
    grid-template-columns: 1fr;

    gap: 7px;

    padding: 11px 12px;
  }

  .project-command > code {
    width: fit-content;
    max-width: 100%;

    font-size: 10px;
  }

  .project-command strong {
    font-size: 10px;
  }

  .project-command p {
    font-size: 10px;
  }

  /* ---------- CODE EXAMPLES ---------- */

  .project-example {
    margin: 0 12px 12px;
  }

  .project-example pre {
    padding: 11px;
  }

  .project-example code {
    font-size: 10px;
  }

  /* ---------- DOCUMENT NOTES ---------- */

  .project-note {
    margin: 0 12px 12px;

    padding: 10px 12px;
  }

  /* ==================================================
     SINGLE PROJECT PAGE
     ================================================== */

  .project-preview {
    min-height: 180px;
  }

  /* ---------- PROJECT LINKS ---------- */

  .project-actions {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));

    gap: 7px;
  }

  .project-link {
    text-align: center;
  }

  /* ---------- DETAIL SECTIONS ---------- */

  .project-detail > header {
    padding: 11px 12px;
  }

  .project-detail > p {
    padding: 12px;

    font-size: 10px;
  }

  /* ---------- PROJECT META ---------- */

  .project-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-meta > div {
    padding: 11px;
  }

  .project-meta > div + div {
    border-left: 0;
  }

  .project-meta > div:nth-child(n + 3) {
    border-top: 1px solid rgba(95, 170, 255, 0.12);
  }

  .project-meta > div:nth-child(even) {
    border-left: 1px solid rgba(95, 170, 255, 0.12);
  }

  /* ---------- PROJECT DOCUMENTS ---------- */

  .project-documents > a {
    grid-template-columns: 1fr;

    gap: 4px;

    padding: 11px 34px 11px 12px;
  }

  .project-documents > a > span {
    position: absolute;

    top: 50%;
    right: 12px;

    transform: translateY(-50%);
  }

  /* ---------- PROJECT IMAGES ---------- */

  .project-images {
    grid-template-columns: 1fr;

    gap: 8px;

    padding: 9px;
  }

  /* ==================================================
     SHARED FOOTER
     ================================================== */

  body > footer {
    padding: 12px 12px 20px;
  }

  body > footer nav {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 4px;

    padding: 5px;
  }

  body > footer button {
    justify-content: center;

    min-width: 0;

    padding: 8px 5px;

    font-size: 10px;
  }
}
