/* epabez.com (index + blog). zenith.html still uses style.css.
   Cobalt direction: Instrument Sans, list-based, section names in a left
   column. Footer button cycles themes: Cobalt (default), Forest, Plum. */

:root {
  /* Cobalt: default for everyone */
  --bg: #1c3786;
  --text: #eef2fb;   /* 9.7:1 */
  --dim: #b4c2e6;    /* 6.1:1 */
  --rule: #435b9e;
  --line: #ffd866;
  --accent: #ffd866; /* 7.9:1 */
  --font: "Instrument Sans", system-ui, sans-serif;
  --label: 8rem;
  color-scheme: dark;
}
/* Forest: deep green + brass */
:root[data-theme="forest"] {
  --bg: #183a2e; --text: #ebf1e8; --dim: #a9c2b4; --rule: #3a5a4c; --line: #f2c14e; --accent: #f2c14e;
}
/* Plum: deep purple + peach */
:root[data-theme="plum"] {
  --bg: #2a1f3d; --text: #f0eaf7; --dim: #bcaed3; --rule: #4a3d63; --line: #ffb38a; --accent: #ffb38a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
  transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
p { margin: 0 0 0.75rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3rem, 12vh, 7rem) 1.25rem 3rem;
}

/* ---------- Intro: the one place with emphasis ---------- */
.intro { margin: 0 0 3.5rem var(--label); max-width: 34rem; }
.avatar {
  display: block;
  width: 4.5rem; height: 4.5rem;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1.75rem;
}
h1 {
  margin: 0 0 1rem;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.intro p { color: var(--dim); }
h1 .k { color: var(--accent); }
.intro .name { text-transform: uppercase; letter-spacing: -0.01em; }
.intro .lede { color: var(--text); font-size: 1.125rem; line-height: 1.55; letter-spacing: -0.005em; }
.links { display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin: 1rem 0 0 -0.5rem; }
.links a { display: inline-block; padding: 0.6rem 0.5rem; }
.contact-email.is-copied { color: var(--accent); }

/* ---------- Sections: name on the left, list on the right ---------- */
.block {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  margin-bottom: 3rem;
}
h2 {
  margin: 0;
  padding: 0.9rem 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

.rows > li + li { border-top: 1px solid var(--rule); }
.block:last-of-type { margin-bottom: 1.5rem; }
.row, summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1rem;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.9rem 0;
}
.what { min-width: 0; font-weight: 500; line-height: 1.5; }
.at { display: block; margin-top: 0.1rem; color: var(--dim); font-weight: 400; font-size: 0.9375rem; line-height: 1.55; }
.when { color: var(--dim); font-size: 0.9375rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

summary {
  grid-template-columns: minmax(0, 1fr) auto 1rem;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+" / "";
  font-size: 1.25rem;
  line-height: 1;
  width: 1rem;
  text-align: center;
  color: var(--dim);
  transition: transform 0.2s ease, color 0.15s;
}
summary:hover::after { color: var(--accent); }
details[open] > summary::after { transform: rotate(45deg); color: var(--accent); }

.notes {
  margin: 0.1rem 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 34rem;
}
.notes li + li { margin-top: 0.5rem; }

/* ---------- Blog ---------- */
.empty { color: var(--dim); }
/* Blog post list, tinyprojects style: one line per post, newest first */
.posts .row { grid-template-columns: minmax(0, 1fr) auto; }
.post-no { font-style: italic; color: var(--dim); font-weight: 400; }
.soon { color: var(--dim); font-weight: 400; }
.back { margin-bottom: 2rem; }
.back a { display: inline-block; padding: 0.6rem 0; }

/* ---------- Blog post ---------- */
.post-meta { margin-bottom: 0.5rem; color: var(--dim); font-size: 0.9375rem; }
.post {
  margin: 0 0 4rem var(--label);
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}
.post p { margin: 0 0 1.25rem; }
.post h2 { margin: 2.5rem 0 0.75rem; font-size: 1.25rem; padding: 0; }
.post ul { margin: 0 0 1.25rem; padding-left: 1.25rem; list-style: square; }
.post li + li { margin-top: 0.4rem; }
.post li::marker { color: var(--accent); }
.post code { font-size: 0.9em; padding: 0.1em 0.3em; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-left: var(--label);
  padding-top: 0.5rem;
  color: var(--dim);
  font-size: 0.875rem;
}
.theme-toggle {
  font: inherit;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 0.75rem 0 0.75rem 1rem;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); text-decoration-color: var(--accent); }

/* ---------- Narrow screens: one column all the way ---------- */
@media (max-width: 680px) {
  :root { --label: 0; }
  .intro { margin-left: 0; }
  .block { grid-template-columns: minmax(0, 1fr); margin-bottom: 2.5rem; }
  h2 { padding: 0 0 0.25rem; border-bottom: 1px solid var(--rule); }
  .foot { margin-left: 0; }
  .post { margin-left: 0; }
  h1 { font-size: 2.25rem; }
  .intro .lede { font-size: 1.0625rem; }
  /* Rows go fully single column: date drops under the detail line. */
  .row, summary { grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
  summary { padding-right: 2rem; }
  summary::after { position: absolute; right: 0; top: 0.95rem; }
  .when { margin-top: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
