/*
 * Broadsheet - styles for the home, about and writings pages.
 * The sub-apps (tools, pictures, etc.) still use layout.pug + Bootstrap.
 */

:root {
  --paper: #f5f2ea;
  --ink: #1b1a17;
  --dim: #4d4a42;
  --patent: #2c2a25;
  --muted: #6b675e;
  --hairline: #d8d3c6;
  --placeholder: #e6e1d4;

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Albert Sans', sans-serif;

  --rule: 1px solid var(--ink);
  --rule-double: 3px double var(--ink);
  --rule-hair: 1px solid var(--hairline);

  --section-gap: clamp(32px, 4vw, 48px);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--ink);
}

a:hover {
  color: var(--muted);
}

.page {
  max-width: 1168px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 28px) clamp(20px, 4.5vw, 56px) 0;
  box-sizing: border-box;
}

/* ---- chrome ---- */

.top-rule {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font: 500 11px var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: var(--rule);
}

.top-rule a {
  text-decoration: none;
  color: var(--muted);
}

.top-rule a:hover {
  color: var(--ink);
}

.masthead {
  font: 600 clamp(40px, 7.4vw, 92px)/1 var(--serif);
  letter-spacing: -.025em;
  margin: clamp(18px, 2.5vw, 28px) 0 clamp(14px, 2vw, 18px);
  text-align: center;
  text-wrap: balance;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px clamp(18px, 3vw, 36px);
  font: 500 12px var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 0;
  border-bottom: var(--rule-double);
}

.masthead + .nav {
  border-top: var(--rule);
}

.nav > a,
.nav summary {
  text-decoration: none;
  color: var(--muted);
}

.nav > a:hover,
.nav summary:hover,
.nav > a.current,
.nav summary.current {
  color: var(--ink);
}

.nav details {
  position: relative;
}

.nav summary {
  list-style: none;
  cursor: pointer;
}

.nav summary::-webkit-details-marker {
  display: none;
}

.nav-menu {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 6px 0;
  background: var(--paper);
  border: var(--rule);
  font: 400 15px var(--serif);
  letter-spacing: 0;
  text-transform: none;
}

.nav-menu a {
  text-decoration: none;
  padding: 7px 16px;
}

.footer {
  margin-top: clamp(36px, 5vw, 56px);
  padding: 16px 0 32px;
  border-top: var(--rule-double);
  font: 400 12px var(--sans);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer a {
  text-decoration: none;
  color: var(--muted);
}

.footer a:hover {
  color: var(--ink);
}

/* ---- shared pieces ---- */

.section {
  padding-top: var(--section-gap);
}

.section-head {
  font: 500 11px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 8px 0;
  border-top: var(--rule);
  border-bottom: var(--rule-hair);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
}

.section-head .note {
  color: var(--muted);
}

.section-head.muted {
  color: var(--muted);
}

.list + .section-head {
  margin-top: 32px;
}

.list {
  font: 400 17px/1.4 var(--serif);
}

.list-row {
  display: block;
  padding: 12px 0;
  border-bottom: var(--rule-hair);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row,
.list-row > a {
  text-decoration: none;
}

.meta {
  font: 400 12px var(--sans);
  color: var(--muted);
  margin-top: 3px;
}

.meta a {
  color: var(--muted);
  text-underline-offset: 2px;
}

.meta a:hover {
  color: var(--ink);
}

.more {
  display: inline-block;
  margin-top: 10px;
  font: 500 12px var(--sans);
  letter-spacing: .04em;
  text-decoration: none;
  border-bottom: var(--rule);
}

.page-title {
  font: 600 clamp(32px, 4vw, 48px)/1.08 var(--serif);
  letter-spacing: -.02em;
  text-wrap: balance;
}

.prose a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.contact {
  font: 400 17px/1.5 var(--serif);
  color: var(--dim);
  margin: 0;
}

.contact a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.contact a:hover {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col, 300px)), 1fr));
  gap: 32px 40px;
}

/* ---- home ---- */

.intro-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 36px 40px;
  padding-top: clamp(24px, 3.5vw, 40px);
}

.intro {
  flex: 1 1 520px;
  min-width: 0;
}

.portrait {
  float: right;
  width: clamp(150px, 30%, 300px);
  height: auto;
  margin: 4px 0 12px clamp(16px, 3vw, 32px);
  mix-blend-mode: multiply;
}

