/* YutoGame Network — portal stylesheet
   Industrial / server-rack visual language: graphite panels, hairline rules,
   monospace data, one signal-orange accent, status LEDs. */

:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c0d0b;
    --bg-alt: #111310;
    --panel: #151713;
    --panel-2: #1b1e19;
    --line: #262a23;
    --line-2: #3a3f35;
    --text: #e9e7e1;
    --muted: #a4a69c;
    --dim: #6d7067;
    --accent: #ff6b2c;
    --accent-ink: #160800;
    --accent-soft: rgba(255, 107, 44, 0.12);
    --ok: #5bd67d;
    --warn: #f2b233;
    --down: #ef5a4c;
    --off: #3b3f37;
    --grid: rgba(233, 231, 225, 0.035);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eeece6;
    --bg-alt: #e6e3db;
    --panel: #f7f6f2;
    --panel-2: #ecE9e1;
    --line: #d4d0c5;
    --line-2: #b6b1a4;
    --text: #161713;
    --muted: #4c4f47;
    --dim: #777a70;
    --accent: #d9480f;
    --accent-ink: #fff7f2;
    --accent-soft: rgba(217, 72, 15, 0.1);
    --ok: #1f8a43;
    --warn: #b7791f;
    --down: #c53b30;
    --off: #bdb8ab;
    --grid: rgba(22, 23, 19, 0.05);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 14px 30px rgba(40, 36, 26, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

h1,
h2,
h3,
p,
dl,
dd,
ol,
ul {
    margin: 0;
}

ol,
ul {
    padding: 0;
    list-style: none;
}

code,
.mono {
    font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: -60px;
    left: 16px;
    z-index: 100;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
}

.wrap {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 40px);
}

/* ---------- LED ---------- */

.led {
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--off);
    vertical-align: middle;
}

.led[data-state="ok"] {
    background: var(--ok);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 22%, transparent), 0 0 8px color-mix(in srgb, var(--ok) 60%, transparent);
}

.led[data-state="down"] {
    background: var(--down);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--down) 22%, transparent);
}

.led[data-state="pending"],
.js .led[data-probe]:not([data-state]) {
    background: var(--warn);
    animation: blink 1.1s steps(2, jump-none) infinite;
}

.led[data-state="ext"] {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--dim);
}

@keyframes blink {
    50% { opacity: 0.25; }
}

/* ---------- Status bar ---------- */

.statusbar {
    border-bottom: 1px solid var(--line);
    background: var(--bg-alt);
    color: var(--dim);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11.5px;
    letter-spacing: 0.04em;
}

.statusbar__inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: 30px;
}

.statusbar__host {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--muted);
}

.statusbar b {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.2) blur(10px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 62px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand__plate {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 30px;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    font-family: "Big Shoulders Display", "IBM Plex Mono", sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.brand__plate::before,
.brand__plate::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: var(--line-2);
}

.brand__plate::before { left: 4px; }
.brand__plate::after { right: 4px; }

.brand__text {
    display: grid;
    line-height: 1.1;
}

.brand__text strong {
    font-family: "Big Shoulders Display", sans-serif;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand__text small {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 150ms ease;
}

.main-nav a span {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--text);
}

.main-nav a.is-active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: -12px;
    left: 12px;
    height: 2px;
    background: var(--accent);
}

.main-nav a.is-active span {
    color: var(--accent);
}

.site-header__actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--muted);
    transition: color 150ms ease, border-color 150ms ease;
}

.icon-btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.theme-icon--sun { display: none; }
:root[data-theme="light"] .theme-icon--sun { display: block; }
:root[data-theme="light"] .theme-icon--moon { display: none; }

.menu-toggle {
    display: none;
}

.menu-toggle__bars {
    display: grid;
    gap: 4px;
    width: 16px;
}

.menu-toggle__bars i {
    display: block;
    height: 1.5px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn--primary:hover {
    background: color-mix(in srgb, var(--accent) 86%, var(--text));
}

.btn--ghost {
    border-color: var(--line-2);
    background: transparent;
    color: var(--text);
}

.btn--ghost:hover {
    border-color: var(--text);
}

.btn--sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn:active {
    transform: translateY(1px);
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    border-bottom: 1px solid var(--line);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: -1px -1px;
}

.hero__layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
    padding-block: clamp(48px, 8vw, 96px);
}

.hero__copy {
    grid-column: 1 / -1;
}

.prompt {
    margin-bottom: 22px;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
}

.prompt__path {
    color: var(--ok);
}

.prompt__sign {
    color: var(--dim);
}

