/* Adapted from kleban.computer/style.css */

:root {
  --primary-text-color: #24292e;
  --secondary-text-color: #586069;
  --link-color: #0366d6;
  --background-color: #ffffff;
  --code-background: #faf9f6;
  --border-color: #f5cd6e;
  --heading-color: #24292e;
  --blockquote-color: #46484a;
}

html {
  font-family: 'Berkeley Mono', 'Courier New', monospace;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  color: var(--primary-text-color);
  background-color: var(--background-color);
  max-width: 104ch;
  padding: 2ch;
  margin: auto;
  font-size: 14px;
}

body { margin: 0; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Berkeley Mono', 'Courier New', monospace;
  color: var(--heading-color);
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.25;
}
h1::before { content: "▓ "; }
h2::before { content: "▒ "; }
h3::before { content: "░ "; }
h2 { margin-top: 2.5em; }
h3, h4 { font-size: 1.1rem; }

p { margin-top: 0; margin-bottom: 1em; }

a { color: var(--link-color); text-decoration: underline; }

ul { list-style-type: none; padding-left: 1em; margin-bottom: 1em; }
ul li { position: relative; padding-left: 1.5em; margin-bottom: 0.3em; }
ul li::before { content: "»"; position: absolute; left: 0; }

hr {
  overflow: visible;
  height: 0;
  margin: 1.5rem 0 2.5rem;
  border: none;
  border-top: 2px dotted #ddd;
}

