/* =========================================================
   Project detail pages (loaded after styles.css)
   ========================================================= */

/* ---------- header extras ---------- */
.back-btn {
  display: none; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line-strong); color: var(--navy);
  align-items: center; justify-content: center; text-decoration: none;
}
.back-btn .ic { width: 20px; height: 20px; }
.site-footer { border-top: 1px solid #1B3A68; }

/* ---------- hero ---------- */
.p-hero { padding: 40px 0 88px; background: var(--hero-bg); }
.p-hero .container { display: flex; flex-direction: column; gap: 32px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs .back-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--white); border: 1px solid #D5DEEF; color: var(--navy); font-weight: 700;
}
.crumbs .current { color: var(--navy); font-weight: 700; }

.p-hero-row { display: flex; gap: 56px; align-items: flex-start; }
.p-hero-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 20px; padding-top: 8px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  padding: 6px 12px; border-radius: 999px; background: var(--white); border: 1px solid #D5DEEF;
  color: var(--text); font-size: 13px; font-weight: 700;
}
.chip.research { background: var(--teal-soft); border-color: var(--teal-soft); color: var(--teal); font-weight: 800; }
.chip.thesis { background: var(--orange-soft); border-color: var(--orange-soft); color: var(--orange-ink); font-weight: 800; }
.chip.project { background: var(--blue-soft); border-color: var(--blue-soft); color: var(--blue); font-weight: 800; }
.p-hero h1 { font-size: 46px; line-height: 1.12; font-weight: 700; letter-spacing: -0.035em; }
.p-hero h1 span { color: var(--blue); }
.p-hero .intro { font-size: 18px; line-height: 1.65; color: var(--muted); }
.p-hero .intro strong { color: var(--navy); font-weight: 700; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tool-tags li { padding: 6px 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--text); }
.p-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.p-ctas .btn-cta { font-weight: 800; box-shadow: 0 10px 24px rgba(194, 65, 12, .25); }
.p-ctas .btn-outline { padding: 0 22px; font-size: 16px; }
.p-hero .hand-note { margin-left: 6px; transform: rotate(-3deg); }

