/* Shared styles for the portfolio (projects.html) and project case-study pages.
   Builds on the tokens defined in styles.css. */

.pf {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 0 24px;
  display: grid;
  gap: 64px;
}

.pf-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pf-section-title {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 700;
}

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

/* Intro */
.pf-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
}

.pf-intro h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
}

.pf-intro h1 .accent {
  color: var(--accent);
}

.pf-lead {
  margin: 0 0 24px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.65;
  color: #4b5563;
}

.pf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pf-avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 52px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, #7c8bff 100%);
  box-shadow: var(--shadow);
}

/* Skills */
.pf-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.pf-skill {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.pf-skill h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.pf-skill p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Project cards */
.pf-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.pf-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.pf-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.pf-status {
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #ecfdf5;
  color: #047857;
}

.pf-status.in-progress {
  background: #fff7ed;
  color: #c2410c;
}

.pf-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.pf-card p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}

.pf-metric {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pf-metric div {
  display: grid;
}

.pf-metric strong {
  font-size: 20px;
  color: var(--ink);
}

.pf-metric span {
  font-size: 12px;
  color: var(--muted);
}

.pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pf-tags li {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--soft);
  border: 1px solid var(--line);
  color: #374151;
}

.pf-card-cta {
  font-weight: 600;
  color: var(--accent);
}

.pf-card-cta.pf-muted {
  font-weight: 500;
  color: var(--muted);
}

/* Call-out band linking portfolio and tools */
.pf-band {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  border-radius: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.pf-band h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.pf-band p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .pf {
    padding-top: 28px;
    gap: 48px;
  }

  .pf-intro {
    grid-template-columns: 1fr;
  }

  .pf-avatar {
    display: none;
  }

  .pf-projects {
    grid-template-columns: 1fr;
  }

  .pf-band {
    padding: 22px 20px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0 16px 32px;
  }
}

/* ---------- Case-study pages ---------- */

.cs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 0 24px;
}

.cs-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.cs-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 800;
  line-height: 1.15;
}

.cs-summary {
  margin: 0 0 20px;
  max-width: 760px;
  font-size: 19px;
  line-height: 1.6;
  color: #374151;
}

.cs-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.cs-facts strong {
  color: var(--ink);
}

.cs-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.cs-kpi {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.cs-kpi strong {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.cs-kpi span {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
}

.cs-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.cs-toc {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.cs-toc a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.cs-toc a:hover {
  background: var(--soft);
  color: var(--ink);
}

.cs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  min-width: 0;
}

.cs-body section {
  scroll-margin-top: 24px;
}

.cs-body h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.cs-body h3 {
  margin: 20px 0 8px;
  font-size: 18px;
}

.cs-body p,
.cs-body li {
  color: #374151;
  font-size: 16px;
  line-height: 1.7;
}

.cs-body p {
  margin: 0 0 12px;
}

.cs-body ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.cs-body .pf-tags {
  padding-left: 0;
}

.cs-num {
  display: inline-block;
  min-width: 28px;
  color: var(--accent);
}

.cs-callout {
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--soft);
}

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

.cs-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cs-compare > div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.cs-compare h3 {
  margin-top: 0;
}

.cs-compare .after {
  border-color: var(--accent);
}

.cs-figure {
  margin: 8px 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow-x: auto;
}

.cs-figure svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.cs-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.cs-challenge {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  margin-bottom: 16px;
}

.cs-challenge h3 {
  margin-top: 0;
}

.cs-label {
  display: inline-block;
  margin-right: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.cs-demo {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}

.cs-demo strong {
  color: var(--ink);
  font-size: 18px;
}

.cs-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  border-left: 2px solid var(--line);
}

.cs-timeline li {
  position: relative;
  padding: 0 0 24px 8px;
}

.cs-timeline li::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--card);
}

.cs-timeline li.done::before {
  border-color: #10b981;
  background: #10b981;
}

.cs-timeline li.active::before {
  border-color: #f59e0b;
}

.cs-timeline h3 {
  margin: 0 0 4px;
}

.cs-timeline .pf-status {
  margin-bottom: 6px;
}

.cs-next {
  margin-top: 56px;
}

@media (max-width: 900px) {
  .cs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .cs {
    padding-top: 24px;
  }

  .cs-summary {
    font-size: 17px;
  }

  .cs-compare {
    grid-template-columns: 1fr;
  }
}
