/* =========================================================
   ROWEN — THE SALE (cmp-)
   ---------------------------------------------------------
   The announcement bar in the header, the homepage section under the
   hero, the /cover-art section and the order form's note. Dates and
   words live in assets/js/campaign.js; this file is only the look.

   Shown only while BOTH hold:
     html.cmp-live                  campaign.js: the sale is running
     [data-svc-state="open"]        main.js: cover art takes orders
   so an ended sale or a closed service leaves no trace on the page.

   The look follows DESIGN.md: a flat charcoal panel with a hairline,
   Space Grotesk for the words that sell it, the white glass pill for
   the one action. The one exception is the pink: on 2026-11-03 Rowen
   asked for the sale to stand out more, so the bar is solid pink with
   near-black text (5.6:1), "50% off" is pink, the panels carry a pink
   top edge, and sale prices elsewhere turn pink. Flat colour only: no
   glow, no gradient, no lift, nothing that moves by itself except the
   numbers.
   ========================================================= */

html:not(.cmp-live) .cmp-scope,
.cmp-scope:not([data-svc-state="open"]){display:none !important;}

/* ---------- the bar ----------
   Sits inside the fixed header, so main.js's header measurement
   (--header-h) already counts it and closing it moves nothing by hand.
   The negative top margin cancels the header's own top padding, and the
   bottom margin gives it back under the bar, so the nav keeps its usual
   spacing. Both follow the header's padding at each size and when it
   shrinks on scroll. */
.cmp-bar{
  position:relative;margin:-22px 0 22px;
  background:var(--accent);
  font-size:13px;line-height:1.3;color:var(--black);
  transition:margin .4s var(--ease);
}
/* The site's focus ring is pink, which would vanish on the bar. */
.cmp-bar :focus-visible{outline-color:var(--black);}
header.scrolled .cmp-bar{margin:-16px 0 16px;}
html.cmp-bar-off .cmp-bar{display:none;}
.cmp-bar-inner{display:flex;align-items:center;gap:18px;min-height:38px;}
.cmp-bar-text{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500;}
.cmp-bar-name{font-family:'Space Grotesk',sans-serif;font-weight:600;letter-spacing:-.005em;}
.cmp-bar-sep{opacity:.5;}
.cmp-bar-narrow{display:none;}
.cmp-bar-time{flex:0 0 auto;font-variant-numeric:tabular-nums;white-space:nowrap;}
.cmp-bar-link{
  flex:0 0 auto;font-weight:600;white-space:nowrap;
  background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;
  padding-bottom:1px;transition:background-size .3s var(--ease);
}
.cmp-bar-link:hover{background-size:100% 1px;}
.cmp-bar-close{
  flex:0 0 auto;display:grid;place-items:center;width:28px;height:28px;margin-right:-6px;
  border-radius:50%;cursor:pointer;color:var(--black);
  border:1px solid transparent;background:transparent;
  transition:background-color .25s var(--ease),border-color .25s var(--ease),color .25s var(--ease),transform .5s var(--lg-spring);
}
.cmp-bar-close:hover{background:rgba(8,8,10,.12);border-color:rgba(8,8,10,.18);}
.cmp-bar-close:active{transform:var(--lg-press);transition-duration:.25s,.25s,.25s,.12s;}

/* ---------- the panel (homepage and /cover-art) ---------- */
.hm-cmp{position:relative;z-index:2;padding:8px 0 72px;}
.cmp-cover{position:relative;z-index:2;margin:6px 0 40px;}
.cmp-panel{
  display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);
  background:var(--card);border:1px solid var(--accent-dim);border-radius:12px;
  box-shadow:inset 0 3px 0 var(--accent);
  overflow:hidden;
}
.cmp-copy{padding:40px 44px 42px;min-width:0;}
.cmp-side{
  display:flex;flex-direction:column;justify-content:center;gap:18px;
  padding:40px 44px;border-left:1px solid var(--line);min-width:0;
}
.cmp-status{margin-bottom:26px;}

/* The headline as three sizes of one voice. Written in sentence case in
   the markup and set in capitals here, so a screen reader says "I'm
   back" rather than spelling it out. */
.cmp-title{font-family:'Space Grotesk',sans-serif;font-weight:500;text-transform:uppercase;color:var(--white);}
.cmp-title > span{display:block;}
.cmp-title-back{font-size:clamp(22px,2.4vw,30px);line-height:1.1;letter-spacing:-.01em;}
.cmp-title-off{
  margin:12px 0 10px -.045em;color:var(--accent);
  font-size:clamp(76px,9.4vw,136px);font-weight:600;line-height:.84;letter-spacing:-.05em;
  font-variant-numeric:lining-nums;white-space:nowrap;
}
.cmp-title-pct{font-size:.5em;vertical-align:.62em;letter-spacing:0;margin:0 .1em 0 .02em;}
.cmp-title-what{font-size:clamp(18px,1.9vw,24px);line-height:1.1;letter-spacing:.05em;}
.cmp-sub{margin-top:22px;max-width:38ch;font-size:16px;line-height:1.6;color:var(--dim);text-wrap:pretty;}

/* Countdown: four cells of tabular figures that never change width, so
   nothing beside them shifts as the seconds tick. */