/* ---------- gallery (mock app window) ---------- */
.gallery { width: 640px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.app-window {
  border-radius: 16px; background: var(--white); border: 1px solid #C9D4EA;
  box-shadow: 0 24px 48px rgba(21, 32, 51, .16); overflow: hidden;
}
.app-bar { height: 38px; padding: 0 14px; background: #F1F4F9; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.app-bar .dot { width: 11px; height: 11px; border-radius: 999px; }
.app-bar .dot.r { background: #F87171; } .app-bar .dot.y { background: #FBBF24; } .app-bar .dot.g { background: #34D399; }
.app-url {
  margin-left: 14px; flex-grow: 1; height: 24px; border-radius: 6px; background: var(--white); border: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--subtle);
  white-space: nowrap; overflow: hidden;
}
.app-body { height: 392px; display: flex; background: #F8FAFC; font-size: 12px; color: var(--navy); }
.app-side { width: 148px; flex-shrink: 0; padding: 16px 12px; background: var(--navy); display: flex; flex-direction: column; gap: 6px; }
.app-side .app-name { display: flex; align-items: center; gap: 8px; padding: 0 6px 14px; font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--white); }
.app-side .app-name .ic { color: #F87171; width: 16px; height: 16px; }
.app-side [data-nav] { padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #B8C4D9; }
.app-side [data-nav].active { background: #12346A; font-weight: 700; color: var(--white); }
.app-view { flex-grow: 1; min-width: 0; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.app-view[hidden] { display: none; }
.app-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.app-title > span:first-child { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.app-pill { padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; white-space: nowrap; }
.app-btn { padding: 6px 10px; border-radius: 8px; background: var(--blue); color: var(--white); font-size: 11px; font-weight: 700; white-space: nowrap; }
.app-card { padding: 12px 14px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.app-label { font-size: 11px; font-weight: 700; color: var(--subtle); }
.ecg { width: 100%; height: 86px; color: #DC2626; }
.ecg .grid { stroke: #FDE2E2; stroke-width: 1; }
.ecg .wave { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.app-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-result { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--green); }
.app-muted { font-size: 12px; font-weight: 600; color: var(--muted); }
.app-warn { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: #FEF3C7; font-size: 11px; font-weight: 600; color: #92400E; }
.vote { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.vote span:last-child { color: var(--green); }
.app-search { height: 32px; border-radius: 8px; background: var(--white); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px; color: var(--subtle); }
.app-table { border-radius: 10px; background: var(--white); border: 1px solid var(--line); overflow: hidden; }
.app-table .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 9px 12px; border-top: 1px solid #EEF1F5; font-weight: 600; align-items: center; }
.app-table .row.head { border-top: 0; background: #F1F4F9; font-weight: 700; color: var(--subtle); }
.res { justify-self: start; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.res.n { background: #DCFCE7; color: var(--green); }
.res.mi { background: #FEE2E2; color: #B91C1C; }
.res.hb { background: var(--orange-soft); color: var(--orange-ink); }
.res.pmi { background: #EDE9FE; color: #6D28D9; }
.bubble { max-width: 340px; padding: 9px 12px; font-size: 12px; line-height: 1.5; }
.bubble.me { align-self: flex-end; border-radius: 12px 12px 2px 12px; background: var(--blue); color: var(--white); font-weight: 600; }
.bubble.bot { align-self: flex-start; border-radius: 12px 12px 12px 2px; background: var(--white); border: 1px solid var(--line); color: var(--text); font-weight: 500; }
.chat-input {
  margin-top: auto; height: 36px; border-radius: 10px; background: var(--white); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 12px; color: var(--subtle);
}
.chat-input span { width: 26px; height: 26px; border-radius: 7px; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; }
.chat-input .ic { width: 14px; height: 14px; }

.shot-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shot-tab {
  height: 72px; padding: 0 14px; border: 1px solid #C9D4EA; border-radius: 12px; background: var(--white);
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
}
.shot-tab .num {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 13px; font-weight: 700;
}
.shot-tab .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shot-tab .lbl { font-size: 14px; font-weight: 800; color: var(--navy); }
.shot-tab .sub { font-size: 12px; font-weight: 600; color: var(--subtle); }
.shot-tab[aria-pressed="true"] { border: 2px solid var(--blue); box-shadow: 0 8px 18px rgba(0, 85, 164, .15); }
.shot-tab[aria-pressed="true"] .num { background: var(--blue); color: var(--white); }
.gallery-note { font-size: 12px; font-weight: 600; color: var(--subtle); text-align: center; }

/* ---------- quick facts ---------- */
.facts { position: relative; z-index: 1; margin-top: -44px; }
.facts dl {
  margin: 0; padding: 24px 32px; background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 16px 36px rgba(21, 32, 51, .08);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px;
}
.facts dl > div { display: flex; flex-direction: column; gap: 6px; }
.facts dl > div + div { padding-left: 24px; border-left: 1px solid #EEF1F5; }
.facts dt { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); }
.facts dd { margin: 0; font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--navy); }

/* ---------- content + sidebar ---------- */
.p-body { padding: 64px 0 96px; }
.p-body .container { display: flex; gap: 56px; align-items: flex-start; }
.p-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 56px; }
.p-block { display: flex; flex-direction: column; gap: 20px; }
.p-block h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.p-block > p { font-size: 17px; line-height: 1.75; color: var(--muted); }
.p-block > p strong { color: var(--navy); font-weight: 700; }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.features li { padding: 18px; border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 14px; align-items: flex-start; }
.features .icon-tile { width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; }
.features .icon-tile .ic { width: 20px; height: 20px; }
.features .f-txt { display: flex; flex-direction: column; gap: 4px; }
.features h3 { font-size: 16px; font-weight: 700; }
.features p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.tile-red { background: #FEE2E2; color: #B91C1C; }
.tile-green { background: #DCFCE7; color: var(--green); }
.tile-purple { background: #EDE9FE; color: #6D28D9; }

.flow { margin: 0; padding: 0; list-style: none; display: flex; align-items: stretch; gap: 8px; }
.flow .step-box {
  flex: 1 1 0; padding: 16px 12px; border-radius: 14px; background: var(--hero-bg);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  font-size: 14px; line-height: 1.35; font-weight: 700; color: var(--navy);
}
.flow .step-box:last-child { background: var(--orange-soft); }
.flow .n {
  width: 32px; height: 32px; border-radius: 999px; background: var(--blue); color: var(--white);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 14px; font-weight: 700;
}
.flow .step-box:last-child .n { background: var(--cta); }
.flow .arrow { display: flex; align-items: center; color: #9AA6B8; }

.stack { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.stack > div { display: flex; align-items: center; gap: 16px; }
.stack dt { width: 150px; flex-shrink: 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.stack dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stack dd span { padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.stack .s-blue span { background: var(--blue-soft); color: #08386C; }
.stack .s-teal span { background: var(--teal-soft); color: var(--teal); }
.stack .s-orange span { background: var(--orange-soft); color: var(--cta-dark); }

.get-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; font-size: 16px; font-weight: 600; color: var(--text); }
.get-list li { display: flex; gap: 10px; align-items: center; }

/* sidebar */
.p-side { width: 390px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 20px; }
.quote-card {
  position: relative; overflow: hidden; isolation: isolate; padding: 30px; border-radius: 20px;
  background: var(--navy); color: var(--white); display: flex; flex-direction: column; gap: 18px;
}
.quote-card .ring-thick { right: -110px; top: -110px; width: 240px; height: 240px; border-radius: 999px; border: 24px solid #12346A; }
.quote-card .eyebrow-pill {
  align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: #0E3368; color: #FDBA74;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.quote-card h3 { color: var(--white); font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.quote-card h3 span { color: #FDBA74; }
.quote-card p { font-size: 15px; line-height: 1.6; color: #D5DCE8; }
.quote-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 600; }
.quote-card li { display: flex; gap: 10px; align-items: center; }
.quote-card li .ic { color: #4ADE80; }
.quote-card .btn { height: 54px; font-size: 16px; font-weight: 800; }
.btn-ghost-dark { height: 50px; border: 1.5px solid #2F4D7D; color: var(--white); background: transparent; font-size: 15px; }
.btn-ghost-dark:hover { border-color: #FDBA74; color: var(--white); }
.quote-card .small { text-align: center; font-size: 13px; font-weight: 600; color: #B8C4D9; }

.idea-card { padding: 26px; border-radius: 20px; background: #FFF7ED; border: 1px solid var(--peach); display: flex; flex-direction: column; gap: 14px; }
.idea-card .hand { font-family: var(--font-hand); font-size: 28px; font-weight: 700; line-height: 1; color: var(--cta); transform: rotate(-2deg); }
.idea-card p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.idea-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 700; color: var(--navy); }
.idea-card li { display: flex; gap: 10px; align-items: center; }
.idea-card li::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: 999px; background: var(--cta); }
.idea-card a { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--cta-dark); text-decoration: none; }

/* ---------- related ---------- */
.related { padding: 80px 0; background: var(--gray-bg); }
.related .container { display: flex; flex-direction: column; gap: 32px; }
.related-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.related-head h2 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.related-card { padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.related-card .badge { align-self: flex-start; font-weight: 800; }
.related-card h3 { font-size: 19px; line-height: 1.3; font-weight: 700; }
.related-card p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.related-card .text-link { margin-top: auto; font-size: 15px; font-weight: 800; }

/* ---------- contact band ---------- */
.talk { position: relative; overflow: hidden; isolation: isolate; padding: 72px 0; background: var(--navy); color: var(--white); }
.talk .container { display: flex; gap: 56px; align-items: center; }
.talk-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 16px; }
.talk h2 { color: var(--white); font-size: 44px; line-height: 1.12; letter-spacing: -0.035em; }
.talk h2 span { color: #FDBA74; }
.talk p { font-size: 18px; line-height: 1.6; color: #D5DCE8; }
.talk .hand { align-self: flex-start; font-family: var(--font-hand); font-size: 28px; font-weight: 700; color: #FDBA74; transform: rotate(-2deg); }
.talk-links { width: 420px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.talk-link {
  min-height: 60px; padding: 10px 20px; border-radius: 14px; border: 1.5px solid #2F4D7D; color: var(--white);
  display: flex; align-items: center; gap: 14px; text-decoration: none; transition: border-color .15s ease, background-color .15s ease;
}
.talk-link:hover { color: var(--white); border-color: #FDBA74; }
.talk-link.primary { min-height: 64px; border-color: var(--cta); background: var(--cta); }
.talk-link.primary:hover { background: var(--cta-dark); border-color: var(--cta-dark); }
.talk-link .ic { width: 22px; height: 22px; }
.talk-link strong { display: block; font-size: 16px; font-weight: 700; }
.talk-link.primary strong { font-size: 17px; font-weight: 800; }
.talk-link small { display: block; font-size: 13px; font-weight: 600; color: #B8C4D9; word-break: break-word; }
.talk-link.primary small { color: #FFE4D2; }
.talk .decor .ring-thick { right: -120px; top: -140px; width: 360px; height: 360px; border-radius: 999px; border: 32px solid #12346A; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1180px) {
  .p-hero-row { flex-direction: column; align-items: stretch; }
  .gallery { width: 100%; }
  .p-side { width: 340px; }
}

@media (max-width: 1023px) {
  .p-body .container { flex-direction: column; align-items: stretch; }
  .p-side { width: 100%; position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts dl > div:nth-child(4) { padding-left: 0; border-left: 0; }
  .talk .container { flex-direction: column; align-items: stretch; }
  .talk-links { width: 100%; }
  .related .cards-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
  .back-btn { display: inline-flex; }
  .site-header .brand img { display: none; }
  .crumbs .back-pill { display: none; }

  .p-hero { padding: 24px 0 40px; }
  .p-hero .container { gap: 16px; }
  .crumbs { font-size: 13px; gap: 6px; }
  .p-hero-row { gap: 20px; }
  .p-hero-copy { gap: 16px; padding-top: 0; }
  .chip { font-size: 12px; padding: 5px 11px; }
  .p-hero h1 { font-size: 29px; line-height: 1.18; letter-spacing: -0.03em; }
  .p-hero .intro { font-size: 16px; line-height: 1.6; }
  .p-hero .tool-tags { display: none; }
  .p-ctas { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 4px; }
  .p-ctas .btn { height: 52px; font-size: 16px; }
  .p-hero .hand-note { align-self: center; font-size: 24px; }
  /* phone order: text → screenshots → buttons (as in the mobile design) */
  .p-hero-row { gap: 16px; }
  .p-hero-copy { display: contents; }
  .p-hero-row > .gallery { order: 2; margin-top: 4px; }
  .p-hero-copy .p-ctas { order: 3; }
  .p-hero-copy .hand-note { order: 4; }

  /* gallery: no app sidebar, 3 short tabs */
  .app-bar { height: 30px; padding: 0 10px; gap: 6px; }
  .app-bar .dot { width: 9px; height: 9px; }
  .app-url { margin-left: 8px; height: auto; border: 0; background: none; padding: 0; font-size: 11px; }
  .app-body { height: auto; min-height: 300px; font-size: 11px; }
  .app-side { display: none; }
  .app-view { padding: 12px; gap: 10px; }
  .app-title > span:first-child { font-size: 14px; }
  .ecg { height: 64px; }
  .app-2col { gap: 8px; }
  .app-card { padding: 10px; gap: 4px; }
  .app-result { font-size: 20px; }
  .app-muted, .vote { font-size: 10px; }
  .app-label { font-size: 10px; }
  .app-table .row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 10px; }
  .app-table .age { display: none; }
  .bubble { max-width: 250px; font-size: 11px; padding: 8px 10px; }
  .shot-tabs { gap: 8px; }
  .shot-tab { height: 60px; padding: 0 6px; flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
  .shot-tab .num { width: auto; height: auto; background: none !important; color: var(--subtle); font-size: 11px; }
  .shot-tab[aria-pressed="true"] .num { color: var(--blue); }
  .shot-tab .lbl { font-size: 13px; }
  .shot-tab .sub { display: none; }

  .facts { margin-top: 0; padding-top: 24px; }
  .facts dl { padding: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; border-radius: 16px; }
  .facts dl > div + div { padding-left: 0; border-left: 0; }
  .facts dl > div:last-child { grid-column: span 2; padding-top: 14px; border-top: 1px solid #EEF1F5; }
  .facts dt { font-size: 11px; }
  .facts dd { font-size: 15px; }

  .p-body { padding: 32px 0 48px; }
  .p-main { gap: 40px; }
  .p-block { gap: 16px; }
  .p-block h2 { font-size: 24px; }
  .p-block > p { font-size: 16px; line-height: 1.7; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .features li { padding: 16px; }

  /* how it works: vertical timeline */
  .flow { flex-direction: column; gap: 0; }
  .flow .arrow { display: none; }
  .flow .step-box {
    flex-direction: row; text-align: left; background: none !important; padding: 0 0 18px; gap: 14px;
    position: relative; font-size: 15px;
  }
  .flow .step-box:not(:last-child)::after {
    content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: #D5DEEF;
  }
  .flow .n { flex-shrink: 0; }

  .stack > div { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stack dt { width: auto; font-size: 12px; }
  .get-list { grid-template-columns: minmax(0, 1fr); font-size: 15px; gap: 12px; }

  .p-side { grid-template-columns: minmax(0, 1fr); }
  .quote-card { padding: 24px; }
  .quote-card h3 { font-size: 23px; }

  .related { padding: 48px 0; }
  .related .container { gap: 20px; }
  .related-head h2 { font-size: 26px; }
  .related-card { padding: 20px; }

  .talk { padding: 48px 0; }
  .talk .container { gap: 28px; }
  .talk h2 { font-size: 30px; }
  .talk p { font-size: 16px; }
}
