/* Product detail pages. Loaded after home.css, which supplies .contact; .hero__actions lives in base.css.
   Each page sets --accent, --accent-ink and --accent-soft on .product. */

.p-hero {
  position: relative;
  overflow: hidden;
  padding-block: 1.75rem clamp(3.5rem, 2rem + 4vw, 5.5rem);
  background:
    radial-gradient(circle at 1px 1px, rgb(21 34 60 / 0.12) 1px, transparent 0) 0 0 / 24px 24px,
    var(--white);
  border-bottom: 2px solid var(--ink);
}
.p-hero .wrap { position: relative; z-index: 1; }


.p-hero__grid { display: grid; gap: 3.5rem; align-items: center; }
@media (min-width: 1000px) { .p-hero__grid { grid-template-columns: 1.15fr 1fr; gap: 4.5rem; } }
.p-hero__grid > * { min-width: 0; }

.p-hero__cat {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--accent);
  font-size: var(--text-sm);
  font-weight: 700;
}
.p-hero__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
}
.p-hero__icon svg { width: 18px; height: 18px; }
.p-hero h1 {
  font-size: var(--text-hero);
  letter-spacing: -0.05em;
  line-height: 0.95;
  margin-top: 1.25rem;
  overflow-wrap: break-word;
}
.p-hero__tagline { margin-top: 1.5rem; font-size: var(--text-lg); color: var(--ink-2); max-width: 46ch; }

/* Visual: photo or icon art on an accent block, with the glance card overlapping */
.p-visual { position: relative; }
@media (min-width: 1000px) { .p-visual { margin: 0 0 2.5rem 2.5rem; } }
.p-visual__photo, .p-visual__art {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 10px 10px 0 var(--accent);
}
.p-visual__photo { object-fit: cover; }
.p-visual__art {
  display: grid;
  align-items: start;
  justify-items: end;
  padding: 9%;
  background:
    radial-gradient(circle at 1px 1px, rgb(21 34 60 / 0.18) 1.2px, transparent 0) 0 0 / 18px 18px,
    var(--accent);
  color: var(--ink);
}
.p-visual__art svg { width: 46%; height: auto; stroke-width: 1.2; }
.tri--pv { --size: 150px; --tri: var(--ink); z-index: 0; right: -40px; top: -50px; transform: rotate(16deg); }

