/* ═══════════════════════════════════════════════════════════════
   HiBargh — landing page (spec sheet).
   Page-scoped styles only; builds on css/spec.css :root tokens.
   Registered via $hbExtraCss = ['/css/spec-home.css'] before header.
   Direct port of ~/Desktop/F-t index-fa.html (styles.css + fa.css):
   hero figure, jacket marquee, catalog index, services band,
   counter board carousel, sizing card, cut-list CTA. RTL baked in.
   ═══════════════════════════════════════════════════════════════ */

/* ————— hero (copy + cable cross-section) ————— */
.home-hero {
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 7vw, 6rem);
}
.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.hero-copy .kicker { margin-bottom: 0.6rem; }
.home-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 3.3rem);
  line-height: 1.25;
  text-wrap: balance;
  margin: 0;
}
.home-hero h1 .line-2 { display: block; color: var(--cobalt-text); }
.hero-copy .lede {
  max-width: 34rem;
  margin-top: 1.4rem;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.85;
}
.hero-copy .lede strong { color: var(--ink); font-weight: 700; }
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 0.9rem;
  margin-top: 2.1rem;
}
.hero-meta {
  margin-top: 2.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
}
.hero-meta > * { color: var(--muted); text-decoration: none; }
.hero-meta a:hover { color: var(--cobalt-text); }
.hero-meta > *::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--copper);
  margin-inline-end: 0.55rem;
  vertical-align: baseline;
}

.hero-copy > * { animation: rise 0.7s var(--ease-out) both; }
.hero-copy > *:nth-child(2) { animation-delay: 90ms; }
.hero-copy > *:nth-child(3) { animation-delay: 180ms; }
.hero-copy > *:nth-child(4) { animation-delay: 270ms; }
.hero-copy > *:nth-child(5) { animation-delay: 360ms; }

.hero-figure {
  margin: 0;
  animation: rise 0.9s var(--ease-out) 150ms both;
}
.hero-figure svg { width: 100%; height: auto; display: block; }
.hero-figure figcaption {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.callout-line {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw 0.9s ease-out 650ms forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ————— shelf ticker (real products, drifting band) ————— */
.jacket-band {
  background: var(--jacket);
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding-block: 0.85rem;
  direction: ltr;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.jacket-track {
  display: flex;
  width: max-content;
  animation: jacket-scroll 50s linear infinite;
}
.jacket-band:hover .jacket-track { animation-play-state: paused; }
.jacket-set { display: flex; align-items: center; }
.tk-item {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding-inline-start: 2.4rem;
  white-space: nowrap;
  direction: rtl;
}
/* copper diamond separates each line as the belt drifts */
.tk-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 1rem;
  top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  background: var(--copper);
  transform: rotate(45deg);
}
.tk-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.tk-price {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper-deep);
  font-variant-numeric: tabular-nums;
}
@keyframes jacket-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ————— catalog index ————— */
.catalog-cols {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) 4.5rem 9rem 1.75rem;
  gap: 1.4rem;
  align-items: center;
}
.catalog-header {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-bottom: 0.6rem;
}
.catalog-header .num,
.catalog-row .lines, .catalog-row .from {
  text-align: left;
  direction: ltr;
}
.catalog-row {
  text-decoration: none;
  color: inherit;
  padding-block: 1.05rem;
  border-top: 1px solid var(--line);
  transition: background-color 150ms ease-out;
}
.catalog-row:last-of-type { border-bottom: 1px solid var(--line); }
.catalog-row:hover { background: var(--surface); }
.catalog-row .glyph { display: flex; justify-content: center; }
.catalog-row .glyph .cat-art { width: 100%; max-width: 58px; height: auto; }
.catalog-row h3 {
  font-size: 1.1rem; font-weight: 700;
  line-height: 1.35; margin: 0;
}
.catalog-row .desc {
  display: block;
  font-size: 0.9rem; color: var(--muted);
  line-height: 1.6; margin-top: 0.1rem;
}
.catalog-row .lines, .catalog-row .from {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.catalog-row .lines { color: var(--muted); }
.catalog-row .from { font-weight: 500; }
.catalog-row .arrow { justify-self: end; }
.catalog-foot {
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ————— counter services (cobalt-deep band) ————— */
.services {
  background: var(--cobalt-deep);
  color: var(--on-dark);
}
.services-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(2.5rem, 6vw, 5rem);
}
.services h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  margin: 0;
}
.services .intro p {
  margin-top: 1.1rem;
  color: var(--on-dark-muted);
  max-width: 26rem;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.5rem;
  align-content: start;
}
.service {
  border-top: 1px solid oklch(1 0 0 / 0.22);
  padding-top: 1rem;
}
.service h3 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.service p {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  color: var(--on-dark-muted);
  line-height: 1.7;
}