.caret {
    display: inline-block;
    width: 8px;
    height: 15px;
    margin-left: 4px;
    background: var(--accent);
    vertical-align: -2px;
    animation: blink 1s steps(2, jump-none) infinite;
}

.hero__title {
    display: grid;
    font-family: "Big Shoulders Display", "Arial Narrow", sans-serif;
    font-size: clamp(4rem, 11.5vw, 9.4rem);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: 0.01em;
}

.hero__title-outline {
    color: transparent;
    -webkit-text-stroke: 1.5px var(--text);
}

@supports not (-webkit-text-stroke: 1px black) {
    .hero__title-outline { color: var(--muted); }
}

.hero__title-outline::after {
    content: "";
    display: inline-block;
    width: 0.16em;
    height: 0.16em;
    margin-left: 0.06em;
    background: var(--accent);
}

.hero__lead {
    max-width: 34em;
    margin-top: 28px;
    color: var(--muted);
    font-size: 16px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.hero__spec {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 560px;
    margin-top: 44px;
    border-top: 1px solid var(--line-2);
}

.hero__spec div {
    padding: 12px 14px 0 0;
}

.hero__spec div + div {
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.hero__spec dt {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
    letter-spacing: 0.1em;
}

.hero__spec dd {
    font-family: "Big Shoulders Display", sans-serif;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
}

/* ---------- Rack ---------- */

.rack {
    position: relative;
    padding: 0 26px 18px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.rack::before,
.rack::after {
    content: "";
    position: absolute;
    top: 46px;
    bottom: 50px;
    width: 8px;
    background-image: radial-gradient(circle at 50% 50%, var(--bg) 1.6px, transparent 2.2px);
    background-size: 8px 13px;
}

.rack::before { left: 9px; }
.rack::after { right: 9px; }

.rack__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-inline: -26px;
    margin-bottom: 14px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line-2);
    background: var(--panel-2);
    font-family: "IBM Plex Mono", monospace;
}

.rack__head h2 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.rack__head span {
    color: var(--dim);
    font-size: 11px;
}

.rack__units {
    display: grid;
    gap: 5px;
}

.unit {
    position: relative;
    display: grid;
    grid-template-columns: 20px 8px minmax(0, 1fr) 64px 42px;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    background: linear-gradient(var(--panel-2), var(--panel));
    text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.unit::before,
.unit::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: var(--line-2);
}

.unit::before { left: 4px; }
.unit::after { right: 4px; }

.unit:hover {
    border-color: var(--accent);
}

.unit:hover .unit__tag {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.unit__no {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
}

.unit__name {
    display: grid;
    min-width: 0;
    line-height: 1.3;
}

.unit__name strong {
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit__name small {
    overflow: hidden;
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unit__vent {
    height: 20px;
    background-image: repeating-linear-gradient(90deg, var(--line-2) 0 2px, transparent 2px 6px);
    opacity: 0.7;
}

.unit__tag {
    padding: 2px 0;
    border: 1px solid var(--line-2);
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.06em;
    transition: background-color 150ms ease, color 150ms ease;
}

.rack__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 11.5px;
}

.rack__legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.rack__legend small {
    flex-basis: 100%;
    color: var(--dim);
    font-size: 11px;
}

/* ---------- Game server status ---------- */

.server-rack__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--muted);
}

.server-rack__refresh {
    flex-shrink: 0;
    padding: 5px 12px;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
}

.server-rack__refresh:hover { border-color: var(--accent); }
.server-rack__refresh:disabled { opacity: 0.5; cursor: wait; }

.server-rack__scroll {
    max-height: 550px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) var(--panel);
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
}

.server-unit {
    grid-template-columns: 20px 8px minmax(0, 1fr) 70px;
    gap: 10px;
    padding-block: 8px;
}

.server-unit .unit__name strong { white-space: normal; overflow-wrap: anywhere; }
.server-unit .unit__name small { font-family: inherit; }
.server-unit__state { font-size: 11px; text-align: right; color: var(--muted); }
.server-unit[data-status="running"] .server-unit__state { color: var(--ok); }
.server-unit[data-status="offline"] .server-unit__state { color: var(--down); }
.server-unit[data-status="starting"] .server-unit__state,
.server-unit[data-status="stopping"] .server-unit__state { color: var(--warn); }
.server-rack__message { padding: 24px 8px; color: var(--muted); font-size: 13px; }

@media (min-width: 901px) {
    .hero__copy {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 32px;
        row-gap: 20px;
    }
    .hero__copy .prompt { grid-column: 1 / -1; margin-bottom: 0; }
    .hero__title { grid-column: 1; grid-row: 2 / 5; font-size: clamp(4rem, 8vw, 7rem); }
    .hero__lead, .hero__actions, .hero__spec { grid-column: 2; margin-top: 0; }
}

