/* Project H.O.P.E. — application styles.
   Palette comes from brand.css, which was measured from the logo.
   Gold is an ACCENT: rules, borders, one primary button. Large gold fills on
   paper fail contrast (2.1:1), so gold text on paper is gold-700 or larger-than-24px only.
   Motion: entrances ease-out, nothing over 300ms, transform/opacity only. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }

h1, h2, h3, h4 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  color: var(--navy-800);
  line-height: 1.15;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
p  { margin: 0 0 1rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy-800); color: #fff; padding: .7rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- layout ---------- */
.wrap { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: clamp(2.5rem, 1.5rem + 4vw, 5rem) 0; }
.section--tight { padding: clamp(1.75rem, 1rem + 2vw, 3rem) 0; }
.section--navy { background: var(--grad-navy); color: #E9EDF4; }
.section--navy h2, .section--navy h3 { color: #fff; }
.section--paper2 { background: var(--paper-2); }

.grid { display: grid; gap: clamp(1rem, .6rem + 1.2vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.stack > * + * { margin-top: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.center { text-align: center; }
.muted { color: var(--ink-mute); }
.prose { max-width: 62ch; }
.eyebrow {
  font-family: Inter, sans-serif; font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-700); margin: 0 0 .6rem;
}
.section--navy .eyebrow { color: var(--gold-400); }
.lede { font-size: clamp(1.02rem, .97rem + .3vw, 1.2rem); color: var(--ink-soft); max-width: 60ch; }
.section--navy .lede { color: #C3CEDE; }
.rule-gold { height: 3px; width: 72px; background: var(--grad-gold); border-radius: 2px; margin: 0 0 1.25rem; }
.center .rule-gold { margin-inline: auto; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,250,250,.88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__in { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; margin-right: auto; }
.brand__mark { border-radius: 6px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong {
  font-family: "Playfair Display", Georgia, serif; font-size: 1.05rem; color: var(--navy-800); letter-spacing: .01em;
}
.brand__text small { font-size: .68rem; color: var(--ink-mute); letter-spacing: .02em; }

.site-nav { display: flex; align-items: center; gap: 1.35rem; }
.site-nav a { color: var(--navy-700); text-decoration: none; font-size: .93rem; font-weight: 500; }
.site-nav a:hover, .site-nav a.is-active { color: var(--gold-700); }
.site-nav a.btn:hover { color: #fff; }
.site-nav a.btn--ghost:hover { color: var(--navy-800); }

.navburger { display: none; }
@media (max-width: 860px) {
  .navburger {
    display: block; width: 42px; height: 42px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); position: relative; cursor: pointer; background: #fff;
  }
  .navburger span, .navburger span::before, .navburger span::after {
    position: absolute; left: 11px; width: 18px; height: 2px; background: var(--navy-800); content: "";
    transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  }
  .navburger span { top: 20px; }
  .navburger span::before { top: -6px; left: 0; }
  .navburger span::after  { top: 6px;  left: 0; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
    box-shadow: var(--shadow-md);
  }
  .site-nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .site-nav a.btn { margin-top: .75rem; border-bottom: 0; }
  .navtoggle:checked ~ .site-nav { transform: none; opacity: 1; pointer-events: auto; }
  .navtoggle:checked ~ .navburger span { background: transparent; }
  .navtoggle:checked ~ .navburger span::before { transform: translateY(6px) rotate(45deg); }
  .navtoggle:checked ~ .navburger span::after  { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.35rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 .94rem/1.2 Inter, sans-serif; text-decoration: none; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring-gold); }
.btn--gold { background: var(--grad-gold); color: #2A1E05; border-color: var(--gold-700); box-shadow: var(--shadow-sm); }
.btn--gold:hover { color: #2A1E05; box-shadow: var(--shadow-md); }
.btn--navy { background: var(--navy-800); color: #fff; }
.btn--navy:hover { background: var(--navy-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy-800); border-color: var(--navy-200); }
.btn--ghost:hover { background: var(--navy-100); color: var(--navy-800); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { padding: .5rem .95rem; font-size: .85rem; }
.btn--lg { padding: .9rem 1.8rem; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.section--navy .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.section--navy .btn--ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- cards ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card__body { padding: clamp(1.1rem, .9rem + .6vw, 1.6rem); }
.card__head {
  padding: 1rem clamp(1.1rem, .9rem + .6vw, 1.6rem); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card__head h2, .card__head h3 { margin: 0; }
.card--gold { border-top: 3px solid transparent; border-image: var(--grad-gold) 1; }
.card--feature { position: relative; }
.card--feature::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--grad-gold);
}

/* ---------- stats ---------- */
.stat-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
}
.stat__label { font-size: .76rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-mute); margin: 0 0 .3rem; }
.stat__value { font-family: "Playfair Display", Georgia, serif; font-size: 1.65rem; color: var(--navy-800); line-height: 1.1; margin: 0; }
.stat__note { font-size: .82rem; color: var(--ink-mute); margin: .35rem 0 0; }
.stat--gold .stat__value { color: var(--gold-700); }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field--full { grid-column: 1 / -1; }
.field > label { font-size: .85rem; font-weight: 600; color: var(--navy-700); }
.input, .select, .textarea {
  width: 100%; padding: .68rem .85rem; font: inherit; font-size: .95rem; color: var(--ink);
  background: #fff; border: 1px solid var(--navy-200); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--ring-gold); }
.textarea { min-height: 7rem; resize: vertical; }
.help { font-size: .8rem; color: var(--ink-mute); }
.err  { font-size: .8rem; color: var(--danger); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin: 0 0 1rem; }
legend { font-size: .85rem; font-weight: 600; color: var(--navy-700); padding-inline: .4rem; }

/* ---------- flashes ---------- */
.flashes { padding-top: 1rem; }
.flash {
  border: 1px solid; border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0 0 .65rem; font-size: .92rem;
  animation: ph-rise var(--dur) var(--ease-out) both;
}
.flash--info    { background: var(--info-bg);    border-color: #BBD5EF; color: #19456E; }
.flash--success { background: var(--success-bg); border-color: #A9D8C8; color: #0C5540; }
.flash--warning { background: var(--warning-bg); border-color: #EBCE9A; color: #7A4D06; }
.flash--danger  { background: var(--danger-bg);  border-color: #EDB6C3; color: #7A1830; }
@keyframes ph-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  background: var(--navy-100); color: var(--navy-700);
}
.badge--ok   { background: var(--success-bg); color: #0C5540; }
.badge--warn { background: var(--warning-bg); color: #7A4D06; }
.badge--bad  { background: var(--danger-bg);  color: #7A1830; }
.badge--info { background: var(--info-bg);    color: #19456E; }
.badge--gold { background: var(--gold-200);   color: var(--gold-800); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-mute); background: var(--paper-2); white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FBFCFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-mute); }

/* ---------- the table/board (boxed tiers) ---------- */
.tbl-scroll { overflow-x: auto; }
.tbl { min-width: 720px; display: flex; flex-direction: column; gap: 6px; }
.tbl__row { display: flex; gap: 6px; }
.tbl__cell {
  position: relative; min-width: 0; border-radius: 6px; padding: .45rem .5rem;
  display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 54px;
  color: #1f2a44; text-align: center;
  border: 2px solid var(--gold-600);
  background: linear-gradient(180deg, rgba(255,255,255,.28) 0, rgba(255,255,255,.28) 45%, rgba(0,0,0,.05) 45%), var(--gold-400);
}
.tbl__cell--1 { flex: 0 0 100%; }
.tbl__cell--2 { flex: 0 0 calc(50% - 3px); }
.tbl__cell--4 { flex: 0 0 calc(25% - 4.5px); }
.tbl__cell--8 { flex: 0 0 calc(12.5% - 5.25px); min-height: 84px; padding: .4rem .3rem; }
.tbl__who {
  font-size: .85rem; font-weight: 700; color: #1f2a44; max-width: 100%;
  background: rgba(255,255,255,.55); border-radius: 3px; padding: 1px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbl__cell--8 .tbl__who { font-size: 10.5px; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.tbl__cell--open {
  background: var(--gold-100); border: 2px dashed var(--gold-500); color: #4a3a12;
}
.tbl__cell--open .tbl__who { background: transparent; color: #5a4a22; font-weight: 600; }
.tbl__cell--me { border: 3px solid var(--gold-800); box-shadow: 0 0 0 2px rgba(110,78,16,.35); }
.tbl-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; justify-content: center; font-size: .82rem; color: var(--ink-mute); }
.tbl-legend i { display: inline-block; width: 16px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .35rem; box-sizing: border-box; border: 1px solid var(--gold-600); }
.tbl-legend__head, .tbl-legend__filled { background: var(--gold-400); }
.tbl-legend__open { background: var(--gold-100); border: 1px dashed var(--gold-500) !important; }
.tbl-legend__me { background: var(--gold-400); border: 3px solid var(--gold-800) !important; }
.tbl-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.tbl-tabs a {
  padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line);
  font-size: .85rem; font-weight: 600; color: var(--navy-700); text-decoration: none; background: #fff;
}
.tbl-tabs a.is-active { background: var(--grad-navy); color: var(--gold-200); border-color: var(--navy-700); }
.tbl-notice { padding: .9rem 1.1rem; border-radius: 6px; border: 1px solid var(--gold-300); border-left: 5px solid #1b6b2f; background: #FFFBEF; color: #2A1E05; }
.tbl-notice h3 { margin: 0 0 .5rem; color: #1b6b2f; font-size: 1.15rem; }
.tbl-notice p { margin: .4rem 0; }

/* ---------- products ---------- */
.product { display: flex; flex-direction: column; }
.product__media {
  aspect-ratio: 4 / 3; background: var(--grad-navy); display: grid; place-items: center; overflow: hidden;
  position: relative;
}
/* The bottle is portrait, so the hero package card gets a taller frame. */
.product__media--tall { aspect-ratio: 1 / 1; }
@media (min-width: 620px) { .product__media--tall { aspect-ratio: 16 / 11; } }
.product__media img { width: 100%; height: 100%; object-fit: cover; }
/* A real product photograph: show the WHOLE item rather than cropping it to the
   tile, on its own light ground. The bottle is portrait and the tile is 4:3, so
   `cover` would slice the middle out of it. The img paints its own background,
   which hides the navy gradient meant for the emblem placeholder. */
/* Absolutely filled rather than height:100%: the box takes its height from
   aspect-ratio, and a percentage height on a centred grid item does not resolve
   against that — the image kept its intrinsic 3:4 height (541px in a 285px box)
   and was clipped by overflow:hidden. inset:0 makes the box definite. */
.product__media img:not(.ph-mark) {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: #F1F2F4; padding: 4%;
}
/* Stand-in for a product with no photograph yet. The emblem carries its own
   near-white ground rather than transparency, so round it into a ringed
   medallion — otherwise it reads as a white box dropped on the navy tile. */
.product__media .ph-mark {
  width: 46%; height: auto; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(201,162,39,.55), 0 10px 24px rgba(0,0,0,.3);
}
.product__body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; gap: .4rem; }
.product__body h3 { margin: 0; }
.product__body .cluster { margin-top: auto; padding-top: .8rem; }
.price { font-family: "Playfair Display", Georgia, serif; font-size: 1.4rem; color: var(--gold-700); font-weight: 700; }
.price--sm { font-size: 1.1rem; }

/* ---------- product leaflet ---------- */
/* The supplied artwork is a two-page spread, split in half so each page gets a
   full column on desktop and a full screen width on a phone — at 522px native a
   half-spread shrunk into one column would be unreadable. Caption sits outside
   the frame so the artwork itself is never overlaid. */
.leaflet { align-items: start; margin-block: 1.5rem; }
.leaflet__page { margin: 0; }
.leaflet__page img {
  width: 100%; height: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.leaflet__page figcaption { margin: .6rem 0 0; }
/* ---------- hero ---------- */
.hero { background: var(--grad-navy); color: #E9EDF4; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -45% 55%; height: 70%;
  background: radial-gradient(closest-side, rgba(201,162,39,.22), transparent 70%); pointer-events: none;
}
.hero__in {
  display: grid; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  padding: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) 0;
  position: relative; z-index: 1;
}
.hero h1 { color: #fff; }
/* The logo carries its own near-white ground, so present it as a deliberate
   plaque on the navy hero rather than a bare white rectangle. */
.hero__art { justify-self: center; max-width: 380px; }
.hero__art img {
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(0,0,0,.38), 0 0 0 1px rgba(201,162,39,.45);
  animation: ph-in 420ms var(--ease-out) both;
}
@keyframes ph-in { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.site-foot { background: var(--navy-900); color: #A9B6CA; margin-top: 3rem; }
.site-foot__in { display: grid; gap: 1.5rem; padding: 2.5rem 0 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.site-foot__brand { display: flex; gap: .7rem; align-items: center; }
.site-foot__brand img { border-radius: 6px; }
.site-foot__brand strong { display: block; color: #fff; font-family: "Playfair Display", Georgia, serif; }
.site-foot__brand span { font-size: .78rem; }
.site-foot__nav { display: flex; flex-direction: column; gap: .4rem; }
.site-foot__nav a { color: #C3CEDE; text-decoration: none; font-size: .9rem; }
.site-foot__nav a:hover { color: var(--gold-400); }
.site-foot__legal { font-size: .78rem; line-height: 1.6; margin: 0; }

.steps { counter-reset: s; display: grid; gap: 1.25rem; }
.steps li { counter-increment: s; list-style: none; display: grid; grid-template-columns: 2.5rem 1fr; gap: .25rem 1rem; align-items: start; }
/* The counter is a third grid item alongside the heading and the paragraph, so
   without pinning the columns the paragraph auto-places into the 2.5rem marker
   column and renders one word per line. Marker stays in column 1; everything
   else stacks in column 2. */
.steps li::before {
  content: counter(s); grid-column: 1; grid-row: 1;
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--grad-gold); color: #2A1E05; font-weight: 700; font-size: .95rem;
}
.steps li > * { grid-column: 2; }
.steps h3 { margin: .15rem 0 .25rem; }
.steps p { margin: 0; color: var(--ink-soft); }
.section--navy .steps p { color: #C3CEDE; }

.pay-box { background: var(--paper-2); border: 1px dashed var(--navy-200); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.pay-box dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .92rem; }
.pay-box dt { font-weight: 600; color: var(--navy-700); }
.pay-box dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- view-as banner ----------
   Deliberately loud: an administrator must never mistake a member's screen for
   their own. Sticky under the header so it stays visible down a long page. */
.viewas {
  position: sticky; top: 68px; z-index: 39;
  background: var(--grad-gold); color: #2A1E05;
  border-bottom: 1px solid var(--gold-700);
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
}
.viewas__in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: .6rem 0;
}
.viewas strong { font-weight: 700; }
.viewas form { margin: 0; }
@media (max-width: 860px) { .viewas { top: 68px; } }

/* ---------- powered-by attribution ---------- */
.poweredby { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; }
.poweredby img { width: 34px; height: auto; flex: none; }
.poweredby span { font-size: .78rem; line-height: 1.35; color: #A9B6CA; }
.poweredby strong { display: block; color: #fff; font-size: .9rem; letter-spacing: .02em; }