/* ————— counter board (carousel) ————— */
.board-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}
.board-bar p { max-width: 40rem; color: var(--muted); margin: 0; }
.board-controls { display: flex; align-items: center; gap: 0.55rem; }
.board-count {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-inline-end: 0.5rem;
}
.board-btn {
  width: 2.4rem; height: 2.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: var(--hair) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}
.board-btn:hover:not(:disabled) { background: var(--surface); }
.board-btn:disabled { border-color: var(--line); color: var(--line); cursor: default; }
.board-btn svg { transform: scaleX(-1); }

.board-track {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.board-track::-webkit-scrollbar { display: none; }
.board-list {
  list-style: none;
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 2px;
}
.tag-card {
  position: relative;
  flex: 0 0 min(16rem, 82vw);
  scroll-snap-align: start;
  border: var(--hair) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}
.tag-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1.6rem 1.15rem 1.25rem;
  height: 100%;
  transition: background-color 150ms ease-out;
}
.tag-link:hover { background: var(--surface); }
/* jacket band: the sheath colour of the item on the tag */
.tag-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: var(--tag-jacket, var(--jacket));
}
/* punched eyelet */
.tag-card::before {
  content: "";
  position: absolute;
  top: calc(7px + 0.8rem);
  inset-inline-start: 1.05rem;
  width: 0.7rem; height: 0.7rem;
  border: var(--hair) solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  z-index: 1;
}
.tag-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: end;
  margin: 0;
}
.tag-card h3 {
  font-size: 1.02rem; font-weight: 700;
  line-height: 1.5; margin: 0.6rem 0 0;
}
.tag-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}
.tag-length {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 0.9rem 0 0;
  font-variant-numeric: tabular-nums;
}
.tag-length span { font-size: 1rem; font-weight: 700; color: var(--muted); }
.tag-price {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tag-price s { color: var(--muted); margin-inline-end: 0.2rem; }
.tag-price strong { font-weight: 700; color: var(--cobalt-text); }
.tag-note {
  margin: 0.75rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
}

/* tape-measure progress: cobalt fill, meter ticks punched through */
.board-tape {
  position: relative;
  height: 8px;
  margin-top: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.board-tape .fill {
  position: absolute; inset: 0;
  background: var(--cobalt);
  transform-origin: right;
  transform: scaleX(0);
}
.board-tape::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 13px, var(--bg) 13px 15px);
}
.board-foot { margin-top: 1.3rem; font-size: 0.9rem; color: var(--muted); }

/* ————— sizing card ————— */
.sizing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.sizing-copy h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  border-top: var(--rule) solid var(--ink);
  padding-top: 1.1rem;
  margin: 0;
}
.sizing-copy p { margin-top: 1.1rem; color: var(--muted); max-width: 30rem; }
.sizing-copy p strong { color: var(--ink); font-weight: 700; }

