/* ==========================================================================
   WedPlan calculators
   Design note: the planner's real artifact is not the marigold, it is the
   ledger. So the results panel is a ruled register sheet: hairline rules,
   mono tabular figures aligned to one column, and a double rule under every
   total, which is what a double rule means in accounting. The green is doing
   two jobs at once, mehendi and ledger paper.
   ========================================================================== */

:root {
  --paper:    #edf0e9;
  --sheet:    #fafbf7;
  --ink:      #16231a;
  --ink-2:    #4a5a4e;
  --ink-3:    #7b8a7e;
  --rule:     #c7d1c4;
  --rule-2:   #e2e8de;
  --marigold: #e8871e;
  --marigold-deep: #c26a0d;
  --kumkum:   #9e2b25;
  --gold:     #a8823c;

  --display: "Fraunces", Georgia, serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --data:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap: 1180px;
  --r: 3px;
  --shadow: 0 1px 2px rgba(22, 35, 26, .06), 0 12px 32px -18px rgba(22, 35, 26, .3);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--marigold-deep); }

:focus-visible {
  outline: 2px solid var(--marigold-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: var(--sheet);
  padding: .75rem 1.25rem; font-weight: 600;
}
.skip:focus { left: 0; }

/* --- Type scale ---------------------------------------------------------- */

.eyebrow {
  font-family: var(--data);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .75rem;
}
.eyebrow--light { color: rgba(250, 251, 247, .55); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 30, "WONK" 1;
  letter-spacing: -.015em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

/* --- Masthead ------------------------------------------------------------ */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: rgba(250, 251, 247, .8);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.masthead__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand__mark {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--marigold);
  box-shadow: 0 0 0 3px rgba(232, 135, 30, .18);
}
.brand__name {
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em;
}
.masthead__nav { display: flex; align-items: center; gap: 1.25rem; }
.masthead__nav > a {
  font-size: .875rem; font-weight: 500; text-decoration: none;
}
.masthead__nav > a[aria-current] { color: var(--marigold-deep); }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  background: var(--marigold);
  color: #21150a;
  border: 1px solid var(--marigold-deep);
  border-radius: var(--r);
  padding: .6rem 1.1rem;
  font-family: var(--body);
  font-size: .9375rem; font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.btn:hover {
  background: #f5972f; color: #21150a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px -4px rgba(194, 106, 13, .5);
}
.btn:active { transform: translateY(0); }
.btn--sm { padding: .4rem .8rem; font-size: .8125rem; }
.btn--lg { padding: .8rem 1.6rem; font-size: 1rem; }
.btn--ghost {
  background: transparent;
  color: var(--sheet);
  border-color: rgba(250, 251, 247, .35);
}
.btn--ghost:hover {
  background: rgba(250, 251, 247, .1);
  color: var(--sheet);
  box-shadow: none;
}

/* --- Page head ----------------------------------------------------------- */

.pagehead { padding: 3.25rem 0 2rem; }
.pagehead__h {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  max-width: 17ch;
}
.pagehead__deck {
  margin: 1rem 0 0;
  max-width: 56ch;
  font-size: 1.0625rem;
  color: var(--ink-2);
}
.crumbs {
  font-family: var(--data);
  font-size: .75rem; letter-spacing: .04em;
  color: var(--ink-3);
  margin: 0 0 1.25rem;
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--marigold-deep); text-decoration: underline; }
.crumbs span { margin: 0 .45rem; opacity: .5; }

/* --- The workbench: inputs left, ledger right ---------------------------- */

.bench {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.75rem;
  align-items: start;
  padding-bottom: 3.5rem;
}
@media (max-width: 900px) {
  .bench { grid-template-columns: 1fr; }
}

