:root {
  --ink: #e8e3d5;
  --accent: #c9c9d1;
  --panel: rgba(18, 22, 34, 0.72);
  --panel-border: rgba(200, 200, 210, 0.30);
  --gutter: clamp(12px, 2.5vw, 22px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #04060c;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: grab;
  touch-action: none;
}

#sky:active { cursor: grabbing; }

@supports (height: 100dvh) {
  body,
  #sky {
    height: 100dvh;
  }
}


/* ---- 右侧缩放滑块（iOS 透明毛玻璃） ---- */
#zoom-slider {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 340px);
  width: 28px;
  height: 36vh;
  cursor: pointer;
  touch-action: none;
  z-index: 20;
}

.zs-track {
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  transform: translateX(-50%);
  width: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

.zs-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* ---- 右下角控制区（位于滑块下方） ---- */
#controls {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* 统一右下角所有开关的字体大小与毛玻璃质感 */
.grid-toggle,
#term-toggle {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 2px 10px rgba(0,0,0,0.35);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease, color .2s ease;
}

.grid-toggle {
  padding: 7px 11px;
  border-radius: 999px;
  opacity: 0.82;
}

.grid-toggle.on {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200, 200, 210, 0.14);
  opacity: 1;
}

.grid-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 14px rgba(200, 200, 210, 0.25);
}

.grid-toggle:active { transform: scale(0.97); }

#term-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: clamp(32px, 5vh, 38px);
  padding: 0 clamp(12px, 1.6vw, 16px);
  border-radius: 999px;
}

#term-toggle:hover {
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 16px rgba(200, 200, 210, 0.25);
}

#term-toggle:active { transform: scale(0.97); }

.term-toggle-label { line-height: 1; }

.term-toggle-switch {
  position: relative;
  width: 26px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

.term-toggle-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transition: left .2s ease;
}

#term-toggle.ancient .term-toggle-switch i { left: 14px; }
#term-toggle.ancient .term-toggle-label { color: var(--accent); }

/* ---- 星座搜索（替换式输入栏） ---- */
#search-bar {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 300px);
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#toggle-search {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

#toggle-search .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  display: block;
}

#search-input {
  width: 0;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px 0 0 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  outline: none;
  opacity: 0;
  transition: width .25s ease, opacity .2s ease, padding .25s ease, border-color .2s ease;
}

#search-input::placeholder { color: rgba(232, 227, 213, 0.5); }

#search-go {
  width: 0;
  height: 30px;
  padding: 0;
  border: none;
  background: var(--accent);
  color: #0a0c12;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  border-radius: 0 999px 999px 0;
  opacity: 0;
  transition: width .25s ease, opacity .2s ease;
}

#search-bar.open #search-input {
  width: 150px;
  padding: 0 12px;
  border-color: var(--panel-border);
  opacity: 1;
}

#search-bar.open #search-go {
  width: 28px;
  opacity: 1;
}

#search-bar.open #toggle-search {
  display: none;
}

#search-input.err { animation: search-shake .3s ease; }

@keyframes search-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ---- 顶部菜单栏（液体玻璃特效） ---- */
#menu {
  position: fixed;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 2px solid rgba(215, 220, 232, 0.45);
  box-shadow: 0 0 12px rgba(205, 212, 228, 0.35), 0 0 28px rgba(205, 212, 228, 0.18), 0 0 48px rgba(205, 212, 228, 0.10);
  overflow: hidden;
  transition: opacity .8s ease, transform .8s ease;
}

#menu.hide {
  opacity: 0;
  transform: translate(-50%, -14px) scale(0.85);
  pointer-events: none;
}

#menu::before {
  display: none;
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

#menu::after {
  display: none;
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.18) 42%, rgba(255,255,255,0.04) 52%, transparent 64%);
  background-size: 260% 100%;
  animation: liquid-sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquid-sheen {
  0% { background-position: 220% 0; }
  100% { background-position: -80% 0; }
}

.menu-item {
  position: relative;
  padding: 7px 48px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: background .2s ease, color .2s ease;
}

