/* Caria Network's own Ufuk (2026-11-29, Efe: the network site looked
   generic; "the old mc.cariacore.com site was really good"). The company
   frame's paper, ink, serif and pixel horizon, with the network's own
   greens: an emerald-black ground under Zelie, and the old Minecraft site's
   ember, night-sea, dawn and dusk skies under the game servers. Loaded only
   on carianetwork.com (`<html data-site="network">`); Core keeps frame.css
   and Games keeps the shared product design. */

@property --sun {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

:root[data-site='network'] {
  --canvas: #faf9f5;
  --band: #f0eee6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule: #74716a;
  --rule-soft: rgba(20, 20, 19, 0.12);
  --on-mark: #1d1c19;
  --ok: #1f6b3a;
  --warn: #7e5200;
  --bad: #94261a;
  --gst: #0c6272;
  --focus: #0c6272;
  --night: #10140f;
  --night-2: #1b201a;
  --on-night: #f2ede4;
  --on-night-2: #b3ada2;
  --earth: #0d0f0c;
  --on-horizon: #f2ede4;
  --on-horizon-2: #bdb6aa;
  /* The game servers' ember, the old site's accent; decoration and fills. */
  --ember: #c2410c;
  --on-ember: #fffaf3;
  --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-display: var(--font-serif);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-site='network'] body {
  background-color: var(--canvas);
}

[data-site='network'] :is(h1, h2, h3, h4, .display, .brand):not(.label, .sans) {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
}

/* Zelie's room on the paper: the same pairs, its emerald accent kept. */
[data-site='network'] .zelie {
  --canvas: #faf9f5;
  --band: #f0eee6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule: #74716a;
  --rule-soft: rgba(20, 20, 19, 0.12);
  --accent: #146c43;
  --on-accent: #ffffff;
  --night: #10140f;
  --night-2: #1b201a;
  --on-night: #f2ede4;
  --on-night-2: #b3ada2;
  --night-rule: rgba(242, 237, 228, 0.14);
  --night-focus: #cbef5e;
  --font-display: var(--font-serif);
}

/* ── horizons ────────────────────────────────────────────────────────── */

/* A page's opening and a small plate in a page share the vertical sky and
   the line; other dark bands stay a quiet night. Default: Zelie's. */
[data-site='network'] :is(.page-horizon, .horizon-figure) {
  --sky: linear-gradient(
    180deg,
    #04060a 0%,
    #0a1522 calc(var(--horizon-at) - 40%),
    #10304a calc(var(--horizon-at) - 24%),
    #1b5866 calc(var(--horizon-at) - 12%),
    #2f8a74 calc(var(--horizon-at) - 5%),
    #7fd3a4 calc(var(--horizon-at) - 0.5%),
    #0f2420 calc(var(--horizon-at) + 4.5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(110, 230, 170, 0.55);
  --horizon-at: 62%;
  --band: rgba(242, 237, 228, 0.1);
  --rule-soft: rgba(242, 237, 228, 0.16);
  background-image:
    radial-gradient(
      160% 48% at 50% calc(var(--horizon-at) + 46%),
      var(--earth) 0 72%,
      transparent 74.5%
    ),
    radial-gradient(70% 9% at 50% var(--horizon-at), var(--glow), transparent 70%),
    var(--sky);
}

[data-site='network'] .horizon:not(.page-horizon, .horizon-figure) {
  --sky: linear-gradient(180deg, #121a15 0%, var(--earth) 100%);
  --glow: rgba(110, 230, 170, 0.16);
  --glow-2: rgba(203, 239, 94, 0.06);
}

/* SMP: the ember dusk over the castle. */
[data-site='network'] :is(.page-horizon, .horizon-figure).horizon-mc {
  --sky: linear-gradient(
    180deg,
    #1c0605 0%,
    #5a1210 calc(var(--horizon-at) - 42%),
    #a8281a calc(var(--horizon-at) - 26%),
    #e0672c calc(var(--horizon-at) - 14%),
    #f3a84a calc(var(--horizon-at) - 6%),
    #f8d070 calc(var(--horizon-at) - 1%),
    #3a1a0e calc(var(--horizon-at) + 5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(255, 205, 110, 0.8);
}

/* Skyblock: night blue to sea green, with stars. */
[data-site='network'] :is(.page-horizon, .horizon-figure).horizon-skyblock {
  --sky: linear-gradient(
    180deg,
    #04070f 0%,
    #0a1c34 calc(var(--horizon-at) - 40%),
    #0f3a4e calc(var(--horizon-at) - 24%),
    #1b6a66 calc(var(--horizon-at) - 12%),
    #3fae8e calc(var(--horizon-at) - 5%),
    #8fe0c0 calc(var(--horizon-at) - 0.5%),
    #0f2420 calc(var(--horizon-at) + 4.5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(120, 235, 190, 0.55);
}

/* Voting: dawn. */
[data-site='network'] :is(.page-horizon, .horizon-figure).horizon-vote {
  --sky: linear-gradient(
    180deg,
    #160f2c 0%,
    #3b2a5e calc(var(--horizon-at) - 42%),
    #85476e calc(var(--horizon-at) - 26%),
    #d8746c calc(var(--horizon-at) - 14%),
    #f3ac76 calc(var(--horizon-at) - 6%),
    #fbd998 calc(var(--horizon-at) - 1%),
    #2a1612 calc(var(--horizon-at) + 5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(255, 205, 150, 0.75);
}

/* The Hub and the servers' front page: a violet dusk. */
[data-site='network'] :is(.page-horizon, .horizon-figure).horizon-hub {
  --sky: linear-gradient(
    180deg,
    #070b16 0%,
    #18234a calc(var(--horizon-at) - 42%),
    #3b3f7a calc(var(--horizon-at) - 26%),
    #7a5a8e calc(var(--horizon-at) - 14%),
    #d08a7a calc(var(--horizon-at) - 6%),
    #f5c48a calc(var(--horizon-at) - 1%),
    #24140f calc(var(--horizon-at) + 5%),
    var(--earth) calc(var(--horizon-at) + 18%)
  );
  --glow: rgba(255, 196, 140, 0.7);
}

/* The printed gradient is the whole sky without scripting; the pixel
   surface replaces the grain after its first paint. */
[data-site='network'] :is(.page-horizon, .horizon-figure)::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 220px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

[data-site='network'] .horizon:has(> .pixel-sky[data-px])::after {
  display: none;
}

[data-site='network'] .horizon > .pixel-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

[data-site='network'] .ufuk-page-horizon {
  --horizon-at: 190px;
  min-height: min(74svh, 680px);
  border-bottom: 0;
}

/* An inner page: the same line, a shorter opening. */
[data-site='network'] .ufuk-page-horizon.ufuk-compact {
  --horizon-at: 150px;
  min-height: 0;
}

/* A small plate inside a page (a game mode, the servers band). */
[data-site='network'] .horizon-figure {
  --horizon-at: 74%;
  height: clamp(150px, 22vw, 220px);
  border-radius: 10px;
}

[data-site='network'] .pressed {
  filter: url('#cc-press');
}

/* Pixel art from the server's own pack, never smoothed. */
[data-site='network'] .pixel {
  image-rendering: pixelated;
}

/* A heading with a hairline running to the edge (the old site's chapters). */
[data-site='network'] .rule-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
[data-site='network'] .rule-head::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--rule-soft);
}

/* ── the bar ─────────────────────────────────────────────────────────── */

html[data-site='network'] .site-bar,
html[data-site='network'][data-scrolled] .site-bar {
  --band: rgba(242, 237, 228, 0.12);
  --rule-soft: rgba(242, 237, 228, 0.16);
  border-bottom: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

[data-site='network'] .bar-pill {
  height: 38px;
  border-color: rgba(242, 237, 228, 0.14);
  background: rgba(18, 21, 17, 0.8);
  font-size: 14.5px;
}

[data-site='network'] .bar-pill:is(:hover, :focus-visible) {
  background: rgba(40, 46, 38, 0.94);
}

[data-site='network'] .bar-pill.is-current {
  border-color: rgba(203, 239, 94, 0.5);
}

[data-site='network'] .bar-pill:has(+ [popover]:popover-open) {
  background: #faf9f5;
  color: #141413;
  border-color: #faf9f5;
}

[data-site='network'] .bar-pill-light {
  background: #f2ede4;
  color: #141413;
  border-color: #f2ede4;
}

[data-site='network'] .bar-pill-light:is(:hover, :focus-visible) {
  background: #fff;
}

[data-site='network'] .bar-icon {
  width: 38px;
}

[data-site='network'] .bar-light {
  --canvas: #faf9f5;
  --band: #f0eee6;
  --ink: #141413;
  --ink-2: #5e5d59;
  --rule-soft: rgba(20, 20, 19, 0.12);
  --focus: #0c6272;
}

[data-site='network'] .bar-panel {
  background: var(--canvas);
  border-color: rgba(20, 20, 19, 0.08);
  box-shadow: 0 24px 60px rgba(10, 8, 6, 0.28);
}

/* The Servers menu has a column per server and the way in under it. */
[data-site='network'] .bar-panel.bar-panel-wide {
  width: min(720px, calc(100vw - 2rem));
}

[data-site='network'] .bar-sheet {
  background: var(--night);
}

[data-site='network'] .bar-big {
  font-weight: 400;
  letter-spacing: -0.015em;
}

[data-site='network'] .logo > span {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

[data-site='network'] footer .logo + p {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* ── the forum and support's dark surface, on the network's night ───── */

[data-site='network'] .forum-dark {
  --canvas: #10140f;
  --band: #1b201a;
  --ink: #f2ede4;
  --ink-2: #b3ada2;
  --rule: #6f6a60;
  --rule-soft: rgba(242, 237, 228, 0.14);
  background-color: #10140f;
  color: #f2ede4;
}

[data-site='network'] .forum-dark .site-doc {
  color: #e9e3d8;
}

[data-site='network'] .forum-dark .site-doc a {
  color: #b9e4c9;
}

[data-site='network'] .forum-dark .site-doc :is(blockquote, code) {
  background-color: #161a15;
  border-color: #2c3229;
}

/* ── the copy chip on a horizon (address of a game server) ─────────── */

[data-site='network'] .mc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(242, 237, 228, 0.22);
  border-radius: 9999px;
  background: rgba(13, 15, 12, 0.72);
  padding: 0.35rem 0.35rem 0.35rem 1.15rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* A phone: the whole address and the button still fit on one line. */
@media (max-width: 420px) {
  [data-site='network'] .mc-chip {
    max-width: 100%;
    gap: 0.5rem;
    padding-left: 0.85rem;
  }
  [data-site='network'] .mc-chip code {
    font-size: 0.8rem;
  }
  [data-site='network'] .mc-chip .mc-chip-copy {
    padding-inline: 0.75rem;
  }
}

[data-site='network'] .mc-chip-copy {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding-inline: 1rem;
  border-radius: 9999px;
  background: #f2ede4;
  color: #141413;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
[data-site='network'] .mc-chip-copy:is(:hover, :focus-visible) {
  background: #ffffff;
}
[data-site='network'] .mc-chip-copy[data-copied] {
  background: var(--mark, #cbef5e);
  color: #1d1c19;
}

/* A mode's live state: a small square lamp, lime when open. */
[data-site='network'] .mc-lamp {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--rule);
}
[data-site='network'] .mc-lamp[data-up] {
  background: var(--mark, #cbef5e);
  box-shadow: 0 0 0 1px rgba(20, 20, 19, 0.35);
}
