.portion-demo {
  --portion-ink: #202c24;
  --portion-muted: #566450;
  --portion-lime: #d7ed97;
  background: #f7f6ec;
  color: var(--portion-ink);
  padding-block: clamp(56px, 7.3vw, 125px);
  scroll-margin-top: 20px;
}
.portion-demo [hidden] { display: none !important }
.portion-demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "camera intro" "camera goals" "camera result";
  align-content: center;
  align-items: start;
  column-gap: clamp(35px, 6vw, 100px);
}
.portion-demo-intro { grid-area: intro; align-self: end; padding-top: 5px }
.portion-demo-kicker, .portion-demo-goals legend, .portion-demo-result-label {
  font-size: .71rem;
  font-weight: 720;
  line-height: 1.45;
  letter-spacing: .125em;
  text-transform: uppercase;
}
.portion-demo-kicker { display: flex; align-items: center; gap: 9px; color: var(--portion-muted); margin: 0 0 15px }
.portion-demo-kicker > span { width: 7px; height: 7px; border-radius: 50%; background: #6b8342; box-shadow: 0 0 0 4px #dce5bb }
.portion-demo h2 {
  margin: 0;
  color: var(--portion-ink);
  font-size: clamp(44px, 4.65vw, 74px);
  line-height: .96;
  letter-spacing: -.067em;
}
.portion-demo h2 em { color: #4a633e; font-weight: 400 }
.portion-demo-instructions { margin: 18px 0 0; max-width: 39ch; color: #475546; font-size: 1rem; line-height: 1.55; text-wrap: pretty }
.portion-demo-goals { grid-area: goals; align-self: end; min-width: 0; padding: 0; margin: 24px 0 0; border: 0 }
.portion-demo-goals legend { padding: 0; margin-bottom: 8px; color: var(--portion-muted) }
.portion-demo-options { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px }
.portion-demo-options label { position: relative; display: inline-flex; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation }
.portion-demo-options input { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden }
.portion-demo-options label > span {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 7px 13px;
  border: 1px solid #aeb8a9; border-radius: 50px;
  background: #fcfcf6; color: #354638; font-size: .87rem; font-weight: 640;
}
.portion-demo-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor }
.portion-demo-options input:checked + span { background: var(--portion-ink); color: white; border-color: var(--portion-ink) }
.portion-demo-options input:checked + span .portion-demo-dot { background: var(--portion-lime); border-color: var(--portion-lime) }
.portion-demo-options input:focus-visible + span { outline: 3px solid #9a4622; outline-offset: 3px }
.portion-demo-result {
  grid-area: result; align-self: start;
  box-sizing: border-box; margin: 22px 0 0; padding: 0 0 2px 17px;
  border-left: 3px solid #809c50;
}
.portion-demo-result-label { color: var(--portion-muted); margin: 0 0 4px }
.portion-demo-result [data-result] { margin: 0; max-width: 40ch; line-height: 1.35; font-size: clamp(18px, 1.5vw, 24px); font-weight: 540; letter-spacing: -.035em }
.portion-demo-camera {
  grid-area: camera; align-self: center; position: relative; overflow: hidden; min-width: 0;
  margin: 0; background: #d3c9b0; border-radius: 24px;
  box-shadow: 0 0 0 1px #2636280d;
}
.portion-demo-photo { position: relative; aspect-ratio: 4 / 3; isolation: isolate; overflow: hidden; margin: 0 }
.portion-demo-photo img { display: block; width: 100%; height: auto }
.portion-demo-mark {
  position: absolute; inset: 0; pointer-events: none;
}
.portion-demo-mark svg { display: block; width: 100%; height: 100% }
.portion-demo-slice { fill: #deed938f; stroke:#294633; stroke-width:2px; vector-effect:non-scaling-stroke }
.portion-demo-edge, .portion-demo-cut, .portion-demo-leader {
  fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.portion-demo-edge { stroke: #fffce9; stroke-width: 5px }
.portion-demo-cut { stroke: #354e36; stroke-width: 2.5px }
.portion-demo-leader { stroke: #354e36; stroke-width: 1.5px }
.portion-demo-mark > span {
  position: absolute; left: 74%; top: 80%; transform: translateY(-50%);
  padding: 4px 8px; border-radius: 99px; white-space: nowrap;
  font-size: .68rem; font-weight: 700; line-height: 1.2; color: #fff; background: #293d2d;
}
.portion-demo-scan {
  opacity: 0; position: absolute; z-index: 1;
  height: 1px; top: 7%; left: 4%; right: 4%;
  background: linear-gradient(90deg, transparent, #e6ffad 20%, #f5ffc4 70%, transparent);
  box-shadow: 0 3px 10px 1px #d8f87696; pointer-events: none;
}
.portion-demo-caption { position: absolute; left: 17px; bottom: 17px; display: flex; align-items: center; gap: 9px; padding: 8px 13px 8px 9px; border: 1px solid #ffffff64; border-radius: 100px; background: #1b291ef2; backdrop-filter: blur(14px); color: #f9f8ed; font-size: .79rem; font-weight: 570; line-height: 1.2 }
.portion-demo-caption-icon { display: grid; place-items: center; width: 23px; height: 23px; color: var(--portion-lime) }
.portion-demo-caption-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round }
@media (hover: hover) {
  .portion-demo-options label:hover > span { border-color: #3a523b }
}
@media (max-width: 920px) and (min-width: 761px) {
  .portion-demo-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 4% }
  .portion-demo-options label > span { padding-inline: 9px; font-size: .79rem; gap: 5px }
  .portion-demo-camera { align-self: center }
  .portion-demo-result { margin-top: 18px }
}
@media (max-width: 760px) {
  .portion-demo { padding-block: 48px }
  .portion-demo-grid { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: "intro" "goals" "camera" "result" }
  .portion-demo h2 { font-size: clamp(44px, 8.5vw, 62px); line-height: .98 }
  .portion-demo h2 br { display: none }
  .portion-demo-kicker { margin-bottom: 12px }
  .portion-demo-instructions { margin-top: 12px }
  .portion-demo-goals { margin-top: 18px; margin-bottom: 15px }
  .portion-demo-options label > span { padding-inline: 9px; gap: 5px; font-size: .82rem }
  .portion-demo-camera { border-radius: 17px }
  .portion-demo-result { margin-top: 16px; padding-left: 12px }
  .portion-demo-result [data-result] { min-height: 2.7em }
  .portion-demo-caption { left: 10px; bottom: 10px; font-size: .72rem; gap: 4px; padding: 5px 9px 5px 6px }
}
@media (max-width: 374px) {
  .portion-demo-options { gap: 4px }
  .portion-demo-options label > span { font-size: .8rem; gap: 4px; padding-inline: 8px }
}
@media (prefers-reduced-motion: reduce) {
  .portion-demo-scan { display: none }
}
