/* pelto.se start page: warm paper and ink, Bricolage Grotesque, one vermilion accent.
   Deliberately independent of the Minecraft design (style.css); shares no tokens or classes. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --paper: #f2ede3;
  --ink: #1d1b17;
  --soft: #5e594f;
  --faint: #8c8577;
  --rule: #d6cebf;
  --hover: #e9e2d4;
  --accent: #b03c17;
  --online: #25773f;
  --offline: #b23a2a;
  --gold: #8a5d0b;
  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #161512;
    --ink: #ece6da;
    --soft: #aaa293;
    --faint: #7d7668;
    --rule: #34302a;
    --hover: #211f1b;
    --accent: #ef7148;
    --online: #6cc488;
    --offline: #f08a78;
    --gold: #e3b552;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.55;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: var(--accent); color: var(--paper); }
html { scrollbar-color: var(--rule) var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 10; transform: translateY(-200%); background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.frame { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }

/* ---------- top line ---------- */
.topline {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 22px 0 18px; border-bottom: 1px solid var(--ink);
  font-size: .8125rem; color: var(--soft); letter-spacing: .01em;
}
.topline strong { color: var(--ink); font-weight: 600; }
/* Space for "00:00" is kept before hub.js fills the clock, so the top line never shifts. */
.clock { display: inline-block; min-width: 5ch; text-align: right; font-variant-numeric: tabular-nums; }
.clock:empty { visibility: hidden; }

/* ---------- masthead ---------- */
.masthead { padding: clamp(36px, 7vw, 80px) 0 clamp(32px, 5vw, 56px); }
.wordmark {
  margin: 0; font-weight: 700; font-variation-settings: "opsz" 96;
  font-size: clamp(4.25rem, 18vw, 10rem); line-height: .8; letter-spacing: -.04em;
  margin-left: -.05em;
}
.wordmark span { color: var(--accent); }
.lead { max-width: 30ch; margin: clamp(24px, 4vw, 44px) 0 0; font-size: clamp(1.125rem, 2.2vw, 1.375rem); line-height: 1.4; color: var(--soft); }