/* Tables */
table {
  display: table !important;
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  text-align: left;
  font-family: 'Berkeley Mono', 'Courier New', monospace;
  border: .08333rem solid #bfbfbf;
  border-left: 4px solid #bfbfbf;
  margin-bottom: 1.5em;
  font-size: 0.95em;
  box-shadow: 2px 2px #ddd;
  border-top: 2px dotted #ddd;
}
th, td { border: .08333rem solid #bfbfbf !important; padding: .3rem .5rem 0.2rem !important; vertical-align: top; }
th { font-weight: bold; border-bottom: .08333rem solid black !important; }
tr:nth-child(even) { background-color: #f5f5f5; }

.table-yellow { border-left: 4px solid #ffb700; }
.table-blue   { border-left: 4px solid #1660c1; }
.table-green  { border-left: 4px solid #008458; }
.table-red    { border-left: 4px solid #e7040f; }
.table-gray   { border-left: 4px solid #777; }

/* Borealis section colors */
.table-s1 { border-left: 4px solid #FE8113; }
.table-s2 { border-left: 4px solid #278CBE; }
.table-s3 { border-left: 4px solid #018292; }
.table-s4 { border-left: 4px solid #897F94; }
.table-s5 { border-left: 4px solid #B8860B; }
.table-s6 { border-left: 4px solid #D5311E; }
.table-s7 { border-left: 4px solid #278CBE; }
.table-s8 { border-left: 4px solid #018292; }

/* Code */
pre, code {
  font-family: 'Berkeley Mono', 'Courier New', monospace;
  background-color: var(--code-background);
}
code { padding: 0.1em 0.3em; font-size: 1em; }
pre {
  padding: 16px;
  overflow: auto;
  font-size: 0.85em;
  line-height: 1.45;
  margin-bottom: 1em;
  border: 1px solid var(--border-color);
  border-top: 2px dotted #ddd;
  border-left: 4px solid #ffb700;
}

/* Blockquote */
blockquote {
  font-style: italic;
  margin: 1em 0;
  padding: 0.5em 1em;
  color: var(--blockquote-color);
  border-left: 0.2em solid var(--border-color);
}

/* SKU badges */
.sku {
  font-weight: 400;
  font-style: normal;
  line-height: 1.2rem;
  padding: 0.1rem 0.3rem;
  letter-spacing: .08rem;
  text-transform: uppercase;
  font-size: 0.78em;
  border: 1px dotted #000;
  white-space: nowrap;
}
.sku-solid {
  font-weight: 400;
  padding: 0.1rem 0.3rem;
  letter-spacing: .08rem;
  text-transform: uppercase;
  font-size: 0.78em;
  border: .1rem solid #000;
  white-space: nowrap;
}
.sku.red,   .sku-red   { color: #ff4136; border-color: #ff4136; }
.sku.blue,  .sku-blue  { color: #005eec; border-color: #005eec; }
.sku.green, .sku-green { color: #00a96c; border-color: #00a96c; }
.sku.gold,  .sku-gold  { color: #ffb700; border-color: #ffb700; }
.sku.gray,  .sku-gray  { color: #777;    border-color: #777; }

.sku.bg-blue  { background: #005eec; color: #fff; border-color: #005eec; }
.sku.bg-green { background: #00a96c; color: #fff; border-color: #00a96c; }
.sku.bg-gold  { background: #ffb700; color: #000; border-color: #ffb700; }
.sku.bg-gray  { background: #777;    color: #fff; border-color: #777; }
.sku.bg-red   { background: #ff4136; color: #fff; border-color: #ff4136; }
.sku.bg-black { background: #000;    color: #fff; border-color: #000; }

/* Details/collapsible */
details {
  margin: 1em 0;
  padding: 0.5em 1em;
  background-color: rgba(0,0,0,0.02);
  border: .08333rem solid #bfbfbf;
  border-left: 4px solid #bfbfbf;
  border-top: 2px dotted #ddd;
  box-shadow: 2px 2px #ddd;
}
details[open] { padding-bottom: 1em; }
summary { font-weight: bold; cursor: pointer; padding: 0.5em 0; list-style: none; }
summary::before { content: "[ ➙ ] "; }
details[open] > summary::before { content: "[ ➘ ] "; }

/* Pattern-specific layout */
.diagram-container {
  background: #fff;
  border: .08333rem solid #bfbfbf;
  border-left: 4px solid #ffb700;
  border-top: 2px dotted #ddd;
  box-shadow: 2px 2px #ddd;
  aspect-ratio: 1 / 1;
  width: 100%;
  margin-bottom: 0.5em;
  overflow: hidden;
}
.diagram-note { font-size: 0.8em; color: #999; text-align: right; margin-bottom: 1.5em; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5em; margin-bottom: 1.5em; }
.box {
  padding: 1em;
  border: .08333rem solid #bfbfbf;
  border-top: 2px dotted #ddd;
  box-shadow: 2px 2px #ddd;
}
.box.green { border-left: 4px solid #00a96c; }
.box.red   { border-left: 4px solid #e7040f; }
.box.blue  { border-left: 4px solid #005eec; }
.box.gold  { border-left: 4px solid #ffb700; }
.box-label {
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5em;
}
.box-label.green { color: #00a96c; }
.box-label.red   { color: #e7040f; }
.box-label.blue  { color: #005eec; }
.box-label.gold  { color: #ffb700; }

.scenario-block {
  padding: 1em 1.2em;
  border: .08333rem solid #bfbfbf;
  border-left: 4px solid var(--border-color);
  border-top: 2px dotted #ddd;
  box-shadow: 2px 2px #ddd;
  margin-bottom: 1.5em;
  background: #faf9f6;
}

.metrics-row { display: flex; gap: 1em; flex-wrap: wrap; margin-bottom: 1.5em; }
.metric {
  flex: 1;
  min-width: 140px;
  padding: 0.6em 0.8em;
  border: .08333rem solid #bfbfbf;
  border-top: 2px dotted #ddd;
  box-shadow: 2px 2px #ddd;
}
.metric-label { font-size: 0.75em; font-weight: bold; text-transform: uppercase; letter-spacing: 0.08em; color: #777; margin-bottom: 0.2em; }
.metric-val { font-size: 0.9em; }

.nav { margin-bottom: 2em; font-size: 0.85em; color: #777; }
.nav a { color: var(--link-color); }

/* Periodic table */
.pt-grid {
  display: flex;
  flex-direction: column;
  gap: 1.8em;
  margin: 1.5em 0 2em;
}

.pt-group {
  border-left: 4px solid var(--gc, #999);
  padding-left: 0.75em;
}

.pt-group-label {
  font-size: 0.9em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gc, #999);
  margin-bottom: 0.6em;
}

.pt-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}

.pt-tile {
  display: flex;
  flex-direction: column;
  width: 110px;
  min-height: 56px;
  padding: 0.45em 0.6em;
  border: 1px solid var(--gc, #999);
  border-top: 3px solid var(--gc, #999);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  box-shadow: 1px 1px #ddd;
}

.pt-tile:hover {
  background: color-mix(in srgb, var(--gc, #999) 8%, #fff);
  text-decoration: none;
}

.pt-id {
  font-size: 0.75em;
  font-weight: bold;
  color: var(--gc, #999);
  letter-spacing: 0.03em;
  margin-bottom: 0.25em;
}

.pt-name {
  font-size: 0.85em;
  color: #333;
  line-height: 1.3;
}

@media (max-width: 600px) {
  .two-col { grid-template-columns: 1fr; }
  .metrics-row { flex-direction: column; }
  .pt-tile { width: 90px; }
}
