/* KesefSmart v2 homepage. Uses tokens from css/v2/kesef.css only. */

/* ---------- 1. Hero ---------- */
.h-hero { position: relative; padding: calc(var(--header-h) + clamp(40px, 5vw, 72px)) 0 clamp(48px, 6vw, 88px); overflow: hidden; min-height: min(100svh, 1000px); display: flex; flex-direction: column; justify-content: center; }
.h-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(236, 230, 216, .055) 1px, transparent 1px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%); }
.h-hero > * { position: relative; z-index: 1; }
.h-hero__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 520px); gap: clamp(32px, 5vw, 80px); align-items: center; }
.h-hero .ks-display { font-size: clamp(52px, 7.2vw, 108px); }
.h-hero__copy .ks-display { max-width: 9.5em; }
.h-hero__copy .ks-display .ks-dim { display: block; }
.h-hero__sub { margin-top: 28px; max-width: 30em; }
.h-hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* Calculator card */
.h-calc { background: var(--stage-2); border: 1px solid var(--hair-stage); border-radius: var(--r-panel); padding: 26px 26px 24px; display: grid; gap: 14px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
.h-calc__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.h-calc__row--ages { flex-wrap: wrap; margin-top: 4px; }
.h-calc__amt { font: 400 22px/1 var(--font-sans); color: var(--parchment); letter-spacing: -0.01em; }
.h-calc__ages button { min-height: 36px; padding: 0 12px; }
.h-calc__result { border-top: 1px solid var(--hair-stage); margin-top: 6px; padding-top: 18px; }
.h-calc__result .ks-label { margin: 0 0 6px; }
.h-calc__big { margin: 0; font: 300 clamp(44px, 4.6vw, 64px)/1 var(--font-sans); letter-spacing: -0.04em; color: var(--kesef); white-space: nowrap; }
.h-calc__split { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 13px; color: var(--parchment-2); }
.h-calc__split b { color: var(--parchment); font-weight: 500; }

/* Chart */
.h-chart { position: relative; margin: 26px 0 28px; height: clamp(190px, 19vw, 270px); touch-action: pan-y; cursor: crosshair; }
.h-chart__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.h-chart__grid line { stroke: var(--hair-stage); stroke-width: 1; vector-effect: non-scaling-stroke; }
.h-chart__area { fill: url(#g-fill); transition: opacity .6s var(--ease); }
.h-chart__paid { fill: none; stroke: rgba(236, 230, 216, .38); stroke-width: 1.25; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.h-chart__line { fill: none; stroke: var(--kesef); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.h-chart__cursor { stroke: rgba(236, 230, 216, .35); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: 0; transition: opacity .2s; }
.h-chart.is-scrub .h-chart__cursor { opacity: 1; }
.h-chart__dot { position: absolute; width: 0; height: 0; left: 100%; top: 0; transition: left .5s var(--ease), top .5s var(--ease); }
.h-chart__dot i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--kesef); box-shadow: 0 0 0 6px rgba(255, 214, 2, .16); }
.h-chart__dot i::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(255, 214, 2, .55); animation: h-pulse 2.4s var(--ease) infinite; }
@keyframes h-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.h-chart.is-drawing .h-chart__dot { opacity: 0; }
.h-chart__tip { position: absolute; top: 0; left: 0; transform: translate(-50%, calc(-100% - 14px)); display: grid; gap: 2px; padding: 8px 12px; border-radius: var(--r-chip); background: var(--parchment); color: var(--stage); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; font-size: 12px; }
.h-chart__tip b { font: 500 16px/1.1 var(--font-sans); letter-spacing: -0.01em; }
.h-chart.is-scrub .h-chart__tip { opacity: 1; }
.h-chart__axis { position: absolute; left: 0; right: 0; bottom: -24px; height: 16px; color: var(--parchment-2); font-size: 12px; }
.h-chart__axis span { position: absolute; transform: translateX(-50%); }
.h-chart__axis span:first-child { transform: none; }
.h-chart__axis span:last-child { transform: translateX(-100%); }
.h-chart__legend { position: absolute; left: 0; top: -2px; display: flex; gap: 16px; font-size: 12px; color: var(--parchment-2); }
.h-chart__legend .k::before { content: ''; display: inline-block; width: 16px; height: 0; margin-right: 8px; vertical-align: middle; border-top: 2px solid var(--kesef); }
.h-chart__legend .k--paid::before { border-top: 1.25px dashed rgba(236, 230, 216, .5); }
.h-calc__note { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.h-inline-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

@media (max-width: 1023px) {
  .h-hero { min-height: 0; }
  .h-hero__grid { grid-template-columns: 1fr; align-items: start; }
  .h-calc { max-width: 560px; }
}
@media (max-width: 600px) {
  .h-hero { padding-top: calc(var(--header-h) + 36px); }
  .h-hero__copy .ks-display { font-size: clamp(46px, 13.2vw, 60px); }
  .h-hero__sub { margin-top: 18px; font-size: 17px; }
  .h-hero__ctas { margin-top: 24px; }
  .h-hero__ctas .ks-btn { flex: 1 1 auto; }
  .h-calc { padding: 20px; }
  .h-calc__ages { width: 100%; justify-content: space-between; }
  .h-calc__ages button { flex: 1; padding: 0; min-height: 40px; }
  .h-chart { height: 180px; }
  .h-chart__legend { gap: 12px; font-size: 12px; }
}

/* ---------- 2. Three numbers ---------- */
.h-three__grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hair-strong); }
.h-three__card { padding: 36px 32px 8px 0; border-right: 1px solid var(--hair); }
.h-three__card + .h-three__card { padding-left: 32px; }
.h-three__card:last-child { border-right: 0; }
.h-three__fig { margin: 0; font: 300 clamp(44px, 5.4vw, 84px)/1 var(--font-display); letter-spacing: -0.035em; font-variation-settings: 'opsz' 72; white-space: nowrap; }
.h-three__fig .ks-odo { height: 1em; }
.h-three__card--hi .h-three__fig { position: relative; }
.h-three__card--hi .h-three__fig { isolation: isolate; display: inline-block; }
.h-three__card--hi .h-three__fig::after { content: ''; position: absolute; left: -.04em; right: -.04em; bottom: .04em; height: .3em; background: var(--kesef); z-index: -1; }
.h-three__cap { margin: 18px 0 0; color: var(--ink-2); font-size: 16px; }
.h-three__cap b { color: var(--ink); font-weight: 500; }
@media (max-width: 860px) {
  .h-three__grid { grid-template-columns: 1fr; }
  .h-three__card, .h-three__card + .h-three__card { padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--hair); }
  .h-three__tabs { justify-self: start; }
}

