:root {
  color-scheme: light;
  --paper: #efe9d8;
  --paper-deep: #e1dac5;
  --ink: #172019;
  --muted: #5f665b;
  --rule: #172019;
  --accent: #17643a;
  --screen: #111713;
  --screen-ink: #edf0cf;
  --focus: #f1c40f;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 300px;
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  border-radius: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.masthead {
  min-height: 76px;
  border-bottom: 3px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 76px);
  background: var(--paper);
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font: 700 27px/1 "Courier New", monospace;
  letter-spacing: 0.04em;
}

.wordmark span {
  color: var(--accent);
}

.document-code,
.figure-label,
.eyebrow,
.mode-stamp {
  margin: 0;
  font: 700 12px/1.35 "Courier New", monospace;
  letter-spacing: 0.08em;
}

.service-state {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font: 13px/1.3 "Courier New", monospace;
}

.signal {
  width: 11px;
  height: 11px;
  display: inline-block;
  border: 2px solid var(--ink);
  background: transparent;
}

.signal.online {
  background: var(--accent);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.introduction {
  max-width: 900px;
  padding: clamp(58px, 9vw, 118px) 0 clamp(56px, 8vw, 92px);
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 760px;
  margin: 36px 0 0;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.42;
}

.manual-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.65fr);
  border-top: 3px solid var(--rule);
  border-bottom: 3px solid var(--rule);
}

.procedure {
  padding: 34px 34px 40px 0;
  border-right: 1px solid var(--rule);
}

.procedure h2,
.pairing-desk h2,
.watch-figure h2,
.boundary-note h2,
.transcript-section h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.08;
}

.procedure ol {
  padding: 0;
  margin: 34px 0 48px;
  list-style: none;
}

.procedure li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.procedure li:last-child {
  border-bottom: 1px solid var(--rule);
}

.procedure li > span {
  font: 700 13px/1.5 "Courier New", monospace;
  color: var(--accent);
}

.procedure li p {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.button-map {
  font: 12px/1.25 "Courier New", monospace;
}

.button-map p {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  margin: 9px 0;
}

kbd {
  font: inherit;
  font-weight: 700;
}

.pairing-desk {
  padding: 34px 0 46px 42px;
}

.desk-heading,
.ledger-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}

.desk-heading .figure-label,
.section-heading .figure-label {
  margin-bottom: 10px;
  color: var(--accent);
}

.mode-stamp {
  border: 1px solid var(--rule);
  padding: 8px 10px;
}

.notice {
  margin-top: 28px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font: 14px/1.4 "Courier New", monospace;
}

.account-panel,
.device-code-panel,
.pair-panel,
.device-ledger {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.account-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}

.panel-copy h3,
.device-ledger h3,
.pair-panel h3 {
  margin: 4px 0 8px;
  font-size: 23px;
  font-weight: 600;
}

.panel-copy p,
.ledger-heading p,
.pair-panel p {
  max-width: 570px;
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.primary-action,
.text-action {
  cursor: pointer;
  border: 2px solid var(--ink);
  padding: 12px 16px;
  background: transparent;
  color: var(--ink);
  font: 700 13px/1.2 "Courier New", monospace;
}

.primary-action {
  background: var(--accent);
  color: #fffef4;
  border-color: var(--accent);
}

.primary-action:hover,
.primary-action:active {
  background: var(--ink);
  border-color: var(--ink);
}

.text-action:hover,
.text-action:active {
  background: var(--paper-deep);
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.device-code-panel {
  background: var(--screen);
  color: var(--screen-ink);
  padding: 22px;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 20px 0 13px;
}

.code-row code {
  font: 700 clamp(30px, 6vw, 56px)/1 "Courier New", monospace;
  letter-spacing: 0.1em;
}

.code-row a {
  color: var(--screen-ink);
  font: 700 14px/1.3 "Courier New", monospace;
  text-underline-offset: 4px;
}

.device-code-panel > p:last-child {
  margin: 0;
  font: 14px/1.4 "Courier New", monospace;
}

.pair-panel form {
  margin-top: 24px;
}

.pair-panel label {
  display: block;
  margin-bottom: 8px;
  font: 700 13px/1.2 "Courier New", monospace;
}

.form-line {
  display: grid;
  grid-template-columns: 1fr auto;
}

.form-line input {
  min-width: 0;
  border: 2px solid var(--ink);
  border-right: 0;
  padding: 12px 14px;
  background: #fffdf4;
  color: var(--ink);
  font-size: 18px;
}

.credential-result {
  margin-top: 24px;
  border-left: 8px solid var(--accent);
  padding: 16px 0 16px 18px;
}

.credential-result code {
  display: block;
  margin: 10px 0 15px;
  max-width: 100%;
  padding: 9px;
  background: #fffdf4;
  border: 1px solid var(--rule);
  font: 12px/1.45 "Courier New", monospace;
  word-break: break-all;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.device-ledger .ledger-heading {
  align-items: start;
}

.device-ledger .ledger-heading p {
  text-align: right;
  font-size: 15px;
}

.device-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px dotted var(--rule);
}

.device-row:first-child {
  margin-top: 20px;
}

.device-row h4,
.device-row p {
  margin: 0;
}

.device-row h4 {
  font-size: 18px;
}

.device-row p {
  margin-top: 4px;
  color: var(--muted);
  font: 12px/1.4 "Courier New", monospace;
}

.watch-figure {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
  gap: clamp(50px, 9vw, 130px);
  align-items: center;
  padding: clamp(76px, 11vw, 140px) 0;
}

.watch-body {
  position: relative;
  width: min(330px, 80vw);
  aspect-ratio: 0.79;
  margin: 0 auto;
  border: 20px solid #252823;
  background: #171917;
  padding: 20px 14px;
}

.watch-body::before,
.watch-body::after {
  content: "";
  position: absolute;
  left: 26%;
  width: 48%;
  height: 70px;
  z-index: -1;
  background: #353832;
}

.watch-body::before {
  bottom: 100%;
}

.watch-body::after {
  top: 100%;
}

.watch-screen {
  height: 100%;
  padding: 13px 14px 35px;
  background: var(--screen);
  color: var(--screen-ink);
  font: 16px/1.25 "Courier New", monospace;
  overflow: hidden;
  position: relative;
}

.watch-screen p {
  margin: 4px 0 13px;
}

.watch-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--screen-ink);
  padding-bottom: 7px;
  margin-bottom: 13px;
  font-weight: 700;
}

