@font-face {
  font-family: "Kitoa Display";
  src: url("kitoa-display.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --bg: #fafafa; --surface: #ffffff; --surface-solid: #ffffff; --surface-2: #f0f0ed;
  --surface-hover: #f2f2ee; --text: #191919; --muted: #62625a; --muted-strong: #44443e;
  --line: #d7d7ce; --line-strong: #8c8c82; --accent: #ffd43b; --accent-strong: #9a7100;
  --accent-ink: #191919; --green: #146e45; --blue: #265b94; --amber: #9a7100;
  --warm: #9a7100; --danger: #b12c2c; --red: #b12c2c;
  --page: min(1320px, calc(100% - 80px)); --ease: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171817; --surface: #20221f; --surface-solid: #20221f; --surface-2: #2c2e29;
  --surface-hover: #2c2e29; --text: #f5f5ee; --muted: #b6b8ad; --muted-strong: #d0d2c5;
  --line: #46483f; --line-strong: #969989; --accent-strong: #ffd43b;
  --green: #8bddaa; --blue: #9bbfe7; --amber: #ffd43b; --warm: #ffd43b;
  --danger: #ffaaa3; --red: #ffaaa3;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 4px; }
::selection { background: var(--accent); color: #191919; }
html { scrollbar-color: var(--muted) var(--bg); }
input { caret-color: var(--text); }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.025em; text-wrap: balance; }
h1 { font-family: "Kitoa Display", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif; font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 12px 20px; color: #191919; background: var(--accent); }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; z-index: 50; width: 100%; background: var(--bg); border-bottom: 1px solid var(--line); }
.floating-nav, .nav { display: flex; align-items: center; gap: 28px; min-height: 80px; width: var(--page); margin: auto; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 44px; }
.brand-logo { width: 120px; height: auto; filter: grayscale(1) brightness(.1); }
:root[data-theme="dark"] .brand-logo { filter: grayscale(1) brightness(2.8); }
.brand-mark, .mark { display: none; }
.nav-health { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.nav-health-dot, .sync-dot, .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.nav-health[data-state="error"] { color: var(--danger); }
.nav-health[data-state="error"] .nav-health-dot { background: var(--danger); }
.nav-links { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--accent); color: #191919; }
.theme-toggle { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); color: var(--text); background: transparent; font-size: 13px; }
.theme-toggle svg { width: 16px; height: 16px; }
main, footer { width: var(--page); margin: auto; }
body[data-page="home"] main { max-width: 880px; padding-top: 32px; padding-bottom: 64px; }
.hero { grid-column: 1 / -1; display: grid; grid-template-columns: 1.45fr 1fr; align-items: end; gap: 60px; margin: 32px 0 52px; padding: 42px; color: #191919; background: var(--accent); }
.hero h1 { font-size: clamp(2.8rem, 4.6vw, 4.6rem); line-height: 1.12; margin: 0; font-weight: 700; }
.hero h1 span { display: block; }
.hero-lede { max-width: 38ch; font-size: 15px; line-height: 1.8; color: #3e3514; margin: 0; }
.hero-actions { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.button-link { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; border-bottom: 1px solid #65551c; }
.button-link.primary { padding: 10px 18px; border: 0; background: #191919; color: #fff; }
.button-link:hover { opacity: .8; }
.section { min-width: 0; }
.section-intro { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 20px; border-bottom: 2px solid var(--text); }
.section-intro h1, .section-intro h2 { font-family: inherit; font-size: 26px; margin: 0; }
.section-intro p { font-size: 13px; color: var(--muted); margin: 0; max-width: 28ch; }
.directory-tools { padding: 20px 0; }
.service-search { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line-strong); padding: 0 14px; }
.service-search input { width: 100%; min-width: 0; height: 46px; color: var(--text); background: transparent; border: 0; font-size: 14px; }
.service-search input::placeholder { color: var(--muted); }
.directory-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.filter-button { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); background: transparent; color: var(--muted-strong); font-size: 13px; }
.filter-button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter-button:hover { border-color: var(--text); }
.directory-result { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.services-grid { display: block; border-top: 1px solid var(--line); }
.service-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; align-items: center; gap: 16px; padding: 19px 6px; min-width: 0; border-bottom: 1px solid var(--line); color: var(--text); transition: background .2s ease; }
.service-card[hidden] { display: none; }
.service-card:hover { background: var(--surface-hover); }
.service-top { display: flex; }
.service-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--text); }
.service-icon svg { width: 25px; height: 25px; }
.service-icon img { width: 34px; height: 34px; object-fit: contain; }
.service-icon img.official-on-light { background: #fff; padding: 3px; }
.service-card h3 { font-size: 18px; font-weight: 650; margin: 0; }
.service-description, .frigate-card small { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.service-arrow { color: var(--muted); }
.service-card:hover .service-arrow { color: var(--text); }
.directory-empty { padding: 32px 16px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
[hidden] { display: none !important; }
.system-layout { margin-top: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-kicker { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.panel h3 { font-size: 18px; margin-bottom: 6px; }
.panel-description { font-size: 12px; color: var(--muted); margin: 0; }
.storage-head-actions { display: flex; align-items: center; gap: 10px; }
.sync-state { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.sync-state[data-state="error"] { color: var(--danger); }
.storage-refresh { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); background: transparent; border: 1px solid var(--line); }
.storage-refresh svg { width: 16px; height: 16px; }
.storage-main { padding: 22px 0 18px; }
.usage-copy { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.usage-copy strong { font-size: 40px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.usage-copy span { font-size: 13px; color: var(--muted); }
#capacity-detail { font-size: 13px; color: var(--muted-strong); margin-bottom: 12px; }
.capacity { height: 7px; background: var(--line); overflow: hidden; }
.capacity-bar { display: block; height: 100%; width: 0; background: var(--accent-strong); }
.storage-panel[data-tier="critical"] .capacity-bar { background: var(--danger); }
.capacity-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.cleanup-button, .host-cleanup-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; width: 100%; padding: 10px 16px; margin-top: 18px; border: 1px solid var(--line-strong); color: var(--text); background: var(--surface); font-size: 14px; font-weight: 650; }
.cleanup-button { color: #191919; background: var(--accent); border-color: var(--accent); }
.cleanup-button:hover, .host-cleanup-button:hover { filter: brightness(.95); }
.button-spinner { display: none; }
[aria-busy="true"] .button-icon { display: none; }
[aria-busy="true"] .button-spinner { display: block; animation: spin 1s linear infinite; }
.storage-refresh[aria-busy="true"] svg { animation: spin 1s linear infinite; }
.host-maintenance { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.host-maintenance-title { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.host-maintenance-scope { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 0; }
.host-message, .message, .storage-note { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 10px 0 0; overflow-wrap: anywhere; }
.message:empty { margin: 0; }
[data-state="error"].message, [data-state="error"].host-message, .message.error { color: var(--danger); }
[data-state="success"].message, [data-state="success"].host-message { color: var(--green); }
.storage-stats, .history-grid { display: grid; grid-template-columns: 1fr; }
.stat, .history-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cleanup-history { margin-top: 20px; }
.history-title { font-size: 14px; font-weight: 650; margin-bottom: 12px; }
.loading-value { color: var(--muted); }
footer { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-brand { color: var(--text); font-weight: 650; }
.reveal { opacity: 1; transform: none; }
body:not([data-page="home"]) main { padding: 56px 0 72px; }
.page-heading { padding: 32px; background: var(--accent); color: #191919; }
.page-heading h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.15; }
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; margin-top: 36px; }
.card { padding: 24px 0; border-top: 2px solid var(--text); min-width: 0; }
.status { grid-row: span 2; }
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.card h2 { font-size: 22px; margin-bottom: 8px; }
.sub { color: var(--muted); font-size: 14px; }
.badge { display: flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.dot { background: var(--amber); }
[data-state="protected"] .dot { background: var(--green); }
[data-state="error"] .dot { background: var(--danger); }
.facts { margin-top: 24px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.label { color: var(--muted); font-size: 14px; }
.value { font-weight: 650; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { min-height: 46px; padding: 10px 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.button.primary { background: var(--accent); color: #191919; border-color: var(--accent); }
.button:hover { border-color: var(--text); }
.list { margin: 16px 0 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.list strong { color: var(--text); }
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.story-title { background: var(--accent); padding: 42px; color: #191919; }
.story h1 { font-size: clamp(3.6rem, 6vw, 5.5rem); line-height: 1; margin-bottom: 28px; }
.statement { font-size: 22px; line-height: 1.5; margin: 0; }
.copy { padding: 12px 0; }
.copy p { color: var(--muted-strong); font-size: 18px; line-height: 1.9; max-width: 65ch; }
.copy p + p { margin-top: 28px; }
.copy strong { color: var(--text); font-weight: 650; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.back, .connection b { gap: 8px; }
.back svg, .connection b svg { width: 16px; height: 16px; }
.connection b { display: inline-flex; align-items: center; }
body[data-page="fnos"] main { max-width: 960px; }
.identity { display: flex; gap: 24px; align-items: center; background: var(--accent); padding: 32px; color: #191919; }
.identity img { width: 72px; height: 72px; object-fit: contain; }
.identity h1 { font-size: 38px; line-height: 1.2; margin-bottom: 8px; }
.identity p { margin-bottom: 0; font-size: 15px; }
.connections { margin: 30px 0; }
.connection { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); }
.connection strong { font-size: 22px; }
.connection span, .connection b, .hint { font-size: 14px; color: var(--muted); }
.connection:hover { background: var(--surface-hover); }
.hint { line-height: 1.7; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1000px) {
  :root { --page: calc(100% - 48px); }
  .floating-nav, .nav { gap: 16px; }
  .nav-health { display: none; }
  .hero { gap: 28px; padding: 32px; }
  .section-intro { flex-direction: column; gap: 8px; }
  .section-intro p { max-width: none; }
  .panel-head { flex-wrap: wrap; }
  .story { gap: 32px; }
}
@media (max-width: 700px) {
  :root { --page: calc(100% - 32px); }
  html { scroll-padding-top: 142px; }
  .floating-nav, .nav { flex-wrap: wrap; gap: 0; padding: 12px 0 0; }
  .brand-logo { width: 98px; }
  .theme-toggle { margin-left: auto; font-size: 12px; min-height: 40px; }
  .nav-links { order: 3; width: 100%; margin: 8px 0 0; justify-content: space-between; }
  .nav-links a { font-size: 13px; padding: 8px 12px; }
  body[data-page="home"] main { display: block; }
  .hero { display: block; padding: 28px 24px; margin: 20px 0 32px; }
  .hero h1 { font-size: clamp(2.4rem, 10vw, 3rem); margin-bottom: 22px; }
  .hero-lede { font-size: 14px; }
  .hero-actions { gap: 16px; margin-top: 20px; }
  .button-link { font-size: 13px; }
  .section-intro h1, .section-intro h2 { font-size: 24px; }
  .service-card { padding: 16px 0; gap: 12px; }
  .service-card h3 { font-size: 17px; }
  .panel-head { flex-wrap: nowrap; }
  .sync-state { font-size: 12px; }
  .storage-head-actions { gap: 6px; }
  footer { flex-direction: column; gap: 8px; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  body:not([data-page="home"]) main { padding-top: 28px; }
  .page-heading { padding: 28px 24px; }
  .grid { grid-template-columns: 1fr; gap: 20px; margin-top: 28px; }
  .status { grid-row: auto; }
  .card-top { flex-wrap: wrap; }
  .pause-options { flex-direction: column; }
  .pause-options .button { width: 100%; }
  .story { grid-template-columns: 1fr; gap: 28px; }
  .story-title { padding: 32px 24px; }
  .story h1 { font-size: 3.8rem; }
  .statement { font-size: 20px; }
  .copy p { font-size: 16px; }
  .identity { gap: 16px; padding: 24px; }
  .identity img { width: 52px; height: 52px; }
  .identity h1 { font-size: 28px; }
  .connection { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