@media (min-width: 761px) {
    .rack .unit__vent { display: none; }
    .rack .unit:not(.server-unit) { grid-template-columns: 20px 8px minmax(0, 1fr) 42px; }
}

@media (min-width: 1200px) {
    .hero__layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(64px, 9vw, 112px);
    border-bottom: 1px solid var(--line);
}

.section--alt {
    background: var(--bg-alt);
}

.section__head {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 32px;
    row-gap: 10px;
    align-items: baseline;
    margin-bottom: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--line-2);
}

.section__index {
    grid-row: span 2;
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.section__head h2 {
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.section__note {
    grid-column: 2;
    color: var(--muted);
}

.section__head--tight {
    grid-template-columns: 1fr;
    margin-bottom: 22px;
}

.section__head--tight .section__index {
    grid-row: auto;
}

/* ---------- Toolbar ---------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
}

.cmd {
    display: flex;
    flex: 1 1 320px;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--line-2);
    background: var(--panel);
    font-family: "IBM Plex Mono", monospace;
    font-size: 14px;
    transition: border-color 150ms ease;
}

.cmd:focus-within {
    border-color: var(--accent);
}

.cmd__prompt {
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 0 14px;
    border-right: 1px solid var(--line);
    color: var(--accent);
    font-size: 13px;
    white-space: nowrap;
}

.cmd input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
}

.cmd input::placeholder {
    color: var(--dim);
}

.cmd input::-webkit-search-cancel-button {
    display: none;
}

.cmd__clear {
    margin-right: 8px;
    padding: 3px 8px;
    border: 1px solid var(--line-2);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 11px;
}

.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    border: 1px solid var(--line-2);
    background: var(--line);
}

.seg__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 15px;
    border: 0;
    background: var(--panel);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color 150ms ease, color 150ms ease;
}

.seg__btn b {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 500;
}

.seg__btn:hover {
    color: var(--text);
}

.seg__btn.is-active {
    background: var(--text);
    color: var(--bg);
}

.seg__btn.is-active b {
    color: var(--bg);
    opacity: 0.6;
}

.result-line {
    margin: 22px 0 12px;
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
}

.result-line::before {
    content: "» ";
    color: var(--accent);
}

/* ---------- Service grid ---------- */

.svc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line-2);
    border-left: 1px solid var(--line-2);
}

.svc {
    position: relative;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line-2);
    border-bottom: 1px solid var(--line-2);
    background: var(--panel);
    transition: background-color 180ms ease;
}

.svc.is-filtered-out {
    display: none;
}

.svc:hover {
    background: var(--panel-2);
}

.svc__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: #07080a;
}

.svc__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease, filter 300ms ease;
    filter: saturate(0.92);
}

.svc:hover .svc__media img {
    transform: scale(1.03);
    filter: saturate(1.05);
}

.svc__media--logo {
    display: grid;
    place-items: center;
    background: #050505;
}

.svc__media--logo img {
    width: 62%;
    height: auto;
    object-fit: contain;
}

.svc__media--plate {
    display: grid;
    place-items: center;
    background-color: #101210;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 22px 22px;
    color: #e9e7e1;
}

.plate {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 18px 28px;
    border: 1px solid rgba(233, 231, 225, 0.28);
    background: rgba(12, 13, 11, 0.85);
}

.plate b {
    font-family: "Big Shoulders Display", sans-serif;
    font-size: clamp(2.2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: 0.1em;
}

.plate small {
    color: #8d9086;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.bays {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: 100%;
    margin-top: 6px;
}

.bays i {
    height: 10px;
    border: 1px solid rgba(233, 231, 225, 0.25);
    background: repeating-linear-gradient(90deg, rgba(233, 231, 225, 0.2) 0 1px, transparent 1px 4px);
}

.svc__cat {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    background: rgba(8, 9, 7, 0.82);
    color: #e9e7e1;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.svc__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 18px 20px 16px;
}

.svc__host {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svc h3 {
    margin-top: 8px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
}

.svc__link {
    text-decoration: none;
}

.svc__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.svc__link:focus-visible {
    outline: none;
}

.svc:has(.svc__link:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.svc__desc {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.75;
}

.svc__spec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
}

.svc__spec div {
    min-width: 0;
    padding-top: 8px;
    border-top: 1px dashed var(--line-2);
}

.svc__spec dt {
    color: var(--dim);
    font-size: 11px;
}

.svc__spec dd {
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svc__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    transition: background-color 180ms ease, color 180ms ease;
}

.svc__arrow {
    font-family: "IBM Plex Mono", monospace;
    transition: transform 180ms ease;
}

.svc:hover .svc__foot {
    background: var(--accent);
    color: var(--accent-ink);
}

.svc:hover .svc__arrow {
    transform: translateX(4px);
}

.empty {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 40px;
    border: 1px dashed var(--line-2);
}

.empty[hidden] {
    display: none;
}

.empty__code {
    color: var(--accent);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
}

.empty h3 {
    font-size: 20px;
}

.empty p {
    color: var(--muted);
}

.empty .btn {
    margin-top: 10px;
}

/* ---------- Storage ---------- */

.storage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 88px);
    align-items: start;
}

