/* ===== Reset (minimal) ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Base variables ===== */
:root{
  /* Light */
  --bg: #ffffff;
  --text: #231b16;
  --muted: #6d5e55;
  --link: #e26a2c;      /* Music Man orange */
  --rule: #e2d7ce;

  --font-body: "Inter", system-ui, sans-serif;
  --font-heading: "Literata", Georgia, serif;

  --size: 19px;         /* body size */
  --lh: 1.55;           /* line-height */
  --measure: 70ch;      /* line length */
  --space: 0.9rem;      /* paragraph spacing */
}

/* Dark */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #141312;      
    --text: #e8e6e3;
    --muted: #a8a5a0;
    --link: #ff8643;     /* warmer orange for dark */
    --rule: #2c2c2f;

    --font-body: "Inter", system-ui, sans-serif;
    --font-heading: "Literata", Georgia, serif;
  }
}

@media (max-width: 768px) {
  /* Increase side margins on tablets and phones */
  #content, #header, #footer {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}


/* ===== Page ===== */
html { font-size: 100%; }
body{
  font-family: var(--font-body);
  font-size: var(--size);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Shared container for structure */
header, main, footer{
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Vertical rhythm for header/footer */
header { margin-top: 4rem; margin-bottom: 1.5rem; }
footer {
  margin: 3rem auto 4rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-heading);
}

/* Main content area */
main, .article, #content {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ===== Typography ===== */
p, ul, ol, pre, blockquote, figure, .paragraph{
  margin-top: var(--space);
  margin-bottom: var(--space);
}

h1, h2, h3, h4{
  font-family: var(--font-heading);
  line-height: 1.25;
  letter-spacing: 0.005em;
  margin: 2.2rem 0 0.6rem 0;
  color: var(--text);
}
h1{ font-size: clamp(1.8rem, 1.6rem + 1vw, 2.3rem); font-weight: 600; }
h2{ font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); font-weight: 600; }
h3{ font-size: 1.1rem; font-weight: 600; }

p.lead, .lead{
  font-size: calc(var(--size) * 1.05);
}

small, .byline, .subtitle{
  color: var(--muted);
  font-family: var(--font-heading);
  display: block;
  margin-top: .2rem;
}

/* Headline → first paragraph tightening */
h1 + .byline,
h1 + p,
h1 + .paragraph p { margin-top: .8rem; }

/* ===== Links ===== */
a{
  color: var(--link);
  text-decoration: none;
  text-underline-offset: .18em;
}
a:hover{ text-decoration: underline; }
a:focus-visible{
  outline: 2px solid color-mix(in srgb, var(--link), #000 20%);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Text selection */
::selection{
  background: color-mix(in srgb, var(--link), #fff 70%);
  color: #000;
}
@media (prefers-color-scheme: dark){
  ::selection{
    background: color-mix(in srgb, var(--link), #000 70%);
    color: #fff;
  }
}

/* ===== Media ===== */
img, video{
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}
figure{ margin: 2rem 0; }
figcaption{
  font-family: var(--font-heading);
  font-size: .9rem;
  color: var(--muted);
  margin-top: .4rem;
  text-align: center;
}

/* ===== Lists ===== */
ul, ol{ padding-left: 1.2rem; }
li + li{ margin-top: .25rem; }

/* ===== Quotes & rules ===== */
blockquote{
  border-left: 3px solid var(--rule);
  padding: .5rem 1rem;
  color: var(--muted);
  font-style: italic;
}
hr{
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ===== Code (bare basics) ===== */
pre, code, kbd, samp{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
pre{
  background: color-mix(in srgb, var(--bg), #000 7%);
  border: 1px solid var(--rule);
  padding: .9rem 1rem;
  border-radius: 8px;
  overflow: auto;
}

/* ===== Fine tuning ===== */
p{ hyphens: auto; }
@supports (hanging-punctuation:first){
  p{ hanging-punctuation: first; }
}

/* Asciidoctor blocks (safe spacing) */
.admonitionblock, .imageblock, .listingblock, .exampleblock{
  margin: 1.2rem 0 1.6rem;
}
