/* revach-naki. local-paper portal: red masthead rules, serif headlines, boxed modules, black footer. */

/* ---- faces. self-hosted variable fonts, no third-party request ---- */

@font-face {
  font-family: 'Assistant';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/assistant-hebrew.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Assistant';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/assistant-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Suez One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/suez-hebrew.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Suez One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/suez-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens ---- */

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --paper-2: #ffffff;
  --paper-3: #f5f5f2;
  --ink-band: #111114;
  --ink-band-text: #b9b9bd;
  --text: #16161a;
  --text-soft: #5f5f68;
  --edge: #e3e3e0;
  --edge-strong: #c7c7c2;
  --brand: #d21f26;
  --brand-ink: #ffffff;

  --display: 'Suez One', 'David Libre', Georgia, serif;   /* every heading and figure */
  --sans: 'Assistant', 'Segoe UI', system-ui, 'Noto Sans Hebrew', Arial, sans-serif;

  --measure: 50rem;   /* reading column, ~72 hebrew characters at 20px */
  --wide: 76rem;      /* masthead, hub grid and footer */
  --gutter: 1.75rem;
  --fs-body: 21px;   /* every component size below is a multiple of this */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131316;
    --paper-2: #191920;
    --paper-3: #1e1e25;
    --ink-band: #0b0b0e;
    --ink-band-text: #9a9aa4;
    --text: #f2f2f4;
    --text-soft: #a0a0ab;
    --edge: #2b2b33;
    --edge-strong: #45454f;
    --brand: #ff6b62;
    --brand-ink: #16161a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--fs-body)/1.72 var(--sans);
  font-optical-sizing: auto;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand); color: var(--brand-ink); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 1px;
}

/* reading progress. no markup, no script. */
@supports (animation-timeline: scroll()) {
  body::before {
    content: "";
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: right center;
    animation: read linear both;
    animation-timeline: scroll(root block);
    z-index: 50;
  }
  @keyframes read { to { transform: scaleX(1); } }
}

/* ---- type ---- */

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: 0;
  text-wrap: balance;
}
h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 1.45rem + 4vw, 3.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
}
h2 {
  font-size: clamp(1.6rem, 1.28rem + 1.4vw, 2rem);
  margin: 3.4rem 0 0.8rem;
}
h3 {
  margin: 2.15rem 0 0.4rem;
  font-family: var(--sans);
  font-size: calc(var(--fs-body) * 1.09);
  font-weight: 700;
  line-height: 1.35;
  text-wrap: balance;
}

p { margin: 0 0 1.05rem; }
ul, ol { margin: 0 0 1.15rem; padding-inline-start: 1.35rem; }
li { margin-bottom: 0.45rem; padding-inline-start: 0.15rem; }
li::marker { color: var(--text-soft); }
ol li::marker { font-variant-numeric: tabular-nums; }
b, strong { font-weight: 700; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-thickness 90ms linear, color 90ms linear;
}
a:hover { color: var(--brand); text-decoration-thickness: 2px; }

/* ---- masthead ---- */

.topbar { background: var(--paper); }

.topbar__utility {
  background: var(--ink-band);
  color: var(--ink-band-text);
  font-size: calc(var(--fs-body) * 0.68);
}
.topbar__utility > div {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.4rem var(--gutter);
  display: flex;
  gap: 0.6rem 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.topbar__utility a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}
.topbar__utility a:hover { color: var(--brand); }
.topbar__utility nav { margin-inline-start: auto; display: flex; gap: 1.1rem; }

.topbar__mast {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 1.35rem;
  text-align: center;
}
.topbar__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.45rem + 2.8vw, 3rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.topbar__mark:hover { color: inherit; }
.topbar__mark svg { width: 1.5rem; height: 1.5rem; color: var(--brand); }
.topbar__tag {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  font-size: calc(var(--fs-body) * 0.72);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar__nav {
  border-top: 1px solid var(--edge);
  border-bottom: 3px solid var(--ink-band);
}
.topbar__links {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: center;
  gap: 0 1.9rem;
  flex-wrap: wrap;
  font-size: calc(var(--fs-body) * 0.8);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.topbar__links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.7rem 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}
.topbar__links a:hover { color: var(--brand); }
.topbar__links a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ---- the reading column ---- */

.column {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.6rem var(--gutter) 4.5rem;
}
.column > h1 + .column__lead { margin-top: 0.85rem; }
.column__lead {
  color: var(--text-soft);
  font-size: calc(var(--fs-body) * 1.18);
  line-height: 1.55;
  margin: 0 0 0.2rem;
}

.meta {
  margin: 1.5rem 0 0;
  padding: 0.5rem 0;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
  color: var(--text-soft);
  font-size: calc(var(--fs-body) * 0.76);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* contents block */
.toc {
  margin: 1.1rem 0 0;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid var(--edge);
  background: var(--paper-3);
}
.toc h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: calc(var(--fs-body) * 1.1);
  font-weight: 400;
  color: var(--brand);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 2.4rem;
  font-size: calc(var(--fs-body) * 0.86);
}
.toc li {
  counter-increment: toc;
  margin: 0 0 0.24rem;
  padding: 0;
  break-inside: avoid;
}
.toc li::before {
  content: counter(toc);
  color: var(--brand);
  font-family: var(--display);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  margin-inline-end: 0.5rem;
}
.toc a { text-decoration-color: var(--edge-strong); }

/* pull quote */
.aside {
  margin: 2.4rem 0;
  padding: 1.15rem 0;
  border-top: 3px solid var(--brand);
  border-bottom: 1px solid var(--edge);
  font-family: var(--display);
  font-size: calc(var(--fs-body) * 1.3);
  line-height: 1.45;
}
.aside p { margin: 0 0 0.6rem; }
.aside > :last-child { margin-bottom: 0; }
.aside a { text-decoration-thickness: 1px; }

.fineprint {
  margin-top: 2.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--edge);
  color: var(--text-soft);
  font-size: calc(var(--fs-body) * 0.84);
  line-height: 1.6;
}

