/* Article layout for projects/*.html. Load after project-base.css, which holds the tokens, top bar and footer. */
html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .6em; color: var(--ink); font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1.1em; }
strong { color: #333; }

code {
  padding: .1em .35em;
  font-family: var(--mono);
  font-size: .88em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.col { max-width: var(--col); margin: 0 auto; padding: 0 20px; }

/* Project header */
.project-hero { padding-top: 40px; }
.breadcrumb { margin-bottom: 18px; font-size: .85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #6c757d; }
.project-hero h1 { margin-bottom: 14px; font-size: clamp(1.9rem, 4.2vw, 2.6rem); }
.lede { font-size: 1.1rem; color: #495057; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.tags li { padding: 5px 12px; font-size: 12px; font-weight: 500; color: #374151; background: #f1f3f5; border-radius: 999px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.3;
  border: 2px solid var(--accent);
  border-radius: 8px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { color: #fff; background: var(--accent); }
.btn-primary:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline { color: var(--accent); background: #fff; }
.btn-outline:hover { color: var(--accent-dark); background: var(--accent-tint); }

.cover { margin: 32px auto 0; }
.cover img { width: 100%; max-height: 560px; object-fit: cover; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 15px; margin: 28px 0 0; }
.stat { padding: 14px 12px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
.stat b { display: block; font-size: 1.35rem; line-height: 1.3; color: var(--ink); }
.stat span { font-size: .78rem; font-weight: 600; color: #666; }

/* Article body */
.section { margin-top: 56px; }
.section > h2 { font-size: 1.6rem; }
.section > h2::before { content: ""; display: block; width: 40px; height: 3px; margin-bottom: 12px; background: var(--accent); border-radius: 2px; }
.section h3 { margin-top: 1.6em; font-size: 1.15rem; }
.section ul, .section ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.section li { margin: .3em 0; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0 0 1.4em;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.facts dt { font-weight: 600; color: var(--ink); }
.facts dd { margin: 0; }

.note { margin: 20px 0; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; }
.note > :last-child { margin-bottom: 0; }

figure { margin: 24px 0; }
figure img, .cover img { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
figure img { width: 100%; }
figure.narrow img { width: auto; }
figure.portrait img { width: auto; max-height: 640px; }
figcaption { margin-top: 8px; font-size: .85rem; line-height: 1.5; color: var(--muted); }
.grid-2, .grid-3 { display: grid; align-items: start; gap: 14px; margin: 24px 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 figure, .grid-3 figure { margin: 0; }
a[data-zoom] { display: block; cursor: zoom-in; }

.lightbox { max-width: 96vw; max-height: 94vh; padding: 0; background: transparent; border: 0; }
.lightbox::backdrop { background: rgba(10, 14, 20, .88); }
.lightbox img { width: auto; max-width: 96vw; max-height: 90vh; background: #fff; border-radius: 6px; }
.lightbox-close {
  position: fixed;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.video { position: relative; aspect-ratio: 16 / 9; margin: 24px 0 8px; overflow: hidden; background: #000; border-radius: var(--radius); }
.video iframe, .video .yt, .video .yt img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .yt img { object-fit: cover; }
.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 50px;
  background: rgba(0, 0, 0, .72);
  border-radius: 14px;
  transform: translate(-50%, -50%);
  transition: background-color .2s ease;
}
.yt-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  transform: translate(-35%, -50%);
}
.yt:hover .yt-play, .yt:focus-visible .yt-play { background-color: var(--accent); }

pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: .86rem;
  line-height: 1.6;
  color: #e6e8eb;
  background: var(--dark);
  border-radius: 10px;
}
pre code { padding: 0; font-size: inherit; color: inherit; background: none; border: 0; }
figure.code figcaption { margin: 0 0 8px; font-family: var(--mono); }

.table-wrap { margin: 20px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; font-size: .92rem; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: .78rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--ink); background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; color: var(--ink); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }

.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.links a { display: block; height: 100%; padding: 14px 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s ease, transform .2s ease; }
.links a:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.links b { display: block; font-weight: 600; }
.links span { display: block; font-size: .85rem; line-height: 1.5; color: var(--muted); }

/* Related projects: same card style as the home page sandbox grid. */
.related { margin-top: 72px; padding: 48px 0 64px; background: var(--surface); border-top: 1px solid var(--line); }
.related h2 { font-size: 1.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 20px; margin-top: 20px; }
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover { color: inherit; text-decoration: none; border-color: var(--accent); box-shadow: 0 8px 25px rgba(0, 0, 0, .08); transform: translateY(-4px); }
.card img { width: 100%; height: 140px; object-fit: cover; }
.card div { padding: 14px 16px 16px; }
.card > div:first-child { flex: 1; padding-top: 18px; border-top: 4px solid var(--accent); }
.card small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: #999; }
.card b { display: block; margin-top: 4px; font-weight: 600; line-height: 1.4; color: #333; }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .section { margin-top: 44px; }
}
