/* Nox Cultris: the one stylesheet for both pages (front page and guide). The look is "Moonlit Order": ink night,
   moon-silver text, pewter hairlines, gold as the only accent. All motion is transform or opacity. */

@font-face {
  font-family: "IM Fell English SC";
  src: url("/fonts/fell-sc.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg:          #06080c;                  /* ink black-blue */
  --text:        #cfd3db;                  /* moon-silver: headings, values */
  --text-2:      #a9afbb;                  /* body text */
  --dim:         #737b8a;                  /* labels */
  --line:        rgba(150, 162, 182, .34); /* pewter hairlines */
  --line-soft:   rgba(150, 162, 182, .16);
  --accent:      #c9a24c;                  /* gold, the one accent */
  --accent-text: #d8b45e;
  --ink:         #0a0b0f;                  /* text on gold */
  --hl-bg:       rgba(201, 162, 76, .07);
  --hl-fill:     rgba(201, 162, 76, .06);
  --hl-fill-on:  rgba(201, 162, 76, .22);
  --display: "IM Fell English SC", "Times New Roman", serif;
  --body:    "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a { color: inherit; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

/* ---------- the night: moonlight above the seal and a vignette, then stars and mist, all on fixed layers ---------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 30%, rgba(80, 110, 160, .16), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, .7) 100%);
}
.layer { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

/* stars: two layers of box-shadow dots, twinkling out of step */
.stars {
  position: absolute; top: 0; left: 0;
  width: 1px; height: 1px;
  border-radius: 50%;
  animation: twinkle 7s ease-in-out infinite;
  box-shadow:
    14.2vw 59.5vh 0 .5px rgba(214, 220, 235, 0.77),
    12.6vw 53.5vh 0 1px rgba(214, 220, 235, 0.61),
    78.3vw 7.5vh 0 1px rgba(214, 220, 235, 0.37),
    43.4vw 53.6vh 0 1px rgba(214, 220, 235, 0.35),
    27.1vw 56.3vh 0 0px rgba(214, 220, 235, 0.68),
    89.3vw 3.1vh 0 0px rgba(214, 220, 235, 0.36),
    93.0vw 27.3vh 0 1px rgba(214, 220, 235, 0.47),
    72.1vw 37.4vh 0 1px rgba(214, 220, 235, 0.77),
    55.2vw 24.9vh 0 1px rgba(214, 220, 235, 0.72),
    94.3vw 64.9vh 0 0px rgba(214, 220, 235, 0.58),
    19.2vw 69.5vh 0 0px rgba(214, 220, 235, 0.82),
    73.8vw 62.8vh 0 1px rgba(214, 220, 235, 0.89),
    50.8vw 63.8vh 0 .5px rgba(214, 220, 235, 0.45),
    58.6vw 61.9vh 0 1px rgba(214, 220, 235, 0.82),
    58.7vw 3.4vh 0 1px rgba(214, 220, 235, 0.48),
    41.6vw 12.9vh 0 .5px rgba(214, 220, 235, 0.65),
    9.5vw 46.8vh 0 .5px rgba(214, 220, 235, 0.41),
    52.1vw 28.1vh 0 0px rgba(214, 220, 235, 0.62),
    47.0vw 22.3vh 0 1px rgba(214, 220, 235, 0.82),
    64.4vw 12.6vh 0 0px rgba(214, 220, 235, 0.47),
    76.5vw 38.2vh 0 .5px rgba(214, 220, 235, 0.82),
    40.6vw 24.7vh 0 .5px rgba(214, 220, 235, 0.82),
    46.0vw 19.6vh 0 0px rgba(214, 220, 235, 0.65),
    38.6vw 60.1vh 0 .5px rgba(214, 220, 235, 0.88),
    51.8vw 39.7vh 0 0px rgba(214, 220, 235, 0.58),
    48.1vw 26.2vh 0 1px rgba(214, 220, 235, 0.65),
    48.5vw 25.6vh 0 .5px rgba(214, 220, 235, 0.54),
    45.9vw 2.9vh 0 .5px rgba(214, 220, 235, 0.48),
    55.0vw 13.5vh 0 .5px rgba(214, 220, 235, 0.40),
    4.2vw 66.1vh 0 0px rgba(214, 220, 235, 0.39),
    45.4vw 53.0vh 0 .5px rgba(214, 220, 235, 0.50),
    11.7vw 44.1vh 0 0px rgba(214, 220, 235, 0.54),
    17.4vw 18.6vh 0 .5px rgba(214, 220, 235, 0.87),
    64.5vw 21.3vh 0 1px rgba(214, 220, 235, 0.74),
    47.4vw 2.6vh 0 1px rgba(214, 220, 235, 0.56),
    79.0vw 18.8vh 0 .5px rgba(214, 220, 235, 0.49),
    95.6vw 30.8vh 0 .5px rgba(214, 220, 235, 0.89),
    2.8vw 11.1vh 0 .5px rgba(214, 220, 235, 0.75),
    44.7vw 35.9vh 0 .5px rgba(214, 220, 235, 0.58),
    96.7vw 44.5vh 0 1px rgba(214, 220, 235, 0.73),
    22.9vw 45.7vh 0 .5px rgba(214, 220, 235, 0.57),
    65.7vw 30.4vh 0 .5px rgba(214, 220, 235, 0.76),
    95.9vw 61.4vh 0 0px rgba(214, 220, 235, 0.52),
    31.4vw 65.8vh 0 1px rgba(214, 220, 235, 0.76),
    56.4vw 10.0vh 0 0px rgba(214, 220, 235, 0.66),
    58.9vw 16.0vh 0 1px rgba(214, 220, 235, 0.85);
}
.stars.late {
  animation-duration: 11s;
  animation-delay: -4s;
  box-shadow:
    94.7vw 66.4vh 0 0px rgba(214, 220, 235, 0.38),
    36.4vw 12.7vh 0 .5px rgba(214, 220, 235, 0.79),
    25.7vw 15.6vh 0 .5px rgba(214, 220, 235, 0.37),
    99.0vw 45.1vh 0 .5px rgba(214, 220, 235, 0.79),
    54.3vw 31.7vh 0 0px rgba(214, 220, 235, 0.50),
    86.4vw 26.1vh 0 1px rgba(214, 220, 235, 0.86),
    42.5vw 62.0vh 0 .5px rgba(214, 220, 235, 0.44),
    24.1vw 2.6vh 0 .5px rgba(214, 220, 235, 0.53),
    51.0vw 25.8vh 0 .5px rgba(214, 220, 235, 0.63),
    98.5vw 31.7vh 0 .5px rgba(214, 220, 235, 0.58),
    78.4vw 25.4vh 0 1px rgba(214, 220, 235, 0.89),
    16.8vw 53.0vh 0 1px rgba(214, 220, 235, 0.74),
    65.2vw 18.2vh 0 1px rgba(214, 220, 235, 0.50),
    50.1vw 58.4vh 0 1px rgba(214, 220, 235, 0.54),
    89.2vw 32.8vh 0 1px rgba(214, 220, 235, 0.66),
    48.7vw 16.3vh 0 .5px rgba(214, 220, 235, 0.53),
    86.9vw 43.5vh 0 1px rgba(214, 220, 235, 0.78),
    31.3vw 67.1vh 0 1px rgba(214, 220, 235, 0.74),
    31.6vw 15.3vh 0 0px rgba(214, 220, 235, 0.63),
    77.9vw 24.6vh 0 .5px rgba(214, 220, 235, 0.35),
    98.7vw 8.3vh 0 0px rgba(214, 220, 235, 0.67),
    27.8vw 16.6vh 0 0px rgba(214, 220, 235, 0.83),
    74.9vw 10.4vh 0 .5px rgba(214, 220, 235, 0.50),
    93.5vw 5.2vh 0 0px rgba(214, 220, 235, 0.84),
    6.6vw 25.9vh 0 0px rgba(214, 220, 235, 0.49),
    9.1vw 66.9vh 0 0px rgba(214, 220, 235, 0.36),
    37.6vw 9.8vh 0 .5px rgba(214, 220, 235, 0.86),
    52.3vw 1.1vh 0 .5px rgba(214, 220, 235, 0.67),
    15.8vw 3.5vh 0 0px rgba(214, 220, 235, 0.54),
    29.0vw 34.7vh 0 0px rgba(214, 220, 235, 0.52),
    89.4vw 53.1vh 0 .5px rgba(214, 220, 235, 0.82),
    47.3vw 16.6vh 0 .5px rgba(214, 220, 235, 0.71),
    83.2vw 2.7vh 0 .5px rgba(214, 220, 235, 0.78),
    51.8vw 54.9vh 0 .5px rgba(214, 220, 235, 0.62);
}
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* mist along the bottom */
.mist { top: auto; height: 42vh; }
.mist i {
  position: absolute; bottom: -10vh; left: -50%;
  width: 200%; height: 100%;
  background:
    radial-gradient(ellipse 22% 40% at 20% 70%, rgba(120, 136, 165, .11), transparent 70%),
    radial-gradient(ellipse 26% 45% at 55% 80%, rgba(120, 136, 165, .09), transparent 70%),
    radial-gradient(ellipse 20% 38% at 85% 72%, rgba(120, 136, 165, .10), transparent 70%);
  animation: drift 70s ease-in-out infinite alternate;
}
.mist i + i { bottom: -18vh; opacity: .8; animation-duration: 95s; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translateX(25%); } }

/* ---------- the astrolabe round the seal: ticks turning one way, the inscription the other, the moons fixed ---------- */
.emblem {
  position: relative;
  display: block;
  flex: none;
  width: var(--em);
  height: var(--em);
}
.emblem > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.emblem > img {
  position: absolute; left: 50%; top: 50%;
  height: 66%; width: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .6));
}
.emblem .ticks, .emblem .hair { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.emblem .hair.faint { stroke: var(--line-soft); }
.emblem .disk { fill: rgba(70, 100, 150, .07); }
.emblem .moon-back { fill: var(--bg); stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.emblem .moon-new { fill: #1a1f29; }
.emblem .moon-lit { fill: #d9d6ca; }
.emblem .inscr { font-family: var(--display); font-size: 11.5px; letter-spacing: 4px; fill: #aeb4bf; }
.spin-slow { animation: spin 300s linear infinite; }
.spin-rev  { animation: spin 200s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- the rule: hairline, gold crescent, hairline ---------- */
.rule { display: flex; align-items: center; justify-content: center; gap: 14px; }
.rule::before, .rule::after {
  content: "";
  width: clamp(48px, 9vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
}
.rule::after { transform: scaleX(-1); }
.rule svg { width: 16px; height: 16px; fill: var(--accent); }

/* =================================================================================================
   Front page
   ================================================================================================= */
.gate {
  position: relative; z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vh, 64px) 22px;
  text-align: center;
}
.gate .emblem { --em: clamp(200px, min(48vh, 86vw, 100vh - 320px), 450px); }
.name {
  margin-top: clamp(18px, 4vh, 40px);
  margin-right: -.1em;                   /* the tracking after the last letter, so it centres */
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, min(7.4vw, 8vh), 78px);
  letter-spacing: .1em;
  line-height: 1.05;
  white-space: nowrap;
  background: linear-gradient(180deg, #eef0f4 15%, #9aa2b0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate .rule { margin: clamp(12px, 2.4vh, 22px) 0 clamp(18px, 3.4vh, 34px); }

.join {
  display: inline-block;
  width: min(380px, 100%);
  padding: clamp(13px, 1.9vh, 17px) 0;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(201, 162, 76, .7);
  outline: 1px solid rgba(201, 162, 76, .22);
  outline-offset: -6px;
  background: linear-gradient(180deg, rgba(201, 162, 76, .06), rgba(0, 0, 0, .2));
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
.join:hover, .join:focus-visible {
  background: linear-gradient(180deg, #e2c27a, #b8913f);
  color: var(--ink);
  box-shadow: 0 0 40px rgba(201, 162, 76, .28);
}

.tally {
  display: flex;
  align-items: stretch;
  gap: clamp(22px, 5vw, 44px);
  margin-top: clamp(22px, 5vh, 50px);
  padding: 6px 12px;
  text-decoration: none;
}
.tally .stat { display: grid; gap: 4px; min-width: 7.5em; }
.tally .k {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--dim);
}
.tally .v {
  font-variant-numeric: lining-nums;
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: .04em;
  color: var(--text);
  transition: color .3s ease;
}
.tally .sep { width: 1px; background: linear-gradient(180deg, transparent, var(--line), transparent); }
.tally:hover .v, .tally:focus-visible .v { color: var(--accent); }

/* =================================================================================================
   Guide
   ================================================================================================= */
.guide {
  position: relative; z-index: 2;
  width: min(1060px, 100% - 2 * clamp(18px, 4vw, 48px));
  margin: 0 auto;
  padding: clamp(36px, 7vh, 72px) 0 clamp(60px, 10vh, 110px);
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.55;
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: clamp(28px, 6vh, 56px);
}
.masthead .emblem { --em: 132px; }
.masthead h1 {
  margin-top: 18px;
  margin-right: -.1em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 6vw, 52px);
  letter-spacing: .1em;
  line-height: 1.1;
  color: #e2e5ea;
}
.masthead .rule { margin-top: clamp(12px, 2.4vh, 22px); }

/* chapters: I Install, II Configure, III Claim your name */
.chapter { margin-top: clamp(30px, 6vh, 60px); }
.chapter > h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: .08em;
  color: var(--text);
}
.chapter > h2 .numeral { color: var(--accent); }
.chapter > h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* cards: a hairline box with gold corners, near-opaque so the stars stay behind the text */
.card {
  position: relative;
  padding: clamp(20px, 3.6vw, 40px);
  margin-bottom: 18px;
  scroll-margin-top: 24px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(170deg, rgba(14, 18, 27, .95), rgba(6, 8, 12, .95) 60%);
}
.card::before, .card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--accent);
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.3;
  color: var(--text);
}
.n {
  flex: none;
  font-family: var(--body);
  font-variant-numeric: lining-nums;
  font-weight: 600;
  font-size: .85em;
  letter-spacing: .06em;
  color: var(--accent);
}
.card p { margin-top: 6px; color: var(--text-2); }
.card p strong { color: var(--text); }
.indent { margin-left: calc(2ch + 12px); }

/* steps 1-4: the instructions beside the one screenshot they share */
.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.install ol { list-style: none; display: grid; gap: clamp(16px, 2.6vw, 26px); }
.install li { scroll-margin-top: 24px; }

/* screenshots: framed, the markers drawn in the image's own pixel grid */
.shot {
  position: relative;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  line-height: 0;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
}
.install .shot, .target .shot { margin: 0; }
.shot img { display: block; max-width: 100%; height: auto; }
.shot.px img { image-rendering: pixelated; }       /* RuneLite's pixel font, scaled up */
.shot.x2 img { width: calc(2 * var(--w)); }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.marks line { stroke: var(--accent); stroke-width: 2px; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.marks polygon { fill: var(--accent); }
.marks circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.marks text {
  font-family: var(--body);
  font-weight: 700;
  font-size: 11px;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
}

/* step 6: the a-e list beside the target screenshot, each row outlined on it */
.target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 52px);
  align-items: start;
  margin-top: 22px;
}
.target .side { position: sticky; top: 28px; }
.rows { list-style: none; }
.rows button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .2s ease;
}
.rows button:hover, .rows button:focus-visible, .rows button.on { background: var(--hl-bg); }
.tag {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  background: var(--accent);
  color: var(--ink);
}
.val { font-variant-numeric: lining-nums; font-weight: 600; font-size: 15px; letter-spacing: .04em; color: var(--accent-text); }
.box { width: 18px; height: 18px; border: 1px solid var(--line); display: grid; place-items: center; }
.box svg { width: 12px; height: 12px; opacity: 0; }
.box path { fill: none; stroke: var(--ink); stroke-width: 2; }
.rows [aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.rows [aria-pressed="true"] .box svg { opacity: 1; }
.rows [aria-pressed="true"] .label { color: var(--dim); text-decoration: line-through; }
.outlines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.outlines rect {
  fill: var(--hl-fill);
  stroke: var(--accent);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  transition: fill .2s ease, stroke-width .2s ease;
}
.outlines circle { fill: var(--accent); }
.outlines text {
  font-family: var(--body);
  font-weight: 700;
  font-size: 10px;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: central;
}
.outlines g.on rect { fill: var(--hl-fill-on); stroke-width: 3px; }
.outlines g.done rect { stroke-dasharray: 3 3; }

/* step 7: the command, tap to copy */
.command {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font: 500 clamp(16px, 2.4vw, 20px)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
}
.command svg { width: 16px; height: 16px; color: var(--dim); }
.command:hover svg, .command:focus-visible svg { color: var(--accent); }
.command .icon-done { display: none; color: var(--accent); }
.command.copied .icon-copy { display: none; }
.command.copied .icon-done { display: block; }

/* ---------- small screens ---------- */
@media (max-width: 1000px) {
  .install { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .target { grid-template-columns: minmax(0, 1fr); }
  .target .side { position: static; }
  .target .shot { margin-top: 8px; }
  .shot.x2 img { width: auto; }
  .indent { margin-left: 0; }
}
@media (max-width: 360px) {
  .tally { gap: 14px; padding-inline: 0; }
  .tally .k { letter-spacing: .14em; text-indent: .14em; }
}
/* phone landscape: the astrolabe shrinks so the front page stays one screen */
@media (max-height: 520px) and (orientation: landscape) {
  .gate { padding-block: 16px; }
  .gate .emblem { --em: clamp(110px, 100vh - 250px, 200px); }
  .name { margin-top: 10px; }
  .gate .rule { margin: 8px 0 12px; }
  .join { padding: 10px 0; }
  .tally { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