/* ---- entries ---- */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 0 1.45rem;
  border-top: 1px solid var(--edge);
  background: none;
}
.panel__title { margin: 0 0 0.32rem; font-size: calc(var(--fs-body) * 1.09); }
.panel__body { margin: 0; color: var(--text-soft); font-size: calc(var(--fs-body) * 0.88); line-height: 1.65; }

/* section tag, the reference's category chip */
.panel > .panel__kicker {
  order: -1;
  align-self: flex-start;
  margin: 0 0 0.6rem;
  padding: 0.2rem 0.6rem;
  background: var(--brand);
  color: var(--brand-ink);
  font-size: calc(var(--fs-body) * 0.66);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.55;
}

a.panel { text-decoration: none; }
a.panel .panel__title {
  font-family: var(--display);
  font-size: calc(var(--fs-body) * 1.3);
  font-weight: 400;
  letter-spacing: -0.005em;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 110ms linear;
}
a.panel:hover { color: inherit; }
a.panel:hover .panel__title { text-decoration-color: var(--brand); }

.stack > *:last-child { border-bottom: 1px solid var(--edge); }
.panel--flat { border: 0; padding-inline: 0; }

.next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0 2rem;
  margin: 2.6rem 0 0;
}
.next .panel { border-bottom: 1px solid var(--edge); }

/* ---- boxed module, the reference's sidebar unit ---- */

.module {
  border: 1px solid var(--edge);
  background: var(--paper-2);
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1.4rem;
}
.module > h2 {
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--edge);
  color: var(--brand);
  font-size: calc(var(--fs-body) * 1.1);
}
.module ul, .module ol { margin: 0; padding: 0; list-style: none; font-size: calc(var(--fs-body) * 0.86); }
.module li {
  margin: 0;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--edge-strong);
  display: flex;
  gap: 0.55rem;
  line-height: 1.45;
}
.module li:last-child { border-bottom: 0; padding-bottom: 0; }
.module li::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.5rem;
  background: var(--brand);
}
.module a { text-decoration: none; }
.module a:hover { text-decoration: underline; text-underline-offset: 3px; }
.module p { font-size: calc(var(--fs-body) * 0.86); color: var(--text-soft); line-height: 1.6; }
.module > :last-child { margin-bottom: 0; }
.module__meta { display: block; color: var(--text-soft); font-size: calc(var(--fs-body) * 0.74); font-weight: 600; }

/* ---- hub grid ---- */

.hub {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.2rem var(--gutter) 4rem;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(13rem, 1fr);
  gap: 0 2.4rem;
  align-items: start;
}
.hub__main { min-width: 0; }
.hub__rail { min-width: 0; }
.hub__head {
  grid-column: 1 / -1;
  margin-bottom: 1.7rem;
  padding-bottom: 1.1rem;
  border-bottom: 3px solid var(--ink-band);
}
.hub__head h1 { margin-bottom: 0.7rem; }
.hub__head p { margin: 0; color: var(--text-soft); font-size: calc(var(--fs-body) * 1.12); line-height: 1.55; }
.hub__main > h2:first-child, .hub__main > h1:first-child { margin-top: 0; }

/* red section rules belong to the index, not to an article body */
.hub--index .hub__main > h2 {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--edge);
  color: var(--brand);
}
.hub--index .hub__main > h2 + p { margin-top: 0.7rem; color: var(--text-soft); }