.storage__lead {
    max-width: 32em;
    color: var(--muted);
    font-size: 15.5px;
}

.checklist {
    display: grid;
    margin: 28px 0 32px;
    border-top: 1px solid var(--line);
}

.checklist li {
    display: grid;
    grid-template-columns: 24px 1fr;
    column-gap: 10px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.checklist li::before {
    content: "[✓]";
    grid-row: span 2;
    color: var(--ok);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    line-height: 1.9;
}

.checklist strong {
    font-size: 14.5px;
}

.checklist span {
    color: var(--dim);
    font-size: 13px;
}

.nas {
    border: 1px solid var(--line-2);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.nas__front {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: stretch;
    padding: 18px;
    border-bottom: 1px solid var(--line-2);
    background: #121411;
    color: #e9e7e1;
}

.nas__bays {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.nas__bays span {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 30px;
    min-height: 118px;
    padding: 10px 9px;
    border: 1px solid #3a3f35;
    background:
        repeating-linear-gradient(180deg, transparent 0 5px, rgba(233, 231, 225, 0.07) 5px 6px),
        #191c17;
    color: #8d9086;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
}

.nas__bays .led {
    background: #3b3f37;
}

.nas__badge {
    display: grid;
    align-content: end;
    justify-items: end;
    padding-left: 18px;
    border-left: 1px solid #3a3f35;
    text-align: right;
}

.nas__badge b {
    font-family: "Big Shoulders Display", sans-serif;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.06em;
}

.nas__badge small {
    color: #8d9086;
    font-family: "IBM Plex Mono", monospace;
    font-size: 10.5px;
}

.nas__spec {
    display: grid;
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
}

.nas__spec div {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
}

.nas__spec dt {
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 0.1em;
    line-height: 1.9;
}

.nas__spec dd {
    display: flex;
    align-items: center;
    gap: 9px;
}

.nas__note {
    padding: 14px 18px 18px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.75;
}

/* ---------- Community panels ---------- */

.panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-2);
    background: var(--panel);
}

.panel__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-2);
    background: var(--panel-2);
}

.panel__dots {
    display: inline-flex;
    gap: 5px;
}

.panel__dots i {
    width: 8px;
    height: 8px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
}

.panel__bar h3 {
    font-size: 14px;
    font-weight: 700;
}

.panel__src {
    margin-left: auto;
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    white-space: nowrap;
}

.panel__body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.panel__body > p {
    color: var(--muted);
    font-size: 13.5px;
}

.embed {
    overflow: hidden;
    border: 1px solid var(--line);
    background: #000;
}

.embed iframe {
    display: block;
    width: 100%;
    height: 440px;
    border: 0;
}

.embed--compact iframe {
    height: 390px;
}

.panel--fill .panel__body {
    flex: 1;
    grid-template-rows: auto minmax(440px, 1fr);
}

.panel--fill .embed iframe {
    height: 100%;
}

.code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--line-2);
}

.code-row small {
    display: block;
    color: var(--dim);
    font-size: 11px;
}

.code-row code {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    word-break: break-all;
}

.text-link {
    justify-self: start;
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 700;
    text-underline-offset: 4px;
}

.fineprint {
    color: var(--dim);
    font-size: 11.5px;
    line-height: 1.7;
}

/* ---------- Restricted ---------- */

.section--restricted .section__index {
    color: var(--warn);
}

.locker {
    border: 1px solid var(--line-2);
    background: var(--panel);
}

.locker summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 18px 20px;
    cursor: pointer;
    list-style: none;
}

.locker summary::-webkit-details-marker {
    display: none;
}

.locker summary::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 5px;
    background: repeating-linear-gradient(-45deg, var(--warn) 0 8px, var(--bg) 8px 16px);
}

.locker__label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.locker__label svg {
    width: 18px;
    height: 18px;
    color: var(--warn);
}

