/* pouliot.dev styles. Hand-written, no framework, no third-party requests. */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f5f6f8;
  --fg:        #1c1e21;
  --fg-muted:  #5a6069;
  --rule:      #dfe2e6;
  --link:      #14548c;
  --link-hover:#0d3a62;
  --accent:    #14548c;
  --note-bg:   #eef4fa;
  --note-edge: #14548c;
  --warn-bg:   #fdf3ec;
  --warn-edge: #a8531a;
  --code-bg:   #f5f6f8;
  --plate:     #f7f8fa;
  --measure:   42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14161a;
    --bg-soft:   #1c1f24;
    --fg:        #e4e6ea;
    --fg-muted:  #9aa2ad;
    --rule:      #2c3038;
    --link:      #7ab5e8;
    --link-hover:#a3cdf3;
    --accent:    #7ab5e8;
    --note-bg:   #1a2530;
    --note-edge: #4d87bd;
    --warn-bg:   #2b2019;
    --warn-edge: #d08a4e;
    --code-bg:   #1c1f24;
    /* Deeper than the light-mode plate so it does not glare against a dark
       page, but still light enough to keep knocked-out label text legible. */
    --plate:     #e9ebef;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: .6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---- header / nav ---- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-soft);
  margin-bottom: 2.5rem;
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: .5rem 1.25rem; padding-top: .9rem; padding-bottom: .9rem;
}
.brand {
  font-weight: 700; font-size: 1.05rem; color: var(--fg);
  text-decoration: none; margin-right: auto;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-header nav a { font-size: .93rem; color: var(--fg-muted); text-decoration: none; }
.site-header nav a:hover { color: var(--link-hover); }
.site-header nav a[aria-current="page"] {
  color: var(--fg); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---- type ---- */

h1, h2, h3, h4 { line-height: 1.25; margin: 2.25rem 0 .75rem; }
h1 { font-size: 2rem; margin-top: 0; letter-spacing: -.015em; }
h2 { font-size: 1.4rem; padding-top: .5rem; border-top: 1px solid var(--rule); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; color: var(--fg-muted); }

p, ul, ol { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .35rem; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

.subtitle { color: var(--fg-muted); font-size: 1.1rem; margin-top: -.4rem; }
.lede { font-size: 1.08rem; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

img { max-width: 100%; height: auto; border-radius: 4px; }

/* Diagrams with transparent backgrounds were drawn for a white page. Their
   label text is knocked out of the shapes, so on a dark background it turns
   dark-on-dark. Give them the white page they expect. */
.plate {
  background: var(--plate);
  padding: .75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

/* ---- code ---- */

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
}
code { font-size: .875em; background: var(--code-bg); padding: .12em .35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: .9rem 1rem;
  overflow-x: auto;          /* long docker run lines must not blow out phones */
  font-size: .85rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: inherit; }
kbd {
  background: var(--bg-soft); border: 1px solid var(--rule);
  border-bottom-width: 2px; border-radius: 4px;
  padding: .1em .4em; font-size: .82em;
}

/* ---- callouts (replaces claat <aside class="positive">) ---- */

.note {
  background: var(--note-bg);
  border-left: 3px solid var(--note-edge);
  border-radius: 0 5px 5px 0;
  padding: .9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.note > :first-child { margin-top: 0; }
.note > :last-child  { margin-bottom: 0; }
.note-label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--note-edge); margin-bottom: .4rem;
}

/* Same shape as .note, but for things with legal or safety consequences. */
.warn {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-edge);
  border-radius: 0 5px 5px 0;
  padding: .9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.warn > :first-child { margin-top: 0; }
.warn > :last-child  { margin-bottom: 0; }
.warn-label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--warn-edge); margin-bottom: .4rem;
}

/* ---- try-it challenges (replaces the graded lab prompts) ---- */

.try {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  padding: .9rem 1.1rem;
  margin: 1.5rem 0;
  background: var(--bg-soft);
  font-size: .95rem;
}
.try > :first-child { margin-top: 0; }
.try > :last-child  { margin-bottom: 0; }
.try-label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .4rem;
}

/* ---- table of contents ---- */

#toc { background: var(--bg-soft); border: 1px solid var(--rule);
       border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 2rem; font-size: .93rem; }
#toc ul { margin: 0; padding-left: 1.1rem; }
#toc > ul { padding-left: 1rem; }
#toc li { margin-bottom: .2rem; }
#toc .toc-title { font-weight: 700; font-size: .8rem; letter-spacing: .06em;
                  text-transform: uppercase; color: var(--fg-muted); margin-bottom: .5rem; }

/* ---- home page cards ---- */

.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 2rem 0; padding: 0; list-style: none; }
@media (min-width: 34rem) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  border: 1px solid var(--rule); border-radius: 8px; padding: 1.1rem 1.2rem;
  background: var(--bg-soft); margin: 0;
}
.card h2 { margin: 0 0 .4rem; font-size: 1.05rem; border-top: 0; padding-top: 0; }
.card h2 a { text-decoration: none; }
.card p { margin: 0; font-size: .93rem; color: var(--fg-muted); }

/* ---- footer ---- */

.site-footer {
  margin-top: 4rem; padding: 1.75rem 0 2.5rem;
  border-top: 1px solid var(--rule); background: var(--bg-soft);
  font-size: .87rem; color: var(--fg-muted);
}
.site-footer p { margin: 0 0 .35rem; }
