/* Content pages: same palette and details as home, laid out for reading. */

/* The wash is smaller here and scrolls away with the page, so it stays texture
   in the top-right corner and never ends up behind body text. */
body.page::before {
  position: absolute;
  inset: 0 0 auto auto;
  width: min(640px, 90vw);
  aspect-ratio: 8 / 5;
  background-position: top right;
  background-size: 100% auto;
  -webkit-mask-image: radial-gradient(ellipse 65% 66% at 62% 36%, var(--mask-solid) 45%, transparent 95%);
          mask-image: radial-gradient(ellipse 65% 66% at 62% 36%, var(--mask-solid) 45%, transparent 95%);
  animation-name: pageWashIn;
}

@keyframes pageWashIn {
  from { opacity: 0; }
  to   { opacity: 0.22; }
}

/* Keeps focused elements and anchor targets clear of the sticky header. */
html { scroll-padding-top: 6rem; }

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: max(16px, 6vw);
  z-index: 3;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--accent);
  transform: translateY(-200%);
}

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

body.page {
  display: flex;
  flex-direction: column;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---- Site header ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.85rem max(16px, 6vw);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.site-header ul {
  display: flex;
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header li a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease;
}

.site-header li a:hover,
.site-header li a:focus-visible {
  color: var(--ink);
}

.site-header li a[aria-current] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- Content column ---------------------------------------------------- */
.content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: calc(700px + 2 * max(16px, 6vw));
  margin: 0 auto;
  padding: 3.5rem max(16px, 6vw) 4rem;
}

/* Receives focus from the skip link, and isn't an interactive control. */
.content:focus { outline: 0; }

/* The page title is the eyebrow: the h1 for structure, without the h1 look. */
h1.eyebrow {
  font-weight: 400;
  line-height: normal;
  text-transform: uppercase;
}

/* Project pages: "Portfolio" links back, and the project name is the real title. */
.content h1:not(.eyebrow) {
  font-size: clamp(2rem, 5vw, 2.6rem);
  margin: 0 0 1.4rem;
}

.content .eyebrow a {
  color: inherit;
  text-transform: uppercase;
  border-bottom: 0;
}

/* Name and contact line, for the printed resume only. */
.print-header { display: none; }

.content h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}

.content h2::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  margin-right: 0.6em;
  border-radius: 1px;
  vertical-align: middle;
}

.content h3 {
  font-size: 1em;
  font-weight: 500;
  margin: 0;
}

.content p { margin: 0 0 1rem; }

.content a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

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

/* ---- Resume entries ---------------------------------------------------- */
.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1.5rem;
  margin-bottom: 1.5rem;
}

.entry p { margin: 0; color: var(--ink-soft); }

.entry .dates {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.entry .note,
.entry .detail {
  grid-column: 1 / -1;
}

.entry .detail { color: var(--ink); line-height: 1.5; margin-top: 0.2rem; }

.entry ul {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.5;
}

.entry li + li { margin-top: 0.2rem; }

.content .entry h3 a { border-bottom: 0; }

.skill strong { font-weight: 500; }

.content .skill { margin-bottom: 0.4rem; line-height: 1.5; }

.certifications {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.5;
}

/* ---- Portfolio cards --------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.25rem;
  transition: border-color 0.15s ease;
}

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

.content .card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

.content .card h2::before { display: none; }

/* The title link covers the whole card. */
.card h2 a { border-bottom: 0; }
.card h2 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.content .year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0.15rem 0 0.75rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}

.chips li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
}

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

/* ---- Project pages ----------------------------------------------------- */
.project-summary { color: var(--ink-soft); }

.project-list {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  line-height: 1.5;
}

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

.content .back {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 2.5rem;
}

/* ---- Footer ------------------------------------------------------------ */
footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem max(16px, 6vw) 2rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-soft);
}

/* ---- Responsive -------------------------------------------------------- */
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .content { padding-top: 2.5rem; }
  .entry { grid-template-columns: 1fr; }
  @keyframes pageWashIn {
    from { opacity: 0; }
    to   { opacity: 0.16; }
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page::before { animation: none; opacity: 0.22; }
}

/* ---- Print: /resume/ doubles as the resume PDF, in a Harvard-style layout -- */
@media print {
  @page { size: letter; margin: 0.6in; }

  html, body { background: none; }

  body.page {
    display: block;
    font-size: 10pt;
    line-height: 1.3;
  }

  body.page::before,
  .skip-link,
  .site-header,
  footer,
  h1.eyebrow,
  .divider,
  .back {
    display: none;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .print-header {
    display: block;
    text-align: center;
  }

  .print-header p { margin: 0; }

  .print-header .print-name {
    font-family: var(--font-display);
    font-size: 17pt;
    font-weight: 600;
    line-height: 1.2;
  }

  .content h2 {
    font-family: var(--font-body);
    font-size: 11pt;
    font-weight: 500;
    text-align: center;
    margin: 1.1rem 0 0.4rem;
    break-after: avoid;
  }

  .content h2::before { display: none; }

  .content a { border-bottom: 0; }

  /* Organization in capitals on the first line, role beneath it. */
  .entry > div {
    display: flex;
    flex-direction: column-reverse;
  }

  .entry > div p {
    color: var(--ink);
    font-weight: 500;
    text-transform: uppercase;
  }

  .entry .dates {
    font-family: var(--font-body);
    font-size: inherit;
    font-weight: 400;
    text-transform: none;
  }

  .entry .detail { margin-top: 0; line-height: 1.3; }
  .content .skill { margin-bottom: 0.1rem; line-height: 1.3; }
  .certifications { line-height: 1.3; columns: 2; column-gap: 1.5rem; }

  .entry { margin-bottom: 0.55rem; }
  .entry ul { margin-top: 0.1rem; line-height: 1.3; }
  .entry li + li { margin-top: 0.1rem; }
  .entry, .card { break-inside: avoid; }
}
