/* ====================================================================
   PROJECT PAGE — case-study overview, chapter detail, about
   ==================================================================== */

.page { padding: 0 var(--gutter); }
.page-inner { max-width: var(--maxw); margin: 0 auto; }

/* ── HERO ───────────────────────────────────────────── */
.project-hero {
  padding-top: clamp(6.5rem, 12vw, 9rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.crumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.crumb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s;
}

.crumb-back svg { transition: transform 0.3s var(--ease-out); }
.crumb-back:hover { color: var(--text); }
.crumb-back:hover svg { transform: translateX(-4px); }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero-eyebrow::after {
  content: "";
  width: 48px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.project-hero h1 {
  font-family: var(--serif);
  font-size: clamp(3.5rem, 11vw, 11rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.9;
}

/* spec sheet */
.spec-sheet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr);
  gap: 0 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.spec-sheet > div { padding: 1rem 0; }
.spec-sheet dt { margin-bottom: 0.5rem; }
.spec-sheet dd { font-size: 0.92rem; line-height: 1.5; }
.spec-sheet dd a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: color 0.25s, border-color 0.25s; }
.spec-sheet dd a:hover { color: var(--accent); border-color: var(--accent); }
.spec-sheet .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.spec-metric { text-align: right; }

.spec-metric-value {
  font-family: var(--serif);
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.spec-metric .label { display: block; margin-top: 0.6rem; }

/* ── OVERVIEW ───────────────────────────────────────── */
.overview-section {
  padding-bottom: clamp(5rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
}

.project-intro {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.15;
  max-width: 34ch;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

/* chapters: heading that says what the cards are for */
.chapters-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.chapters-head-title { color: var(--accent); }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* each chapter is a visible, pressable card */
.overview-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.overview-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s var(--ease-out), transform 0.45s var(--ease-out),
              border-color 0.3s, background-color 0.3s;
}

.overview-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg);
}

.overview-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out), filter 0.6s;
  filter: grayscale(0.25);
}

.overview-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.4rem 1.4rem 1.2rem;
}

.overview-card .feature-number { margin-bottom: 1.1rem; }

.overview-card-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: 0.6rem;
  transition: color 0.3s;
}

.overview-card-teaser {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  font-weight: 300;
  margin-bottom: 1.75rem;
}

/* footer pinned to the bottom so every card's CTA lines up */
.overview-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.overview-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.overview-card-cta-arrow {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 0.9rem;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.45s var(--ease-out);
}

/* hover (mouse) — lift, accent and push the arrow */
@media (hover: hover) {
  .overview-card.visible:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    background-color: var(--surface-hover);
  }
  .overview-card:hover .overview-card-title { color: var(--accent); }
  .overview-card:hover .overview-card-image img { transform: scale(1.04); filter: none; }
  .overview-card:hover .overview-card-cta-arrow {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    transform: translateX(4px);
  }
}

/* touch — the arrow is filled by default so the card reads as a button, and it presses */
@media (hover: none) {
  .overview-card-cta-arrow { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
  .overview-card.visible:active { transform: scale(0.98); border-color: var(--accent); }
}

.overview-card:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

/* next project */
.next-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  margin-top: clamp(5rem, 10vw, 8rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}

.next-project .label { display: block; margin-bottom: 1rem; }

.next-project-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  transition: color 0.3s, transform 0.5s var(--ease-out);
}

.next-project:hover .next-project-name { color: var(--accent); transform: translateX(0.75rem); }

.next-project-thumb {
  width: clamp(120px, 18vw, 240px);
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
}

.next-project-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── CHAPTER DETAIL ─────────────────────────────────── */
.detail-section { padding-bottom: clamp(4rem, 8vw, 6rem); }

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0 3rem;
  border-top: 1px solid var(--line);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s;
  cursor: pointer;
}

.detail-back svg { transition: transform 0.3s var(--ease-out); }
.detail-back:hover { color: var(--text); }
.detail-back:hover svg { transform: translateX(-4px); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}

.detail-grid.no-visual { grid-template-columns: 1fr; max-width: 62ch; }

.feature-visual { position: relative; }

/* fanned stack */
.card-stack {
  position: relative;
  width: 100%;
  padding-bottom: calc(75% + 1.5rem);
  margin-bottom: 3rem;
  cursor: pointer;
}

.stack-card {
  position: absolute;
  cursor: pointer;
  width: 88%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.1);
  transform-origin: center 115%;
  left: 6%;
  top: 0;
  will-change: transform;
}

.stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.card-stack:hover .stack-card:last-child {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.26), 0 4px 14px rgba(0, 0, 0, 0.14);
}

.stack-hint {
  position: absolute;
  bottom: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s;
}

.card-stack.fanned .stack-hint { opacity: 0; }

.feature-content { display: flex; flex-direction: column; }

.feature-number {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.25rem;
}

.feature-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
  margin-bottom: 1.5rem;
}

.feature-description {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 2rem;
  font-weight: 300;
  max-width: 56ch;
}

.highlights {
  list-style: none;
  margin-bottom: 2rem;
  counter-reset: h;
  border-top: 1px solid var(--line);
}

.highlights li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(10, 10, 10, 0.8);
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: h;
}

.highlights li::before {
  content: counter(h, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  padding-top: 0.2rem;
}

.feature-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }

.store-link { width: fit-content; }

.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.detail-nav-link { display: block; text-decoration: none; }
.detail-nav-link.next { text-align: right; margin-left: auto; }
.detail-nav-label { margin-bottom: 0.5rem; }

.detail-nav-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  color: var(--text);
  transition: color 0.25s;
}

.detail-nav-link:hover .detail-nav-title { color: var(--accent); }

/* ── ABOUT MODE ─────────────────────────────────────── */
.about-layout { padding-bottom: clamp(5rem, 10vw, 8rem); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  align-items: start;
}

.about-avatar {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  position: sticky;
  top: 6rem;
}

.about-avatar img { width: 100%; height: 100%; object-fit: cover; }

.about-bio {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
}

.about-section { margin-bottom: 3rem; }
.about-section-label { margin-bottom: 1rem; color: var(--accent); }

.experience-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.about-section-label + .experience-item { border-top: 1px solid var(--line); }

.exp-main strong { display: block; font-size: 1rem; font-weight: 500; margin-bottom: 0.15rem; }
.exp-main span { font-size: 0.9rem; color: var(--muted); }
.exp-period { white-space: nowrap; }

.about-links { display: flex; flex-wrap: wrap; gap: 1.75rem; margin-top: 2.5rem; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1000px) {
  .spec-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-metric { text-align: left; grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid.no-visual { max-width: none; }
  .about-grid { grid-template-columns: 1fr; }
  .about-avatar { position: static; max-width: 320px; }
}

@media (max-width: 600px) {
  .overview-grid { grid-template-columns: 1fr; }
  .chapters-head { flex-direction: column; gap: 0.35rem; }
  .next-project { grid-template-columns: 1fr; }
  .next-project-thumb { display: none; }
  .detail-nav-title { font-size: 1.2rem; }
}
