/* athonmillane.com: one plain column, serif type. Hand-written, no framework. */

:root {
  color-scheme: light dark;
  --page: #f2f1ee;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --rule: #e2e0db;
  --link: #2b4c6f;
  --link-hover: #12304f;
  --note: #f7f4ec;
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
  font-size: 106.25%;
  line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #121212;
    --paper: #1b1b1b;
    --ink: #e8e6e1;
    --muted: #a3a09a;
    --rule: #33322f;
    --link: #a9c1dc;
    --link-hover: #d3e1f0;
    --note: #24231f;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

/* About 75 characters a line once the padding is taken off. */
main {
  width: min(41rem, calc(100% - 2rem));
  margin: 1.5rem auto;
  padding: 1.75rem 2.25rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

/* Contain the floated photo inside the column. */
main::after {
  content: "";
  display: block;
  clear: both;
}

h1,
h2 {
  font-weight: normal;
  line-height: 1.2;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h2 {
  margin: 1.9rem 0 0.6rem;
  font-size: 1.3rem;
}

p {
  margin: 0 0 0.9rem;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  overflow-wrap: anywhere;
}

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

a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

ul {
  margin: 0;
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.75rem;
}

em {
  font-style: italic;
}

/* The photo is a <picture>; the <img> inside keeps its width and height attributes. */
.profile-image {
  float: right;
  width: 168px;
  margin: 0.35rem 0 1rem 1.5rem;
}

.profile-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--rule);
}

/* Home: the location line under the name, and the row of contact links under the intro. */
h1:has(+ .where) {
  margin-bottom: 0.3rem;
}

.where {
  margin: 0 0 1rem;
  color: var(--muted);
}

.nowrap {
  white-space: nowrap;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.2rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.links li + li {
  margin-top: 0;
}

.byline,
footer {
  color: var(--muted);
}

.crumb {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

footer {
  clear: both;
  margin-top: 2.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
}

footer p {
  margin: 0;
}

/* The PIN form on /wtft. Controls are at least 44px tall for touch. */
.unlock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.9rem;
}

.unlock label {
  flex-basis: 100%;
  margin: 0;
}

.unlock input,
.unlock button {
  min-height: 2.75rem;
  font: inherit;
  border-radius: 3px;
}

.unlock input {
  width: 11rem;
  max-width: 100%;
  padding: 0.35rem 0.6rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
}

.unlock button {
  margin: 0;
  padding: 0.35rem 1.1rem;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
}

.unlock button:hover {
  opacity: 0.88;
}

.note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  background: var(--note);
  border-left: 3px solid var(--muted);
}

.note[hidden] {
  display: none;
}

/* Phones: the column fills the screen, and the photo sits beside the name, not the intro. */
@media (max-width: 40rem) {
  :root {
    font-size: 100%;
  }

  body {
    background: var(--paper);
  }

  main {
    width: 100%;
    margin: 0;
    padding: 1.25rem 1.1rem 1rem;
    border: 0;
    border-radius: 0;
  }

  h1 {
    font-size: 1.75rem;
  }

  .profile-image {
    width: 92px;
    margin: 0.2rem 0 0.75rem 0.9rem;
  }

  /* Start the intro below the photo, so its first lines aren't squeezed beside it. */
  .where + p {
    clear: right;
  }

  ul {
    padding-left: 1.1rem;
  }
}

@media print {
  :root {
    color-scheme: light;
    --ink: #000;
    --muted: #444;
    --link: #000;
    font-size: 11pt;
  }

  body,
  main {
    background: #fff;
  }

  main {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }

  a {
    text-decoration: none;
  }

  /* Spell out the contact links and this site's own pages; other links print as text. */
  .links a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }

  a[href^="/"]:not([href="/"]):not([href^="/#"])::after {
    content: " (athonmillane.com" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }

  .profile-image {
    width: 110px;
  }

  .unlock,
  .note {
    display: none;
  }

  h2 {
    break-after: avoid;
  }

  li,
  p {
    break-inside: avoid;
  }
}
