/* ==========================================================================
   Pepino server network - shared design system
   Dark by default (no media query). Light is opt-in: <html data-theme="light">.
   No external fonts or assets. All type effects come from weight/size/tracking.
   ========================================================================== */

:root {
  /* dark is the primary design */
  --bg:        #070c09;
  --surface:   #101a13;
  --surface-2: #16241b;
  --text:      #eaf5ea;
  --text-2:    #93ad9c;
  --border:    #1d2e23;
  --border-2:  #2e4736;

  --accent:    #57d97e;   /* green */
  --punch:     #bcf252;   /* lime, for emphasis only */
  --on-accent: #04140a;

  --ok:      #6ce596;
  --ok-bg:   rgba(60, 200, 110, .14);
  --down:    #ff8f80;
  --down-bg: rgba(255, 80, 60, .15);
  --unk:     #f4d264;
  --unk-bg:  rgba(240, 200, 60, .14);

  --radius: 8px;
  --gutter: 1.1rem;   /* page side gutter, see .wrap */
  color-scheme: dark;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light theme: only when the visitor asks for it (theme.js sets the attribute).
   A light OS setting alone must NOT flip the site - dark is the default. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #eef4ec;
  --surface:   #ffffff;
  --surface-2: #e7f0e5;
  --text:      #0c1710;
  --text-2:    #46604f;
  --border:    #cadfcd;
  --border-2:  #a8c9ae;

  --accent:    #157a3c;
  --punch:     #3c7a12;
  --on-accent: #ffffff;

  --ok:      #10682f;
  --ok-bg:   #d8f0dc;
  --down:    #9c1c12;
  --down-bg: #fbe0dd;
  --unk:     #6c4f08;
  --unk-bg:  #f7eccd;
}

*, *::before, *::after { box-sizing: border-box; }
/* Sticky header must not cover an anchor target (e.g. the skip link -> #main). */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(70rem 34rem at 8% -14%, rgba(87, 217, 126, .13), transparent 72%),
    radial-gradient(46rem 24rem at 100% 0%, rgba(188, 242, 82, .09), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .014) 0 2px, transparent 2px 7px);
  background-repeat: no-repeat, no-repeat, repeat;
  min-height: 100vh;
}

h1, h2 {
  margin: 0 0 .35em;
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.035em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.7rem, 9vw, 5.2rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.02em; }
h1 .accent { color: var(--punch); }

p { margin: 0 0 .8rem; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--punch); }
code, kbd { font-family: var(--mono); }

:focus-visible {
  outline: 3px solid var(--punch);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--punch);
  color: var(--on-accent);
  padding: .55rem 1rem;
  font-weight: 800;
}
.skip-link:focus { left: 0; color: var(--on-accent); }

/* --------------------------------------------------------- layout ------- */

/* Every direct page gutter comes from here. Anything that also sets padding on
   a .wrap element must use padding-top/bottom only, or it wipes the gutter out
   and the content ends up flush against the viewport edge. */
.wrap {
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main { display: block; padding-bottom: 2.5rem; }

/* --------------------------------------------------------- header ------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--punch) 55%, transparent);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.2rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.brand .logo { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand:hover { color: var(--punch); }
.brand .thin { color: var(--text-2); font-weight: 600; letter-spacing: .12em; font-size: .68rem; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  padding: .3rem .55rem;
  border-radius: 4px;
  color: var(--text-2);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--on-accent); background: var(--punch); }

/* Icon only: no border, no background, no text. The padding is the tap target,
   the negative margin keeps the icon optically on the page gutter. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: .5rem;
  margin: -.5rem -.5rem -.5rem 0;
  border: 0;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  line-height: 0;
}
.theme-toggle svg { width: 20px; height: 20px; flex: none; display: block; }
.theme-toggle:hover { color: var(--punch); }
.theme-toggle:focus-visible { outline: 3px solid var(--punch); outline-offset: 3px; border-radius: 3px; }
/* Show the theme you will get: sun while dark is active, moon while light is. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* --------------------------------------------------------- hero --------- */

/* padding-top/bottom only - a `padding` shorthand here would kill the .wrap gutter */
.hero { padding-top: 2.2rem; padding-bottom: 1.4rem; }
.hero > :last-child { margin-bottom: 0; }

.eyebrow {
  display: block;
  margin: 0 0 .55rem;
  padding-left: .6rem;
  border-left: 3px solid var(--punch);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-2);
}
.lede { max-width: 46ch; color: var(--text-2); font-size: 1.02rem; }

/* An eyebrow starts a new block, so it needs air above it - otherwise the gap
   between two steps reads exactly like the gaps inside one step. */
* + .eyebrow { margin-top: 1.9rem; }

.statline {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .9rem;
  margin: 0 0 .55rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.note {
  border-left: 3px solid var(--unk);
  background: var(--unk-bg);
  color: var(--text);
  padding: .5rem .75rem;
  font-size: .9rem;
  margin: 0 0 .8rem;
}
.note[hidden] { display: none; }
/* the <noscript> note is also a .wrap, so it needs the gutter back */
.note.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }

