/* Products grid (#homes): nine cards, each with a line drawing from the same family as the logo
   portico and the property types. Drawings are inline SVG in currentColor; gold is only a light.
   The markup is the finished state, so every drawing reads without JS or with reduced motion.
   products.js plays each drawing once as its card scrolls into view, and again on hover. */
.prod-grid { --prod-light: var(--gold); list-style: none; padding: 0; margin: clamp(44px, 5vw, 64px) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.prod { background: var(--surface); padding: clamp(24px, 2.6vw, 36px) clamp(22px, 2.8vw, 40px) clamp(30px, 3.2vw, 42px); display: flex; flex-direction: column; min-width: 0; text-align: center; }
.prod-art { display: block; width: 100%; height: 168px; margin: 0 0 12px; color: var(--ink); overflow: hidden; }
.prod-name { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 2.4vw, 31px); line-height: 1.1; }
.prod-who { margin-top: 8px; font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--ink); }
.prod-note { margin-top: 2px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.prod-who, .prod-note { text-wrap: pretty; }
.prod-note .nb { white-space: nowrap; }

/* Drawing parts */
.prod-art .lt { fill: var(--prod-light); stroke: none; }
.prod-art .lts { stroke: var(--prod-light); }
.prod-art .o { fill: var(--surface); }
.prod-art .pg { stop-color: var(--prod-light); }
.prod-art .cone { fill: var(--prod-light); opacity: .12; stroke: none; }
@media (prefers-color-scheme: dark) { .prod-grid { --prod-light: #d6b98a; } }

/* Pivots, in drawing units */
.prod-art .g-page { transform-origin: 76px 81px; }
.prod-art .f-mob { transform-origin: 86px 31px; }
.prod-art .f-d1 { transform-origin: 74px 36px; }
.prod-art .f-d2 { transform-origin: 86px 36px; }
.prod-art .f-d3 { transform-origin: 98px 36px; }
.prod-art .w-drum { transform-origin: 23px 90.5px; }
.prod-art .m-cl { transform-origin: 31px 30px; }
.prod-art .m-cr { transform-origin: 73px 30px; }
.prod-art .fi-f1 { transform-origin: 43.2px 99px; }
.prod-art .fi-f2 { transform-origin: 48px 98.5px; }
.prod-art .fi-f3 { transform-origin: 52.8px 99px; }
.prod-art .ss-case { transform-origin: 25px 106px; }

/* Layout: three across, two on tablets (the ninth card spans both), one row per card on phones */
@media (max-width: 1000px) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prod:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .prod-grid { grid-template-columns: minmax(0, 1fr); }
  .prod { flex-direction: row; align-items: center; gap: 18px; padding: 20px 20px 20px 12px; text-align: left; }
  .prod-art { flex: 0 0 108px; width: 108px; height: 108px; margin: 0; }
  .prod-name { font-size: 25px; }
  .prod-who { margin-top: 5px; font-size: 15.5px; }
  .prod-note { font-size: 14.5px; }
}

/* Motion: cards rise in, then each drawing plays its moment. .play runs on arrival, .again on hover. */
@media (prefers-reduced-motion: no-preference) {
  .prod-grid.armed .prod { opacity: 0; transform: translateY(18px); }
  .prod-grid.armed .prod.seen { opacity: 1; transform: none; transition: opacity .8s ease var(--d, 0ms), transform .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }

  /* 1 Undergraduate: the desk lamp switches on */
  .prod.play .u-light { animation: p-lamp-on 1.6s ease-out both; animation-delay: calc(var(--ad, 0s) + .25s); }
  .prod.again .u-light { animation: p-lamp-again 1.8s ease-out both; }

  /* 2 Graduate: a page turns */
  .prod.play .g-page { animation: p-page 1.7s cubic-bezier(.45, .05, .35, 1) both; animation-delay: calc(var(--ad, 0s) + .2s); }
  .prod.again .g-page { animation: p-page 1.7s cubic-bezier(.45, .05, .35, 1) both; }

  /* 3 Graduate family: the mobile sways and settles */
  .prod.play .f-mob, .prod.again .f-mob { animation: p-sway 4.4s ease-in-out both; }
  .prod.play .f-d1, .prod.play .f-d2, .prod.play .f-d3,
  .prod.again .f-d1, .prod.again .f-d2, .prod.again .f-d3 { animation: p-dangle 4.4s ease-in-out both; }
  .prod.play .f-mob, .prod.play .f-d2 { animation-delay: calc(var(--ad, 0s) + .1s); }
  .prod.play .f-d1 { animation-delay: calc(var(--ad, 0s) + .22s); }
  .prod.play .f-d3 { animation-delay: calc(var(--ad, 0s) + .3s); }
  .prod.again .f-d1 { animation-delay: .12s; }
  .prod.again .f-d3 { animation-delay: .2s; }

  /* 4 Academic themed: the figure and notes are drawn on the board */
  .prod.play .a-board path { stroke-dasharray: 1 1.5; animation: p-draw 1.1s ease-in-out both; }
  .prod.play .a-board .a-c { animation-delay: calc(var(--ad, 0s) + .15s); }
  .prod.play .a-board .a-t { animation-delay: calc(var(--ad, 0s) + 1.05s); animation-duration: .9s; }
  .prod.play .a-board .a-l1 { animation-delay: calc(var(--ad, 0s) + 1.7s); animation-duration: .55s; }
  .prod.play .a-board .a-l2 { animation-delay: calc(var(--ad, 0s) + 2.05s); animation-duration: .45s; }
  .prod.play .a-board .a-l3 { animation-delay: calc(var(--ad, 0s) + 2.35s); animation-duration: .5s; }
  .prod.again .a-board { animation: p-wipe .4s ease-in; }
  .prod.again .a-board path { stroke-dasharray: 1 1.5; animation: p-draw 1.1s ease-in-out .4s forwards; }
  .prod.again .a-board .a-l1, .prod.again .a-board .a-l2, .prod.again .a-board .a-l3 { animation-name: p-draw-late; animation-duration: 1.3s; }

  /* 5 Athletes: the washer runs */
  .prod.play .w-drum { animation: p-spin 3.4s cubic-bezier(.35, 0, .2, 1) both; animation-delay: calc(var(--ad, 0s) + .3s); }
  .prod.play .w-ind { animation: p-on .5s ease both; animation-delay: calc(var(--ad, 0s) + .15s); }
  .prod.again .w-drum { animation: p-spin-again 2.4s cubic-bezier(.35, 0, .2, 1) both; }

  /* 6 Medical: blackout curtains draw closed over the morning sun */
  .prod.play .m-cl, .prod.play .m-cr { animation: p-close 2.6s cubic-bezier(.45, .05, .3, 1) both; animation-delay: calc(var(--ad, 0s) + .45s); }
  .prod.again .m-cl, .prod.again .m-cr { animation: p-close-again 3.8s cubic-bezier(.45, .05, .3, 1) both; }

  /* 7 Faculty: the fire catches */
  .prod.play .fi-f1, .prod.play .fi-f2, .prod.play .fi-f3 { animation: p-fire 3s ease-in-out both; }
  .prod.play .fi-f2 { animation-delay: calc(var(--ad, 0s) + .1s); }
  .prod.play .fi-f1 { animation-delay: calc(var(--ad, 0s) + .3s); }
  .prod.play .fi-f3 { animation-delay: calc(var(--ad, 0s) + .45s); }
  .prod.play .fi-glow { animation: p-glow 3.2s ease-out both; animation-delay: calc(var(--ad, 0s) + .1s); }
  .prod.again .fi-f1, .prod.again .fi-f2, .prod.again .fi-f3 { animation: p-flicker 2.4s ease-in-out both; }
  .prod.again .fi-f1 { animation-delay: .15s; }
  .prod.again .fi-f3 { animation-delay: .3s; }

  /* 8 Staff and workforce: steam rises from the kettle */
  .prod.play .s-w1, .prod.play .s-w2 { animation: p-steam 3.2s ease-in-out 2 both; animation-delay: calc(var(--ad, 0s) + .1s); }
  .prod.play .s-w2 { animation-delay: calc(var(--ad, 0s) + 1s); }
  .prod.again .s-w1, .prod.again .s-w2 { animation: p-steam 3.2s ease-in-out both; }
  .prod.again .s-w2 { animation-delay: .9s; }

  /* 9 Short stay: a suitcase rolls in and its handle goes down */
  .prod.play .ss-case { animation: p-roll 2.6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--ad, 0s) + .2s); }
  .prod.play .ss-rods { animation: p-rods 2.9s ease-in-out both; animation-delay: calc(var(--ad, 0s) + .2s); }
  .prod.again .ss-rods { animation: p-rods-again 2.2s ease-in-out both; }
}