/* ---------- 3. Instrument panel ---------- */
.h-panel { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair-strong); counter-reset: none; }
.h-panel li { border-bottom: 1px solid var(--hair); }
.h-row { display: grid; grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1fr) 44px; align-items: center; gap: 24px; min-height: 104px; padding: 18px 12px; margin: 0 -12px; color: var(--ink); text-decoration: none; border-radius: 12px; transition: background .3s var(--ease); }
.h-row:hover, .h-row:focus-visible { background: var(--paper); }
.h-row__idx { font: 400 13px/1 var(--font-mono); color: var(--ink-2); }
.h-row__name { display: grid; gap: 6px; font: 500 19px/1.2 var(--font-sans); letter-spacing: -0.01em; }
.h-row__name small { font: 400 15px/1.45 var(--font-sans); color: var(--ink-2); letter-spacing: 0; }
.h-row__out { display: grid; gap: 4px; justify-items: end; text-align: right; }
.h-row__out b { font: 300 clamp(28px, 2.8vw, 38px)/1 var(--font-display); letter-spacing: -0.03em; font-variation-settings: 'opsz' 72; white-space: nowrap; }
.h-row__out small { font-size: 13px; color: var(--ink-2); }
.h-row__go { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair-strong); display: grid; place-items: center; transition: background .3s var(--ease), border-color .3s var(--ease), color .3s; }
.h-row__go svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.h-row:hover .h-row__go { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.h-row:hover .h-row__go svg { transform: translateX(2px); }
@media (max-width: 760px) {
  .h-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name go' 'out out'; gap: 14px 16px; padding: 22px 0; margin: 0; min-height: 0; }
  .h-row__idx { display: none; }
  .h-row__name { grid-area: name; }
  .h-row__out { grid-area: out; justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; }
  .h-row__go { grid-area: go; }
}

/* ---------- 4. Maaser band ---------- */
.h-maaser__grid { display: grid; grid-template-columns: 1fr minmax(320px, 460px); gap: clamp(40px, 7vw, 120px); align-items: center; }
.h-maaser .ks-lead { margin: 24px 0 32px; }
.h-receipt { background: var(--parchment); color: var(--ink); border-radius: var(--r-panel); padding: 28px; position: relative; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.h-receipt .ks-field label { color: var(--ink-2); }
.h-receipt__input { position: relative; }
.h-receipt__input span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-size: 18px; }
.h-receipt__input .ks-input { padding-left: 32px; font-size: 22px; min-height: 56px; background: #FFFDF6; border-color: rgba(18, 17, 14, .18); color: var(--ink); }
.h-receipt__lines { margin: 22px 0 0; display: grid; }
.h-receipt__lines div { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; }
.h-receipt__lines div::after { content: none; }
.h-receipt__lines dt { font-size: 15px; color: var(--ink-2); flex: none; order: 0; }
.h-receipt__lines dd { margin: 0; order: 2; font: 400 18px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.h-receipt__lines div > dt::after { content: ''; }
.h-receipt__lines div { position: relative; }
.h-receipt__lines div::before { content: ''; order: 1; flex: 1; border-bottom: 1px dotted rgba(18, 17, 14, .3); transform: translateY(-4px); }
.h-receipt__lines .is-hi dd { font-weight: 500; background: var(--kesef); padding: 4px 8px; margin: -4px 0; border-radius: 6px; }
.h-receipt__lines .is-total { border-top: 1px solid rgba(18, 17, 14, .2); margin-top: 6px; padding-top: 16px; }
.h-receipt__lines .is-total dd { font-size: 26px; font-weight: 300; letter-spacing: -0.02em; }
.h-receipt .h-receipt__foot { margin: 14px 0 0; color: var(--ink-2); }
.h-receipt.is-printing .h-receipt__lines div { animation: h-print .5s var(--ease) both; }
.h-receipt.is-printing .h-receipt__lines div:nth-child(2) { animation-delay: .08s; }
.h-receipt.is-printing .h-receipt__lines div:nth-child(3) { animation-delay: .16s; }
.h-receipt.is-printing .h-receipt__lines div:nth-child(4) { animation-delay: .24s; }
@keyframes h-print { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .h-maaser__grid { grid-template-columns: 1fr; } }

/* ---------- 5. Real costs ---------- */
.h-costs__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.h-costs__top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.h-costs__total { margin: 0; font: 300 clamp(36px, 3.6vw, 52px)/1 var(--font-display); letter-spacing: -0.03em; font-variation-settings: 'opsz' 72; }
.h-costs .ks-micro { margin: 8px 0 28px; }
.h-simcha__bar { display: flex; height: 48px; border-radius: 8px; overflow: hidden; gap: 2px; }
.h-simcha__bar i { display: block; transition: flex-basis .5s var(--ease); min-width: 2px; }
[data-k="catering"] { background: var(--ink); }
[data-k="hall"] { background: rgba(18, 17, 14, .62); }
[data-k="music"] { background: rgba(18, 17, 14, .4); }
[data-k="photo"] { background: rgba(18, 17, 14, .26); }
[data-k="flowers"] { background: rgba(18, 17, 14, .15); }
.h-simcha__legend, .h-tuition__legend { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }
.h-simcha__legend li, .h-tuition__legend li { display: inline-flex; align-items: center; gap: 7px; }
.h-simcha__legend i, .h-tuition__legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.h-simcha__legend b { color: var(--ink); font-weight: 500; margin-left: 2px; }
.h-simcha__guests { margin-top: 24px; }
.h-simcha__guests label { font: 500 13px/1.3 var(--font-sans); color: var(--ink-2); }
.h-simcha__guests output { font: 400 18px/1 var(--font-sans); }
.h-tuition__bars { display: flex; align-items: flex-end; gap: 4px; height: 168px; border-bottom: 1px solid var(--hair-strong); }
.h-tuition__bars i { flex: 1; display: block; border-radius: 3px 3px 0 0; height: var(--h); transform-origin: bottom; transition: transform .7s var(--ease); position: relative; }
.h-tuition__bars i[data-k="early"] { background: rgba(18, 17, 14, .2); }
.h-tuition__bars i[data-k="elementary"] { background: rgba(18, 17, 14, .5); }
.h-tuition__bars i[data-k="highschool"] { background: var(--ink); }
.h-tuition__bars.is-pre i { transform: scaleY(0); }
.h-tuition__legend [data-k="early"] { background: rgba(18, 17, 14, .2); }
.h-tuition__legend [data-k="elementary"] { background: rgba(18, 17, 14, .5); }
.h-tuition__legend [data-k="highschool"] { background: var(--ink); }
.h-tuition__axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-2); position: relative; height: 16px; }
.h-tuition__axis span { position: absolute; transform: translateX(-50%); }
.h-tuition__axis span:nth-child(1) { left: 0; transform: none; }
.h-tuition__axis span:nth-child(2) { left: 20%; }
.h-tuition__axis span:nth-child(3) { left: 73.33%; }
.h-tuition__axis span:nth-child(4) { right: 0; left: auto; transform: none; }
@media (max-width: 900px) { .h-costs__grid { grid-template-columns: 1fr; } }

/* ---------- 6. Guides ---------- */
.h-guides__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.h-feature { display: grid; gap: 12px; color: var(--ink); text-decoration: none; }
.h-feature__cover { aspect-ratio: 16 / 10; border-radius: var(--r-panel); background: var(--stage); color: var(--parchment); display: grid; place-content: center; justify-items: center; gap: 10px; margin-bottom: 14px; position: relative; overflow: hidden; transition: transform .6s var(--ease); }
.h-feature__cover::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(236, 230, 216, .07) 1px, transparent 1px); background-size: 20px 20px; }
.h-feature__fig { font: 300 clamp(64px, 8vw, 120px)/1 var(--font-display); letter-spacing: -0.04em; position: relative; }
.h-feature__fig sup { font-size: .38em; vertical-align: top; position: relative; top: .25em; margin-left: .04em; color: var(--kesef); }
.h-feature__eq { font: 400 18px/1 var(--font-mono); color: var(--parchment-2); position: relative; }
.h-feature:hover .h-feature__cover { transform: scale(.985); }
.h-feature__meta { font-size: 14px; color: var(--ink-2); }
.h-feature__title { font: 300 clamp(28px, 2.8vw, 40px)/1.1 var(--font-display); letter-spacing: -0.025em; font-variation-settings: 'opsz' 72; max-width: 18em; }
.h-feature:hover .h-feature__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.h-feature__dek { color: var(--ink-2); max-width: 32em; }
.h-glist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair-strong); }
.h-glist li { border-bottom: 1px solid var(--hair); }
.h-glist a { display: grid; gap: 6px; padding: 22px 40px 22px 0; color: var(--ink); text-decoration: none; position: relative; }
.h-glist a::after { content: '→'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--ink-3); transition: transform .3s var(--ease), color .3s; }
.h-glist a:hover::after { transform: translate(4px, -50%); color: var(--ink); }
.h-glist .c { font-size: 13px; color: var(--ink-2); }
.h-glist .t { font: 400 22px/1.25 var(--font-display); letter-spacing: -0.012em; }
@media (max-width: 900px) { .h-guides__grid { grid-template-columns: 1fr; } }

