/* ==========================================================================
   Homepage.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01 — Hero (work-light / EXECUTION 01)
   -------------------------------------------------------------------------- */

/*
 * The hero is the one dark section above the fold, so it spends the 20%
 * charcoal of the brand ratio in a single place. Everything below it stays
 * light — do not add a second dark section near the top.
 *
 * Warmth comes from the cut-out and a tungsten wash, not from copper paint.
 * --tr-copper / --tr-copper-on-dark stay reserved for the TYPE TEST mark.
 */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #11171c;
  color: var(--color-text-invert);
  padding-block: clamp(2.75rem, 6vw, 4.75rem) 0;
}

.hero :where(h1, h2, h3) {
  color: var(--color-heading-invert);
}

/* Work lamp behind the product plate (inline-start / figure side in RTL). */
.hero__wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    58% 68% at 28% 44%,
    rgba(255, 186, 122, 0.13),
    transparent 70%
  );
}

/* Film grain — static; animated grain would burn the motion budget. */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__inner {
  position: relative;
  z-index: 4;
}

.hero__grid {
  display: grid;
  /* Copy first in DOM = inline-start in RTL (right) — brand reads first. */
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(1.75rem, 4.5vw, 3.75rem);
  align-items: center;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-block-end: 1.15rem;
}

.hero__brand .readout {
  color: var(--tr-teal-on-dark);
}

.hero__title {
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  font-weight: var(--fw-bold);
  letter-spacing: -0.015em;
  max-inline-size: 18ch;
  line-height: 1.2;
  margin: 0;
}

.hero__tag {
  display: block;
  margin-block-start: 0.55rem;
  font-size: 0.95rem;
  color: var(--color-text-invert);
  max-inline-size: 36ch;
}

.hero__lede {
  margin-block-start: 1.05rem;
  max-inline-size: 46ch;
  font-size: clamp(0.98rem, 1.25vw, 1.08rem);
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-block-start: 1.7rem;
}

/*
 * Primary fill on charcoal: light teal + dark ink clears AA. White on
 * --tr-teal does not — see tokens.css.
 */
.hero .btn--primary {
  background: var(--tr-teal-on-dark);
  color: #06231e;
}

.hero .btn--primary:hover,
.hero .btn--primary:focus-visible {
  background: #5ee2cc;
  color: #06231e;
}

.hero .btn--secondary {
  background: transparent;
  color: var(--color-heading-invert);
  border-color: var(--color-border);
}

.hero .btn--secondary:hover,
.hero .btn--secondary:focus-visible {
  border-color: var(--color-heading-invert);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-heading-invert);
}

/* --- product plate ------------------------------------------------------- */

.hero__fig {
  margin: 0;
}

.hero__plate {
  position: relative;
  aspect-ratio: 1;
}

.hero__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  display: block;
  transform: scale(0.86);
  /*
   * drop-shadow follows the alpha channel — a photo WITH a background will
   * cast a rectangular shadow. Keep the cut-out.
   */
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 72px rgba(255, 186, 122, 0.1));
}

.hero__over {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.hero__over svg {
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

.hero__over .dim {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
  fill: none;
}

.hero__over .lead {
  stroke: var(--tr-teal-on-dark);
  stroke-width: 1;
  fill: none;
}

.hero__over .dot {
  fill: var(--tr-teal-on-dark);
}

.hero__over .lead--cert {
  stroke: var(--tr-copper-on-dark);
}
.hero__over .dot--cert {
  fill: var(--tr-copper-on-dark);
}

.hero__over text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  fill: #fff;
  direction: ltr;
  unicode-bidi: isolate;
}

.hero__over text.cert {
  fill: var(--tr-copper-on-dark);
}
.hero__over text.tbd {
  opacity: 0.55;
  letter-spacing: 0.18em;
}
.hero__over .pill {
  fill: rgba(8, 12, 15, 0.82);
}

/*
 * The overlay has no animation of its own. It rides the .rv reveal on
 * .hero__fig, which is this section's single hero animation.
 *
 * It previously drew its strokes on (stroke-dashoffset, 900ms) AND staggered
 * each label, on top of eight .rv items — three sequences where the restraint
 * budget allows one. Do not reintroduce a draw-on here; if the drawing should
 * animate, remove the stagger instead and pick one.
 */

.hero__bar {
  margin-block-start: clamp(2.5rem, 5vw, 4rem);
}

@media (max-width: 940px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__fig {
    order: -1;
    max-inline-size: 26rem;
    /*
     * inline-size is required, not redundant. `margin-inline: auto` overrides
     * a grid item's default justify-self:stretch and makes it shrink-to-fit;
     * every child of .hero__plate is position:absolute, so fit-content
     * resolved to 0 and the product vanished on every screen under 940px.
     */
    inline-size: 100%;
    margin-inline: auto;
  }
  /* Callouts crowd the silhouette at phone width. */
  .hero__over {
    display: none;
  }
}

@media (max-width: 620px) {
  .hero__img {
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.55));
  }
}