@keyframes p-lamp-on { 0% { opacity: 0; } 22% { opacity: .85; } 32% { opacity: .3; } 55%, 100% { opacity: 1; } }
@keyframes p-lamp-again { 0% { opacity: 1; } 8%, 30% { opacity: 0; } 48% { opacity: .85; } 58% { opacity: .3; } 78%, 100% { opacity: 1; } }
@keyframes p-page { 0% { transform: rotate(180deg) scaleY(-1); } 50% { transform: rotate(90deg) scaleY(.25); } 100% { transform: rotate(0deg) scaleY(1); } }
@keyframes p-sway { 0% { transform: rotate(0deg); } 16% { transform: rotate(6deg); } 36% { transform: rotate(-4.5deg); } 56% { transform: rotate(3deg); } 76% { transform: rotate(-1.4deg); } 100% { transform: rotate(0deg); } }
@keyframes p-dangle { 0% { transform: rotate(0deg); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(1.2deg); } 100% { transform: rotate(0deg); } }
@keyframes p-draw { 0% { stroke-dashoffset: 1.02; opacity: 0; } 1% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes p-draw-late { 0%, 50% { stroke-dashoffset: 1.02; opacity: 0; } 51% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes p-wipe { 0% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes p-spin { from { transform: rotate(-720deg); } to { transform: rotate(0deg); } }
@keyframes p-spin-again { from { transform: rotate(-360deg); } to { transform: rotate(0deg); } }
@keyframes p-on { from { opacity: .1; } to { opacity: 1; } }
@keyframes p-close { from { transform: scaleX(.26); } to { transform: scaleX(1); } }
@keyframes p-close-again { 0%, 100% { transform: scaleX(1); } 40%, 56% { transform: scaleX(.26); } }
@keyframes p-fire { 0% { transform: scale(.4, .05); opacity: 0; } 22% { transform: scale(.95, 1.12); opacity: 1; } 40% { transform: scale(1.04, .9); } 58% { transform: scale(.97, 1.07); } 78% { transform: scale(1.02, .96); } 100% { transform: scale(1, 1); opacity: 1; } }
@keyframes p-glow { 0% { opacity: 0; } 30% { opacity: 1; } 50% { opacity: .8; } 70%, 100% { opacity: 1; } }
@keyframes p-flicker { 0%, 100% { transform: scale(1, 1); } 20% { transform: scale(.96, 1.1); } 40% { transform: scale(1.04, .92); } 60% { transform: scale(.97, 1.06); } 80% { transform: scale(1.02, .97); } }
@keyframes p-steam { 0% { opacity: 1; transform: translateY(0); } 45% { opacity: 0; transform: translateY(-8px); } 46% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes p-roll { 0% { opacity: 0; transform: translateX(-38px) rotate(0deg); } 18% { opacity: 1; } 68% { transform: translateX(0) rotate(0deg); } 78% { transform: translateX(0) rotate(2.2deg); } 89% { transform: translateX(0) rotate(-.8deg); } 100% { opacity: 1; transform: translateX(0) rotate(0deg); } }
@keyframes p-rods { 0%, 62% { transform: translateY(-15px); } 88%, 100% { transform: translateY(0); } }
@keyframes p-rods-again { 0%, 100% { transform: translateY(0); } 38%, 62% { transform: translateY(-15px); } }

@media print { .prod-grid.armed .prod { opacity: 1; transform: none; } }