.deck {
  font: italic clamp(18px, 2vw, 24px)/1.35 var(--serif);
  color: var(--dim);
  margin: 0 0 20px;
}

.intro .body {
  font: 400 clamp(18px, 1.6vw, 20px)/1.55 var(--serif);
  margin: 0 0 16px;
  text-wrap: pretty;
}

.dropcap {
  float: left;
  font: 600 clamp(54px, 5vw, 66px)/0.8 var(--serif);
  padding: 8px 8px 0 0;
}

.home-aside {
  flex: 1 1 260px;
  max-width: 100%;
  min-width: 0;
}

.home-aside .section-head + * + .section-head {
  margin-top: 22px;
}

.find-me {
  font: 400 15px/1.3 var(--serif);
}

.find-me a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: var(--rule-hair);
  text-decoration: none;
}

.find-me a:last-child,
.projects a:last-child {
  border-bottom: 0;
}

.find-me .label {
  font: 500 11px/1.6 var(--sans);
  color: var(--muted);
}

.projects {
  font: 400 15px/1.4 var(--serif);
}

.projects a {
  display: block;
  padding: 10px 0;
  border-bottom: var(--rule-hair);
  text-decoration: none;
}

.projects .name {
  font-weight: 600;
}

.projects .desc {
  color: var(--dim);
}

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 28px;
  padding-top: 20px;
}

.videos iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--placeholder);
}

.video-title {
  font: 600 19px/1.3 var(--serif);
  margin-top: 12px;
}

.video-link {
  font: 400 15px var(--serif);
  color: var(--dim);
  text-underline-offset: 3px;
}

.patents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px 28px;
  padding-top: 16px;
  font: 400 16px/1.45 var(--serif);
}

.patents a {
  text-decoration: none;
  color: var(--patent);
}

.patents a:hover {
  color: var(--muted);
}

.patents .meta {
  margin: 0 0 4px;
}

/* ---- about ---- */

.about-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 36px clamp(40px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 48px);
}

.about-aside {
  flex: 1 1 260px;
  max-width: 300px;
  min-width: 0;
}

.about-aside img {
  display: block;
  width: 100%;
  height: auto;
}

.about-aside .section-head {
  margin-top: 24px;
}

.career {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  padding-top: 12px;
  font: 400 15px/1.35 var(--serif);
}

.career .place {
  font: 400 12px/1.6 var(--sans);
  color: var(--muted);
}

.bio {
  flex: 1 1 440px;
  max-width: 660px;
  min-width: 0;
}

.bio .page-title {
  margin: 0 0 28px;
}

.bio p {
  font: 400 19px/1.55 var(--serif);
  margin: 0 0 16px;
  text-wrap: pretty;
}

.bio p.aside {
  font-style: italic;
  color: var(--dim);
}

.bio p.contact {
  font: 400 17px/1.5 var(--serif);
  margin: 0;
}

.bios {
  padding-top: clamp(36px, 5vw, 56px);
}

.snippets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px;
  padding-top: 20px;
}

.snippet-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 500 12px var(--sans);
  color: var(--muted);
  margin-bottom: 10px;
}

.btn,
.copy-btn {
  font: 500 12px var(--sans);
  color: var(--ink);
  background: none;
  border: var(--rule);
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
}

.snippet-body p {
  font: 400 16px/1.5 var(--serif);
  margin: 0 0 10px;
}

.snippet-body p:last-child {
  margin-bottom: 0;
}

/* ---- page heading (writings, tools, etc.) ---- */

.page-head {
  margin: clamp(28px, 4vw, 48px) 0 clamp(24px, 3vw, 40px);
}

.lede {
  max-width: 760px;
  font: 400 18px/1.55 var(--serif);
  text-wrap: pretty;
}

.lede p {
  margin: 0 0 16px;
}

.measure {
  max-width: 900px;
}

.muted {
  color: var(--muted);
}

.btn:hover {
  color: var(--paper);
  background: var(--ink);
}

.btn-solid {
  color: var(--paper);
  background: var(--ink);
}

.btn-solid:hover {
  background: var(--dim);
  border-color: var(--dim);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  font-size: .88em;
}

pre {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  background: #ede9df;
  border: var(--rule-hair);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- forms ---- */

.fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px 20px;
}

.field {
  grid-column: span 12;
  min-width: 0;
}