.p-glance {
  position: relative;
  z-index: 2;
  width: min(330px, 92%);
  margin: -3rem 0 0 1rem;
  background: var(--navy);
  color: var(--on-navy);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.35rem 1.25rem 1.25rem;
  box-shadow: 6px 6px 0 var(--ink);
}
@media (min-width: 1000px) {
  .p-glance { position: absolute; left: -2.5rem; bottom: -2.5rem; width: 290px; margin: 0; }
  .p-glance__fits { display: none; }
}
.p-glance__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--navy-line);
}
.p-glance__row strong { font: 700 var(--text-xl) / 1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent); }
.p-glance__row span { color: var(--on-navy-2); font-size: var(--text-sm); text-align: right; }
.p-glance__fits { padding-top: 0.9rem; }
.p-glance__fits > span { font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-navy-2); }
.p-glance__fits ul { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.p-glance__fits li { padding: 0.25rem 0.65rem; border-radius: 999px; border: 1px solid var(--navy-line); font-size: var(--text-xs); }

/* Summary + flow */
.p-summary__text {
  font: 700 var(--text-xl) / 1.3 var(--font-display);
  letter-spacing: -0.025em;
  max-width: 40ch;
}
.p-flow { margin-top: clamp(3rem, 2rem + 3vw, 4.5rem); }
.p-flow__title {
  font: 700 var(--text-xs) var(--font-display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.flow { position: relative; display: grid; gap: 1rem; counter-reset: f; }
@media (min-width: 700px) { .flow { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) {
  .flow { grid-template-columns: repeat(5, 1fr); }
  .flow::before {
    content: "";
    position: absolute;
    top: 46px;
    left: 4%;
    right: 4%;
    height: 4px;
    border-radius: 2px;
    background: var(--stripe);
  }
}
.flow__step {
  position: relative;
  padding: 1.5rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.flow__step:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--accent); }
.flow__num {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--accent);
  color: var(--accent-fg);
  font: 700 var(--text-sm) var(--font-display);
}
.flow__num svg { width: 20px; height: 20px; }
.flow__step h3 { font-size: var(--text-lg); letter-spacing: -0.02em; margin-top: 1rem; }
.flow__step p { margin-top: 0.4rem; color: var(--ink-2); font-size: var(--text-sm); }
.flow__step--final { background: var(--navy); color: var(--on-navy); }
.flow__step--final p { color: var(--on-navy-2); }
.flow__step--final .flow__num { background: var(--ok); color: var(--white); }

/* Modules */
.p-modules__grid { display: grid; gap: 2.5rem; }
.p-modules__grid > * { min-width: 0; }
@media (min-width: 1000px) { .p-modules__grid { grid-template-columns: 0.7fr 1.3fr; gap: 4rem; } }
.p-index { align-self: start; }
@media (min-width: 1000px) { .p-index { position: sticky; top: 110px; } }
.p-index h2 { font-size: var(--text-2xl); margin-top: 1.25rem; overflow-wrap: break-word; }

.finder {
  position: relative;
  margin-top: 1.75rem;
}
.finder svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.finder input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  font: 500 var(--text-base) var(--font-body);
  transition: box-shadow var(--duration-fast);
}
.finder input::placeholder { color: var(--ink-3); }
.finder input:focus-visible { box-shadow: 4px 4px 0 var(--ink); }
.finder__status { min-height: 1.4em; margin-top: 0.6rem; font-size: var(--text-sm); color: var(--ink-2); }

.p-index nav { display: none; }
@media (min-width: 1000px) { .p-index nav { display: block; } }
.p-index ol { margin-top: 1rem; }
.p-index li a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink-2);
  transition: color var(--duration-fast), background-color var(--duration-fast), padding var(--duration) var(--ease-out);
}
.p-index li a span {
  min-width: 2rem;
  padding: 0.05rem 0.45rem;
  border-radius: 6px;
  background: var(--white);
  text-align: center;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}
.p-index li a:hover { color: var(--ink); background: var(--white); }
.p-index li a.is-active { color: var(--ink); background: var(--white); box-shadow: inset 4px 0 0 var(--accent); padding-left: 1.1rem; }
.p-index li a.is-active span { background: var(--accent); color: var(--accent-fg); }
.p-index li a.is-empty { color: var(--ink-3); text-decoration: line-through; }

.p-module-list { display: grid; gap: 1rem; align-content: start; }
.module {
  padding: clamp(1.4rem, 1.2rem + 1vw, 2.1rem);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  scroll-margin-top: 110px;
}
.module[hidden] { display: none; }
.module__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--mist-2);
}
.module h3 { font-size: var(--text-xl); }
.module__count {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  font: 700 var(--text-xs) var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.module ul { display: grid; gap: 0.1rem 1.5rem; }
@media (min-width: 640px) { .module ul { grid-template-columns: 1fr 1fr; } }
.module li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.6rem;
  padding-block: 0.45rem;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.module li[hidden] { display: none; }
.module li svg { width: 16px; height: 16px; margin-top: 0.2rem; color: var(--ok); }
.module mark { background: var(--amber); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.finder__empty {
  padding: 2rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--ink-2);
}
.finder__empty[hidden] { display: none; }

/* Other products */
.p-others__list { display: grid; gap: 1rem; }
@media (min-width: 720px) { .p-others__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .p-others__list { grid-template-columns: repeat(4, 1fr); } }
.p-others__list a {
  position: relative;
  display: grid;
  gap: 0.4rem;
  height: 100%;
  padding: 1.6rem 1.5rem 1.5rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.p-others__list a::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: var(--c); }
.p-others__list a:hover { transform: translate(-4px, -4px); box-shadow: 6px 6px 0 var(--c); }
.p-others__list strong { font: 700 var(--text-lg) var(--font-display); letter-spacing: -0.02em; }
.p-others__list span { font-size: var(--text-sm); color: var(--ink-3); }