.menu-item:hover { background: rgba(255,255,255,0.14); }
.menu-item.active { background: rgba(255,255,255,0.18); color: var(--accent); }

/* ---- 首页文案 ---- */
#home-intro {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  width: min(840px, 92vw);
  text-align: center;
  pointer-events: none;
}

#home-intro p {
  margin: 0;
  font-size: clamp(18px, 2.1vw, 23px);
  line-height: 2.1;
  letter-spacing: 0.1em;
  color: rgba(232, 227, 213, 0.94);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.6);
}

#home-intro .sign {
  margin-top: 18px;
  text-align: right;
  padding-right: 4em;
  font-size: clamp(18px, 2.1vw, 23px);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(232, 227, 213, 0.94);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.6);
}

.hidden { display: none !important; }

/* ---- 返回按钮（右上角） ---- */
#back-btn {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 30;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: rgba(235, 238, 244, 0.92);
  color: #10131c;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35), 0 0 20px rgba(205, 212, 228, 0.5);
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: opacity .8s ease, transform .8s ease;
}

#back-btn.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#back-btn:hover { background: #ffffff; }

/* 右侧控件仅在观星页显示 */
#zoom-slider,
#controls,
#search-bar {
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
body.observe #zoom-slider,
body.observe #controls,
body.observe #search-bar {
  opacity: 1;
  pointer-events: auto;
}

/* ---- 时间选择器 ---- */
#time-picker {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 52px);
  z-index: 22;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
}
#time-picker.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
.tp-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 2px 14px rgba(0,0,0,0.4);
}
#time-picker select {
  width: 52px;
  height: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(10,12,18,0.7);
  color: var(--ink);
  font-size: 11px;
  text-align: center;
  outline: none;
  cursor: pointer;
}
#time-picker select:focus { border-color: var(--accent); }
.tp-label {
  font-size: 10px;
  color: var(--ink);
  opacity: 0.8;
}
#tp-go {
  margin-left: 4px;
  padding: 4px 12px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0c12;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
#tp-go:hover { background: #fff; }

/* ---- 底部备案信息（底部居中） ---- */
#beian {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#beian a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  transition: color .2s ease, background .2s ease;
}
#beian a:hover {
  color: var(--accent);
}
#beian img {
  width: 13px;
  height: 14px;
  display: block;
}


/* ---- 首页标题栏下移，其他页面保持原位 ---- */
body.home #menu {
  top: 20%;
}


/* ---- 页面切换淡入淡出遮罩 ---- */
#route-fade {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #04060c;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
#route-fade.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---- 观测地点选择 ---- */
#location-picker {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + 88px);
  z-index: 22;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease;
}
#location-picker.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}
#location-picker input {
  width: 68px;
  height: 24px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(10,12,18,0.7);
  color: var(--ink);
  font-size: 11px;
  text-align: center;
  outline: none;
}
#location-picker input:focus { border-color: var(--accent); }
#location-picker .tp-label { padding: 0 2px; }

/* ---- 底部横排控件（全天图 / 地点 / 古代） ---- */
.controls-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* 搜索按钮进入控制栏后，按 pill 按钮样式显示 */
#controls #toggle-search {
  width: auto;
  height: auto;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.06em;
  opacity: 0.82;
}

/* 首页圆内标题栏：收窄菜单，避免左右超出地面圆 */
body.home #menu { top: 20%; }
body.home #menu .menu-item { padding-left: 24px; padding-right: 24px; font-size: 12px; }


