/* saulno.github.io — black & white, no frills, all taste. */

:root {
  --ink: #1a1a1a;
  --paper: #fff;
  --faded: #6b6b6b;
  --rule: #d4d4d4;
}

:root[data-theme="dark"] {
  --ink: #e8e8e8;
  --paper: #161616;
  --faded: #9a9a9a;
  --rule: #3a3a3a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8e8e8;
    --paper: #161616;
    --faded: #9a9a9a;
    --rule: #3a3a3a;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.7 "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, serif;
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ---- masthead ---- */

.masthead {
  margin-bottom: 4.5rem;
  text-align: center;
}

.site-title {
  font-size: 1.375rem;
  letter-spacing: 0.02em;
}

.site-sub {
  color: var(--faded);
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* ---- sections ---- */

h2 {
  font-size: 0.8125rem;
  font-weight: normal;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faded);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.about {
  margin-bottom: 4.5rem;
}

.about p + p {
  margin-top: 1rem;
}

/* ---- post list ---- */

.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
}

.post-list a {
  flex: 1;
}

.post-list time {
  color: var(--faded);
  font: 0.75rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ---- article ---- */

article header {
  margin: 3.5rem 0 2.5rem;
  text-align: center;
}

article h1 {
  font-size: 1.75rem;
  font-weight: normal;
  line-height: 1.3;
}

article .date {
  color: var(--faded);
  font: 0.75rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.05em;
  margin-top: 1rem;
}

article p + p {
  margin-top: 1.25rem;
}

/* Markdown subheadings inside a post: quiet, not label-styled */
article h2,
article h3 {
  font-size: 1.125rem;
  color: var(--ink);
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 0;
  padding-bottom: 0;
  margin: 2.5rem 0 1rem;
}

article pre {
  font: 0.8125rem/1.6 ui-monospace, "SF Mono", Menlo, monospace;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-left: 2px solid var(--rule);
}

article code {
  font: 0.85em ui-monospace, "SF Mono", Menlo, monospace;
}

article pre code {
  font-size: inherit;
}

article blockquote {
  color: var(--faded);
  font-style: italic;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  border-left: 2px solid var(--rule);
}

article ul,
article ol {
  margin: 1.25rem 0 1.25rem 1.5rem;
}

article li + li {
  margin-top: 0.4rem;
}

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

article footer {
  margin-top: 3.5rem;
  text-align: right;
  color: var(--faded);
  font-style: italic;
}

/* ---- small bits ---- */

nav[aria-label="Site"] {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  margin-bottom: 3rem;
}

footer {
  color: var(--faded);
  font-size: 0.8125rem;
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* ---- theme toggle ---- */

.theme-toggle {
  position: absolute;
  top: 2.45rem;
  right: 1.15rem;
  width: 2rem;
  height: 2rem;
  padding: 0.2rem;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ensō half-moon: brush stroke + pencil-hatched half that flips with the theme */
.tm-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.tm-hatch { fill: url(#hatch); }

.tm-half-l { display: none; }

:root[data-theme="dark"] .tm-half-l { display: block; }
:root[data-theme="dark"] .tm-half-r { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tm-half-l { display: block; }
  :root:not([data-theme="light"]) .tm-half-r { display: none; }
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 30rem) {
  body {
    padding-top: 2rem;
  }
  .post-list li {
    flex-direction: column;
    gap: 0.2rem;
  }
}