/* ---- checklist ---- */

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.7rem;
  counter-reset: step;
  border-top: 1px solid var(--edge);
}
.checklist li {
  counter-increment: step;
  border-bottom: 1px solid var(--edge);
  padding: 0.85rem 0;
  margin: 0;
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
}
.checklist li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--brand);
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(var(--fs-body) * 0.88);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.checklist b { display: block; font-weight: 700; margin-bottom: 0.1rem; }
.checklist span { color: var(--text-soft); font-size: calc(var(--fs-body) * 0.88); line-height: 1.65; }

/* ---- calculator band ---- */

.calcbar {
  background: var(--paper-3);
  border-bottom: 1px solid var(--edge);
}
.calcbar__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.4rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(13rem, 1fr);
  gap: 0 2.4rem;
}
.calcbar__inner > * { grid-column: 1; }   /* align with .hub__main, leave the rail lane empty */
.calcbar__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.3rem;
}
.calcbar__out {
  display: flex;
  gap: 1.9rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 3px solid var(--ink-band);
}
.calcbar__figure b {
  display: block;
  font-family: var(--display);
  font-size: calc(var(--fs-body) * 1.6);
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.calcbar__figure b.is-lead { color: var(--brand); font-size: calc(var(--fs-body) * 2.4); font-weight: 400; }
.calcbar__figure span {
  display: block;
  margin-top: 0.3rem;
  font-size: calc(var(--fs-body) * 0.72);
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.05em;
}

/* ---- controls ---- */

.field__label {
  display: block;
  font-size: calc(var(--fs-body) * 0.74);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-bottom: 0.28rem;
}
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--edge-strong);
  border-radius: 2px;
  padding: 0.5rem 0.7rem;
  font-size: max(16px, calc(var(--fs-body) * 0.92));
  font-variant-numeric: tabular-nums;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-soft); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
textarea { min-height: 7.5rem; resize: vertical; font-variant-numeric: normal; }

.button {
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  border-radius: 2px;
  padding: 0.62rem 1.5rem;
  font-size: calc(var(--fs-body) * 0.88);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-block;
  width: auto;
  cursor: pointer;
  margin-top: 0.4rem;
}
.button:hover { color: var(--brand-ink); filter: brightness(1.1); }
.button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.button--outline { background: none; color: var(--text); border: 1px solid var(--edge-strong); }
.button--outline:hover { color: var(--text); border-color: var(--brand); filter: none; }
.buttons { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 1.4rem; }

.field + .field, .calcbar__grid + .field { margin-top: 0.85rem; }

/* ---- revenue split figure ---- */

.flowfig { margin: 2.2rem 0 0.6rem; color: var(--brand); }
.flowfig svg { display: block; direction: ltr; }   /* labels are placed in ltr coordinates */

/* ---- footer ---- */

.tail {
  border-top: 4px solid var(--brand);
  background: var(--ink-band);
  color: var(--ink-band-text);
  font-size: calc(var(--fs-body) * 0.84);
}
.tail__cols {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2.4rem var(--gutter) 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.8rem 2.4rem;
}
.tail__group h4 {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: calc(var(--fs-body) * 1.05);
  font-weight: 400;
  color: #ffffff;
}
.tail__group a {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.22rem 0;
}
.tail__group a::before {
  content: "";
  flex: none;
  width: 0.35rem;
  height: 0.35rem;
  background: var(--brand);
}
.tail a { color: var(--ink-band-text); text-decoration: none; }
.tail a:hover { color: #ffffff; }
.tail__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.9rem var(--gutter) 1.6rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  font-size: calc(var(--fs-body) * 0.76);
}
.tail__note { border-top: 1px solid #2a2a30; margin-top: 0.6rem; }

/* ---- narrow ---- */

@media (max-width: 52rem) {
  .hub, .calcbar__inner { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hub__rail { margin-top: 2.4rem; }
}

@media (max-width: 40rem) {
  :root { --fs-body: 19px; }
  .column { padding-top: 2rem; }
  .topbar__utility > div { justify-content: center; }
  .topbar__utility nav { margin-inline-start: 0; }
  .topbar__mast { padding: 1.1rem var(--gutter) 1rem; }
  .topbar__links { gap: 0 1.1rem; justify-content: flex-start; }
  .topbar__links a { padding: 0.55rem 0; }
  .calcbar__grid { grid-template-columns: minmax(0, 1fr); }
  .calcbar__inner { padding-top: 1.8rem; }
  .calcbar__out { gap: 1.3rem 1.6rem; }
  .toc { padding: 1rem 1rem 1.1rem; }
  .toc ol { columns: 1; }
  .hub__head { padding-bottom: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- print ---- */

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar__utility, .topbar__nav, .tail__cols, .toc, .next, .hub__rail { display: none; }
  .tail { background: none; color: #000; border-top: 1px solid #000; }
  .column, .hub { max-width: none; padding: 0; }
  a { text-decoration: none; }
  h2, h3 { break-after: avoid; }
  .panel, .checklist li, .module { break-inside: avoid; }
}