/* ---- Mobile responsive layout ---- */
button,
input,
select {
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[role="slider"]:focus-visible {
  outline: 1px solid rgba(232, 227, 213, 0.9);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  :root {
    --gutter: 10px;
  }

  #menu {
    top: max(10px, env(safe-area-inset-top, 0px));
    left: var(--gutter);
    right: var(--gutter);
    transform: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px 5px;
    border-width: 1px;
  }

  #menu.hide {
    transform: translateY(-14px) scale(0.96);
  }

  #menu .menu-item {
    min-width: 0;
    padding: 7px 0;
    font-size: clamp(10px, 2.7vw, 12px);
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
  }

  #menu .menu-item:last-child {
    grid-column: auto;
  }

  /* 手机首页与桌面一致：标题栏居中在地面圆内。 */
  body.home #menu {
    left: 50%;
    right: auto;
    width: 56vmin;
    top: calc(50% - 12vmin);
    transform: translateX(-50%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px 5px;
  }

  body.home #menu.hide {
    transform: translateX(-50%) translateY(-14px) scale(0.96);
  }

  body.home #menu .menu-item {
    padding: 7px 0;
    font-size: clamp(10px, 2.8vmin, 12px);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
  }

  body.home #menu .menu-item:last-child {
    grid-column: auto;
  }

  #home-intro {
    top: calc(50% + 6vmin);
    transform: translate(-50%, 0);
    width: 68vmin;
  }

  #home-intro p {
    font-size: clamp(10.5px, 3vmin, 13px);
    line-height: 1.54;
    letter-spacing: 0.025em;
  }

  #home-intro br {
    display: none;
  }

  #home-intro .sign {
    margin-top: 7px;
    padding-right: 0;
    font-size: clamp(10.5px, 3vmin, 13px);
  }

  #back-btn {
    top: calc(max(10px, env(safe-area-inset-top, 0px)) + 2px);
    right: var(--gutter);
    padding: 8px 12px;
    font-size: 12px;
  }

  #controls {
    left: var(--gutter);
    right: var(--gutter);
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: rgba(8, 10, 17, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
  }

  .controls-row {
    display: grid;
    gap: 6px;
  }

  .controls-row:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls-row:not(:first-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .controls-row:last-child {
    grid-template-columns: 1fr 1fr 1fr 1.28fr;
  }

  .grid-toggle,
  #controls #toggle-search {
    min-width: 0;
    min-height: 36px;
    padding: 8px 3px;
    font-size: 11px;
    text-align: center;
  }

  #term-toggle {
    min-height: 36px;
    padding: 8px 5px;
    gap: 4px;
    font-size: 11px;
    justify-content: center;
  }

  .term-toggle-switch {
    width: 22px;
    height: 12px;
  }

  .term-toggle-switch i {
    width: 8px;
    height: 8px;
  }

  #term-toggle.ancient .term-toggle-switch i {
    left: 10px;
  }

  #zoom-slider {
    right: 4px;
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px) + 194px);
    width: 24px;
    height: min(30vh, 240px);
  }

  .zs-track {
    width: 4px;
  }

  .zs-thumb {
    width: 18px;
    height: 18px;
  }

  #search-bar,
  #time-picker,
  #location-picker {
    left: var(--gutter);
    right: var(--gutter);
    top: calc(max(10px, env(safe-area-inset-top, 0px)) + 48px);
    bottom: auto;
  }

  #search-bar {
    justify-content: stretch;
    pointer-events: none;
  }

  #search-bar.open {
    padding: 4px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: var(--panel);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }

  #search-bar.open #search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 38px;
    font-size: 16px;
  }

  #search-bar.open #search-go {
    width: 42px;
    height: 38px;
    font-size: 16px;
  }

  #time-picker,
  #location-picker {
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
  }

  #time-picker.open,
  #location-picker.open {
    transform: none;
  }

  .tp-row {
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    border-radius: 18px;
  }

  #time-picker select {
    flex: 1 0 58px;
    width: auto;
    height: 36px;
    font-size: 16px;
  }

  #location-picker input {
    flex: 1 1 76px;
    width: auto;
    min-width: 0;
    height: 36px;
    font-size: 16px;
  }

  #tp-go,
  #loc-go {
    height: 36px;
    margin-left: auto;
    padding: 0 14px;
    font-size: 13px;
  }

  body.observe #beian {
    top: max(10px, env(safe-area-inset-top, 0px));
    bottom: auto;
    left: var(--gutter);
    right: 78px;
    transform: none;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 3px;
  }

  body.observe #beian a {
    height: 24px;
    max-width: 100%;
    padding: 0 8px;
    font-size: 10px;
  }

  body.observe #beian img {
    width: 10px;
    height: 11px;
  }

  #beian {
    gap: 4px;
  }

  #beian a {
    height: 24px;
    padding: 0 8px;
    font-size: 9.5px;
  }
}

