/* ───────────────────────── Flowify · home (the desk) ─────────────────────────
   hero panels · tagline sticker · side paper tabs · pick hint                  */

html, body { height: 100%; }
body { overflow: hidden; } /* the hero IS the page — nothing to scroll */

/* ── hero: the whole page is 3 panels ── */
.hero {
  position: relative;
  height: 100dvh;
  padding: var(--frame);
}

.panels {
  display: flex;
  gap: var(--frame);
  height: 100%;
}

.panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-wonky);
  box-shadow: 4px 6px 0 var(--accent);
  overflow: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M6 26 L9 18 L23 4 L28 9 L14 23 Z M9 18 L14 23 M6 26 L9 25' fill='%23FBEFC9' stroke='%233A3A3A' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 4 26, pointer;
  transition:
    flex-grow .55s var(--spring),
    background-color .4s ease,
    transform .55s var(--spring);
}
.panel--web { --bg: var(--pink-deep);  --bg-deep: var(--pink-deep);  --accent: var(--pink-accent);  view-transition-name: sheet-web; }
.panel--app { --bg: var(--mint-deep);  --bg-deep: var(--mint-deep);  --accent: var(--mint-accent);  view-transition-name: sheet-app; }
.panel--mkt { --bg: var(--lilac-deep); --bg-deep: var(--lilac-deep); --accent: var(--lilac-accent); view-transition-name: sheet-mkt; }

/* the flood: each panel becomes a giant say-hi button when courted */
.panel--web { --flood-hi: #FF7A4D; --flood-mid: #E5320F; --flood-lo: #B5220A; --flood-text: #FFF7F0; }
.panel--app { --flood-hi: #FF8B95; --flood-mid: #EE2456; --flood-lo: #B81740; --flood-text: #FFF7F0; }
.panel--mkt { --flood-hi: #FF9166; --flood-mid: #F23F49; --flood-lo: #BC2630; --flood-text: #FFF7F0; }
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(178deg, var(--flood-hi) 0%, var(--flood-mid) 55%, var(--flood-lo) 100%);
  opacity: 0;
  transition: opacity .4s ease;
}
.panel:active::before,
.panel.pressing::before { opacity: 1; transition-duration: .12s; }

.panel:focus-visible,
.panel.is-active {
  flex-grow: 1.75;
}
.panel:focus-visible::before,
.panel.is-active::before { opacity: 1; }
.panel:focus-visible h2,        .panel.is-active h2,
.panel:focus-visible p,         .panel.is-active p,
.panel:focus-visible .see-more, .panel.is-active .see-more { color: var(--flood-text); }
.panel:focus-visible p,         .panel.is-active p { font-weight: 700; }
.panel:focus-visible .panel-doodle .stroke,
.panel.is-active    .panel-doodle .stroke { stroke: var(--flood-text); }
.panel:focus-visible .see-more .arrow path,
.panel.is-active    .see-more .arrow path { stroke: var(--flood-text); }
.panel:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: -8px;
}

.panel-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 24px;
  max-width: 100%;
  transition: transform .55s var(--spring);
}
.panel:focus-visible .panel-inner,
.panel.is-active .panel-inner { transform: scale(1.05); }

/* fixed layout size per breakpoint: the pencil filter rasterizes once and
   all growing/shrinking happens on the compositor via transform scale */
.panel-doodle {
  width: 180px;
  height: auto;
  will-change: transform;
  transition: transform .5s var(--spring);
}
@media (min-width: 1100px) { .panel-doodle { width: 240px; } }
@media (min-width: 1280px) { .panel-doodle { width: 290px; } }
.panel:focus-visible .panel-doodle,
.panel.is-active .panel-doodle { transform: scale(1.1) rotate(-2.5deg); }

.panel h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.3vw, 2.2rem);
  line-height: 1.15;
  transition: color .35s ease;
}

.panel p {
  font-size: clamp(.95rem, 1.15vw, 1.1rem);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  max-width: 26ch;
  transition: color .35s ease;
}
.panel-doodle .stroke { transition: stroke .35s ease; }

