/* Sera in the header and the Tools menu (Header.astro, SeraEyes.astro).
   Colours follow the Promptly Found system: ink #131315, cream #edebe6, accent #e58a9a. */

/* ---------- Header: right-hand group ---------- */
.pf-header__end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

/* ---------- Header: the Ask Sera button ---------- */
header.pf-header .pf-sera-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  height: 40px;
  padding: 0 14px 0 5px;
  border-radius: 12px;
  background: #edebe6;
  color: #131315;
  font: 500 15px/1 Archivo, "Helvetica Neue", Arial, system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(229, 138, 154, 0.16),
    0 10px 22px -10px rgba(229, 138, 154, 0.75);
  overflow: hidden;
  isolation: isolate;
  transition: background-color 0.18s, box-shadow 0.18s, transform 0.18s;
  animation: pf-sera-glow 7s ease-in-out 3s infinite;
}
/* A band of light that sweeps across the button on hover */
header.pf-header .pf-sera-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(229, 138, 154, 0.28) 46%, rgba(255, 255, 255, 0.9) 50%, rgba(229, 138, 154, 0.28) 54%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
header.pf-header .pf-sera-btn:hover::after { transform: translateX(120%); transition: transform 0.75s ease; }
header.pf-header .pf-sera-btn:active { transform: translateY(0) scale(0.97); }
@keyframes pf-sera-glow {
  0%, 82%, 100% { box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(229, 138, 154, 0.16), 0 10px 22px -10px rgba(229, 138, 154, 0.75); }
  90% { box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(229, 138, 154, 0.28), 0 12px 26px -8px rgba(229, 138, 154, 0.95); }
}
header.pf-header .pf-sera-btn:hover {
  animation: none;
  background: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(229, 138, 154, 0.34),
    0 14px 26px -10px rgba(229, 138, 154, 0.95);
}
.pf-sera-btn:focus-visible {
  outline: 2px solid #e58a9a;
  outline-offset: 3px;
}
header.pf-header .pf-sera-btn[aria-current="page"] {
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 2px #e58a9a;
}
.pf-sera-btn__face {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: radial-gradient(120% 120% at 15% 0%, #2d2942 0%, #131315 62%);
  box-shadow: inset 0 0 0 1px rgba(229, 138, 154, 0.4);
}
.pf-sera-btn__face svg {
  width: 26px;
  height: 26px;
}

/* ---------- The star eyes (shared by button and card) ---------- */
.pf-sera-eyesbox {
  position: relative;
  display: grid;
  place-items: center;
}
.pf-sera-btn__face .pf-sera-eyesbox { width: 100%; height: 100%; }
.pf-sera-eyesbox__cv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.pf-sera-eyesbox--lg .pf-sera-eyesbox__cv { inset: -12px -16px; width: calc(100% + 32px); height: calc(100% + 24px); }
.pf-sera-eyesbox.is-live > svg { visibility: hidden; }
/* The eyes here use the crisp mode of src/lib/sera-eyes.ts (solid, fully lit dots), so they need only a little extra light. */
.pf-sera-eyesbox--lg .pf-sera-eyesbox__cv { filter: brightness(1.1); }
.pf-sera-eyes {
  display: block;
  overflow: visible;
}
.pf-sera-eyes .e {
  transform-box: fill-box;
  transform-origin: center;
  animation: pf-sera-blink 6.5s infinite;
}
.pf-sera-eyes .d,
.pf-sera-eyes .s {
  transform-box: fill-box;
  transform-origin: center;
  animation: pf-sera-twinkle 3.2s ease-in-out infinite;
}
.pf-sera-eyes .d1 { animation-delay: -0.8s; }
.pf-sera-eyes .d2 { animation-delay: -1.6s; }
.pf-sera-eyes .d3 { animation-delay: -2.4s; }
.pf-sera-eyes .s { animation-name: pf-sera-flare; animation-duration: 4.4s; }
.pf-sera-eyes .s1 { animation-delay: -2.2s; }
a:hover > .pf-sera-btn__face .e,
.pfl-sera:hover .e {
  animation-duration: 1.6s;
}
@keyframes pf-sera-blink {
  0%, 91%, 100% { transform: scaleY(1); }
  94.5% { transform: scaleY(0.12); }
}
@keyframes pf-sera-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes pf-sera-flare {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.55) rotate(45deg); opacity: 0.6; }
}

