/* ============================================================
   boto.im — shared stylesheet
   Font: Martian Mono (Google Fonts)
   Accent: #c45870 (dolphin pink)
   ============================================================ */

/* ── THEMES ── */
:root, [data-theme="light"] {
  --paper:          #e9e4da;
  --paper2:         #e1dbd0;
  --paper-dark:     #cfc9bc;
  --paper-bg:       #b8b2a6;
  --ink:            #1c1a16;
  --ink-mid:        #4a4640;
  --ink-dim:        #8a8478;
  --steel:          #526878;
  --steel-faint:    rgba(82,104,120,0.09);
  --dolphin:        #c45870;
  --dolphin-dim:    rgba(196,88,112,0.09);
  --rule:           #cec8bc;
  --green:          #3a6e44;
  --amber:          #8a6a10;
  --red:            #8b2020;
  --shadow:         rgba(28,26,22,0.18);
}

[data-theme="dark"] {
  --paper:          #1e1c18;
  --paper2:         #252320;
  --paper-dark:     #141210;
  --paper-bg:       #0e0d0b;
  --ink:            #ddd8ce;
  --ink-mid:        #a09890;
  --ink-dim:        #6a6460;
  --steel:          #7a9aaa;
  --steel-faint:    rgba(122,154,170,0.09);
  --dolphin:        #d4687e;
  --dolphin-dim:    rgba(212,104,126,0.10);
  --rule:           #302e2a;
  --green:          #5a9e64;
  --amber:          #b08a30;
  --red:            #c45050;
  --shadow:         rgba(0,0,0,0.55);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }

body {
  background: var(--paper-bg);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 27px,
      rgba(0,0,0,0.018) 27px, rgba(0,0,0,0.018) 28px);
  font-family: 'Martian Mono', monospace;
  color: var(--ink);
  min-height: 100vh;
  padding: 48px 40px 80px;
  transition: background 0.3s, color 0.3s;
}

/* ── DOCUMENT SHELL ── */
.document {
  max-width: 800px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow:
    0 2px 0 var(--paper-dark),
    0 12px 48px var(--shadow),
    0 1px 4px rgba(0,0,0,0.22);
  position: relative;
  transition: background 0.3s, box-shadow 0.3s;
}

/* top color rule */
.document::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--dolphin) 0%, var(--dolphin) 36px,
    var(--paper-dark) 36px, var(--paper-dark) 40px,
    var(--steel) 40px, var(--steel) 100%);
  transition: background 0.3s;
}

/* ── STATUS BAR ── */
.status-bar {
  margin-top: 3px;
  background: var(--paper2);
  border-bottom: 1px solid var(--rule);
  font-size: 8px;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 5px 48px 4px;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
  position: relative;
}
.status-bar .bar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--rule);
}
.status-bar .bar-dot.green  { background: var(--green);  box-shadow: 0 0 4px rgba(58,110,68,0.6); }
.status-bar .bar-dot.yellow { background: var(--amber);  box-shadow: 0 0 4px rgba(138,106,16,0.5); }
.status-bar .bar-dot.red    { background: var(--red);    box-shadow: 0 0 4px rgba(139,32,32,0.5); }
#statusText { transition: color 0.3s; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  font-family: 'Martian Mono', monospace;
  font-size: 7.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-dim); }

/* ── HEADER ── */
.doc-header {
  padding: 38px 48px 22px;
  border-bottom: 1.5px solid var(--ink);
  transition: border-color 0.3s;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.header-left {
  flex: 0 0 200px;
  min-width: 0;
}

h1 {
  font-family: 'Martian Mono', monospace;
  font-weight: 300;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
  transition: color 0.3s;
}
h1 .tld { color: var(--dolphin); }

.doc-sub {
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 300;
  font-style: italic;
  color: var(--ink-mid);
  line-height: 1.75;
  max-width: 340px;
  transition: color 0.3s;
}

/* ── DOLPHIN ── */
.dolphin-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.dolphin-art {
  font-size: clamp(4px, 0.9vw, 7px);
  line-height: 1.28;
  color: var(--dolphin);
  white-space: pre;
  opacity: 0.75;
  transition: color 0.3s;
}
.dolphin-name {
  font-size: 7px;
  letter-spacing: 0.22em;
  color: var(--dolphin);
  text-transform: uppercase;
  opacity: 0.5;
  text-align: right;
}
.dolphin-quote {
  font-size: 7.5px;
  font-style: italic;
  color: var(--ink-dim);
  text-align: right;
  line-height: 1.6;
  transition: color 0.3s;
}

/* ── STATUS DOTS ── */
.status-strip {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  transition: border-color 0.3s;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
  text-transform: uppercase;
  transition: color 0.3s;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: var(--green);  box-shadow: 0 0 5px rgba(58,110,68,0.5); }
.dot-yellow { background: var(--amber);  box-shadow: 0 0 5px rgba(138,106,16,0.45); }
.dot-red    { background: var(--red);    box-shadow: 0 0 5px rgba(139,32,32,0.5); }
.dot-grey   { background: var(--rule); }

/* ── BODY ── */
.doc-body { padding: 0 48px 44px; }

/* ── NAV ── */
nav {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0 0;
  display: flex;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 0;
  transition: border-color 0.3s;
}
nav a {
  font-size: 8.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mid);
  text-decoration: none;
  padding: 0 18px 12px 0;
  margin-right: 18px;
  border-bottom: 2px solid transparent;
  position: relative;
  top: 1px;
  transition: color 0.15s, border-color 0.15s;
}
nav a:hover { color: var(--ink); }
nav a.active {
  color: var(--dolphin);
  border-bottom-color: var(--dolphin);
  font-weight: 600;
}