.see-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .02em;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease .08s, transform .35s var(--spring) .08s, color .35s ease;
}
.panel:focus-visible .see-more,
.panel.is-active .see-more {
  opacity: 1;
  transform: translateY(0);
}
.see-more .arrow { width: 44px; height: auto; }
.see-more .arrow path {
  fill: none;
  stroke: var(--accent, var(--ink));
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── tagline sticker taped over the top seam ── */
.sticker {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  z-index: 8;
  pointer-events: none;
  text-align: center;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 18px 28px 20px 30px / 28px 18px 30px 20px;
  padding: 20px 42px 22px;
  box-shadow: 6px 7px 0 rgba(58, 58, 58, .16);
  transition: transform .5s var(--spring);
  view-transition-name: sticker;
}
.sticker-brand { display: none; }

/* washi tape corners */
.sticker::before,
.sticker::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 24px;
  top: -13px;
  background: #F6DFA8;
  opacity: .85;
  border: 1.5px solid rgba(58, 58, 58, .35);
}
.sticker::before { left: -26px;  transform: rotate(-38deg); }
.sticker::after  { right: -26px; transform: rotate(38deg); background: #F9CDB8; }

.sticker h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.1;
}
.sticker > p {
  margin-top: 6px;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  color: var(--ink-soft);
}

/* proof strip — the real numbers, right at the focal point */
.sticker-proof {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 2px 14px;
  margin-top: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(.78rem, .95vw, .92rem);
  color: var(--ink-soft);
}
.sticker-proof strong { font-weight: 700; color: var(--flow-ink, var(--ink)); }

/* one clear primary CTA — re-enables pointer events (the sticker disables them) */
.sticker-cta {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .01em;
  color: #FFF7F0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
  text-decoration: none;
  background: linear-gradient(178deg, #FF7A4D 0%, var(--flow-red) 60%, #D92E18 100%);
  border: 2.5px solid var(--ink);
  border-radius: 16px 22px 14px 24px / 22px 14px 24px 16px;
  padding: 10px 24px;
  box-shadow: 3px 4px 0 rgba(58, 58, 58, .18);
  transition: transform .25s var(--spring), box-shadow .2s ease, filter .15s ease;
}
.sticker-cta:hover, .sticker-cta:focus-visible { transform: translateY(-2px) rotate(-1deg); box-shadow: 4px 6px 0 rgba(58, 58, 58, .22); }
.sticker-cta:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.sticker-cta:active, .sticker-cta.pressing { transform: translateY(0) scale(.96); filter: brightness(.95); transition-duration: .08s; }

/* ── pick-a-panel hint at the bottom seam ── */
.pick-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) rotate(-1.5deg);
  z-index: 9;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* sketched Clippy — the paperclip greeter, bobbing as he eyes up the panels */
.clippy { width: 52px; height: auto; flex-shrink: 0; overflow: visible; animation: bob 2s ease-in-out 1.4s infinite; }
.clippy .pupil { fill: var(--ink); transition: transform .28s var(--spring); }
/* eye-glance: pupils dart toward whatever Clippy is talking about */
.clippy[data-look="left"]  .pupil { transform: translate(-3.5px, 1px); }
.clippy[data-look="right"] .pupil { transform: translate(3.5px, 1px); }
.clippy[data-look="up"]    .pupil { transform: translate(0, -2px); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px) rotate(-1deg); } }

/* Clippy's speech bubble — hand-drawn, fixed box so text swaps never reflow */
.clippy-say {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 13rem; min-height: 2.9em;
  font-family: var(--font-hand); font-weight: 700; font-size: 1.14rem;
  line-height: 1.12; text-align: center; color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px 22px 16px 24px / 22px 16px 24px 16px;
  padding: 8px 16px;
  box-shadow: 2px 3px 0 rgba(58, 58, 58, .12);
}
/* little tail pointing down-left toward Clippy */
.clippy-say::after {
  content: ""; position: absolute; left: -7px; bottom: 14px;
  width: 12px; height: 12px; background: var(--paper);
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  border-bottom-left-radius: 3px;
  transform: rotate(45deg);
}
/* a tiny pop each time the line changes */
@keyframes clippy-pop { 0% { transform: scale(.92); } 55% { transform: scale(1.035); } 100% { transform: scale(1); } }
.clippy-say.pop { animation: clippy-pop .26s ease; }