/* ---------- index ---------- */
.index { position: relative; list-style: none; margin: 0; padding: 0; }
.index::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--ink); transform-origin: left center; }
.entry {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: start;
  padding: 28px 0 32px; border-bottom: 1px solid var(--rule);
}
.entry h3 { margin: 0; font-weight: 600; font-variation-settings: "opsz" 72; font-size: clamp(2.25rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
.entry h3 a { text-decoration: none; }
/* The title link covers the whole row; controls inside sit above it. */
.entry h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.entry p { margin: 10px 0 0; max-width: 46ch; color: var(--soft); }
.entry-arrow { width: 28px; height: 28px; margin-top: .6rem; color: var(--soft); stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 18px; font-size: .875rem; color: var(--soft); }
.address { font-family: var(--mono); font-size: .9375rem; color: var(--ink); }
.copy {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 12px; padding: 4px 4px 4px 18px;
  border: 1px solid var(--faint); border-radius: 999px; background: var(--paper); cursor: pointer;
}
.copy code { font-family: var(--mono); font-size: 1rem; color: var(--ink); }
/* Shared with the Minecraft page's copy button: filled pill, copy icon, green with a check once copied. */
.copy > span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: .875rem; font-weight: 600; }
.copy svg { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.copy-check, .copy.copied .copy-icon { display: none; }
.copy.copied .copy-check { display: block; stroke-width: 2.25; }
.copy.copied > span { background: var(--online); }
.status { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: .9375rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status[data-state="online"]::before { background: var(--online); }
.status[data-state="offline"]::before { background: var(--offline); }
.copy-note { flex-basis: 100%; margin: 0; font-size: .8125rem; color: var(--soft); }
.copy-note:empty { display: none; }

/* ---------- drift ---------- */
.drift { margin-top: clamp(40px, 6vw, 64px); font-size: .8125rem; color: var(--soft); }
.drift-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.drift-head h2 { margin: 0; font-weight: 600; font-size: 1rem; letter-spacing: -.01em; color: var(--ink); }
.drift-summary, .service-name { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.drift-summary { color: var(--ink); }
.drift-summary::before, .service-name::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.drift-summary[data-state="up"]::before, .service-name[data-state="up"]::before { background: var(--online); }
.drift-summary[data-state="down"]::before, .service-name[data-state="down"]::before { background: var(--offline); }
.drift-summary[data-state="maintenance"]::before, .service-name[data-state="maintenance"]::before { background: var(--gold); }
/* The skeleton in index.html and these reserved lines keep the section the same height once data arrives. */
.drift-vds { margin: 8px 0 2px; min-height: 1.55em; font-variant-numeric: tabular-nums; }
.services { list-style: none; margin: 0; padding: 0; }
.service { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 3.5rem; gap: 12px; align-items: center; padding: 5px 0; }
.service-name { color: var(--ink); }
.service-pct { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.days { display: flex; gap: 1px; height: 10px; list-style: none; margin: 0; padding: 0; }
.days li { flex: 1 1 0; min-width: 0; border-radius: 1px; background: var(--rule); }
.days li[data-level="full"] { background: var(--online); }
.days li[data-level="partial"] { background: var(--gold); }
.days li[data-level="low"] { background: var(--offline); }
.drift-note { margin: 6px 0 0; min-height: 1.55em; color: var(--soft); }

/* ---------- visits (GoatCounter totals from /api/visitors) ---------- */
/* Bars are full height and scaled with transform, so filling them never moves anything. */
.visits-total { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.visits-line { margin: 8px 0 0; min-height: 1.55em; font-variant-numeric: tabular-nums; }
.visits-chart { display: flex; gap: 2px; height: 48px; margin: 8px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.visits-chart li { flex: 1 1 0; min-width: 0; border-radius: 1px 1px 0 0; background: var(--faint); transform-origin: bottom; transform: scaleY(var(--v, 0)); }
.visits-chart li.today { background: var(--accent); }
.visits-axis { display: flex; justify-content: space-between; margin: 4px 0 0; font-size: .75rem; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
main.frame { padding-bottom: 96px; }
.footer {
  margin-top: auto; padding: 6px 0 28px; border-top: 1px solid var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 4px 24px; flex-wrap: wrap;
  font-size: .875rem; color: var(--soft);
}
.footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

@media (hover: hover) {
  .entry:hover { background: linear-gradient(var(--hover), var(--hover)) no-repeat center / calc(100% + 32px) 100%; }
  .entry:hover .entry-arrow { color: var(--accent); transform: translate(5px, -5px); }
  .entry:hover h3 a { color: var(--accent); }
  .copy:hover { border-color: var(--ink); }
  .copy:hover:not(.copied) > span { background: var(--accent); }
  .footer a:hover { color: var(--ink); }
}
.copy:active { transform: scale(.97); }


@media (max-width: 640px) {
  .frame { width: calc(100% - 32px); }
  .entry { padding: 24px 0 28px; gap: 4px 16px; }
  .entry-arrow { margin-top: .45rem; width: 24px; height: 24px; }
  .service { grid-template-columns: 4.75rem minmax(0, 1fr) 3.25rem; gap: 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  .entry-arrow, .entry h3 a, .copy { transition: transform .2s var(--ease-out), color .15s ease, border-color .15s ease; }
  /* Load: the wordmark sharpens into place, the line follows, the rule draws across and the entry lifts in. */
  .masthead .wordmark { animation: focus-in .9s var(--ease-out) both; }
  .masthead .lead { animation: lift .6s var(--ease-out) .25s both; }
  .index::before { animation: draw 1s var(--ease-out) .35s both; }
  .entry { animation: lift .6s var(--ease-out) .5s both; }
  @keyframes focus-in { from { opacity: 0; transform: translateY(.18em); filter: blur(12px); } }
  @keyframes lift { from { opacity: 0; transform: translateY(16px); } }
  @keyframes draw { from { transform: scaleX(0); } }
  .drift { animation: lift .6s var(--ease-out) .65s both; }
  .visits { animation-delay: .75s; }
  .visits-chart li { transition: transform .6s var(--ease-out); transition-delay: calc(var(--i, 0) * 12ms); }
  .days li { transition: background-color .3s ease; }
  /* Bars grow in once the section has lifted in; hub.js sets --i per bar. */
  .days li { animation: grow .5s var(--ease-out) calc(.65s + var(--i, 0) * 8ms) both; }
  @keyframes grow { from { transform: scaleY(.2); opacity: 0; } }
  .copy > span { transition: background-color .2s ease; }
  .copy.copied .copy-check { animation: pop .3s var(--ease-out); }
  @keyframes pop { from { transform: scale(.4); opacity: 0; } }
  /* A slow ring from the dot while the server is online: the status is live, not static. */
  .status[data-state="online"]::before { animation: pulse 3s cubic-bezier(0, 0, .2, 1) infinite; }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 45%, transparent); }
    55%, 100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--online) 0%, transparent); }
  }
}
