/* Kyle Sangillo: Paper & Pine */

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

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

:root {
  --ground: #FBF9F5;
  --raised: #F3EFE8;
  --rule: #E2DBD0;
  --ink: #191C1A;
  --muted: #6A6659;
  --pine: #1F5040;
  --max-w: 70rem;
  --prose: 68ch;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Public Sans', system-ui, sans-serif;
}

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

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
}

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

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

:focus { outline: none; }

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

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--rule);
}

.skip-link:focus { top: 1rem; }

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-mark {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-mark:hover { color: var(--pine); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--pine);
  border-bottom-color: var(--pine);
}

/* ── Layout ── */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.section {
  padding-top: 4rem;
  scroll-margin-top: 4rem;
}

.section__eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.section__rule {
  width: 2.5rem;
  height: 2px;
  background: var(--pine);
  border: 0;
  margin: 0 0 0.75rem;
}

.section__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 1.15;
  margin: 0 0 1.75rem;
  color: var(--ink);
}

.prose {
  max-width: var(--prose);
}

.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

/* ── Hero ── */

.hero {
  display: grid;
  gap: 2.5rem;
  padding-top: 2.5rem;
  padding-bottom: 1rem;
}

@media (min-width: 840px) {
  .hero {
    grid-template-columns: 1fr minmax(280px, 480px);
    align-items: start;
    gap: 3rem;
  }
}

@media (max-width: 839px) {
  .hero__photo { order: -1; }
}

.hero__name {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 500;
  font-optical-sizing: auto;
  line-height: 1.05;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}

.hero__role {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.hero__lede {
  max-width: var(--prose);
  margin: 0 0 1.5rem;
  color: var(--ink);
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.hero__links a {
  color: var(--pine);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.1rem;
}

.hero__links a:hover {
  border-bottom-color: var(--pine);
}

.hero__photo img {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
}

/* ── About ── */

.about-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr minmax(12rem, 16rem);
    align-items: start;
  }
}

.facts-rail {
  background: var(--raised);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.35rem;
  font-size: 0.875rem;
}

.facts-rail dl {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.facts-rail dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.facts-rail dd {
  margin: 0;
  color: var(--ink);
}

/* ── Game cards ── */

.card-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  border: 1px solid var(--rule);
  background: var(--raised);
  display: flex;
  flex-direction: column;
}

.card__plate {
  aspect-ratio: 16 / 9;
  background: var(--raised);
  border-bottom: 1px solid var(--rule);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1.5rem;
  min-height: 10rem;
}

.card__plate-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.card__plate-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.card__media {
  display: block;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  background: var(--ink);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body { padding: 1.25rem 1.35rem 1.5rem; }

.card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 0.35rem;
}

.card__meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.card__list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.card__list li { margin-bottom: 0.35rem; }
.card__list li:last-child { margin-bottom: 0; }

.card__desc {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}

.card__links a {
  color: var(--pine);
  text-decoration: none;
}

.card__links a:hover { text-decoration: underline; }

.card__pending {
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

/* ── Definition list (jams) ── */

.def-list {
  margin: 2.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
}

.def-list h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 1rem;
}

.def-list dl {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.def-list dt {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
}

.def-list dd {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ── Video grid ── */

.video-intro {
  max-width: var(--prose);
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.video-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--raised);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.video-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-facade__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(251, 249, 245, 0.55);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pine);
  opacity: 0;
}

.video-facade:hover .video-facade__label,
.video-facade:focus-visible .video-facade__label {
  opacity: 1;
}

.video-card__title {
  font-size: 0.875rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.video-fallback {
  display: none;
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

html.no-js .video-facade { display: none; }
html.no-js .video-fallback { display: block; }

/* ── Service ledger ── */

.ledger {
  border: 1px solid var(--rule);
  background: var(--raised);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.ledger__row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.ledger__row:last-child { border-bottom: 0; }

.ledger__key {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ledger__val { color: var(--ink); }

@media (max-width: 520px) {
  .ledger__row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ── Background (two columns) ── */

.bg-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .bg-grid { grid-template-columns: 1fr 1fr; }
}

.bg-block h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.85rem;
}

.bg-block p,
.bg-block li {
  font-size: 0.9375rem;
  color: var(--ink);
}

.bg-block ul {
  margin: 0;
  padding-left: 1.15rem;
}

.bg-block li { margin-bottom: 0.35rem; }

.toolkit-groups {
  display: grid;
  gap: 1.25rem;
}

.toolkit-group h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

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

.tag-list li {
  font-size: 0.8125rem;
  padding: 0.35rem 0.6rem;
  background: var(--raised);
  border: 1px solid var(--rule);
  color: var(--ink);
}

.community-block {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.community-block h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 0.85rem;
}

/* ── Contact ── */

.contact-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .contact-grid { grid-template-columns: 1fr auto; align-items: start; }
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.contact-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.contact-list a {
  color: var(--pine);
  text-decoration: none;
}

.contact-list a:hover { text-decoration: underline; }

.btn-resume {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.25rem;
  background: var(--pine);
  color: var(--ground);
  text-decoration: none;
  border: 1px solid var(--pine);
}

.btn-resume:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}

/* ── Footer ── */

.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ── 404 ── */

.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
}

.error-page p { color: var(--muted); margin: 0 0 1.25rem; }

/* ── Print ── */

@media print {
  .site-header,
  .skip-link,
  .video-facade,
  .btn-resume { display: none !important; }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
    line-height: 1.4;
  }

  main { padding: 0; max-width: none; }

  .section {
    padding-top: 1.25rem;
    break-inside: avoid;
  }

  .hero {
    grid-template-columns: 1fr 2.5in;
    gap: 1rem;
    padding-top: 0;
  }

  .hero__photo img { max-width: 2.5in; }

  .video-wrap {
    aspect-ratio: auto;
    border: 0;
    min-height: 0;
  }

  .video-wrap::after {
    content: attr(data-print-url);
    display: block;
    font-size: 9pt;
    color: #333;
    margin-top: 0.15rem;
  }

  .video-card__title { font-size: 9pt; }

  a[href^="http"]::after,
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #555;
    word-break: break-all;
  }

  a[href^="#"]::after { content: none; }
}