@media (min-width: 760px) {
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
  .span-6 { grid-column: span 6; }
  .span-8 { grid-column: span 8; }
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font: 500 11px var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  font: 400 17px/1.4 var(--serif);
  color: var(--ink);
  background: #fbf9f4;
  border: 1px solid var(--hairline);
  border-bottom-color: var(--ink);
  border-radius: 0;
}

.input:focus {
  outline: none;
  border-color: var(--ink);
}

.input::placeholder {
  color: #9a958a;
}

.input[readonly] {
  background: transparent;
}

select.input {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231b1a17'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

textarea.input {
  resize: vertical;
}

.hint {
  margin-top: 5px;
  font: 400 12px/1.4 var(--sans);
  color: var(--muted);
}

.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-row .input {
  flex: 1;
}

/* ---- tabs ---- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px clamp(16px, 2.5vw, 28px);
  border-top: var(--rule);
  border-bottom: var(--rule-hair);
}

.tabs button {
  margin: 0 0 -1px;
  padding: 10px 0 8px;
  font: 500 11px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tabs button:hover,
.tabs button.active {
  color: var(--ink);
}

.tabs button.active {
  border-bottom-color: var(--ink);
}

.tab-pane {
  padding-top: 24px;
}

/* ---- tools ---- */

.tool {
  max-width: 640px;
}

.tool-note {
  margin: 14px 0 0;
  font: 400 12px/1.5 var(--sans);
  color: var(--muted);
}

.ip-address {
  padding: 18px 0 4px;
  font: 600 clamp(36px, 7vw, 72px)/1.05 var(--serif);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.qr-display {
  margin-top: 24px;
  max-width: 400px;
}

.qr-display img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.qr-video {
  display: block;
  width: 100%;
  max-height: 60vh;
  background: var(--ink);
}

.ratio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ratio-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 160px;
}

.ratio-side hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 2px solid var(--ink);
}

.ratio-equals {
  font: 400 40px var(--serif);
}

.field.arrow {
  align-self: end;
  padding-bottom: 8px;
  text-align: center;
  font: 400 22px var(--serif);
}

@media (max-width: 759px) {
  .arrow {
    display: none;
  }
}

/* ---- djbdns record builder ---- */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 8px;
  font: 400 12px var(--sans);
  color: var(--muted);
}

.record {
  padding-top: var(--section-gap);
  scroll-margin-top: 12px;
}

.record-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding: 10px 0;
  border-top: var(--rule);
  border-bottom: var(--rule-hair);
}

.record-head h2 {
  margin: 0;
  font: 600 clamp(20px, 2.2vw, 24px)/1.25 var(--serif);
  letter-spacing: -.01em;
}

.record-head .note {
  font: 400 12px var(--sans);
  color: var(--muted);
}

.record-head .note a {
  color: var(--muted);
}

.record-body {
  padding-top: 16px;
  font: 400 17px/1.55 var(--serif);
}

.record-body p {
  margin: 0 0 16px;
}

.record-body p.tight {
  margin-bottom: 6px;
}

.record-body p.note-text {
  font: 400 13px/1.5 var(--sans);
  color: var(--muted);
}

.record-body .fields + p.note-text {
  margin: 16px 0 0;
}

.record-foot {
  margin-top: 20px;
}

.output-block + .output-block {
  margin-top: 16px;
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.output-head .field-label {
  margin: 0;
}

.output-block pre {
  margin: 0;
}

/* ---- tables ---- */

.table {
  width: 100%;
  border-collapse: collapse;
  font: 400 15px/1.4 var(--serif);
}

.table th {
  padding: 8px 10px;
  font: 500 11px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  border-top: var(--rule);
  border-bottom: var(--rule-hair);
}

.table td {
  padding: 8px 10px;
  border-bottom: var(--rule-hair);
}

.table-scroll {
  overflow-x: auto;
}

/* ---- toss-up ---- */

.game-wrap {
  padding-top: clamp(24px, 3.5vw, 40px);
}

.game-wrap #game {
  max-width: 850px;
}

/* ---- pictures ---- */

.section-head + p.meta {
  margin: 12px 0 4px;
}

.years {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  column-gap: 20px;
  font: 400 17px/1.4 var(--serif);
}

.years a {
  padding: 12px 0;
  border-bottom: var(--rule-hair);
  text-decoration: none;
}