/*
 * No prefers-reduced-motion block for the overlay: it no longer animates, so
 * there is no initial state to land on. The reveal it rides (.rv) is already
 * handled in schematic.css.
 */

/* --------------------------------------------------------------------------
   02 — Proof chips
   -------------------------------------------------------------------------- */

.proof {
  background: var(--tr-white);
  border-block-end: 1px solid var(--color-border);
}

.proof__inner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-block: 1.15rem 1.75rem;
}

.proof__claim {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  color: var(--tr-charcoal);
}

.proof__live {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tr-teal);
}

.proof__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.proof__chip {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border-subtle);
  background: var(--tr-white);
  color: var(--tr-charcoal);
}

.proof__chip--cert {
  border-color: rgba(158, 94, 28, 0.4);
  color: var(--tr-copper);
}

/* Legacy claim styles kept for any leftover markup outside the homepage. */
.claim {
  background: var(--tr-off-white);
  border-block-end: 1px solid var(--color-border);
}

.claim__inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-block: 1.1rem;
}

.claim__bolt {
  color: var(--tr-teal);
  flex-shrink: 0;
}

.claim p {
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  color: var(--tr-charcoal);
  max-inline-size: none;
}

/* --------------------------------------------------------------------------
   04 — Process
   -------------------------------------------------------------------------- */

.process {
  padding-block: var(--section-pad);
}

.process__bar {
  margin-block-end: 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  position: relative;
  padding: var(--space-lg) var(--space-md) 0;
}

/* The node sits ON the busbar above, so each step reads as a tap-off. */
.step__node {
  position: absolute;
  inset-block-start: -6.5px;
  inset-inline-start: var(--space-md);
  inline-size: 13px;
  block-size: 13px;
  border: 1.5px solid var(--tr-light-gray);
  border-radius: 50%;
  background: var(--tr-white);
  transition:
    border-color 500ms var(--ease-out),
    background 500ms var(--ease-out);
  transition-delay: calc(var(--i) * 180ms);
}

/* Busbar alone is the live signal — nodes stay charcoal unless cert. */
.busbar.is-in ~ .steps .step--cert .step__node {
  border-color: var(--tr-copper);
  background: var(--tr-copper);
}

.step__n {
  display: block;
  margin-block-end: 0.8rem;
  padding: 0;
}

.step__title {
  font-size: 1rem;
  margin-block-end: 0.4rem;
}

.step__body {
  font-size: var(--fs-small);
  line-height: 1.6;
}

.step__cert {
  display: inline-block;
  margin-block-start: 0.6rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--tr-copper-soft);
}

@media (max-width: 1080px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-xl);
  }
}

@media (max-width: 620px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   05 — Projects
   Lead panel + indexed rail. Not four equal portfolio cards.
   -------------------------------------------------------------------------- */

.projects {
  padding-block: var(--section-pad);
}

.projects .sec-head p {
  margin-block-start: 0.55rem;
  max-inline-size: 48ch;
  font-size: var(--fs-lead);
  color: var(--color-text);
}

.proj-board {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  align-items: stretch;
}

.proj-lead {
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--tr-white);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}

.proj-lead__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--tr-charcoal-900);
  overflow: hidden;
}

.proj-lead__media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.proj-lead__schematic {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  color: rgba(255, 255, 255, 0.35);
}

.proj-lead__media .idx {
  position: absolute;
  inset-block-start: 0.9rem;
  inset-inline-start: 0.9rem;
  min-inline-size: 0;
  padding: 0.3rem 0.55rem;
  color: #fff;
  background: rgba(31, 41, 51, 0.55);
  letter-spacing: 0.06em;
}

.lang-fa .proj-lead__media .idx,
.lang-ar .proj-lead__media .idx {
  letter-spacing: normal;
}

.proj-lead__body {
  padding: 1.15rem 1.2rem 1.3rem;
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.proj-lead__body h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.3;
  margin: 0;
}

.proj-lead__meta {
  display: block;
}

.proj-specs {
  display: grid;
  gap: 0.15rem;
}

.proj-spec {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding-block: 0.35rem;
  border-block-end: 1px solid var(--color-border-subtle);
  font-size: var(--fs-small);
}

.proj-spec:last-child {
  border-block-end: 0;
}

.proj-spec__k {
  color: var(--tr-gray);
}

.proj-spec__v {
  font-weight: var(--fw-medium);
  color: var(--tr-charcoal);
}

.proj-rail {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-block-size: 100%;
}

.proj-rail__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-block-end: 0.15rem;
}

