/* =========================================================
   Quest Badge Remover — shared styles
   ========================================================= */

:root {
  --paper:   #EEF0F3;
  --plane:   #FFFFFF;
  --ink:     #14161C;
  --soft:    #5A6070;
  --line:    #D9DDE4;
  --badge:   #8E93FF;
  --slot:    #12141B;
  --signal:  #4B42D8;
  --btn-bg:  #14161C;
  --btn-fg:  #FFFFFF;
  --shadow:  0 1px 2px rgba(20,22,28,.05), 0 12px 32px -18px rgba(20,22,28,.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #191C24;
    --plane:  #212630;
    --ink:    #EDEFF3;
    --soft:   #A3AABA;
    --line:   #313846;
    --signal: #A6A3FF;
    --slot:   #0E1016;
    --btn-bg: #EDEFF3;
    --btn-fg: #14161C;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

/* --- no sideways scroll, ever ------------------------- */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* anything that can push the page wide is reined in here */
img, svg, video, canvas, iframe, table { max-width: 100%; }
svg { height: auto; }
code, pre { overflow-wrap: anywhere; word-break: break-word; }

a { color: inherit; }

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

.wrap {
  width: min(100% - 2.5rem, 64rem);
  margin-inline: auto;
}

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
  padding: .6rem 1rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  z-index: 20;
}
.skip:focus { left: 0; }

/* =========================================================
   Header + navigation
   ========================================================= */

.masthead {
  border-bottom: 1px solid var(--line);
  position: relative;
}

.masthead-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.mark {
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.mark svg { flex: none; }

.nav { display: flex; align-items: center; gap: 1.75rem; }

.nav a {
  text-decoration: none;
  color: var(--soft);
  font-size: .9375rem;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

.nav-get {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem 1rem;
  color: var(--ink) !important;
}
.nav-get:hover { border-color: var(--soft); }

/* hamburger */

.burger {
  display: none;
  width: 2.5rem; height: 2.5rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink);
  flex: none;
}
.burger:hover { border-color: var(--soft); }

.burger-bars,
.burger-bars::before,
.burger-bars::after {
  display: block;
  width: 17px;
  height: 1.8px;
  background: currentColor;
  border-radius: 2px;
}
.burger-bars { position: relative; }
.burger-bars::before,
.burger-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.burger-bars::before { top: -5.5px; }
.burger-bars::after  { top:  5.5px; }

@media (prefers-reduced-motion: no-preference) {
  .burger-bars,
  .burger-bars::before,
  .burger-bars::after { transition: transform .18s ease, opacity .18s ease; }
}

.burger[aria-expanded="true"] .burger-bars { background: transparent; }
.burger[aria-expanded="true"] .burger-bars::before { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] .burger-bars::after  { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 759px) {
  .burger { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    z-index: 10;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--plane);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .5rem 0 1rem;
  }
  .nav.is-open { display: flex; }

  .nav a {
    font-size: 1.0625rem;
    padding: .85rem clamp(1.25rem, 5vw, 2rem);
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: 0; }

  .nav-get {
    border: 0;
    border-radius: 0;
    margin-top: .35rem;
    font-weight: 500;
  }
}

/* =========================================================
   Layout + type
   ========================================================= */

main { flex: 1 0 auto; }

.page { padding: clamp(2.75rem, 7vw, 5rem) 0 0; }

section + section { margin-top: clamp(3rem, 7vw, 5rem); }

h1 {
  font-size: clamp(2.125rem, 6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 700;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.page-title { max-width: 20ch; }

h2 {
  font-size: 1.375rem;
  letter-spacing: -.02em;
  font-weight: 700;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.125rem;
  color: var(--soft);
  max-width: 38ch;
  margin: 0 0 2.25rem;
}

.prose { max-width: 62ch; }
.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 500; }

.jump {
  margin-top: 2.5rem;
  font-size: .9375rem;
}
.jump a { color: var(--signal); text-underline-offset: 3px; }

/* =========================================================
   Hero
   ========================================================= */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 3rem;
  align-items: center;
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.hero > * { min-width: 0; }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.0625rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.btn svg { flex: none; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform .15s ease; }
  .btn:hover { transform: translateY(-2px); }
  .btn:active { transform: translateY(0); }
}

.get small { color: var(--soft); font-size: .9375rem; line-height: 1.35; }
.get small b { display: block; color: var(--ink); font-weight: 500; }

.art {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 1;
}

/* the empty slot the badge used to sit in */
.slot {
  position: absolute;
  right: 2%;
  bottom: 2%;
  width: 60%;
  height: 60%;
  background: var(--slot);
  border-radius: 26%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--shadow);
}
.slot-ghost {
  width: 70%;
  opacity: .17;
  filter: grayscale(1) brightness(1.8);
}