/* ---------- Header: smaller screens ---------- */
/* Search is the magnifying glass alone, at every width. */
header.pf-header .pf-header__end .pf-header__search {
  position: relative;
  flex: none;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
}
header.pf-header .pf-header__end .pf-header__search span {
  position: absolute;
  left: 0;
  top: 0;
  flex: none;
  width: 1px;
  min-width: 0;
  max-width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .pf-sera-btn__ask { display: none; }
}
@media (min-width: 1001px) and (max-width: 1180px) {
  /* The menu already ran under the logo and search at these widths. Tighter links make room. */
  header.pf-header nav.pf-nav.pf-nav.pf-nav > a,
  header.pf-header nav.pf-nav.pf-nav.pf-nav > button {
    padding-left: 7px;
    padding-right: 7px;
  }
}
@media (max-width: 1000px) {
  .pf-header__end { margin-left: auto; }
}
@media (min-width: 941px) and (max-width: 1000px) {
  /* Very little room here: the button becomes the face alone, and the menu closes up. */
  header.pf-header .pf-sera-btn { padding: 0 5px; }
  .pf-sera-btn__label { display: none; }
  header.pf-header.pf-header { gap: 12px; }
  header.pf-header nav.pf-nav.pf-nav.pf-nav { gap: 10px; }
  header.pf-header nav.pf-nav.pf-nav.pf-nav > a,
  header.pf-header nav.pf-nav.pf-nav.pf-nav > button { font-size: 14px; }
}
@media (min-width: 760px) and (max-width: 940px) {
  /* The full menu did not fit at these widths before this change. Use the phone layout here too. */
  header.pf-header nav.pf-nav.pf-nav,
  header.pf-header .pf-header__end .pf-header__search { display: none; }
  header.pf-header .pf-header__menu { display: grid; }
}
@media (max-width: 759px) {
  header.pf-header .pf-sera-btn { height: 36px; padding-right: 12px; border-radius: 10px; }
  .pf-sera-btn__face { width: 26px; height: 26px; border-radius: 7px; }
  .pf-sera-btn__face svg { width: 22px; height: 22px; }
}

/* ---------- Phone menu: Sera row above search ---------- */
#pf-mnav .pf-mnav__sera {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 10px 14px 10px 10px;
  border-radius: 10px;
  background: #edebe6;
  color: #131315;
  font: 500 16px/1.2 Archivo, "Helvetica Neue", Arial, system-ui, sans-serif;
  text-decoration: none;
}
.pf-mnav__sera .pf-sera-btn__face { width: 36px; height: 36px; }
.pf-mnav__sera .pf-sera-btn__face svg { width: 30px; height: 30px; }
.pf-mnav__sera small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: #55555c;
}
.pf-mnav__sera .pf-sera-arrow { margin-left: auto; }

/* ---------- Tools menu ---------- */
#pf-mega-tools .pfl-row {
  grid-template-columns: 320px minmax(0, 1fr) 312px;
  gap: 36px;
}

/* White sheet: a second action in place of the old top label */
#pf-mega-tools .pfl-alt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: #18181b;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(24, 24, 27, 0.25);
  text-underline-offset: 4px;
}
#pf-mega-tools .pfl-alt:hover { text-decoration-color: #e58a9a; }
#pf-mega-tools .pfl-alt svg { transition: transform 0.18s; }
#pf-mega-tools .pfl-alt:hover svg { transform: translateX(3px); }

/* Middle: two groups, each named by the question it answers */
#pf-mega-tools .pfl-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}
#pf-mega-tools .pfl-mid,
#pf-mega-tools .pfl-g { min-width: 0; }
#pf-mega-tools .pfl-g .pfl-h {
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid #2b2b2f;
  color: #edebe6;
  font-size: 15px;
  font-weight: 500;
}
#pf-mega-tools .pfl-g .pfl-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}
#pf-mega-tools .pfl-g li { border: 0; }
#pf-mega-tools .pfl-g .pfl-r {
  position: relative;
  display: block;
  margin: 0 -10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  transition: background-color 0.15s;
}
#pf-mega-tools .pfl-g .pfl-r:hover { background: rgba(255, 255, 255, 0.06); }
#pf-mega-tools .pfl-g .pfl-t { display: block; font-size: 15.5px; }
#pf-mega-tools .pfl-g .pfl-d {
  display: block;
  color: #918f8a;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#pf-mega-tools .pfl-g .pfl-r:hover .pfl-d { color: #b5b3ad; }