/* a blink, every few seconds, for a little life */
.clippy .eyes { transform-box: fill-box; transform-origin: center; }
.clippy.blink .eyes { animation: clippy-blink .2s ease; }
@keyframes clippy-blink { 50% { transform: scaleY(.1); } }

/* ── expanding-paper page wipe (touch) · the tapped colour floods out from
   your finger and covers the screen, masking the page swap. Transform-only
   (a scaling circle) so it's GPU-cheap. Desktop keeps the view-transition. ── */
.page-wipe {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

/* ── side paper tabs · notebook dividers peeking from the right edge ── */
.desk-tabs {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.paper-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.3rem;
  color: #FFF7F0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
  text-decoration: none;
  background: var(--bg, var(--butter));
  border: 2px solid var(--ink);
  border-right: none;
  border-radius: 16px 0 0 18px / 20px 0 0 14px;
  padding: 8px 20px 8px 18px;
  box-shadow: -3px 3px 0 rgba(58, 58, 58, .12);
  transform: translateX(16px) rotate(var(--tilt, 0deg));
  transition: transform .3s var(--spring);
}
.tab--studio { background: linear-gradient(178deg, #E45B7B 0%, #D63A5E 60%, #B82A4F 100%); }
.tab--faq    { background: linear-gradient(178deg, #FFB52E 0%, #C77E08 60%, #9A6203 100%); }
.tab--hi     { background: linear-gradient(178deg, #FF7A4D 0%, var(--flow-red) 60%, #D92E18 100%); }
.paper-tab:nth-child(1) { --tilt: -1.6deg; }
.paper-tab:nth-child(2) { --tilt: 1.1deg; }
.paper-tab:nth-child(3) { --tilt: -.9deg; }
.paper-tab:focus-visible {
  transform: translateX(2px) rotate(0deg);
}
.paper-tab:focus-visible { outline: 3px dashed var(--ink); outline-offset: 2px; }
/* instant touch feedback — the tab pulls in + darkens the moment you press it */
.paper-tab:active, .paper-tab.pressing {
  transform: translateX(2px) rotate(0deg) scale(.95);
  filter: brightness(.92);
  transition: transform .08s ease, filter .08s ease;
}
.tab--studio { view-transition-name: sheet-studio; }
.tab--faq    { view-transition-name: sheet-faq; }
.tab--hi     { view-transition-name: sheet-hi; }

/* ═══ intro choreography · the desk assembles itself (first visit only) ═══
   Gated to html.intro (set in the head for navigate/reload, NOT back/forward,
   so the desktop view-transition isn't doubled on return). Transform + opacity
   only → GPU-cheap. Reduced-motion / no-JS fall back to everything visible. */
@keyframes panel-in   { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes sticker-in { from { opacity: 0; transform: translateX(-50%) translateY(-36px) rotate(7deg) scale(.9); } }
@keyframes tab-in     { from { opacity: 0; transform: translateX(72px); } }
@keyframes intro-fade { from { opacity: 0; } }

html.intro .panel  { animation: panel-in .55s var(--spring) both; }
html.intro .panel--web { animation-delay: .28s; }
html.intro .panel--app { animation-delay: .44s; }
html.intro .panel--mkt { animation-delay: .60s; }
html.intro .sticker { animation: sticker-in .6s var(--spring) .08s both; }
html.intro .paper-tab { animation: tab-in .5s var(--spring) both; }
html.intro .paper-tab:nth-child(1) { animation-delay: .92s; }
html.intro .paper-tab:nth-child(2) { animation-delay: 1.0s; }
html.intro .paper-tab:nth-child(3) { animation-delay: 1.08s; }
html.intro .pick-hint { animation: intro-fade .5s ease 1.2s both; }

/* ── mobile: panels stack, tap to expand, tabs become stickers ── */
/* the sticker isn't centre-translated on mobile, so it gets its own drop-in */
@keyframes sticker-in-m { from { opacity: 0; transform: translateY(-26px) rotate(7deg) scale(.9); } }
@media (max-width: 768px) {
  body { overflow: auto; }
  .brand { display: none; }
  html.intro .sticker { animation-name: sticker-in-m; }

  .hero {
    --frame: 9px;
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .panels {
    flex-direction: column;
    height: auto;
    flex: 1;
    min-height: 0;
  }

  /* sticker sits in flow above the panels, with the brand inside it;
     paper pages have no sticker, so a solo snapshot just double-exposes */
  .sticker {
    position: static;
    order: -1;
    transform: rotate(-1.5deg);
    margin: 10px auto 4px;
    width: max-content;
    max-width: 94%;
    view-transition-name: none;
  }
  .sticker-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }
  .sticker-brand svg { width: 88px; height: auto; }

  /* tap feedback is a quick color flood only — no growth, no reflow
     (the desktop-base .is-active grow/scale rules must all reset here) */
  .panel { transition: background-color .35s ease; }
  .panel.is-active { flex-grow: 1; }
  .panel.is-active .panel-inner { transform: none; }
  .panel.is-active .panel-doodle { transform: none; }
  .panel.is-active::before { transition-duration: .15s; }
  .panel-inner { transition: none; }
  .panel-doodle { transition: none; }

  .panel-inner { flex-direction: row; gap: 12px; padding: 12px 16px; width: 100%; justify-content: center; }

  .panel-doodle { width: 84px; flex-shrink: 0; }

  .panel h2 { font-size: 1.25rem; min-width: 0; }

  .panel p,
  .panel .see-more { display: none; }

  .sticker { padding: 12px 22px 14px; }
  .sticker::before, .sticker::after { width: 52px; height: 18px; top: -10px; }
  .sticker h1 { font-size: 1.5rem; }
  .sticker > p { font-size: 1.1rem; margin-top: 2px; }

  /* Clippy rides along on mobile too — in flow, just under the panels */
  .pick-hint { position: static; transform: rotate(-1.5deg); margin: 2px auto 6px; }
  .clippy { width: 46px; }

  /* tabs: a row of paper stickers under the panels */
  .desk-tabs {
    position: static;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    padding: 2px 0 72px;
  }
  .paper-tab {
    border-right: 2px solid var(--ink);
    border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px;
    transform: rotate(var(--tilt, 0deg));
    padding: 6px 16px;
    font-size: 1.15rem;
    box-shadow: 2px 3px 0 rgba(58, 58, 58, .12);
  }
}

/* ── pointer-only interactions (no sticky hover on touch) ── */
@media (hover: hover) and (pointer: fine) {
  .panel:hover {
    flex-grow: 1.75;
  }
  .panel:hover::before { opacity: 1; }
  .panel:hover h2,
  .panel:hover p,
  .panel:hover .see-more { color: var(--flood-text); }
  .panel:hover p { font-weight: 700; }
  .panel:hover .panel-doodle .stroke { stroke: var(--flood-text); }
  .panel:hover .see-more .arrow path { stroke: var(--flood-text); }
  .panel:hover .panel-inner { transform: scale(1.05); }
  .panel:hover .panel-doodle { transform: scale(1.1) rotate(-2.5deg); }
  /* shrink the others on the compositor instead of re-laying-out the SVG */
  .panels:hover .panel:not(:hover) .panel-doodle { transform: scale(.68); }
  .panel:hover .see-more {
    opacity: 1;
    transform: translateY(0);
  }
  .panels:hover ~ .sticker { transform: translateX(-50%) rotate(.8deg) scale(.97); }
  .paper-tab:hover {
    transform: translateX(2px) rotate(0deg);
  }
}
