/* Wax Plum — site chrome, motion keyframes, reveal animations.
   Paired with brand.css (tokens). No border-radius anywhere. */

html, body { margin: 0; padding: 0; background: #d9d7d1; }
body {
  font-family: 'Source Code Pro', monospace;
  display: flex;
  justify-content: center;
  color: var(--wp-dark);
}

/* The 1280 canvas — centered on the gutter neutral, with the one allowed shadow. */
.wp-canvas {
  width: 100%;
  max-width: 1280px;
  background: var(--wp-light);
  color: var(--wp-dark);
  box-shadow: 0 0 80px rgba(23,22,68,.18);
  font-family: var(--wp-mono);
  position: relative;
}

/* ===== Site header / footer ===== */
.wp-site-header {
  padding: 26px 56px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid var(--wp-dark);
}
.wp-site-header__logo img { height: 40px; width: auto; display: block; }
.wp-site-header__mid { justify-self: start; margin-left: 20px; opacity: .6; }
.wp-site-header__nav { display: flex; gap: 26px; }
.wp-site-header__nav a { opacity: .5; }
.wp-site-header__nav a.is-active { opacity: 1; }
.wp-site-header__nav a.is-subscribe { color: var(--wp-plum-red); opacity: 1; }
.wp-navlink { transition: opacity .2s ease; }
.wp-navlink:hover { opacity: 1 !important; }

/* Homepage header has a slightly taller logo */
.wp-site-header--home .wp-site-header__logo img { height: 44px; }
.wp-site-header--home { padding: 28px 56px 20px; border-bottom: 0; }
.wp-standfirst {
  padding: 0 56px 24px;
  border-bottom: 1px solid var(--wp-dark);
}
.wp-standfirst .wp-eyebrow { opacity: .55; }

.wp-site-footer {
  background: var(--wp-dark);
  color: var(--wp-light);
  padding: 24px 56px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.wp-site-footer .opacity-low { opacity: .55; }

/* ===== Hero motion graphic ===== */
@keyframes alchGlyphSwap {
  from { opacity: .15; transform: translateY(-0.16em) scaleY(.55); }
  to   { opacity: 1; transform: none; }
}
@keyframes alchLineIn {
  from { opacity: 0; transform: translateY(0.22em); }
  to   { opacity: 1; transform: none; }
}
@keyframes alchBlink { 50% { opacity: 0; } }

.alch-stage {
  position: relative;
  min-height: clamp(150px, 38vw, 312px);
  cursor: pointer;
}
.alch-layer {
  position: absolute;
  left: 0;
  top: 0;
  transition: opacity .5s ease;
}
.alch-flip {
  display: inline-block;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.7,0,.25,1);
  position: relative;
}
.alch-flip.flipped { transform: rotateX(180deg); }
.alch-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.alch-back {
  position: absolute;
  inset: 0;
  transform: rotateX(180deg);
  display: flex;
  align-items: center;
}
.alch-word {
  font-family: var(--wp-mono);
  font-weight: 700;
  font-size: clamp(46px, 12vw, 96px);
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}
.alch-cursor {
  display: inline-block;
  width: .06em;
  height: .92em;
  margin-left: .06em;
  background: var(--wp-plum-red);
  vertical-align: -0.12em;
  animation: alchBlink 1s steps(1) infinite;
}
.alch-glyph { display: inline-block; animation: alchGlyphSwap .35s ease both; }
.alch-chemy-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.2em);
  transition: opacity .3s ease, transform .3s ease;
}
.alch-readout {
  font-family: var(--wp-mono);
  font-weight: 700;
  font-size: clamp(50px, 13vw, 104px);
  line-height: 0.94;
  margin: 0;
  letter-spacing: -0.045em;
  color: var(--wp-dark);
}
.alch-readout div { animation-fill-mode: both; }
.alch-replay-hint {
  position: absolute;
  right: 0;
  top: 6px;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}

/* ===== Reveal animations ===== */
.wp-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.wp-reveal.in { opacity: 1; transform: none; }

.wp-idx-num {
  display: inline-block;
  transition: transform .7s cubic-bezier(.2,.7,.3,1), color .2s;
}
.wp-reveal .wp-idx-num { transform: translateX(-12px); }
.wp-reveal.in .wp-idx-num { transform: none; transition-delay: .12s; }

.wp-leaf-reveal {
  opacity: 0;
  transform: translateY(-10px) scale(.62) rotate(-8deg);
  transform-origin: 78% 22%;
  transition: opacity .8s ease, transform .9s cubic-bezier(.18,.9,.28,1.18);
}
.wp-leaf-reveal.in { opacity: 1; transform: none; }

.wp-row:hover .wp-idx-num { color: var(--wp-plum-red); }

@media (prefers-reduced-motion: reduce) {
  .wp-reveal,
  .wp-leaf-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== Index rows (homepage + archive) ===== */
.wp-row {
  display: grid;
  align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(23,22,68,.14);
  color: inherit;
  text-decoration: none;
}
.wp-row--home { grid-template-columns: 74px 130px 1fr 110px; padding: 24px 0; }
.wp-row--archive { grid-template-columns: 74px 130px 1fr 80px; }
.wp-row__num { font-weight: 700; font-size: 32px; letter-spacing: -0.02em; color: var(--wp-dark); }
.wp-row--archive .wp-row__num { font-size: 30px; }
.wp-row__title { font-size: 20px; font-weight: 600; color: var(--wp-dark); }
.wp-row--archive .wp-row__title { font-size: 19px; }
.wp-row__dek { font-size: 13px; margin-top: 6px; opacity: .7; }
.wp-row__kind { color: var(--wp-plum-red); }
.wp-row__len { text-align: right; opacity: .55; }

/* ===== Archive filter chips ===== */
.wp-chips {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.wp-chip {
  font-family: var(--wp-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid var(--wp-dark);
  background: transparent;
  color: var(--wp-dark);
  transition: background .15s, color .15s;
}
.wp-chip.is-on {
  background: var(--wp-dark);
  color: var(--wp-light);
}
.wp-chip-count {
  margin-left: auto;
  opacity: .5;
}

/* Hide rows that don't match the active filter */
.wp-row.is-hidden { display: none; }

/* ===== Subscribe form states ===== */
.wp-subscribe-form {
  display: flex;
  gap: 0;
  max-width: 480px;
  margin: 40px auto 0;
  border: 1px solid var(--wp-dark);
}
.wp-subscribe-form input {
  flex: 1;
  border: 0;
  padding: 16px 18px;
  font-family: var(--wp-mono);
  font-size: 15px;
  background: transparent;
  color: var(--wp-dark);
  outline: none;
}
.wp-subscribe-form button {
  border: 0;
  background: var(--wp-dark);
  color: var(--wp-light);
  padding: 0 24px;
  font-family: var(--wp-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.wp-subscribe-confirm {
  margin: 40px auto 0;
  max-width: 480px;
  background: var(--wp-plum-purple);
  color: var(--wp-light);
  padding: 22px 26px;
}
.wp-subscribe-confirm .h { font-weight: 700; font-size: 18px; }
.wp-subscribe-confirm .d { font-size: 14px; opacity: .85; margin-top: 6px; }
.is-hidden-hard { display: none !important; }

/* ===== WP admin bar offset (so it doesn't fight the canvas) ===== */
body.admin-bar .wp-canvas { /* canvas isn't fixed, no offset needed beyond default WP behavior */ }
