/* guyenglish.net — one stylesheet, no JavaScript, no webfonts.
   Gold on dark forest green. A single committed look, so there is no
   light-mode variant; every colour comes from the custom properties below. */

:root {
  --bg:         #16281e;  /* dark forest green                     */
  --panel:      #1e3527;  /* code blocks, slightly lifted          */
  --fg:         #e3c37e;  /* body gold                        9.1:1 */
  --bright:     #f0dca8;  /* headings and the wordmark       11.4:1 */
  --muted:      #b39a63;  /* dates, colophon                  5.7:1 */
  --rule:       #2f4a38;
  --link:       #ffd980;
  --link-hover: #fff2cf;

  /* Georgia for the wordmark and titles. It ships on every Mac and PC, so
     the fallbacks below are only ever reached on Linux. */
  --display: Georgia, "Iowan Old Style", Palatino, "Times New Roman",
             Times, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  color-scheme: dark;       /* dark scrollbars and form controls */
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  /* Keep clear of the notch and home indicator when an iPhone is held
     in landscape; max() leaves the normal padding alone everywhere else. */
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(4rem, env(safe-area-inset-bottom));
  max-width: 34rem;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.7 var(--body);
  /* A long URL should wrap rather than push the page sideways. */
  overflow-wrap: break-word;
}

::selection { background: var(--fg); color: var(--bg); }

a {
  color: var(--link);
  text-decoration-color: rgba(255, 217, 128, 0.6);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

/* --- masthead & colophon ------------------------------------------------ */

.masthead {
  margin-bottom: 3.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.masthead-title {
  display: inline-block;   /* keeps the hover target to the text itself */
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--bright);
  text-decoration: none;
}

.masthead-title:hover { color: var(--link-hover); }

/* One line under the wordmark: tagline on the leading edge, links on the
   trailing edge. space-between rather than margin-left:auto, so that if the
   two ever wrap apart both sit on the leading edge instead of stranding the
   links out to the right. */
.masthead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1.5rem;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.tagline { margin: 0; }

/* The muted colour above applies to the separator; the links take --link. */
.masthead-nav { margin: 0; }

.colophon {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.colophon p { margin: 0; }

/* --- headings ----------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  color: var(--bright);
  line-height: 1.25;
  letter-spacing: normal;
}

h1 { margin: 0 0 1.5rem;        font-size: 1.625rem; letter-spacing: -0.005em; }
h2 { margin: 2.25rem 0 0.75rem; font-size: 1.3125rem; }
h3 { margin: 2rem 0 0.5rem;     font-size: 1.125rem; }
h4, h5, h6 { margin: 1.75rem 0 0.5rem; font-size: 1rem; }

/* --- posts -------------------------------------------------------------- */

.post + .post {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule);
}

.post-title {
  margin: 0;
  font-size: 1.625rem;
}

.post-title a { color: var(--bright); text-decoration: none; }
.post-title a:hover { color: var(--link-hover); }

.post-date {
  margin: 0.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

p, ul, ol, pre, blockquote, figure, table { margin: 0 0 1.3rem; }

li { margin-bottom: 0.4rem; }
li > ul, li > ol { margin: 0.4rem 0 0; }

blockquote {
  margin-left: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}

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

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

code {
  padding: 0.1em 0.3em;
  background: var(--panel);
  border-radius: 3px;
  font-size: 0.8125em;
  font-family: var(--mono);
}

pre {
  padding: 0.9rem 1rem;
  background: var(--panel);
  border-radius: 4px;
  border: 1px solid var(--rule);
  overflow-x: auto;
  line-height: 1.5;
}

pre code { padding: 0; background: none; border: 0; font-size: 0.8125rem; }

/* --- navigation --------------------------------------------------------- */

.post-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.post-nav .next { margin-left: auto; text-align: right; }

/* Two post titles will not sit side by side on a phone; stack them and
   let both read left-aligned. */
@media (max-width: 36rem) {
  .post-nav a { flex: 0 0 100%; }
  .post-nav .next { margin-left: 0; text-align: left; }
}

.more { margin-top: 3rem; }

ul.archive {
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

ul.archive li {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.45rem;
}

ul.archive time {
  flex: 0 0 3.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

/* --- print -------------------------------------------------------------- */

@media print {
  html, body { max-width: none; background: #fff; color: #000; }
  h1, h2, h3, h4, h5, h6, .post-title a, .masthead-title { color: #000; }
  .masthead-nav, .post-nav, .more { display: none; }
  a { color: inherit; text-decoration: none; }
  pre, code { background: #f4f4f4; border-color: #ddd; color: #000; }
}
