/* Styled to match serverplus.tw: warm near-black ground, a single orange
   accent (#f26322), hairline rules instead of boxed shadows, near-square
   corners, and uppercase tracked labels. Fonts are the same files the main site
   serves — Outfit for display, JetBrains Mono for data — self-hosted here so the
   page stays entirely first-party. */

@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark light;

  --bg: #0e0c0b;
  --panel: #16120f;
  --panel-2: #1b1614;
  --border: rgb(255 255 255 / 0.12);
  --border-strong: rgb(255 255 255 / 0.2);
  --text: #ffffff;
  --muted: rgb(255 255 255 / 0.66);
  --faint: rgb(255 255 255 / 0.44);

  --accent: #f26322;
  --accent-hover: #ff7d45;
  --accent-soft: rgb(242 99 34 / 0.14);
  --accent-edge: rgb(242 99 34 / 0.32);
  --on-accent: #ffffff;

  --warn-bg: rgb(242 99 34 / 0.1);
  --warn-border: rgb(242 99 34 / 0.35);
  --warn-text: #ffc59a;
  --danger: #ff8a73;
  --ok: #4ade80;

  --radius: 6px;
  --display: "Outfit", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Hiragino Sans",
          Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f3ee;
    --panel: #ffffff;
    --panel-2: #faf8f5;
    --border: #e6e0d7;
    --border-strong: #d6cec2;
    --text: #171717;
    --muted: #525252;
    --faint: #8c857c;

    --accent: #d94b0b;
    --accent-hover: #a93a0b;
    --accent-soft: #fff4ec;
    --accent-edge: #f2c3a3;

    --warn-bg: #fff4ec;
    --warn-border: #f2c3a3;
    --warn-text: #a93a0b;
    --danger: #b3261e;
    --ok: #047857;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover { color: var(--accent-hover); }

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

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.wordmark {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark b {
  color: var(--accent);
  font-weight: 500;
}

.brand-sub {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  border-left: 1px solid var(--border);
  padding-left: 0.75rem;
  white-space: nowrap;
}

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.langs a {
  padding: 0.22rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--muted);
}

.langs a:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.langs a.active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

@media (prefers-color-scheme: light) {
  .langs a.active { color: #fff; }
}

main { max-width: 1080px; margin: 0 auto; }

/* ---------- eyebrow: orange dot, tracked label, rule running to the edge ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}

.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

.hero { padding: 2.75rem 0 2.5rem; }

.hero .eyebrow { max-width: 22rem; }

.hero-ip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.ip {
  font-family: var(--mono);
  font-size: clamp(1.75rem, 6.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  vertical-align: 0.35em;
}

.hero-back { margin: 1rem 0 0; font-size: 0.88rem; }

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

button {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

button:hover { border-color: var(--accent); color: var(--accent); }
button.done { border-color: var(--ok); color: var(--ok); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  /* 400px keeps the four cards to a 2×2 block on a desktop; a third column
     would leave a stranded empty cell. */
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* Cards sit flush against each other, separated by the grid gap showing the
   border colour through — the same hairline-grid look the main site uses. */
.card {
  background: var(--panel);
  padding: 1.35rem 1.5rem 1.5rem;
}

.block {
  margin-top: 1.5rem;
  padding: 1.35rem 1.5rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
}

.card h2,
.block h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h2::before,
.block h2::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex: none;
}

h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}

dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  /* No column gap: the label and value cells each draw their own top border,
     and only touching cells make it read as one rule across the row. */
  gap: 0;
  margin: 0;
}

dt,
dd {
  padding: 0.42rem 0;
  border-top: 1px solid var(--border);
}

dl > dt:first-of-type,
dl > dt:first-of-type + dd { border-top: 0; }

dt {
  padding-right: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

dd {
  margin: 0;
  word-break: break-word;
  font-size: 0.95rem;
}

.muted { color: var(--faint); }
.flag { font-size: 1.15em; }

.iso {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--faint);
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: 0.1em;
}

.tag.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.value-mono { font-family: var(--mono); font-size: 0.88rem; }

.ua {
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--muted);
}

.note {
  margin: 1rem 0 0;
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--faint);
}

/* Introductory note that sits directly under a heading rather than after
   content, so it needs no leading gap. */
.note.lead { margin-top: -0.35rem; margin-bottom: 1rem; }

.note.warn {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--warn-border);
  border-left-width: 3px;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--warn-bg);
  color: var(--warn-text);
}

.error {
  margin: 1rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

/* ---------- lookup form ---------- */

.lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lookup input {
  flex: 1 1 18rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.lookup input::placeholder { color: var(--faint); }
.lookup input:focus { border-color: var(--accent); outline: none; }

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

/* ---------- dual stack ---------- */

.dual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.dual-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel-2);
}

.dual output {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  word-break: break-all;
}

.dual-item:has(output.ok) { border-left-color: var(--accent); }
.dual output.ok { color: var(--text); }
.dual output.fail { color: var(--faint); }

/* ---------- api ---------- */

.api {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.api td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.api tr:first-child td { border-top: 0; }
.api td:first-child { color: var(--muted); white-space: nowrap; }

.api code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  word-break: break-all;
}

.api code::before {
  content: "$ ";
  color: var(--accent);
}

.api code.plain::before { content: ""; }

/* ---------- Server Plus promotion ---------- */

/* The one place on the page that carries the accent as a field rather than a
   detail, so it reads as a message from the operator instead of another data
   card. */
.promo {
  margin-top: 1.5rem;
  padding: 2rem 1.75rem;
  border: 1px solid var(--accent-edge);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 62%),
    var(--panel);
}

.promo .eyebrow { color: var(--accent); }
.promo .eyebrow::after { background: var(--accent-edge); }

.promo-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.promo-body {
  margin: 0;
  max-width: 46rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.promo-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
  margin: 1.5rem 0 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.promo-stats div {
  display: flex;
  flex-direction: column;
  padding-right: 2.5rem;
  border-right: 1px solid var(--border);
}

.promo-stats div:last-child { border-right: 0; padding-right: 0; }

.promo-stats strong {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.promo-stats span { font-size: 0.76rem; color: var(--faint); }

.promo-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0;
}

.btn-primary,
.btn-ghost {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-ghost {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

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

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

footer {
  max-width: 1080px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-brand { margin-bottom: 1rem; }
.footer-brand .wordmark { font-size: 1.15rem; }
.footer-brand .note { margin-top: 0.35rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

.footer-legal {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--faint);
}

@media (max-width: 560px) {
  .promo-stats { gap: 1rem 1.75rem; }
  .promo-stats div { padding-right: 1.75rem; }
}

/* Below this width the two-column definition list stops fitting, so labels sit
   above their values and the hairline moves to the top of each pair. */
@media (max-width: 560px) {
  .api td:first-child { white-space: normal; }
  dl { grid-template-columns: 1fr; gap: 0; }
  dt { padding: 0.5rem 0 0; border-top: 1px solid var(--border); }
  dd { padding: 0 0 0.5rem; border-top: 0; }
  dl > dt:first-of-type { border-top: 0; }
}