/* the badge, lifted out and set down beside it */
.lifted {
  position: absolute;
  left: 0;
  top: 2%;
  width: 64%;
  transform: rotate(-6deg);
  filter: drop-shadow(8px 14px 16px rgba(20,22,28,.3));
}

@media (prefers-reduced-motion: no-preference) {
  .lifted { animation: lift .85s .4s cubic-bezier(.2,.8,.25,1) both; }
  @keyframes lift {
    from {
      transform: translate(56%, 53%) scale(.66) rotate(0deg);
      filter: drop-shadow(0 0 0 rgba(20,22,28,0));
    }
    to {
      transform: rotate(-6deg);
      filter: drop-shadow(8px 14px 16px rgba(20,22,28,.3));
    }
  }
}

/* =========================================================
   Steps
   ========================================================= */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 52ch;
  border-top: 1px solid var(--line);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8125rem;
  color: var(--soft);
  padding-top: .28rem;
}
.steps b { font-weight: 500; display: block; }
.steps p { margin: .15rem 0 0; color: var(--soft); font-size: .9375rem; }

/* =========================================================
   File panel
   ========================================================= */

.panel {
  background: var(--plane);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.6rem;
  max-width: 44rem;
}

.specs {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: .55rem 2rem;
}
.specs dt { color: var(--soft); font-size: .9375rem; }
.specs dd {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.copy {
  flex: none;
  font: inherit;
  font-size: .875rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .3rem .7rem;
  cursor: pointer;
}
.copy:hover { border-color: var(--soft); }

/* =========================================================
   Code snippets
   ========================================================= */

.snippet {
  position: relative;
  margin: .85rem 0 0;
  background: var(--plane);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.snippet pre {
  margin: 0;
  padding: .85rem 1rem;
  padding-right: 4.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.snippet code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8125rem;
  line-height: 1.7;
  white-space: pre;
}

@media (max-width: 700px) {
  .snippet pre { padding-right: 1rem; padding-top: 2.6rem; }
  .snippet code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
.snippet .copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: var(--plane);
}

.sub {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -.01em;
  margin: 2.75rem 0 .35rem;
}

.parts { max-width: 46rem; margin: 1.25rem 0 0; }
.parts dt {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8125rem;
  line-height: 1.55;
  margin-top: 1.5rem;
  overflow-wrap: anywhere;
}
.parts dt:first-child { margin-top: 0; }
.parts dd {
  margin: .3rem 0 0;
  color: var(--soft);
  font-size: .9375rem;
}

.steps code, .prose code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8125rem;
  background: var(--plane);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1rem .35rem;
  overflow-wrap: anywhere;
}
.steps a, .prose a { color: var(--signal); text-underline-offset: 3px; }

/* =========================================================
   FAQ
   ========================================================= */

.faq { max-width: 62ch; margin: 0; }
.faq dt { font-weight: 500; margin-top: 2rem; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: .3rem 0 0; color: var(--soft); }
.faq a { color: var(--signal); text-underline-offset: 3px; }
.faq code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8125rem;
  background: var(--plane);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1rem .35rem;
}

.flag {
  display: inline-block;
  width: .45rem; height: .45rem;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: .12em;
  margin-right: .45rem;
}

/* =========================================================
   Install collages
   ========================================================= */

figure.collage {
  margin: 0 0 2.5rem;
  text-align: center;
}
figure.collage img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
figure.collage figcaption {
  margin-top: 1rem;
  color: var(--soft);
  font-size: .9375rem;
  line-height: 1.65;
  max-width: 62ch;
  margin-inline: auto;
}
figure.collage figcaption b {
  color: var(--ink);
}

.lost {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 15rem);
  gap: 3rem;
  align-items: center;
  padding: clamp(3rem, 10vw, 7rem) 0;
}
.lost > * { min-width: 0; }
.lost-art {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 12rem;
  aspect-ratio: 1;
}
.lost-art .slot { inset: 0; width: auto; height: auto; }

.backlinks { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: .9375rem; }
.backlinks a { color: var(--signal); text-underline-offset: 3px; }

/* =========================================================
   Footer
   ========================================================= */

footer {
  flex: none;
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: .9375rem;
}
.footer-in {
  padding: 1.75rem 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  justify-content: space-between;
}
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* =========================================================
   Narrow screens
   ========================================================= */

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .art { order: -1; max-width: 12rem; justify-self: start; }
  .lede { max-width: none; }
  .lost { grid-template-columns: 1fr; gap: 2.5rem; }
  .lost-art { order: -1; max-width: 9rem; justify-self: start; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 2rem, 64rem); }
  .panel { padding: 1.25rem; }
  .specs { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .specs dd { margin-bottom: .7rem; }
  .specs dd:last-child { margin-bottom: 0; }
  .btn { width: 100%; justify-content: center; }
  .get { gap: .9rem; }
}