/* ---------- 7. Learning path ---------- */
.h-path__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--hair-strong); position: relative; }
.h-path__list li { border-right: 1px solid var(--hair); }
.h-path__list li:last-child { border-right: 0; }
.h-path__list a { display: grid; align-content: start; gap: 10px; padding: 28px 24px 28px 0; min-height: 220px; color: var(--ink); text-decoration: none; transition: background .3s var(--ease); }
.h-path__list li + li a { padding-left: 24px; }
.h-path__list a:hover { background: var(--paper-2); }
.h-path__list .n { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hair-strong); display: grid; place-items: center; font: 400 15px/1 var(--font-sans); margin-bottom: 28px; transition: background .3s, color .3s, border-color .3s; }
.h-path__list a:hover .n { background: var(--kesef); border-color: var(--kesef); }
.h-path__list .t { font: 400 24px/1.15 var(--font-display); letter-spacing: -0.015em; }
.h-path__list .d { font-size: 15px; color: var(--ink-2); }
@media (max-width: 960px) {
  .h-path__list { grid-template-columns: 1fr; }
  .h-path__list li { border-right: 0; border-bottom: 1px solid var(--hair); }
  .h-path__list a, .h-path__list li + li a { grid-template-columns: 40px 1fr; padding: 22px 0; min-height: 0; column-gap: 18px; row-gap: 4px; }
  .h-path__list .n { grid-row: span 2; margin: 0; }
}

