@font-face {
  font-family: "GuoxinSeed Sans";
  src: url("/assets/fonts/guoxinseed-sans.woff2") format("woff2");
  font-weight: 300 650;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night-bg: #151c24;
  --night-surface: #1c252e;
  --night-raised: #27323b;
  --night-text: #f0eee9;
  --night-muted: #bfc5c8;
  --night-accent: #e5c9a6;
  --night-hairline: #d4dbe42e;
  --night-line: #d4dbe44f;
  --night-gutter: max(clamp(14px, 4vw, 64px), env(safe-area-inset-left), env(safe-area-inset-right));
  --night-content-width: max(75rem, 84vw);
  --night-width: max(1400px, var(--night-content-width));
  --night-font: "GuoxinSeed Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --night-size-title: clamp(32px, 4.7vw, 62px);
  --night-size-section: clamp(22px, 2.35vw, 31px);
  --night-size-item: clamp(16px, 1.65vw, 22px);
  --night-size-body: clamp(14px, 1.25vw, 16px);
  --night-size-meta: 12px;
}

html:has(body.orbital-theme), body.orbital-theme { background-color: var(--night-bg); }
body.orbital-theme {
  margin: 0;
  color: var(--night-text);
  font-family: var(--night-font);
  font-size: var(--night-size-body);
  font-weight: 350;
}
.orbital-theme :focus-visible { outline: 2px solid var(--night-accent); outline-offset: 3px; }
.orbital-theme ::selection { background: var(--night-accent); color: var(--night-bg); }
.orbital-theme .skip-link { color: var(--night-bg); background: var(--night-accent); }
.orbital-theme :is(button, input, select, textarea) { font-family: inherit; }

.night-header, .night-footer {
  box-sizing: border-box;
  position: relative;
  z-index: 3;
  width: min(var(--night-width), calc(100% - var(--night-gutter) * 2));
  margin-inline: auto;
}
.night-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 22px;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 0 8px;
  border-bottom: 1px solid var(--night-hairline);
}
.night-header a, .night-footer a { text-decoration: none; }
.night-brand {
  display: flex; align-items: center; gap: 9px; min-height: 46px;
  white-space: nowrap; color: var(--night-text);
}
.night-brand-icon {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--night-hairline); border-radius: 50%;
  color: var(--night-accent); flex: none;
}
.night-brand-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.night-brand strong { display: block; line-height: 1.15; font-size: var(--night-size-body); font-weight: 300; letter-spacing: .045em; }
.night-brand small { display: block; color: var(--night-muted); margin-top: 3px; font-size: var(--night-size-meta); font-weight: 350; letter-spacing: .12em; }
.night-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: clamp(1px, 1vw, 13px); }
.night-icon {
  display: block; width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round;
}
.night-icon-control, .night-nav .site-search-trigger {
  box-sizing: border-box; display: inline-grid; place-items: center; width: 44px; min-height: 44px;
  padding: 0; border: 0; border-radius: 0;
  color: var(--night-muted); background: transparent; cursor: pointer; text-decoration: none;
}
.night-icon-control:is(:hover, :focus-visible), .night-nav .site-search-trigger:is(:hover, :focus-visible) { color: var(--night-accent); }
.night-nav a[aria-current] { color: var(--night-accent); box-shadow: inset 0 -1px var(--night-accent); }
.night-nav .site-search-trigger { color: var(--night-text); }
.site-search-trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; }
[data-icon-label] { position: relative; }
[data-icon-label]::after {
  position: absolute; z-index: 6; inset: calc(100% + 4px) auto auto 50%;
  display: none; transform: translateX(-50%);
  padding: 4px 8px; border: 1px solid var(--night-hairline);
  background: var(--night-surface); color: var(--night-text);
  font: 350 var(--night-size-meta)/1.5 var(--night-font);
  letter-spacing: 0; white-space: nowrap; pointer-events: none;
  content: attr(data-icon-label);
  content: attr(data-icon-label) / "";
}
[data-icon-label]:focus-visible::after { display: block; }
@media (hover: hover) {
  [data-icon-label]:hover::after { display: block; }
}
.night-nav [data-icon-label]:last-child::after { inset-inline: auto 0; transform: none; }
.night-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 18px;
  border-top: 1px solid var(--night-hairline); padding: 4px 0 max(10px,env(safe-area-inset-bottom)); margin-top: 12px;
}
.night-footer nav { display: flex; flex-wrap: wrap; gap: 2px 13px; }
.night-footer a { color: var(--night-muted); display: inline-flex; align-items: center; min-height: 44px; font-size: var(--night-size-meta); font-weight: 350; }
.night-footer > a { color: var(--night-text); letter-spacing: .045em; }
.night-footer a:hover { color: var(--night-accent); }
.orbital-theme.dashboard-catalog > .edition > :is(.night-header,.night-footer), .orbital-history .page-frame > :is(.night-header,.night-footer) { width: 100%; }

.night-search {
  position: relative; display: inline-flex; flex: 0 0 44px; width: 44px;
  margin: 0; padding: 0; border: 0;
}
.night-search input[type="search"] {
  position: absolute; z-index: 3; inset: 0 calc(100% + 4px) auto auto;
  box-sizing: border-box; width: clamp(150px, calc(100vw - 550px), 282px);
  min-height: 44px; margin: 0; padding: 6px 12px; border: 0;
  border-bottom: 1px solid var(--night-accent); border-radius: 0;
  background: var(--night-bg); color: var(--night-text);
  font: 350 16px/1.5 var(--night-font);
}
.night-search input[hidden] { display: none; }
.night-search input::placeholder { color: var(--night-muted); }
.night-search input:focus-visible { outline-offset: 0; }
.night-search button[aria-expanded="true"] { color: var(--night-accent); }
.night-search button[aria-expanded="true"]::after { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .night-search input:not([hidden]) { animation: reveal-search .2s ease-out; }
  @keyframes reveal-search { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
}
@media (max-width: 680px) {
  .night-header { grid-template-columns: minmax(0, 1fr); }
  .night-brand { justify-self: start; }
  .night-nav { justify-content: flex-end; gap: 1px; }
  .night-search { position: absolute; inset: max(8px, env(safe-area-inset-top)) 0 auto auto; }
  .night-search input[type="search"] { width: min(282px, calc(100vw - 2 * var(--night-gutter) - 60px)); }
}
@media (max-width: 520px) {
  .night-header:has(.night-search button[aria-expanded="true"]) .night-brand { visibility: hidden; }
}
