/* ==================================================================
   Team Encoder — Pinball Software Tutorials
   Shared site stylesheet
   ================================================================== */

:root {
  --brand: #FF3D00;
  --brand-dark: #CC3100;
  --brand-soft: #fff1ec;
  --ink: #161a1f;
  --ink-soft: #1f2329;
  --muted: #555;
  --line: #e2e2e2;
  --bg: #fafafa;
  --warn-bg: #fff1ec;
  --warn-border: #FF3D00;
  --note-bg: #fdf6e3;
  --note-border: #b58a00;
  --tip-bg: #eef6fd;
  --tip-border: #1c7ed6;
  --stop-bg: #fbeaec;
  --stop-border: #b00020;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

code, pre {
  font-family: "Consolas", "Courier New", monospace;
  background: #f3f3f3;
  border-radius: 4px;
}
code { padding: 1px 6px; font-size: 0.92em; }
pre { padding: 12px 16px; overflow-x: auto; font-size: 0.92em; line-height: 1.45; }

/* ----- Header ----- */
.site-header {
  background: var(--ink);
  color: #fff;
  border-bottom: 4px solid var(--brand);
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.site-logo img { width: 28px; height: 28px; }
.site-logo .brand-pill {
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 6px;
}

.site-nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14.5px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--brand); }
.site-nav a.active { color: #fff; border-bottom-color: var(--brand); }

/* ----- Page wrapper ----- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-narrow {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ----- Hero / page heads ----- */
.page-eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 8px;
}
.page-title {
  font-size: 36px;
  line-height: 1.15;
  margin: 0 0 12px 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 28px 0;
  max-width: 720px;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin: 48px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand);
}
h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 8px;
}
h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 6px;
}
p { margin: 0 0 14px 0; }
ul, ol { margin: 0 0 14px 0; padding-left: 24px; }
li { margin-bottom: 4px; }
hr { border: none; border-top: 1px solid var(--line); margin: 36px 0; }

/* ----- Callouts ----- */
.callout {
  border-left: 4px solid;
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  margin-bottom: 6px;
}
.callout.warn   { border-color: var(--warn-border); background: var(--warn-bg); }
.callout.warn .label { color: var(--brand-dark); }
.callout.note   { border-color: var(--note-border); background: var(--note-bg); }
.callout.note .label { color: #8a6800; }
.callout.tip    { border-color: var(--tip-border); background: var(--tip-bg); }
.callout.tip .label { color: #145ca0; }
.callout.stop   { border-color: var(--stop-border); background: var(--stop-bg); border-left-width: 6px; }
.callout.stop .label { color: #8a001a; }

/* ----- Tile grid (landing page) ----- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin: 32px 0;
}
.tile {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 24px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}
.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
  border-color: var(--brand);
  text-decoration: none;
}
.tile-num {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}
.tile h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: var(--ink);
}
.tile p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}
.tile-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ----- Step layout ----- */
.steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
  margin: 18px 0;
}
.steps > li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 48px;
  padding-bottom: 22px;
  border-left: 2px solid var(--line);
  margin-left: 14px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.steps > li::before {
  content: counter(step-counter);
  position: absolute;
  left: -16px;
  top: -4px;
  width: 30px;
  height: 30px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: 700;
  font-size: 14px;
}
.steps > li > .step-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}

/* ----- Simulator framing ----- */
.sim-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin: 28px 0;
}
@media (min-width: 900px) {
  .sim-row.two { grid-template-columns: 1fr 1fr; }
}

.sim-frame {
  background: #232830;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  position: relative;
}
.sim-frame.phone { background: #1d1f24; }
.sim-frame.cabinet { background: #14161a; }
.sim-frame.daemon { background: #2c3e50; }

.sim-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 0 4px;
}
.sim-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2ecc71;
  box-shadow: 0 0 6px rgba(46,204,113,0.8);
}

.sim-screen {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.sim-frame.phone .sim-screen { height: 700px; max-width: 380px; margin: 0 auto; }
.sim-frame.cabinet .sim-screen { height: 460px; }
.sim-frame.daemon .sim-screen { height: 1100px; }

.sim-controls {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.sim-controls .ctrl-label {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}
.sim-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.sim-btn:hover { background: var(--brand); border-color: var(--brand); }
.sim-btn.active { background: var(--brand); border-color: var(--brand); }

/* ----- Annotation badges (numbered points overlay-style on cards) ----- */
.annotated {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 800px) {
  .annotated.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.annot-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 14px 18px;
}
.annot-card .annot-num {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  font-weight: 700;
  font-size: 12px;
  margin-right: 8px;
  vertical-align: 1px;
}
.annot-card h4 {
  display: inline-block;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 700;
}
.annot-card p { margin: 8px 0 0 0; font-size: 14.5px; }
.annot-card .small { font-size: 13px; color: var(--muted); }

/* ----- Tables ----- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
th { background: #f3f3f3; text-align: left; padding: 8px 10px; border: 1px solid #ccc; }
td { padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 28px 24px;
  margin-top: 60px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.site-footer a { margin: 0 10px; }

/* ----- Misc helpers ----- */
.kbd {
  display: inline-block;
  font-family: "Consolas", "Courier New", monospace;
  background: #fff;
  border: 1px solid #ccc;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.86em;
  color: var(--ink);
}
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.brand { background: var(--brand); color: #fff; }
.pill.muted { background: #efefef; color: var(--ink-soft); }
.pill.warn { background: var(--warn-bg); color: var(--brand-dark); }

.center { text-align: center; }
.small { font-size: 13.5px; color: var(--muted); }

/* prevent simulators (iframes) from being interacted with by accident on small viewports */
@media (max-width: 600px) {
  .sim-frame.daemon .sim-screen { height: 1500px; }
}