/* ---------- 8. Subscribe ---------- */
.h-sub__grid { display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: 48px; align-items: end; }
.h-sub .ks-lead { margin-top: 20px; }
.h-sub__form .subscribe-form { display: flex; gap: 10px; }
.h-sub__form .ks-input { flex: 1; min-height: 52px; }
.h-sub__form .ks-btn { min-height: 52px; }
.h-sub .honeypot-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.h-sub .form-success-message, .h-sub .form-error-message { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-chip); font-size: 14px; font-weight: 500; text-align: left; }
.h-sub .form-success-message { background: var(--stage-2); color: var(--parchment); border: 1px solid var(--hair-stage); }
.h-sub .form-error-message { background: rgba(178, 62, 40, .18); color: #F3B7A9; border: 1px solid rgba(178, 62, 40, .5); }
@media (max-width: 860px) { .h-sub__grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .h-sub__form .subscribe-form { flex-direction: column; } }

@media (prefers-reduced-motion: reduce) {
  .h-chart__dot i::after { animation: none; }
  .h-tuition__bars.is-pre i { transform: none; }
  * { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* beat main.js's injected legacy subscribe styles */
.h-sub .subscribe-form input[type="email"].ks-input { background: var(--stage-2); color: var(--parchment); border: 1px solid rgba(236, 230, 216, .2); border-radius: var(--r-pill); padding: 0 20px; font-size: 16px; }
.h-sub .subscribe-form input[type="email"].ks-input::placeholder { color: var(--parchment-2); }
.h-sub .subscribe-form input[type="email"].ks-input:focus { border-color: var(--kesef); box-shadow: 0 0 0 3px rgba(255, 214, 2, .18); }
.h-sub .subscribe-form .ks-btn { padding: 0 26px; border-radius: var(--r-pill); }