.sizing .pocket-card table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.sizing .pocket-card th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  direction: ltr;
  padding: 0.7rem 0.9rem 0.45rem;
  border-bottom: 1px solid var(--line);
}
.sizing .pocket-card th:last-child { text-align: right; direction: rtl; }
.sizing .pocket-card td {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-align: left;
  direction: ltr;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.sizing .pocket-card td:first-child { font-weight: 500; }
/* کاربرد column: Persian words read RTL, sit at the row's end */
.sizing .pocket-card th:last-child,
.sizing .pocket-card td:last-child {
  text-align: right;
  direction: rtl;
  font-family: var(--font-body);
  color: var(--muted);
}
.sizing .pocket-card tr:last-child td { border-bottom: none; }

/* ————— brand marquee (colored logos, right-to-left drift) ————— */
.br-section { padding-block: clamp(2.8rem, 6vw, 4.4rem); }
.br-inner .section-head { margin-bottom: clamp(1.7rem, 4vw, 2.6rem); }

/* Forced LTR so the belt drifts leftward as one continuous loop. */
.br-marquee {
  position: relative;
  direction: ltr;
  overflow: hidden;
  padding-block: 0.6rem;
  --marquee-gap: clamp(3rem, 6vw, 5.5rem);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.br-marqueeTrack {
  display: flex;
  inline-size: max-content;
  animation: br-drift 40s linear infinite;
}
.br-marquee:hover .br-marqueeTrack { animation-play-state: paused; }
.br-marqueeSet {
  display: flex;
  align-items: stretch;
  gap: var(--marquee-gap);
  padding-inline-end: var(--marquee-gap);
}
@keyframes br-drift { to { transform: translateX(-50%); } }

.br-mark {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 0.9rem; margin: 0;
}
.br-markLogo {
  block-size: 64px;
  display: flex; align-items: center; justify-content: center;
}
.br-markLogo img {
  max-block-size: 64px; max-inline-size: 200px;
  inline-size: auto; block-size: auto;
  object-fit: contain;
}
.br-markCap {
  display: flex; align-items: baseline; gap: 0.55em;
  white-space: nowrap;
}
.br-markName { font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.br-markRole { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; }
.br-mark--featured .br-markRole { color: var(--cobalt-text); }

/* Touch / narrow: static swipe belt, single set, no edge mask. */
@media (max-width: 700px) {
  .br-marquee {
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: none; mask-image: none;
  }
  .br-marquee::-webkit-scrollbar { display: none; }
  .br-marqueeTrack { animation: none; }
  .br-marqueeSet[aria-hidden="true"] { display: none; }
}

/* ————— cut list CTA (cobalt band, centered) ————— */
.cutlist {
  background: var(--cobalt);
  color: var(--on-dark);
  text-align: center;
}
.cutlist h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.3;
  margin: 0;
}
.cutlist p {
  max-width: 34rem;
  margin: 1.1rem auto 0;
  color: oklch(0.93 0.02 250);
}
.cutlist-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}
.btn-inverse { background: var(--bg); color: var(--cobalt-text); }
.btn-inverse:hover { background: var(--surface); color: var(--cobalt-text); }

/* ————— section-head trailing link (mono, arrow slides on hover) ————— */
.home-moreLink {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cobalt-text);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.home-moreLink .arrow { transition: transform 150ms ease-out; }
.home-moreLink:hover { text-decoration: underline; }
.home-moreLink:hover .arrow { transform: translateX(-4px); }

/* ————— articles ledger (از مجله) ————— */
.led-art {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 1.5rem;
  gap: clamp(0.9rem, 2.5vw, 1.6rem);
  align-items: baseline;
  padding-block: 1.05rem;
}
.led-art__date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  direction: ltr; text-align: left;
  font-variant-numeric: tabular-nums;
}
.led-art__title { font-size: 1.02rem; font-weight: 500; line-height: 1.45; }
.led-art .arrow { justify-self: end; align-self: center; font-size: 1.15rem; line-height: 1; }

/* ————— responsive ————— */
@media (max-width: 900px) {
  .home-hero__grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 26rem; margin-inline: auto; }
  .services-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .sizing-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .catalog-cols { grid-template-columns: 3.6rem minmax(0, 1fr) 9rem 1.5rem; }
  .catalog-cols .lines { display: none; }
}
@media (max-width: 560px) {
  .service-grid { grid-template-columns: 1fr; }
  .catalog-cols { grid-template-columns: 3rem minmax(0, 1fr) 1.4rem; gap: 0.9rem; }
  .catalog-cols .from { display: none; }
  .led-art { grid-template-columns: 5rem minmax(0, 1fr) 1.2rem; gap: 0.9rem; }
}

/* ————— reduced motion ————— */
@media (prefers-reduced-motion: reduce) {
  .hero-copy > *, .hero-figure { animation: none; }
  .callout-line { animation: none; stroke-dashoffset: 0; }
  .jacket-track, .br-marqueeTrack { animation: none; }
  .home-moreLink:hover .arrow { transform: none; }
}