.panel {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.panel__head {
  padding: 1rem 1.25rem .875rem;
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.panel__title {
  font-family: var(--data);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2);
}
.panel__body { padding: 1.25rem; }

/* Inputs ------------------------------------------------------------------ */

.field { margin-bottom: 1.15rem; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: block;
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: .4rem;
}
.field__hint {
  display: block;
  font-size: .75rem; font-weight: 400;
  color: var(--ink-3);
  margin-top: .3rem;
  line-height: 1.45;
}

.input, .select {
  width: 100%;
  font-family: var(--data);
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: .55rem .7rem;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.select { font-family: var(--body); }
.input:focus, .select:focus {
  border-color: var(--marigold);
  box-shadow: 0 0 0 3px rgba(232, 135, 30, .16);
  outline: none;
}
.input[type="number"] { -moz-appearance: textfield; }
.input::-webkit-outer-spin-button,
.input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.input--money { padding-left: 1.6rem; }
.money { position: relative; }
.money::before {
  content: "₹";
  position: absolute; left: .65rem; top: 50%; transform: translateY(-50%);
  font-family: var(--data); font-size: .875rem; color: var(--ink-3);
  pointer-events: none;
}

.suffix { position: relative; }
.suffix::after {
  content: attr(data-suffix);
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  font-family: var(--data); font-size: .75rem; color: var(--ink-3);
  pointer-events: none;
}
.suffix .input { padding-right: 2.9rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }

/* Chips (event pickers) --------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { position: relative; }
.chip input {
  position: absolute; opacity: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.chip span {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: .35rem .8rem;
  font-size: .8125rem; font-weight: 500;
  background: #fff;
  transition: all .12s ease;
  user-select: none;
}
.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--marigold-deep);
  outline-offset: 2px;
}
.chip span:hover { border-color: var(--ink-3); }

/* Segmented control ------------------------------------------------------- */

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
       border: 1px solid var(--rule); border-radius: var(--r);
       background: #fff; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span {
  display: block; text-align: center;
  padding: .5rem .4rem;
  font-size: .8125rem; font-weight: 500;
  border-right: 1px solid var(--rule-2);
  transition: all .12s ease;
  user-select: none;
}
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--ink); color: var(--sheet); }
.seg input:focus-visible + span { outline: 2px solid var(--marigold-deep); outline-offset: -2px; }

/* --- The ledger: the signature element ----------------------------------- */

.ledger {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 43px,
      var(--rule-2) 43px,
      var(--rule-2) 44px
    );
  background-position: 0 0;
  padding: 0;
}

.ledger__rows { list-style: none; margin: 0; padding: 0; }

.ledger__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .75rem;
  height: 44px;
  padding: 0 1.25rem;
  border-bottom: 1px solid transparent;
}
.ledger__row:hover { background: rgba(232, 135, 30, .05); }

.ledger__name {
  font-size: .875rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ledger__sub {
  display: block;
  font-family: var(--data);
  font-size: .6875rem; font-weight: 400;
  color: var(--ink-3);
  line-height: 1;
  margin-top: .15rem;
}
.ledger__share {
  font-family: var(--data);
  font-size: .75rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  width: 4.5ch; text-align: right;
}
.ledger__amt {
  font-family: var(--data);
  font-size: .9375rem; font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 11ch;
  font-feature-settings: "tnum";
}
.ledger__amt--neg { color: var(--kumkum); }

/* A single rule is a subtotal, a double rule is the total. Standard ledger
   grammar, so it carries meaning rather than decorating. */
.ledger__row--sub {
  border-top: 1px solid var(--ink);
  font-weight: 600;
}
.ledger__row--sub .ledger__name,
.ledger__row--sub .ledger__amt { font-weight: 600; }
.ledger__row--out .ledger__amt { color: var(--kumkum); }

.ledger__total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .75rem;
  margin: 0 1.25rem;
  padding: .9rem 0 1rem;
  border-top: 3px double var(--ink);
}
.ledger__total-label {
  font-family: var(--data);
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
}
.ledger__total-amt {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}