/* Right: the Sera promo card */
#pf-mega-tools .pfl-sera {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 22px 22px 20px;
  border-radius: 8px;
  color: #edebe6;
  text-decoration: none;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(84, 78, 150, 0.42), transparent 70%),
    radial-gradient(80% 60% at 100% 100%, rgba(229, 138, 154, 0.2), transparent 70%),
    #101012;
  box-shadow:
    inset 0 0 0 1px rgba(229, 138, 154, 0.3),
    0 14px 34px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.2s, transform 0.2s;
}
#pf-mega-tools .pfl-sera::before {
  /* a still field of small stars */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 82% 12%, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 36%, rgba(229, 138, 154, 0.9) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 28% 58%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 91% 64%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 84%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 52% 90%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 44% 8%, rgba(255, 255, 255, 0.4) 50%, transparent 51%);
  pointer-events: none;
}
#pf-mega-tools .pfl-sera > * { position: relative; }
#pf-mega-tools .pfl-sera:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(229, 138, 154, 0.65),
    0 20px 44px rgba(0, 0, 0, 0.55),
    0 0 40px -12px rgba(229, 138, 154, 0.55);
}
#pf-mega-tools .pfl-sera:focus-visible {
  outline: 2px solid #e58a9a;
  outline-offset: 3px;
}
#pf-mega-tools .pfl-sera .pf-sera-eyesbox--lg { align-self: flex-start; }
#pf-mega-tools .pfl-sera .pf-sera-eyes--lg {
  width: 128px;
  height: auto;
  margin: 4px 0 20px -4px;
  filter: drop-shadow(0 0 8px rgba(229, 138, 154, 0.35));
}
#pf-mega-tools .pfl-sera__h {
  margin: 0 0 8px;
  color: #edebe6;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
#pf-mega-tools .pfl-sera__h em { color: #e58a9a; font-style: normal; }
#pf-mega-tools .pfl-sera__p {
  margin: 0 0 18px;
  color: #b5b3ad;
  font-size: 13.5px;
  line-height: 20px;
}
#pf-mega-tools .pfl-sera__go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: #edebe6;
  color: #131315;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.18s;
}
#pf-mega-tools .pfl-sera:hover .pfl-sera__go { background: #fff; }
#pf-mega-tools .pfl-sera__go svg { transition: transform 0.18s; }
#pf-mega-tools .pfl-sera:hover .pfl-sera__go svg { transform: translateX(3px); }

/* Bottom row: the four generators, then the link to every tool */
#pf-mega-tools .pfl-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 26px;
}
#pf-mega-tools .pfl-foot__h {
  color: #918f8a;
  font-size: 14px;
}
#pf-mega-tools .pfl-foot > a { font-size: 14px; }
#pf-mega-tools .pfl-foot > a:not(.pfl-foot__all) { text-decoration: none; }
#pf-mega-tools .pfl-foot > a:not(.pfl-foot__all):hover {
  text-decoration: underline 1px #e58a9a;
  text-underline-offset: 4px;
}
#pf-mega-tools .pfl-foot__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

@media (max-width: 1180px) {
  #pf-mega-tools .pfl-row { grid-template-columns: 290px minmax(0, 1fr) 270px; gap: 28px; }
  #pf-mega-tools .pfl-sera__h { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-sera-eyes .e,
  .pf-sera-eyes .d,
  .pf-sera-eyes .s { animation: none; }
  header.pf-header .pf-sera-btn,
  #pf-mega-tools .pfl-sera { transition: none; animation: none; }
  header.pf-header .pf-sera-btn::after { display: none; }
  header.pf-header .pf-sera-btn:hover,
  #pf-mega-tools .pfl-sera:hover { transform: none; }
}