/* ── SECTION HEAD ── */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 34px 0 14px;
}
.section-num {
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--dolphin);
  flex-shrink: 0;
  transition: color 0.3s;
}
.section-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-mid);
  transition: color 0.3s;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  transition: background 0.3s;
}

/* ── LEDE ── */
.lede {
  font-size: 0.78rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.85;
  color: var(--ink-mid);
  max-width: 560px;
  margin-bottom: 26px;
  transition: color 0.3s;
}
.lede strong { font-weight: 600; font-style: normal; color: var(--ink); }

/* ── SERVICE GRID ── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  transition: background 0.3s, border-color 0.3s;
}

.service-tile {
  background: var(--paper);
  padding: 17px 18px 15px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background 0.15s;
}
.service-tile:hover { background: var(--steel-faint); }
.service-tile.disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
}
.tile-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  transition: color 0.3s;
}
.tile-desc {
  font-size: 0.66rem;
  font-weight: 300;
  color: var(--ink-dim);
  line-height: 1.6;
  transition: color 0.3s;
}
.tile-url {
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: var(--steel);
  margin-top: 7px;
  transition: color 0.15s;
}
.service-tile:hover .tile-url { color: var(--dolphin); }

.tile-tag {
  font-size: 7px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 2px 5px;
  border: 1px solid var(--rule);
  color: var(--ink-dim);
  line-height: 1;
  flex-shrink: 0;
  transition: border-color 0.3s, color 0.3s;
}

/* ── INFO BOXES ── */
.connect-box {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--steel);
  padding: 13px 18px;
  margin-top: 10px;
  background: var(--steel-faint);
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.3s, background 0.3s;
}
.connect-label {
  font-size: 7.5px;
  letter-spacing: 0.3em;
  color: var(--steel);
  text-transform: uppercase;
  flex-shrink: 0;
  transition: color 0.3s;
}
.connect-val {
  font-size: 0.72rem;
  color: var(--ink-mid);
  font-weight: 300;
  transition: color 0.3s;
}
.connect-val strong { font-weight: 600; color: var(--ink); }

.notice {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--dolphin);
  padding: 14px 18px;
  margin-top: 32px;
  background: var(--dolphin-dim);
  transition: border-color 0.3s, background 0.3s;
}
.notice-label {
  font-size: 7.5px;
  letter-spacing: 0.32em;
  color: var(--dolphin);
  text-transform: uppercase;
  margin-bottom: 7px;
  transition: color 0.3s;
}
.notice p {
  font-size: 0.72rem;
  font-weight: 300;
  line-height: 1.78;
  color: var(--ink-mid);
  transition: color 0.3s;
}
.notice a { color: var(--dolphin); text-decoration: none; }
.notice a:hover { text-decoration: underline; }

/* ── CHANGELOG ── */
.changelog { margin-top: 4px; }
.changelog-entry {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
  transition: border-color 0.3s;
}
.changelog-entry:last-child { border-bottom: none; }
.cl-date {
  font-size: 8px;
  letter-spacing: 0.13em;
  color: var(--ink-dim);
  transition: color 0.3s;
}
.cl-text {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--ink-mid);
  line-height: 1.6;
  transition: color 0.3s;
}
.cl-text strong { font-weight: 600; color: var(--ink); }
.cl-pill {
  display: inline-block;
  font-size: 7px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.cl-pill.new  { border-color: var(--green); color: var(--green); }
.cl-pill.fix  { border-color: var(--steel); color: var(--steel); }
.cl-pill.note { border-color: var(--amber); color: var(--amber); }

/* ── PROSE (about, rules, services pages) ── */
.prose {
  font-size: 0.75rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--ink-mid);
  max-width: 620px;
  transition: color 0.3s;
}
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { color: var(--dolphin); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose p + p { margin-top: 14px; }

.prose-block {
  margin-bottom: 28px;
}

/* numbered rules */
.rules-list {
  list-style: none;
  margin-top: 4px;
}
.rules-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--ink-mid);
  line-height: 1.7;
  transition: border-color 0.3s, color 0.3s;
}
.rules-list li:last-child { border-bottom: none; }
.rules-list .rule-num {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--dolphin);
  padding-top: 3px;
  transition: color 0.3s;
}

/* service detail cards */
.service-detail {
  border: 1px solid var(--rule);
  margin-bottom: 12px;
  transition: border-color 0.3s;
}
.service-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--rule);
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.3s;
}
.service-detail-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.3s;
}
.service-detail-url {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--steel);
  text-decoration: none;
  transition: color 0.15s;
}
.service-detail-url:hover { color: var(--dolphin); }
.service-detail-body {
  padding: 14px 18px;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--ink-mid);
  line-height: 1.78;
  transition: color 0.3s;
}

/* ── FOOTER ── */
.doc-footer {
  border-top: 1px solid var(--rule);
  margin-top: 40px;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  transition: border-color 0.3s;
}
.doc-footer-col {
  font-size: 7.5px;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  line-height: 2.1;
  transition: color 0.3s;
}
.doc-footer-col a { color: var(--ink-dim); text-decoration: none; transition: color 0.15s; }
.doc-footer-col a:hover { color: var(--dolphin); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  body { padding: 12px 8px 48px; }
  .doc-header, .doc-body { padding-left: 18px; padding-right: 18px; }
  .header-row { flex-direction: column; }
  .dolphin-block { align-items: flex-start; width: 100%; }
  .dolphin-name, .dolphin-quote { text-align: left; }
  .changelog-entry { grid-template-columns: 1fr; gap: 3px; }
  .doc-footer { flex-direction: column; }
  .status-bar { padding-left: 12px; padding-right: 40px; justify-content: flex-start; }
  .rules-list li { grid-template-columns: 22px 1fr; }
}