/* Editable percentage cell inside the ledger */
.pct-cell {
  width: 5.5ch;
  font-family: var(--data);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-2);
  padding: .2rem .3rem;
  -moz-appearance: textfield;
}
.pct-cell::-webkit-outer-spin-button,
.pct-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pct-cell:hover { border-color: var(--rule); background: #fff; }
.pct-cell:focus {
  border-color: var(--marigold); background: #fff;
  box-shadow: 0 0 0 2px rgba(232, 135, 30, .16);
  outline: none;
}

/* Flash on change: the only motion on the page, and it earns its place by
   showing which line just moved when an input changes. */
@keyframes ink-in {
  0%   { background-color: rgba(232, 135, 30, .28); }
  100% { background-color: transparent; }
}
.is-changed { animation: ink-in .5s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .is-changed { animation: none; }
  .btn:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* Callout strip under the ledger ------------------------------------------ */

.verdict {
  margin: 0;
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--ink-2);
  background: rgba(199, 209, 196, .16);
  border-radius: 0 0 var(--r) var(--r);
}
.verdict strong { color: var(--ink); }
.verdict--warn { background: rgba(158, 43, 37, .07); color: #6f231f; }
.verdict--warn strong { color: var(--kumkum); }
.verdict--good { background: rgba(232, 135, 30, .09); }

/* Stat strip -------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  border-top: 1px solid var(--rule);
}
.stat {
  padding: .9rem 1.25rem;
  border-right: 1px solid var(--rule-2);
}
.stat:last-child { border-right: 0; }
.stat__k {
  display: block;
  font-family: var(--data);
  font-size: .625rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .25rem;
}
.stat__v {
  font-family: var(--data);
  font-size: 1.0625rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat__v--warn { color: var(--kumkum); }

/* Repeatable event rows (catering) ---------------------------------------- */

.rows { display: flex; flex-direction: column; gap: .6rem; }
.erow {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)) auto;
  gap: .45rem;
  align-items: center;
}
.erow__f { display: block; min-width: 0; }
.erow__head {
  font-family: var(--data);
  font-size: .625rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: .1rem;
}
/* Per-field labels are redundant on desktop where the column header does the
   job, and essential on a phone where the header row is gone. */
.erow__lab {
  display: none;
  font-family: var(--data);
  font-style: normal;
  font-size: .625rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .25rem;
}
.erow .input { padding: .45rem .5rem; font-size: .8125rem; width: 100%; }
.x-btn {
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: var(--r);
  width: 28px; height: 30px;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 1rem; line-height: 1;
  display: grid; place-items: center;
  transition: all .12s ease;
}
.x-btn:hover { border-color: var(--kumkum); color: var(--kumkum); background: rgba(158, 43, 37, .05); }
.add-btn {
  margin-top: .85rem;
  border: 1px dashed var(--rule);
  background: transparent;
  border-radius: var(--r);
  padding: .5rem .9rem;
  font-family: var(--body);
  font-size: .8125rem; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  width: 100%;
  transition: all .12s ease;
}
.add-btn:hover { border-color: var(--marigold); color: var(--marigold-deep); }
/* On a phone the row becomes a small labelled card. A planner reading this
   in front of a caterer must never have to guess which number is turnout. */
@media (max-width: 620px) {
  .rows { gap: .75rem; }
  .erow {
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    padding: .85rem 2.6rem .85rem .85rem;
    border: 1px solid var(--rule-2);
    border-radius: var(--r);
    background: #fff;
    position: relative;
    align-items: end;
  }
  .erow--head { display: none; }
  .erow__f--name { grid-column: 1 / -1; }
  .erow__lab { display: block; }
  .erow .x-btn { position: absolute; top: .85rem; right: .6rem; }
}

/* --- CTA ----------------------------------------------------------------- */