/* --------------------------------------------------------- status ------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .22rem .55rem;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 3px;
}
.pill .dot { width: .55rem; height: .55rem; flex: none; background: currentColor; }

[data-state="online"]  .pill { color: var(--ok);   background: var(--ok-bg);   border-color: var(--ok); }
[data-state="offline"] .pill { color: var(--down); background: var(--down-bg); border-color: var(--down); }
[data-state="unknown"] .pill { color: var(--unk);  background: var(--unk-bg);  border-color: var(--unk); }

/* shape carries the state too, never colour alone */
[data-state="online"]  .pill .dot { border-radius: 50%; }
[data-state="offline"] .pill .dot { background: none; box-shadow: inset 0 0 0 .28rem currentColor; transform: rotate(45deg); }
[data-state="unknown"] .pill .dot { background: none; box-shadow: inset 0 0 0 2px currentColor; border-radius: 50%; }

/* one big glanceable block on each game page */
.big-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.6rem;
  margin: 0 0 .8rem;
  padding: .9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--border-2);
  border-radius: var(--radius);
}
[data-state="online"].big-status  { border-left-color: var(--ok); }
[data-state="offline"].big-status { border-left-color: var(--down); }
[data-state="unknown"].big-status { border-left-color: var(--unk); }
.big-status .pill { font-size: 1rem; padding: .35rem .7rem; }
.big-status .pill .dot { width: .7rem; height: .7rem; }

.count {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
}
.count + .label { margin-left: .4rem; }
.motd { font-family: var(--mono); font-size: .85rem; color: var(--text-2); }

/* --------------------------------------------------------- table -------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table.servers {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}
/* the caption sits inside .table-scroll, so it needs the same inset as the cells */
table.servers caption { text-align: left; padding: .6rem .9rem; color: var(--text-2); font-size: .82rem; }
table.servers th, table.servers td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
table.servers thead th {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--surface-2);
  white-space: nowrap;
  padding-top: .5rem;
  padding-bottom: .5rem;
}
table.servers tbody tr { border-left: 4px solid transparent; }
table.servers tbody tr[data-state="online"]  { border-left-color: var(--ok); }
table.servers tbody tr[data-state="offline"] { border-left-color: var(--down); }
table.servers tbody tr[data-state="unknown"] { border-left-color: var(--unk); }
table.servers tbody tr:last-child th, table.servers tbody tr:last-child td { border-bottom: 0; }
table.servers tbody tr:hover { background: var(--surface-2); }

table.servers tbody th[scope="row"] { font-size: 1.05rem; font-weight: 900; letter-spacing: -.01em; }
table.servers tbody th[scope="row"] a { text-decoration: none; color: var(--text); }
table.servers tbody th[scope="row"] a:hover { color: var(--punch); text-decoration: underline; }
table.servers .game {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-2);
}
table.servers .num { font-family: var(--mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.servers .num.none { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* --------------------------------------------------------- address ----- */

.addr {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-2);
}
.addr code { padding: .3rem .55rem; font-size: .92rem; font-weight: 700; white-space: nowrap; overflow-x: auto; }
.addr .copy {
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .55rem;
  border: 0;
  border-left: 1px solid var(--border-2);
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  white-space: nowrap;
}
.addr .copy:hover { background: var(--punch); }
.addr .copy svg { width: 13px; height: 13px; flex: none; }
.addr--lg code { font-size: clamp(1rem, 3.4vw, 1.35rem); padding: .5rem .8rem; }
.addr--lg .copy { padding: .5rem .9rem; font-size: .8rem; }

/* port caveat, compact. No margin on a leading badge, or it sits off the gutter
   that everything above and below it lines up on. */
.badge {
  display: inline-block;
  padding: .12rem .4rem;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--text-2);
}
* + .badge { margin-left: .3rem; }
.badge--port { color: var(--punch); border-color: var(--punch); }
.hint { font-size: .82rem; color: var(--text-2); }

/* --------------------------------------------------------- buttons ----- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .45rem .8rem;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--on-accent); background: var(--punch); border-color: var(--punch); }

/* --------------------------------------------------------- footer ------ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: .9rem 0 1.6rem;
  color: var(--text-2);
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ------------------------------------------------- pepinocraft theme --- */
/* Same system, blockier: square everything, mono display type. */

body.theme-mc { --radius: 0px; }
body.theme-mc h1, body.theme-mc .brand { font-family: var(--mono); letter-spacing: -.02em; }
body.theme-mc .hero {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(87, 217, 126, .09) 31px 32px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(87, 217, 126, .09) 31px 32px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
body.theme-mc .addr, body.theme-mc .badge, body.theme-mc .btn, body.theme-mc .pill { border-radius: 0; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  /* Nav takes a row of its own; order keeps the toggle up on the brand row
     instead of stranding it alone on a third row of its own. */
  .site-nav { order: 1; width: 100%; margin-left: 0; }
  .theme-toggle { margin-left: auto; }
  .hero { padding-top: 1.4rem; padding-bottom: 1.2rem; }
  /* The address is the point of these pages. When it and the button no longer
     fit side by side, drop the button to its own row rather than leaving the
     port scrolled out of sight inside a 250px window. Short addresses still
     sit inline. */
  .addr--lg { flex-wrap: wrap; }
  .addr--lg .copy { flex: 1 0 auto; justify-content: center; }
  .big-status { gap: .5rem 1.1rem; padding: .8rem .9rem; }
  html { scroll-padding-top: 8.5rem; }   /* nav wraps, header is taller here */
  * + .eyebrow { margin-top: 1.6rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .copy, .btn, .site-nav a, table.servers tbody tr { transition: background-color .12s ease, color .12s ease; }
}
