/* Chase Stockwell — portfolio styles
   Edit the variables below to change color and type across the site.
   Newsreader and Public Sans are licensed under the SIL Open Font License.
   License texts: /fonts/newsreader-OFL.txt and /fonts/public-sans-LICENSE.md
*/

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/newsreader-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/newsreader-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/public-sans-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/public-sans-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/public-sans-latin-600.woff2") format("woff2");
}

:root {
  --bg: #f4f1ea;
  --bg-elevated: #fffcf7;
  --ink: #1c1915;
  --muted: #3f3b36;
  --line: #ddd4c6;
  --accent: #1e4638;
  --accent-ink: #143328;
  --on-accent: #f7f4ee;
  --copper: #8a4318;
  --copper-ink: #6b3414;
  --copper-bg: #f6eadf;
  --focus: #1e4638;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --shell: 1080px;
  --radius: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 0.9rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

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

:focus {
  outline: none;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--on-accent);
  padding: 0.65rem 0.9rem;
  z-index: 30;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  transform: none;
}

.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;
}

.shell {
  width: min(var(--shell), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(244, 241, 234, 0.94);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  min-height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

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

.mark {
  width: 0.72rem;
  height: 0.72rem;
  background: var(--copper);
  display: inline-block;
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 0.45rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--copper);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 2.5rem 4rem;
  align-items: start;
  padding: 3.25rem 0 1rem;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--copper-ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.15rem, 7.4vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.lede {
  margin: 1.15rem 0 0;
  max-width: 40rem;
  font-size: 1.2rem;
  line-height: 1.5;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin: 1.85rem 0 0;
  padding: 0;
}

.facts div {
  margin: 0;
  border-top: 2px solid var(--ink);
  padding-top: 0.6rem;
}

.facts dt {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.facts dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--accent);
}

.button:hover {
  background: var(--accent-ink);
  color: var(--on-accent);
}

.text-link {
  font-weight: 600;
  padding: 0.4rem 0.1rem;
}

.portrait {
  margin: 0.35rem 0 0;
}

.portrait-frame {
  aspect-ratio: 4 / 5;
  border: 1px dashed #b7a48e;
  border-radius: var(--radius);
  background: linear-gradient(165deg, #e5efe8 0%, #f7f4ee 48%, #f4e7db 100%);
  display: grid;
  place-items: center;
}

.portrait-frame span {
  font-family: var(--serif);
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.portrait figcaption {
  display: flex;
  justify-content: center;
  margin-top: 0.65rem;
}

.section {
  padding-top: 4.25rem;
}

.section-head {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.35rem;
  max-width: 40rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.section-lead {
  margin: 0;
  color: var(--muted);
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: project;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
}

.card {
  counter-increment: project;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.2rem 1.25rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card.is-placeholder {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}

.card:focus-within {
  border-color: var(--accent);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.num::before {
  content: counter(project, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.status {
  margin: 0;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.status-pending,
.status-placeholder {
  color: var(--copper-ink);
}

.card h3 {
  margin: 0.15rem 0 0;
  font-size: 1.65rem;
}

.card h3 a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.summary {
  margin: 0;
  flex: 1;
}

.card-foot {
  margin: 0.35rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem 3.5rem;
}

.about-grid h3 {
  margin: 0 0 0.8rem;
  font-size: 1.55rem;
}

.degrees,
.orgs,
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.degrees li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.degrees li:last-child {
  border-bottom: 1px solid var(--line);
}

.degree {
  margin: 0;
  font-weight: 600;
}

.school,
.detail {
  margin: 0.12rem 0 0;
  color: var(--muted);
}

.orgs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  margin: 0.9rem 0 0;
}

.orgs li {
  margin: 0;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 0.95rem;
}

.contact-list li {
  margin: 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.contact-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.todo {
  display: inline-block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--copper-ink);
  background: var(--copper-bg);
  border: 1px dashed var(--copper);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
}

.site-footer {
  margin-top: 4.5rem;
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.page {
  width: min(44rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.25rem 0 1rem;
}

.page-wide {
  width: min(72rem, calc(100% - 2.5rem));
}

/* Keep prose in a comfortable measure. The diagram and table use the full width. */
.page-wide > article > .eyebrow,
.page-wide > article > h1,
.page-wide > article > h2,
.page-wide > article > p,
.page-wide > article > ul,
.page-wide > article > ol,
.page-wide > article > .part,
.page-wide > article > .legend {
  max-width: 40rem;
}

.back {
  margin: 0 0 1.35rem;
}

.back a {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.back a:hover {
  border-bottom-color: var(--copper);
}

.page h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2.35rem, 5vw, 3.5rem);
}

.page .lede {
  font-size: 1.2rem;
}

.page h2 {
  margin: 2.1rem 0 0.7rem;
  font-size: 1.7rem;
}

.page h3 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}

.page ul,
.page ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.page li + li {
  margin-top: 0.35rem;
}

.repo {
  margin-top: 1rem;
  font-weight: 600;
}

.steps {
  list-style: none;
  margin: 0.4rem 0 1rem;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--accent);
  line-height: 1.3;
}

.part {
  margin: 1.1rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 4px solid var(--part, var(--accent));
}

.part-collect { --part: #2f6eae; }
.part-detect { --part: #8a6a00; }
.part-alert { --part: #2c7a45; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  display: inline-block;
}

.swatch-collect { background: #d3e9ff; box-shadow: inset 0 0 0 1.5px #3d8bd9; }
.swatch-detect { background: #fff0a8; box-shadow: inset 0 0 0 1.5px #d4a300; }
.swatch-alert { background: #cdefd6; box-shadow: inset 0 0 0 1.5px #3ba55c; }

.diagram {
  margin: 1rem 0 0.6rem;
  max-width: 100%;
}

.diagram-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.diagram-scroll img {
  display: block;
  width: 1100px;
  max-width: none;
  height: auto;
}

@media (min-width: 1200px) {
  .diagram-scroll img {
    width: 100%;
    max-width: 100%;
  }
}

.diagram figcaption {
  margin-bottom: 0.55rem;
  max-width: 40rem;
  color: var(--muted);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 0.4rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.7rem 0.85rem 0.8rem;
  color: var(--muted);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

th {
  font-weight: 600;
}

thead th {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: #f7f3eb;
}

.callout {
  margin: 1.2rem 0;
  padding: 0.95rem 1rem;
  background: var(--copper-bg);
  border: 1px dashed var(--copper);
  border-radius: var(--radius);
}

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

.todo-block {
  margin: 1.2rem 0 0;
}

.todo-block div {
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.todo-block div:last-child {
  border-bottom: 1px solid var(--line);
}

.todo-block dt {
  font-weight: 600;
}

.todo-block dd {
  margin: 0.3rem 0 0;
}

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

@media (max-width: 800px) {
  .hero,
  .about-grid,
  .facts {
    grid-template-columns: 1fr;
  }

  .portrait {
    max-width: 190px;
  }

  .facts div {
    border-top: 0;
    border-left: 2px solid var(--ink);
    padding: 0.1rem 0 0.1rem 0.75rem;
  }

  .status {
    text-align: left;
  }

  .card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
}

@media (max-width: 520px) {
  .shell,
  .page,
  .page-wide {
    width: min(100% - 1.5rem, var(--shell));
  }

  .hero {
    padding-top: 2rem;
  }

  .section {
    padding-top: 3.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .mark,
  .portrait-frame,
  .button,
  .card,
  .todo {
    border: 1px solid CanvasText;
  }
}

@media print {
  .site-header,
  .skip-link,
  .hero-actions,
  .back {
    display: none;
  }

  body {
    background: #fff;
  }

  .card,
  .part,
  .degrees li {
    break-inside: avoid;
  }

  a {
    text-decoration: underline;
  }
}
