/* v2-imagine — v2 (feedback 23 Nov) — MARK 47
   Imagine page: orange/yellow identity, two ways in, flip-card warm-up, recent propositions. */

.imagine {
  --im-orange: var(--orange, #F07A1F);
  --im-yellow: var(--yellow, #F5C518);
  --im-ink: var(--ink, #1A1A1A);
  --im-cream: var(--card, #F7F3EB);
  --im-pad: clamp(64px, 10vw, 140px);
  --im-ease: cubic-bezier(.2, .7, .2, 1);
  --im-lift: 0 10px 24px -12px rgba(0, 0, 0, .25);
  color: var(--im-ink);
  overflow-x: clip;
}
.imagine .im-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 32px); }

/* handwritten accent (scoped; global rule may also exist) */
.imagine .hand-accent {
  font-family: "Cedarville Cursive", cursive; font-weight: 400; font-style: normal;
  font-size: 1.15em; letter-spacing: 0; display: inline-block; transform: rotate(-3deg);
  color: var(--im-ink); line-height: 1; white-space: nowrap;
}

/* ---------- hero band ---------- */
.im-hero {
  position: relative; background: var(--im-orange); color: var(--im-ink);
  padding: calc(var(--im-pad) * .8) 0 var(--im-pad); isolation: isolate; overflow: hidden;
}
.im-hero::before { /* yellow sun */
  content: ""; position: absolute; z-index: -1; width: clamp(260px, 42vw, 560px); aspect-ratio: 1;
  right: -8vw; top: -12vw; border-radius: 50%; background: var(--im-yellow); opacity: .9;
}
.im-kicker { font-family: var(--f-mono, monospace); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 18px; }
.im-q {
  font-family: var(--f-head, sans-serif); font-weight: 800; letter-spacing: -.02em; line-height: 1.02;
  font-size: clamp(38px, 7vw, 92px); margin: 0 0 18px; max-width: 14ch;
}
.im-q .hand-accent { color: var(--im-cream); text-shadow: 0 1px 0 rgba(0,0,0,.08); }
@media (max-width: 699px) { .im-q .hand-accent { color: var(--im-ink); text-shadow: none; } }
.im-lede { font-size: clamp(17px, 2vw, 21px); margin: 0 0 clamp(28px, 4vw, 44px); max-width: 34ch; }

.im-ways { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .im-ways { grid-template-columns: 1fr 1fr; gap: 22px; } }
.im-way {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto;
  column-gap: 18px; row-gap: 4px; align-items: center; min-height: 112px;
  padding: 22px 22px; border-radius: 16px; text-decoration: none; color: var(--im-ink);
  background: var(--im-cream); box-shadow: 0 1px 0 rgba(0,0,0,.06);
  transition: translate .22s ease-out, box-shadow .22s ease-out, background-color .22s ease-out;
  animation: im-pop .5s var(--im-ease) both; -webkit-tap-highlight-color: transparent;
}
.im-way--builder { animation-delay: .08s; }
.im-way--quick { background: var(--im-yellow); }
.im-way:hover, .im-way:focus-visible { translate: 0 -4px; box-shadow: var(--im-lift); color: var(--im-ink); }
.im-way:focus-visible { outline: 3px solid var(--im-ink); outline-offset: 3px; }
.im-way.is-on { box-shadow: inset 0 0 0 3px var(--im-ink); }
.im-way-art { grid-row: 1 / span 2; width: 56px; height: 64px; position: relative; display: block; }
.im-way-art i { position: absolute; left: 4px; right: 4px; height: 14px; border-radius: 3px; background: var(--im-cream); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.im-way-art i:nth-child(1) { top: 8px; rotate: -6deg; }
.im-way-art i:nth-child(2) { top: 26px; rotate: 3deg; background: #fff; }
.im-way-art i:nth-child(3) { top: 44px; rotate: -2deg; }
.im-way-art--six { display: flex; gap: 3px; align-items: stretch; padding: 6px 4px; }
.im-way-art--six i { position: static; flex: 1; height: auto; border-radius: 3px; box-shadow: none; }
.im-way-art--six i:nth-child(odd) { margin-top: 8px; }
.im-way-t { font-family: var(--f-head, sans-serif); font-weight: 700; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.01em; line-height: 1.1; align-self: end; }
.im-way-s { font-size: 15px; line-height: 1.35; color: rgba(26,26,26,.78); align-self: start; }
.im-way-go {
  grid-column: 3; grid-row: 1 / span 2; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--im-ink); color: var(--im-cream); font-size: 20px;
  transition: translate .22s ease-out;
}
.im-way:hover .im-way-go { translate: 4px 0; }

/* compact hero when the quick / builder experience is open below */
.im-hero--compact { padding: clamp(28px, 4vw, 48px) 0 clamp(24px, 3vw, 36px); }
.im-hero--compact::before { width: clamp(160px, 22vw, 280px); top: -6vw; right: -4vw; }
.im-hero--compact .im-q { font-size: clamp(26px, 3.6vw, 42px); max-width: none; margin-bottom: 18px; }
.im-hero--compact .im-way { min-height: 72px; padding: 12px 16px; }
.im-hero--compact .im-way-art { width: 40px; height: 44px; }
.im-hero--compact .im-way-art i { height: 10px; }
.im-hero--compact .im-way-art i:nth-child(2) { top: 18px; }
.im-hero--compact .im-way-art i:nth-child(3) { top: 30px; }
.im-hero--compact .im-way-s { font-size: 13.5px; }
.im-hero--compact .im-way-go { width: 40px; height: 40px; }
@media (max-width: 699px) {
  .im-hero--compact .im-ways { grid-template-columns: 1fr 1fr; gap: 10px; }
  .im-hero--compact .im-way { grid-template-columns: 1fr; min-height: 56px; padding: 12px 14px; }
  .im-hero--compact .im-way-art, .im-hero--compact .im-way-s, .im-hero--compact .im-way-go { display: none; }
  .im-hero--compact .im-way-t { font-size: 16px; }
}
.im-work { padding: 0 0 clamp(40px, 6vw, 80px); scroll-margin-top: 80px; }

/* ---------- headings ---------- */
.im-h2 { font-family: var(--f-head, sans-serif); font-weight: 800; letter-spacing: -.02em; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.02; margin: 0; }
.im-hint { font-size: 16px; color: var(--muted, #5E5850); margin: 8px 0 0; }

/* ---------- play ---------- */
.im-play { padding: var(--im-pad) 0; background: #FCEFC2; position: relative; scroll-margin-top: 72px; }
.im-play-head { margin-bottom: clamp(28px, 4vw, 48px); text-align: center; }
.im-deck {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 28px);
  max-width: 760px; margin: 0 auto; perspective: 1400px;
}
@media (min-width: 640px) { .im-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.im-card { opacity: 0; }
.im-deck.is-dealt .im-card { animation: im-pop .55s var(--im-ease) calc(var(--i) * 70ms) both; }
.im-bob { animation: im-bob 4.2s ease-in-out calc(var(--i) * -0.7s) infinite; }
.im-flip {
  all: unset; box-sizing: border-box; display: block; width: 100%; aspect-ratio: 3 / 4; min-height: 150px;
  position: relative; cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent;
  transform-style: preserve-3d; transition: transform .6s var(--im-ease), translate .22s ease-out;
}
.im-flip:focus-visible { outline: 3px solid var(--im-ink); outline-offset: 4px; }
.im-card:hover .im-flip { translate: 0 -4px; }
.im-card:hover .im-bob { animation-play-state: paused; }
.im-card.is-flipped .im-flip { transform: rotateY(180deg); }
.im-face {
  position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 2px 0 rgba(0,0,0,.06), 0 12px 24px -18px rgba(0,0,0,.4);
  transition: box-shadow .22s ease-out;
}
.im-card:hover .im-face { box-shadow: var(--im-lift); }
.im-back {
  background-color: var(--c); color: var(--on);
  background-image: radial-gradient(circle at 20% 15%, rgba(255,255,255,.22) 0 18%, transparent 19%),
                    repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 10px, transparent 10px 20px);
  justify-content: flex-end; padding: clamp(14px, 2vw, 22px);
}
.im-back-mark {
  position: absolute; top: 12px; right: 14px; font-family: var(--f-display, serif); font-style: italic;
  font-size: clamp(30px, 5vw, 48px); line-height: 1; opacity: .55;
}
.im-back-t { font-family: var(--f-head, sans-serif); font-weight: 700; font-size: clamp(16px, 2.2vw, 22px); line-height: 1.1; letter-spacing: -.01em; }
.im-front {
  transform: rotateY(180deg); background: var(--im-cream); color: var(--im-ink);
  padding: clamp(12px, 1.8vw, 20px); gap: 10px; border-top: 6px solid var(--c);
  background-image: linear-gradient(rgba(26,26,26,.035) 1px, transparent 1px); background-size: 100% 22px;
}
.im-front-text {
  flex: 1; font-size: clamp(15px, 1.9vw, 19px); line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8;
}
.im-front-text.is-short { font-size: clamp(19px, 2.6vw, 26px); }
.im-front-text.is-long { font-size: clamp(13px, 1.5vw, 16px); -webkit-line-clamp: 9; }
@media (max-width: 639px) {
  .im-flip { aspect-ratio: 3 / 4.3; }
  .im-front { gap: 6px; }
  .im-front-text { font-size: 14.5px; -webkit-line-clamp: 7; }
  .im-front-text.is-short { font-size: 19px; }
  .im-front-text.is-long { font-size: 13px; -webkit-line-clamp: 8; }
  .im-front-src { font-size: 9.5px; }
}
.im-front-src { font-family: var(--f-mono, monospace); font-size: 10.5px; line-height: 1.35; color: var(--muted, #5E5850); }
.im-front-tag { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--c); color: var(--on); }
.im-deck.has-two .im-card:not(.is-flipped) .im-flip { cursor: default; }
.im-bob { transition: opacity .3s ease; }
.im-deck.has-two .im-card:not(.is-flipped) .im-bob { opacity: .45; }
.im-deck.has-two .im-card:not(.is-flipped) .im-bob { animation-play-state: paused; }
.im-play-foot { text-align: center; margin-top: clamp(24px, 3vw, 36px); }
.im-shuffle, .im-btn {
  font: 600 15px/1 var(--f-ui, sans-serif); min-height: 48px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(26,26,26,.3); background: transparent; color: var(--im-ink);
  transition: translate .22s ease-out, box-shadow .22s ease-out, background-color .22s ease-out;
}
.im-shuffle:hover, .im-btn:hover { translate: 0 -2px; box-shadow: var(--im-lift); }
.im-btn--primary { background: var(--im-ink); color: var(--im-cream); border-color: var(--im-ink); }
.im-btn--primary:hover { background: #000; }

/* the prompt that comes to you */
.im-pop {
  --im-orange: var(--orange, #F07A1F); --im-ink: var(--ink, #1A1A1A); --im-cream: var(--card, #F7F3EB); --im-lift: 0 10px 24px -12px rgba(0,0,0,.25); --im-ease: cubic-bezier(.2,.7,.2,1);
  position: fixed; z-index: 120; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 24px)); translate: -50% 0;
  background: var(--im-orange); color: var(--im-ink); border-radius: 18px;
  padding: 20px 20px 18px; box-shadow: 0 24px 48px -20px rgba(0,0,0,.45);
}
.im-pop[hidden] { display: none; }
.im-pop.is-in { animation: im-rise .45s var(--im-ease) both; }
.im-pop-h { font-family: var(--f-head, sans-serif); font-weight: 800; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.01em; margin: 0 40px 10px 0; line-height: 1.1; }
.im-pop-pair { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-family: var(--f-mono, monospace); font-size: 12px; }
.im-pop-chip { padding: 4px 10px; border-radius: 999px; background: var(--c); color: var(--on); box-shadow: 0 0 0 1.5px rgba(26,26,26,.2); }
.im-pop-plus { font-weight: 700; }
.im-pop-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.im-pop-acts .im-btn--primary { flex: 1 1 auto; }
.im-pop .im-btn--ghost { border-color: rgba(26,26,26,.45); }
.im-pop-x {
  position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; cursor: pointer; color: var(--im-ink); border-radius: 50%;
}
.im-pop-x:hover { background: rgba(255,255,255,.25); }

/* ---------- recent propositions ---------- */
.im-recent { padding: var(--im-pad) 0; }
.im-recent-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(24px, 3vw, 40px); }
.im-more { font-weight: 600; text-decoration: none; color: var(--im-ink); min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.im-more span { transition: translate .22s ease-out; }
.im-more:hover span { translate: 4px 0; }
.im-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.im-props { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 760px) { .im-props { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.im-prop {
  display: flex; flex-direction: column; text-decoration: none; color: var(--im-ink); background: var(--im-cream);
  border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.06);
  transition: translate .22s ease-out, box-shadow .22s ease-out;
  animation: im-pop .5s var(--im-ease) calc(var(--i) * 80ms) both;
}
.im-prop:hover, .im-prop:focus-visible { translate: 0 -4px; box-shadow: var(--im-lift); color: var(--im-ink); }
.im-prop:focus-visible { outline: 3px solid var(--im-ink); outline-offset: 3px; }
.im-prop-img { display: block; aspect-ratio: 16 / 10; background: var(--c); overflow: hidden; }
.im-prop-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-prop-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; border-top: 5px solid var(--c); }
.im-prop-area { font-family: var(--f-mono, monospace); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted, #5E5850); }
.im-prop-t { font-family: var(--f-head, sans-serif); font-weight: 700; font-size: 21px; line-height: 1.15; letter-spacing: -.01em; }
.im-prop-s { font-size: 15px; line-height: 1.4; color: rgba(26,26,26,.78); }
.im-prop-by { font-size: 13px; color: var(--muted, #5E5850); margin-top: 2px; }
@media (max-width: 759px) {
  .im-prop { flex-direction: row; }
  .im-prop-img { aspect-ratio: auto; width: 34%; flex: none; }
  .im-prop-body { border-top: 0; border-left: 5px solid var(--c); padding: 14px 16px; }
  .im-prop-t { font-size: 18px; }
  .im-prop-s { display: none; }
}

/* ---------- motion ---------- */
@keyframes im-pop { from { opacity: 0; scale: .86; } 60% { opacity: 1; scale: 1.03; } to { opacity: 1; scale: 1; } }
@keyframes im-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes im-rise { from { opacity: 0; translate: -50% 30px; scale: .94; } to { opacity: 1; translate: -50% 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .imagine *, .imagine *::before { animation: none !important; transition-duration: .01ms !important; }
  .im-card { opacity: 1; }
}
