/* DoubleC, steve@doublec.biz
   Static CSS only. No external requests, no webfonts, no JavaScript.
   Served from an external file because the CSP is style-src 'self':
   an inline <style> block would be blocked. */

:root {
  color-scheme: light dark;

  --bg: #f4f1e8;
  --bg-sunk: #eae5d7;
  --ink: #262119;
  --ink-soft: #6a6055;
  --navy: #003366;
  --green: #006600;
  --rule: rgba(38, 33, 25, 0.14);
  --rule-strong: rgba(38, 33, 25, 0.3);

  --serif-display: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans-text: "Avenir Next", Avenir, Optima, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;

  --label-col: 19rem;
  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --curve: 1.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1915;
    --bg-sunk: #302b21;
    --ink: #efe9dc;
    --ink-soft: #ab9f8e;
    --navy: #a8c6e6;
    --green: #86c98a;
    --rule: rgba(239, 233, 220, 0.16);
    --rule-strong: rgba(239, 233, 220, 0.34);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans-text);
  font-size: 1.0625rem;
  line-height: 1.75;
  font-weight: 400;
  text-wrap: pretty;
}

h1, h2, h3, .wordmark {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

p {
  margin: 0 0 1.15em;
  overflow-wrap: break-word;
}

p:last-child { margin-bottom: 0; }

a {
  color: var(--navy);
  text-decoration-color: color-mix(in srgb, var(--green) 55%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  border-radius: 0.25rem;
}

a:hover {
  color: var(--green);
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
}

a:active { color: var(--green); }

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 0.35rem;
}

::selection {
  background: var(--bg-sunk);
}

img { display: block; max-width: 100%; height: auto; }

/* skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.65rem 1.1rem;
  background: var(--bg-sunk);
  color: var(--ink);
  border-radius: 999px;
  text-decoration: none;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* page frame */

.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

/* masthead */

.masthead {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 2.25rem 0 0;
}

.masthead img {
  width: 48px;
  height: 48px;
  flex: none;
}

.masthead a { display: block; line-height: 0; }

.wordmark {
  margin: 0;
  font-family: var(--serif-display);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* introduction */

.intro {
  display: grid;
  gap: 0 3.5rem;
  padding: 4.5rem 0 3.5rem;
}

.intro h1 {
  margin: 0 0 1.5rem;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2.375rem, 5.5vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.lede {
  max-width: var(--measure);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink);
}

@media (min-width: 52rem) {
  .intro {
    grid-template-columns: minmax(0, var(--label-col)) minmax(0, 1fr);
    align-items: start;
    padding: 6rem 0 4.5rem;
  }
  .intro h1 { margin-bottom: 0; }
  .lede { padding-top: 0.5rem; }

  /* Same reason as .area p below: without this, the second paragraph would be
     auto-placed into the label column under the name. */
  .intro p { grid-column: 2; }
}

/* areas of work */

.section-label {
  margin: 0;
  font-family: var(--sans-text);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.work { padding: 1rem 0 0; }

.work .section-label { margin-bottom: 1.5rem; }

.area {
  position: relative;
  padding: 2rem 0;
  display: grid;
  gap: 0.6rem 3.5rem;
}

.area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--rule);
}

.area:first-of-type::before {
  background: var(--rule-strong);
}

.area h3 {
  margin: 0;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--navy);
}

.area p {
  max-width: var(--measure);
  color: var(--ink);
}

@media (min-width: 52rem) {
  .area {
    grid-template-columns: minmax(0, var(--label-col)) minmax(0, 1fr);
    padding: 2.5rem 0;
  }
  .area h3 { padding-top: 0.1rem; }

  /* Auto-placement would drop a second paragraph into the label column, so
     prose is pinned to the content column and stacks there. Without this,
     any section with more than one paragraph zig-zags between columns. */
  .area p,
  .contact p { grid-column: 2; }
}

/* contact */

.contact {
  margin-top: 3.5rem;
  padding: 2.25rem 1.75rem;
  background: var(--bg-sunk);
  border-radius: var(--curve);
  display: grid;
  gap: 0.6rem 3.5rem;
}

.contact p {
  max-width: var(--measure);
  font-size: 1.125rem;
}

@media (min-width: 52rem) {
  .contact {
    grid-template-columns: minmax(0, var(--label-col)) minmax(0, 1fr);
    margin-top: 4.5rem;
    padding: 2.75rem 2.5rem;
  }
  .contact .section-label { padding-top: 0.45rem; }
}

/* footer */

.foot {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.foot p { margin: 0; }

/* 404 */

.notfound {
  padding: 4.5rem 0 4rem;
}

.notfound h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2.125rem, 5vw, 2.875rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.notfound p {
  max-width: var(--measure);
  font-size: 1.125rem;
}

@media (min-width: 52rem) {
  .notfound { padding: 7rem 0 5rem; }
}