.watch-header i {
  width: 9px;
  height: 9px;
  background: #63c477;
}

.watch-you,
.watch-codex {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #63c477;
}

.watch-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--screen-ink);
  padding: 8px 12px;
  background: var(--screen);
  font-size: 11px;
}

.watch-buttons {
  position: absolute;
  left: calc(100% + 20px);
  top: 24%;
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.watch-buttons i {
  display: block;
  width: 8px;
  height: 42px;
  background: #252823;
}

.figure-copy .figure-label {
  color: var(--accent);
  margin-bottom: 14px;
}

.figure-copy > p:not(.figure-label) {
  margin: 25px 0 34px;
  font-size: 20px;
  line-height: 1.52;
}

.figure-copy dl {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.figure-copy dl div {
  display: grid;
  grid-template-columns: 120px 1fr;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
}

.figure-copy dt {
  font: 700 12px/1.4 "Courier New", monospace;
}

.figure-copy dd {
  margin: 0;
  font-size: 16px;
}

.transcript-section,
.boundary-note {
  border-top: 3px solid var(--rule);
  padding: 48px 0 72px;
}

.transcript-list {
  margin-top: 32px;
}

.transcript-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 170px;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

.transcript-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.transcript-role,
.transcript-meta {
  margin: 0;
  font: 12px/1.45 "Courier New", monospace;
}

.transcript-role {
  color: var(--accent);
  font-weight: 700;
}

.transcript-copy {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.transcript-meta {
  color: var(--muted);
  text-align: right;
}

.boundary-note {
  display: grid;
  grid-template-columns: 170px minmax(240px, 0.8fr) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
}

.boundary-note .figure-label {
  color: var(--accent);
}

.boundary-note p:last-child {
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
}

footer {
  border-top: 3px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 22px clamp(20px, 5vw, 76px) 50px;
  font-size: 14px;
  background: var(--paper-deep);
}

footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .masthead {
    grid-template-columns: 1fr auto;
  }

  .masthead .document-code {
    display: none;
  }

  .manual-layout,
  .watch-figure {
    grid-template-columns: 1fr;
  }

  .procedure {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
  }

  .pairing-desk {
    padding-left: 0;
  }

  .watch-figure {
    gap: 70px;
  }

  .boundary-note {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .transcript-row {
    grid-template-columns: 70px 1fr;
  }

  .transcript-meta {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  .masthead {
    padding-inline: 14px;
  }

  .service-state {
    font-size: 11px;
  }

  .account-panel,
  .desk-heading,
  .ledger-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-stamp {
    align-self: flex-start;
  }

  .form-line {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .form-line input {
    border-right: 2px solid var(--ink);
  }

  .code-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .device-ledger .ledger-heading p {
    text-align: left;
  }

  .watch-body {
    width: min(270px, 76vw);
    border-width: 14px;
    padding: 13px 8px;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