.cmp-count{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.cmp-unit{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 4px 11px;border:1px solid var(--line);border-radius:8px;background:var(--black);
}
.cmp-unit b{
  font-family:'Space Grotesk',sans-serif;font-weight:600;font-size:clamp(26px,2.5vw,34px);
  line-height:1;letter-spacing:-.02em;color:var(--white);font-variant-numeric:tabular-nums;
}
.cmp-unit small{font-size:11.5px;color:var(--dimmer);}

/* The price waits for main.js to fill it from config, keeping its line
   so the button under it doesn't jump. */
.cmp-price{display:flex;align-items:baseline;gap:8px;font-size:13.5px;color:var(--dim);}
html:not(.cmp-priced) .cmp-price{visibility:hidden;}
.cmp-price b{font-family:'Space Grotesk',sans-serif;font-size:24px;font-weight:600;letter-spacing:-.01em;color:var(--white);}
.cmp-price s{font-size:15px;color:var(--dimmer);}
.cmp-cta{justify-content:center;}
.cmp-ends{font-size:13px;color:var(--dim);}

/* /cover-art adds the terms under both columns: always shown on wide
   screens (campaign.js opens the disclosure and its summary is hidden),
   one "How the sale works" line on phones and tablets. */
.cmp-terms-box{grid-column:1 / -1;border-top:1px solid var(--line);}
.cmp-terms-summary{
  display:none;cursor:pointer;list-style:none;padding:16px 44px;
  font-family:'Space Grotesk',sans-serif;font-size:15px;font-weight:500;color:var(--white);
}
/* A window widened after load keeps a way to open them. */
.cmp-terms-box:not([open]) .cmp-terms-summary{display:block;}
.cmp-terms-summary::-webkit-details-marker{display:none;}
.cmp-terms-summary::after{content:'+';float:right;color:var(--dim);font-weight:400;}
.cmp-terms-box[open] .cmp-terms-summary::after{content:'−';}
.cmp-terms{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.cmp-terms > div{padding:24px 28px 26px 44px;}
.cmp-terms > div + div{border-left:1px solid var(--line);padding-left:28px;}
.cmp-terms dt{font-family:'Space Grotesk',sans-serif;font-size:15px;font-weight:500;color:var(--white);margin-bottom:8px;}
.cmp-terms dd{font-size:13.5px;line-height:1.6;color:var(--dim);text-wrap:pretty;}
.cmp-policy{
  background:none;border:0;padding:0;font:inherit;color:var(--white);cursor:pointer;
  text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line-strong);
}
.cmp-policy:hover{text-decoration-color:currentColor;}

/* Prices elsewhere during the sale: "From $32.50 $65" on cards, the
   listing bar and the homepage price list (mkWasHtml in main.js). */
.mk-price-was{font-size:.82em;font-weight:500;color:var(--dimmer);margin-left:.2em;}
.mk-price:has(.mk-price-was),.hm-service-price :has(> .mk-price-was),
.hm-price:has(.mk-price-was){color:var(--accent);}
.mk-listing-price:has(.mk-price-was) .mk-listing-note{color:var(--accent);}

/* ---------- order form ---------- */
.form-sale-tag{font-size:12.5px;color:var(--accent);padding:2px 9px;border:1px solid var(--accent-dim);border-radius:100px;margin:0 2px;}
.cmp-order-note{
  margin-bottom:14px;padding:14px 16px;border:1px solid var(--accent-dim);border-radius:10px;
  background:var(--card);font-size:13.5px;line-height:1.6;color:var(--dim);
}
.cmp-order-note b{color:var(--white);font-weight:600;}

/* ---------- sizes ---------- */
@media (max-width:1040px){
  .cmp-panel{grid-template-columns:minmax(0,1fr);}
  .cmp-side{border-left:0;border-top:1px solid var(--line);padding-top:30px;}
  .cmp-side .cmp-cta{align-self:flex-start;}
  .cmp-terms > div{padding-left:44px;}
}
@media (max-width:860px){
  /* The phone header's padding (styles.css, MOBILE APP SHELL). */
  .cmp-bar{margin:-12px 0 12px;}
  header.scrolled .cmp-bar{margin:-10px 0 10px;}
  .cmp-bar-wide{display:none;}
  /* "Commission cover art" doesn't fit beside the offer and the time on
     a phone; the link says "Details" there and goes to the same page. */
  .cmp-bar-narrow{display:inline;}
  .cmp-bar-inner{gap:12px;min-height:34px;}
  .cmp-bar-text{gap:8px;}
  .cmp-terms-summary{display:block;}
  .cmp-terms{grid-template-columns:minmax(0,1fr);}
  .cmp-terms > div,.cmp-terms > div + div{padding:4px 44px 14px;border-left:0;}
  .cmp-terms > div:last-child{padding-bottom:24px;}
}
@media (max-width:640px){
  .hm-cmp{padding:0 0 56px;}
  .cmp-copy{padding:26px 22px 24px;}
  .cmp-side{padding:20px 22px 22px;gap:14px;}
  .cmp-status{margin-bottom:18px;}
  .cmp-title-off{font-size:min(20vw,104px);margin-top:10px;}
  .cmp-sub{margin-top:16px;font-size:15px;}
  .cmp-side .cmp-cta{align-self:stretch;}
  .cmp-unit{padding:11px 2px 9px;}
  .cmp-terms-summary{padding-left:22px;padding-right:22px;}
  .cmp-terms > div,.cmp-terms > div + div{padding:4px 22px 14px;}
  .cmp-terms > div:last-child{padding-bottom:22px;}
  /* /cover-art already has its title and price bar above this. */
  .cmp-cover .cmp-title-off{font-size:min(17vw,104px);}
  .cmp-cover .cmp-sub{margin-top:12px;}
  .cmp-bar-name{display:none;}
  .cmp-bar-name + .cmp-bar-sep{display:none;}
}
/* Under reduced motion the countdown shows minutes and changes once a
   minute (campaign.js), and nothing animates. */
@media (prefers-reduced-motion: reduce){
  .cmp-count{grid-template-columns:repeat(3,minmax(0,1fr));}
  .cmp-unit-sec{display:none;}
  .cmp-bar,.cmp-bar-link,.cmp-bar-close{transition:none;}
}