/* 手机竖屏首页：原生自适应。画布占满视口，投影按短边保持地平圈正圆；
   上下额外空间自然显示星空，不再使用黑边舞台。 */
@media (max-width: 768px) and (orientation: portrait) {
  body.home #sky {
    inset: 0;
    width: 100%;
    height: 100dvh;
  }

  /* 标题栏和文案沿用 vmin 几何，始终落在中心地平圈内。 */
  body.home #menu {
    top: calc(50% - 30vmin);
    left: 50%;
    right: auto;
    width: 56vmin;
    transform: translateX(-50%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    justify-content: center;
    gap: 2px;
    padding: 4px 5px;
  }

  body.home #menu.hide {
    transform: translateX(-50%) translateY(-14px) scale(0.96);
  }

  body.home #menu .menu-item {
    padding: 7px 0;
    font-size: clamp(10px, 2.8vmin, 12px);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: visible;
  }

  body.home #home-intro {
    top: calc(50% + 3vmin);
    transform: translate(-50%, -50%);
    width: 68vmin;
  }

  #home-intro p,
  #home-intro .sign {
    font-size: clamp(10.5px, 3vmin, 13px);
    line-height: 1.54;
    letter-spacing: 0.025em;
  }
}

@media (max-width: 768px) and (max-height: 540px) {
  #menu {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    top: max(6px, env(safe-area-inset-top, 0px));
    gap: 2px;
  }

  #menu .menu-item {
    padding: 7px 0;
    font-size: 10px;
  }

  #menu .menu-item:last-child {
    grid-column: auto;
  }

  body.home #menu {
    left: 50%;
    right: auto;
    width: 70vmin;
    top: calc(50% - 12vmin);
    transform: translateX(-50%);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.home #menu.hide {
    transform: translateX(-50%) translateY(-14px) scale(0.96);
  }

  #home-intro {
    top: calc(50% + 8vmin);
    transform: translate(-50%, 0);
    width: 66vmin;
  }

  #home-intro p,
  #home-intro .sign {
    font-size: 10.5px;
    line-height: 1.5;
  }

  #back-btn {
    top: max(6px, env(safe-area-inset-top, 0px));
    padding: 7px 10px;
  }

  #search-bar,
  #time-picker,
  #location-picker {
    top: calc(max(6px, env(safe-area-inset-top, 0px)) + 42px);
  }

  #controls {
    gap: 4px;
    padding: 5px;
    border-radius: 15px;
  }

  .controls-row {
    gap: 4px;
  }

  .grid-toggle,
  #controls #toggle-search,
  #term-toggle {
    min-height: 30px;
    padding: 6px 2px;
    font-size: 10px;
  }

  #zoom-slider {
    top: calc(max(6px, env(safe-area-inset-top, 0px)) + 48px);
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px) + 148px);
    height: auto;
  }

  body.observe #beian a {
    height: 21px;
    font-size: 9px;
  }
}

@media (max-width: 360px) and (orientation: portrait) {
  body.home #menu {
    gap: 2px;
    padding: 3px;
  }

  body.home #menu .menu-item {
    padding: 6px 7px;
    font-size: 10.5px;
  }
}

@media (max-width: 360px) {
  #menu .menu-item {
    font-size: 11px;
  }

  #home-intro p,
  #home-intro .sign {
    font-size: 12.5px;
  }

  .grid-toggle,
  #controls #toggle-search,
  #term-toggle {
    font-size: 10px;
  }

  .controls-row:last-child {
    grid-template-columns: 1fr 1fr 1fr 1.36fr;
  }

  #home-intro {
    width: 68vmin;
  }

  #home-intro p {
    font-size: 10.5px;
    line-height: 1.55;
  }

  #home-intro .sign {
    font-size: 10.5px;
  }
}