.locker__count {
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    letter-spacing: 0.08em;
}

.locker__count::after {
    content: " +";
    color: var(--muted);
}

.locker[open] .locker__count::after {
    content: " −";
}

.locker__list {
    border-top: 1px solid var(--line-2);
}

.locker__list a {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: background-color 150ms ease;
}

.locker__list li:last-child a {
    border-bottom: 0;
}

.locker__list a:hover {
    background: var(--panel-2);
}

.locker__list code {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.locker__list span {
    display: grid;
    line-height: 1.5;
}

.locker__list strong {
    font-size: 14.5px;
}

.locker__list small {
    color: var(--dim);
    font-size: 12.5px;
}

.locker__list em {
    padding: 2px 9px;
    border: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 11.5px;
    font-style: normal;
    white-space: nowrap;
}

.locker__list em.is-warn {
    border-color: color-mix(in srgb, var(--warn) 55%, transparent);
    color: var(--warn);
}

/* ---------- Ad slot ---------- */

.ad-slot {
    padding-block: 32px;
}

.ad-slot:empty,
.ad-slot > div:empty {
    padding: 0;
}

/* AdSense: kept apart from buttons and links, never fixed or overlaid. */
.ad-unit {
    margin-block: 48px;
    padding-block: 16px;
    border-block: 1px solid var(--line);
}

.ad-unit[hidden],
.ad-unit:has(ins[data-ad-status="unfilled"]) {
    display: none;
}

.ad-unit__label {
    margin: 0 0 8px;
    color: var(--dim);
    font-size: 11.5px;
    letter-spacing: 0.08em;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--bg-alt);
    color: var(--muted);
    font-size: 13.5px;
}

.site-footer__main {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 40px;
    padding-block: 52px 40px;
}

.site-footer__brand p {
    max-width: 28em;
    margin-top: 16px;
    color: var(--dim);
}

.site-footer__brand .brand {
    color: var(--text);
}

.site-footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.site-footer__links div {
    display: grid;
    align-content: start;
    gap: 8px;
}

.site-footer__links strong {
    margin-bottom: 4px;
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.site-footer__links a,
.site-footer__bottom a {
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__bottom a:hover {
    color: var(--accent);
}

.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-block: 18px;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
}

/* ---------- Floating UI ---------- */

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line-2);
    background: var(--panel);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease, border-color 150ms ease;
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.back-to-top:hover {
    border-color: var(--accent);
}

.back-to-top svg {
    width: 18px;
    height: 18px;
}

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    z-index: 60;
    padding: 10px 16px;
    border: 1px solid var(--line-2);
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */

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

}

@media (max-width: 760px) {
    .hero__layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: grid;
    }

    .main-nav {
        position: fixed;
        top: 62px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 39;
        display: grid;
        align-content: start;
        gap: 0;
        margin: 0;
        padding: 12px clamp(16px, 4vw, 40px) 40px;
        background: var(--bg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
    }

    .main-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity 180ms ease, transform 180ms ease;
    }

    .main-nav a {
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
        font-size: 17px;
    }

    .main-nav a.is-active::after {
        display: none;
    }

    .site-header__actions {
        margin-left: auto;
    }

    .section__head {
        grid-template-columns: 1fr;
    }

    .section__index {
        grid-row: auto;
    }

    .section__note {
        grid-column: 1;
    }

    .storage,
    .panels,
    .site-footer__main {
        grid-template-columns: 1fr;
    }

    .locker__list a {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .locker__list code {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14.5px;
    }

    .statusbar__item--wide {
        display: none;
    }

    .statusbar__inner {
        gap: 14px;
    }

    .brand__text small {
        display: none;
    }

    .svc-grid {
        grid-template-columns: 1fr;
    }

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

    .hero__spec div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .hero__spec div:nth-child(n + 3) {
        margin-top: 10px;
        border-top: 1px solid var(--line);
    }

    .rack {
        padding-inline: 20px;
    }

    .rack__head {
        margin-inline: -20px;
    }

    .unit {
        grid-template-columns: 8px minmax(0, 1fr) 40px;
        gap: 10px;
    }

    .server-unit { grid-template-columns: 8px minmax(0, 1fr) 70px; }

    .unit__no,
    .unit__vent {
        display: none;
    }

    .seg {
        width: 100%;
    }

    .seg__btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0 10px;
    }

    .nas__bays span {
        min-height: 90px;
    }

    .nas__spec div {
        grid-template-columns: 96px 1fr;
    }

    .embed iframe {
        height: 400px;
    }

    .site-footer__bottom {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