.cta {
  background: var(--ink);
  color: var(--sheet);
  border-top: 1px solid var(--ink);
}
.cta__inner { padding: 3.5rem 0; max-width: 44rem; }
.cta__h {
  color: var(--sheet);
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  max-width: 20ch;
}
.cta__sub {
  color: rgba(250, 251, 247, .72);
  font-size: 1.0625rem;
  margin: .85rem 0 1.75rem;
  max-width: 52ch;
}
.cta__acts { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta__note {
  font-family: var(--data);
  font-size: .75rem;
  color: rgba(250, 251, 247, .4);
  margin: 1.5rem 0 0;
}

/* --- FAQ ----------------------------------------------------------------- */

.faq { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.faq__h { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.faq__list { max-width: 68ch; }
.faq__item { border-bottom: 1px solid var(--rule); }
.faq__q {
  cursor: pointer;
  padding: 1rem 0;
  font-size: 1rem; font-weight: 600;
  list-style: none;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "+";
  font-family: var(--data);
  font-size: 1.1rem; color: var(--marigold-deep);
  flex: none;
}
.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__a { padding: 0 0 1.1rem; }
.faq__a p { margin: 0; color: var(--ink-2); font-size: .9375rem; max-width: 64ch; }

/* --- Related ------------------------------------------------------------- */

.related { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.related__h { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1.5rem; }
.related__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0;
  border-top: 1px solid var(--rule);
}
.related__list li { border-bottom: 1px solid var(--rule); }
.related__list a {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 1.5rem; align-items: baseline;
  padding: 1.1rem .5rem;
  text-decoration: none;
  transition: background-color .12s ease, padding-left .12s ease;
}
.related__list a:hover { background: rgba(232, 135, 30, .06); padding-left: 1rem; }
.related__name { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; }
.related__blurb { color: var(--ink-2); font-size: .875rem; }
.related__hub { margin: 1.5rem 0 0; font-size: .875rem; }
@media (max-width: 700px) {
  .related__list a { grid-template-columns: 1fr; gap: .3rem; }
}

/* --- Hub cards ----------------------------------------------------------- */

.hub { padding-bottom: 3.5rem; }
.hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}
.card {
  display: flex; flex-direction: column;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 1.5rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--marigold);
  box-shadow: 0 1px 2px rgba(22,35,26,.06), 0 20px 40px -22px rgba(22, 35, 26, .45);
}
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
.card__tag {
  font-family: var(--data);
  font-size: .625rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--marigold-deep);
  margin-bottom: .9rem;
}
.card__h {
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 1;
  font-weight: 600; font-size: 1.25rem;
  letter-spacing: -.015em; line-height: 1.15;
  margin: 0 0 .5rem;
}
.card__p { margin: 0 0 1.25rem; font-size: .875rem; color: var(--ink-2); flex: 1; }
.card__go {
  font-family: var(--data);
  font-size: .75rem; font-weight: 500;
  letter-spacing: .06em;
  color: var(--marigold-deep);
}
.card:hover .card__go::after { margin-left: .5rem; }
.card__go::after { content: "\2192"; margin-left: .3rem; transition: margin-left .14s ease; }

.note {
  margin: 2.5rem 0 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--gold);
  background: var(--sheet);
  font-size: .9375rem;
  color: var(--ink-2);
  max-width: 70ch;
}
.note strong { color: var(--ink); }

/* --- Colophon ------------------------------------------------------------ */

.colophon {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
  background: var(--sheet);
}
.colophon__row {
  display: flex; flex-wrap: wrap; gap: 1rem 3rem;
  justify-content: space-between; align-items: baseline;
}
.colophon__note { margin: 0; font-size: .9375rem; max-width: 46ch; color: var(--ink-2); }
.colophon__legal {
  margin: 0;
  font-family: var(--data);
  font-size: .75rem;
  color: var(--ink-3);
  max-width: 34ch;
}

/* --- Utility ------------------------------------------------------------- */

.vh {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript {
  margin: 1rem 0 0; padding: 1rem 1.25rem;
  border: 1px solid var(--kumkum); border-radius: var(--r);
  background: rgba(158, 43, 37, .06); color: #6f231f;
  font-size: .875rem;
}
