/* Project detail pages — an app-store style listing, built on the portfolio tokens in ../styles.css */

.project-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.back-link { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 17px; }
.back-link span { display: inline-block; margin-right: 6px; transition: transform .3s var(--ease); }
.back-link:hover span { transform: translateX(-4px); }

.app-page { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.app-head {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 3vw, 36px);
  align-items: center; padding: clamp(36px, 6vw, 64px) 0 32px;
}
.app-icon {
  width: clamp(110px, 16vw, 160px); height: auto; aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(5, 12, 34, .4);
}
.app-id h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.app-sub { margin-top: 8px; font-size: clamp(16px, 1.6vw, 19px); max-width: 560px; }
.app-dev { margin-top: 6px; font-size: 15px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pill {
  display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  border-radius: 100px; font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .25s var(--ease), background .25s, color .25s;
}
.pill:hover { transform: translateY(-1px); }
.pill-solid { background: var(--accent); color: var(--on-accent); }
.pill-solid:hover { background: var(--highlight-soft); }
.pill-line { border: 1px solid var(--ink); color: var(--ink); }
.pill-line:hover { background: var(--highlight); border-color: var(--highlight); color: var(--royal); }

/* Info strip */
.info-strip {
  list-style: none; margin: 0; padding: 18px 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.info-strip li {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: 0 8px;
}
.info-strip li + li { border-left: 1px solid var(--line); }
.info-strip span { font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.info-strip strong { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.info-strip em { font-style: normal; font-size: 13px; }

/* Sections */
.app-section { padding: 36px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 36px; }
.app-section:last-of-type { border-bottom: 0; }
.app-section h2 { font-size: 24px; font-weight: 600; margin-bottom: 18px; }

/* Screenshots */
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 26vw, 280px);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 14px; margin-right: calc(var(--gutter) * -1);
  padding-right: var(--gutter);
  scrollbar-width: thin;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img {
  width: 100%; height: auto; border-radius: 20px;
  box-shadow: 0 0 0 1px var(--line);
}
.shots:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 8px; }

/* Description */
.app-desc { max-width: 760px; font-size: 17px; line-height: 1.7; color: var(--ink); }
.app-desc p + p { margin-top: 1em; }
.app-desc.clamped {
  max-height: calc(1.7em * 4);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.more {
  margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

/* Features */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.features article {
  background: var(--card); border-radius: 16px; padding: 24px 26px; box-shadow: var(--shadow);
}
.features h3 { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.features p { font-size: 16px; }

/* Links */
.link-list { list-style: none; padding: 0; margin: 0; max-width: 560px; }
.link-list a {
  display: flex; justify-content: space-between; padding: 14px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500;
}
.link-list li:first-child a { border-top: 1px solid var(--line); }
.link-list a:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }

/* Research page */
.paper-head { padding: clamp(40px, 7vw, 80px) 0 32px; max-width: 860px; }
.paper-kicker { color: var(--ink); }
.paper-head h1 { margin-top: 18px; font-size: clamp(40px, 6.5vw, 80px); line-height: 1.02; letter-spacing: -0.035em; }
.paper-sub { margin-top: 14px; font: 400 clamp(19px, 2vw, 24px)/1.4 var(--display); color: var(--ink); }
.paper-lead { max-width: 760px; font: 400 clamp(20px, 2.1vw, 24px)/1.5 var(--display); color: var(--ink); }
.paper-lead em, .app-desc em { font-style: italic; }
.app-desc a { color: var(--ink); text-underline-offset: 3px; }
.conclusion { margin-top: 28px; padding-left: 20px; border-left: 3px solid color-mix(in srgb, var(--f) 80%, var(--ink)); }

.figure {
  margin: 28px 0 0; padding: clamp(20px, 3vw, 32px);
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--f) var(--f-mix), var(--bg));
}
.figure-wide { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { font-size: 16px; line-height: 1.6; color: var(--ink); }
.figure figcaption .mono { display: block; margin-bottom: 8px; color: var(--ink-2); }

.gqa .gqa-lines { stroke: var(--ink); opacity: .45; }
.gqa .gqa-q rect { fill: var(--paper); stroke: var(--ink); stroke-opacity: .25; }
.gqa .gqa-q rect.is-sink { fill: var(--sapphire); stroke: none; }
.gqa .gqa-kv { fill: var(--ink); }
.gqa text { font: 500 15px var(--display); fill: var(--ink); }
.gqa text.gqa-tag { font: 500 11px var(--mono); text-transform: uppercase; fill: var(--ink-2); }
.gqa text:nth-child(2) { fill: var(--swan); }
.gqa > text.gqa-text { fill: var(--royal); }

.loop .loop-lines, .loop .loop-hidden { stroke: var(--ink); opacity: .55; }
.loop .loop-head { fill: var(--ink); opacity: .55; }
.loop .loop-node { fill: var(--paper); stroke: var(--ink); stroke-opacity: .25; }
.loop .loop-node.is-model { fill: var(--sapphire); stroke: none; }
.loop .loop-taste { fill: none; stroke: var(--ink); stroke-opacity: .45; stroke-dasharray: 4 4; }
.loop text { font: 500 15px var(--display); fill: var(--ink); }
.loop text.loop-sub { font: 500 10.5px var(--mono); text-transform: uppercase; fill: var(--ink-2); }
.loop text.on-model { fill: var(--swan); }
.paper-meta { margin-top: 10px; color: var(--ink-2); }

/* Result plots: kept on white plates, like printed figures */
.plot { margin: 22px 0 0; }
.plot a { display: block; border-radius: 14px; background: #fff; padding: clamp(8px, 1.4vw, 16px); box-shadow: var(--shadow); transition: transform .4s var(--ease); }
.plot a:hover { transform: translateY(-3px); }
.plot img { width: 100%; height: auto; }
.plot figcaption { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 720px; }
.plot figcaption .mono { display: block; margin-bottom: 4px; color: var(--ink); }
.app-section > .plot, .plot-pair { margin-bottom: 26px; }
.plot-pair { display: grid; gap: 8px; }
.plot-narrow { max-width: 600px; }
.findings li > div { min-width: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.steps article { background: var(--card); border-radius: 16px; padding: 22px 22px 26px; box-shadow: var(--shadow); }
.steps .mono { color: var(--ink-2); }
.steps h3 { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 10px 0 8px; }
.steps p:last-child { font-size: 15.5px; }

.findings { list-style: none; padding: 0; margin: 0; max-width: 820px; border-top: 1px solid var(--line); }
.findings li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.findings .mono { color: var(--ink-2); padding-top: 4px; }
.findings p { font-size: 17px; color: var(--ink); }
.findings strong { font-weight: 600; }

.data-table-wrap { margin-top: 22px; max-width: 900px; overflow-x: auto; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); }
.data-table thead th { font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); border-top: 1px solid var(--line); }
.data-table tbody th { font-weight: 600; white-space: nowrap; }
.app-section h3.sub-head { font-size: 19px; font-weight: 600; margin: 32px 0 14px; }

.plate-grid .plate { fill: none; stroke: var(--ink); stroke-opacity: .4; stroke-width: 1.4; }
.plate-grid .plate.best { fill: var(--gold); stroke: none; }
.plate-grid text { font: 500 15px var(--display); fill: var(--ink); }
.plate-grid text.plate-tag { font: 500 11px var(--mono); text-transform: uppercase; fill: var(--ink-2); text-anchor: middle; }

.project-page .site-footer { margin-top: 64px; }

@media (max-width: 700px) {
  .app-head { grid-template-columns: 1fr; text-align: left; }
  .info-strip { grid-template-columns: repeat(5, minmax(84px, 1fr)); overflow-x: auto; }
  .features, .steps { grid-template-columns: 1fr; }
  .figure { grid-template-columns: 1fr; }
  .shots { grid-auto-columns: 62vw; }
}