.proj-row {
  display: grid;
  grid-template-columns: 2.4rem 4.5rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem 0.75rem;
  background: var(--tr-white);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition:
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

.proj-row:hover,
.proj-row:focus-visible {
  border-color: rgba(0, 125, 109, 0.45);
  background: var(--tr-teal-soft);
  outline: none;
}

.proj-row .idx {
  display: inline;
  min-inline-size: 0;
  padding: 0;
  color: var(--tr-teal-700);
  letter-spacing: 0.06em;
}

.lang-fa .proj-row .idx,
.lang-ar .proj-row .idx {
  letter-spacing: normal;
}

.proj-row__thumb {
  aspect-ratio: 4 / 3;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-subtle);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--tr-gray);
}

.proj-row__thumb img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.proj-row__copy h3 {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0 0 0.25rem;
}

.proj-row__meta {
  display: block;
  font-size: 0.75rem;
  color: var(--tr-gray);
  line-height: 1.45;
}

.proj-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-block-start: 1.5rem;
  padding-block-start: 1.1rem;
  border-block-start: 1px solid var(--color-border);
}

.proj-foot__note {
  margin: 0;
  font-size: var(--fs-small);
  color: var(--tr-gray);
  max-inline-size: 42ch;
}

@media (max-width: 900px) {
  .proj-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .proj-spec {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .proj-row {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .proj-row__thumb {
    display: none;
  }
}

.card__media--schematic {
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  color: var(--tr-charcoal);
  opacity: 0.4;
}

.insight {
  padding-block: var(--section-pad);
}

.insight__more {
  margin-block-start: var(--space-xl);
  max-inline-size: none;
}

/*
 * Certificates — compact copper strip. Proof on the homepage, not a scan
 * gallery. Padding is intentionally short so the band reads as a credential
 * line between projects and insight, not a chapter of its own.
 */
.certs {
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-block: 1px solid var(--color-border);
}

.certs__strip {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  flex-wrap: wrap;
}

.certs__lead {
  flex: 0 1 14rem;
  min-inline-size: 11rem;
}

.certs__lead .readout {
  display: block;
  margin-block-end: 0.35rem;
}

.certs__lead h2 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  max-inline-size: 12ch;
  margin: 0;
}

.certs__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1 1 28rem;
  min-inline-size: 0;
}

.certs .chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--color-border);
  background: var(--tr-white);
  color: var(--tr-charcoal);
  text-decoration: none;
  transition:
    border-color var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

/* Same rule as .readout: letter-spacing breaks Arabic/Persian joining. */
.lang-fa .certs .chip,
.lang-ar .certs .chip {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  letter-spacing: normal;
  font-size: 0.75rem;
}

.certs .chip--cert {
  border-color: rgba(158, 94, 28, 0.4);
  color: var(--tr-copper);
}

.certs a.chip--cert:hover,
.certs a.chip--cert:focus-visible {
  background: var(--tr-copper-soft);
  border-color: var(--tr-copper);
}

.certs__action {
  flex: 0 0 auto;
}

.certs__action .btn {
  padding: 0.7rem 1.15rem;
  font-size: var(--fs-small);
}

/* Lean CTA styles live in content.css — shared by homepage + interiors. */

/* --------------------------------------------------------------------------
   04b — The shop floor

   Photography is treated as evidence, so it gets the same technical handling
   as everything else: corner brackets, a mono step number tying each frame to
   the process diagram above, and a caption that states what the stage is
   rather than describing a mood.

   Photographs stay unfiltered. The section itself is light — charcoal was
   already spent in the hero.
   -------------------------------------------------------------------------- */

.workshop {
  padding-block: var(--section-pad);
}

.workshop__grid {
  list-style: none;
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.shot {
  padding: var(--space-md);
}

.shot__figure {
  margin: 0;
}

.shot__img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--tr-charcoal-900);
}

.shot__caption {
  display: block;
  padding-block-start: var(--space-md);
}

.shot__step {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.shot__step .readout--code {
  color: var(--color-heading);
}

.shot.is-in .shot__step .readout--code {
  color: var(--tr-teal-700);
}

.shot__label {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  color: var(--color-heading);
}

.shot__note {
  display: block;
  margin-block-start: var(--space-2xs);
  font-size: var(--fs-small);
  line-height: 1.6;
  max-inline-size: 34ch;
}

@media (max-width: 1100px) {
  .workshop__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Three items in a two-column grid: let the last one span so it does not
     sit orphaned at half width. */
  .workshop__grid .shot:last-child {
    grid-column: 1 / -1;
  }

  .workshop__grid .shot:last-child .shot__img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 700px) {
  .workshop__grid {
    grid-template-columns: 1fr;
  }

  .workshop__grid .shot:last-child {
    grid-column: auto;
  }

  .workshop__grid .shot:last-child .shot__img {
    aspect-ratio: 3 / 4;
  }
}
