/*
 * Passage API Explorer - ITEC100 reference project D.
 *
 * A developer tool, not a document: the eye should go to the response, and
 * everything else should get out of the way. Monospace where the bytes
 * matter, and one accent colour spent only on the status code.
 */

:root {
  --bg:        #0f1218;
  --panel:     #171b24;
  --panel-2:   #1d2230;
  --line:      #2a3040;
  --ink:       #e9e7e1;
  --ink-dim:   #8f97a8;
  --gold:      #d8a830;
  --ok:        #59c58d;
  --client:    #e6ab5c;
  --server:    #e08a8a;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(900px 460px at 10% -12%, rgba(216,168,48,.10), transparent 60%),
    radial-gradient(760px 420px at 92% -4%, rgba(89,197,141,.09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

/* --- Header ------------------------------------------------------------ */
.top { border-bottom: 1px solid var(--line); }
.top__inner { max-width: 1120px; margin: 0 auto; padding: 2.2rem 1.25rem 1.5rem; }
.top.has-art .top__inner { position: relative; }
.top__art {
  position: absolute;
  right: 1rem;
  bottom: .4rem;
  width: min(420px, 40%);
  height: auto;
  pointer-events: none;
}
.top.has-art .lede, .top.has-art .mode { max-width: 56%; }
@media (max-width: 720px) {
  .top__art { display: none; }
  .top.has-art .lede, .top.has-art .mode { max-width: none; }
}

.eyebrow {
  margin: 0 0 .45rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0 0 .5rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.lede { margin: 0 0 1rem; max-width: 56ch; color: var(--ink-dim); line-height: 1.6; }

/* Which service answered. This is never hidden: a replica presented as the
   real thing would be a lie, and the contract is the point of the page. */
.mode {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .8rem .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: .84rem;
  color: var(--ink-dim);
}
.mode b { color: var(--ink); font-weight: 600; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink-dim); flex: none; }
.dot--live    { background: var(--ok);   box-shadow: 0 0 10px var(--ok); }
.dot--replica { background: var(--gold); box-shadow: 0 0 10px rgba(216,168,48,.7); }

.link {
  font: inherit;
  font-size: .82rem;
  background: none;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
  padding: 0;
}

/* --- Layout ------------------------------------------------------------ */
.grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.25rem 1.35rem;
  box-shadow: 0 20px 50px -26px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.04);
}

.panel__title {
  margin: 0 0 .9rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.sub {
  margin: 1.3rem 0 .5rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* --- Endpoint switch --------------------------------------------------- */
.seg {
  display: flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 1rem;
}
.seg__btn {
  flex: 1;
  font-family: var(--mono);
  font-size: .8rem;
  padding: .45rem .3rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  white-space: nowrap;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-on { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* --- Fields ------------------------------------------------------------ */
.row { display: grid; gap: .3rem; margin-bottom: .8rem; }
.row[hidden] { display: none; }
.row label {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--gold);
}
.row input {
  font-family: var(--mono);
  font-size: .88rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}
.row input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.row input::placeholder { color: #5c6474; }

.hint { margin: 1rem 0 .5rem; font-size: .82rem; color: var(--ink-dim); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit;
  font-size: .78rem;
  padding: .32rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-dim);
  cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--gold); }

.send {
  width: 100%;
  margin-top: 1rem;
  font: inherit;
  font-weight: 700;
  padding: .65rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8bb47, var(--gold));
  color: #1a1405;
  cursor: pointer;
  box-shadow: 0 8px 22px -10px rgba(216,168,48,.8);
}
.send:hover { filter: brightness(1.06); }
.send:active { transform: translateY(1px); }
.send:disabled { opacity: .5; cursor: default; }

/* --- Wire / body -------------------------------------------------------- */
.wire, .body {
  margin: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.65;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}
.body { min-height: 12rem; }

/* --- Status line -------------------------------------------------------- */
.statusline {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.code {
  font-family: var(--mono);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}
.code--ok     { color: var(--ok); }
.code--client { color: var(--client); }
.code--server { color: var(--server); }
.meaning { font-size: .86rem; color: var(--ink-dim); }
.timing {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--ink-dim);
}

.note {
  margin-top: .8rem;
  padding: .7rem .85rem;
  border-radius: 9px;
  border: 1px solid rgba(216,168,48,.3);
  background: rgba(216,168,48,.07);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink-dim);
}
.note[hidden] { display: none; }
.note code, .explain code {
  font-family: var(--mono);
  font-size: .92em;
  color: var(--gold);
}

.explain { margin: 0; font-size: .87rem; line-height: 1.65; color: var(--ink-dim); }
.explain em { color: var(--ink); font-style: normal; font-weight: 600; }

.foot {
  border-top: 1px solid var(--line);
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.2rem 1.25rem 2.4rem;
}
.foot p { margin: 0; font-size: .8rem; color: var(--ink-dim); }
