/**
 * Page-specific styles for xdimaging.com marketing pages (Task T08) — hero, "how it works" steps,
 * "why xdimaging" tiles, capability sections, and generic prose pages (About/Contact/legal).
 * Chrome-only styles (header/nav/footer, resets, buttons) live in assets/css/base.css instead.
 * Same rule as base.css: only var(--...) for colors/fonts/spacing — no hardcoded hex/px-literal
 * color or font-family values (grep for hex codes: none should be found here).
 *
 * Breakpoint reference (matches base.css — not tokens, custom properties don't work in @media):
 *   tablet up:  640px
 *   desktop up: 1024px
 */

/* ---------- Hero ---------- */

.hero {
  padding-block: var(--space-8) var(--space-7);
}

/* T28: text-specific rules moved from .hero itself onto this wrapper, so .hero can also carry
   .model-split (a two-column text+3D-model layout, reused on the xSOM-AM62A product page) without
   the two sets of rules fighting over the same element. */
.hero__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: center;
  align-items: center;
}

/* width:100% matters here, not just max-width: .hero__content isn't align-items:stretch (the
   button needs to stay its own natural width, not stretch full-width), so without an explicit
   width these flex items size to their own content instead of the parent's actual (post-T28,
   often halved by .model-split) column width -- overflowing sideways rather than wrapping. */
.hero__content h1 {
  width: 100%;
  max-width: 22ch;
}

.hero-sub {
  width: 100%;
  max-width: 60ch;
  font-size: var(--text-lede);
  color: var(--color-ink-muted);
}

.hero__content > p:last-child {
  width: 100%;
  max-width: 68ch;
  text-align: left;
}

@media (min-width: 640px) {
  .hero__content {
    text-align: left;
    align-items: flex-start;
  }
}

/* ---------- Text + 3D model split layout (homepage hero, xSOM-AM62A product page) ---------- */

.model-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* T28: the two-column split roughly halves the text column's width compared to the old
   full-width hero -- long unbroken German compound words (e.g. "Bildverarbeitungssystem") no
   longer fit and were overflowing visibly on top of the 3D model instead of wrapping. inherited by
   the h1/p children below. */
.model-split__content {
  overflow-wrap: break-word;
}

@media (min-width: 1024px) {
  .model-split {
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
  }

  .model-split__content,
  .model-split__viewer {
    flex: 1;
    min-width: 0;
  }
}

/* ---------- "How it works" step list ---------- */

.how-it-works {
  padding-block: var(--space-7);
  border-top: 1px solid var(--color-line);
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
  counter-reset: step-counter;
}

.steps-grid > li {
  counter-increment: step-counter;
  position: relative;
  padding-left: var(--space-7);
}

.steps-grid > li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--space-6);
  height: var(--space-6);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-small);
}

.steps-grid h3 {
  margin-bottom: var(--space-2);
}

@media (min-width: 640px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .steps-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- "Why xdimaging" tiles (home page + capabilities intro) ---------- */

.why-tiles {
  padding-block: var(--space-7);
  border-top: 1px solid var(--color-line);
}

.tiles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.tile {
  padding: var(--space-5);
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.tile h3 {
  margin-bottom: var(--space-2);
}

.tile p:last-child {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .tiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Homepage (solution-focused revision, D-066) ---------- */

/* Side-by-side primary + secondary entry points (system builder / camera module builder). Wraps
   onto two lines on narrow screens instead of shrinking the buttons. */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

@media (min-width: 640px) {
  .hero__content .hero__actions {
    justify-content: flex-start;
  }
}

/* Hero with the lens photo instead of the 3D model (D-069, home.php $heroVisual = 'photo').
   The fade is a CSS mask, not baked into the JPG: the photo turns transparent towards the left only
   (stakeholder: no fade at top/bottom), so it blends into whatever sits behind it -- the page panel
   colour -- with no visible seam. Mobile: photo above the text. Desktop: photo is a layer behind the
   right ~60% of the hero, text on top of the faded side. */
.hero--photo {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-4); /* the photo itself provides the visual top margin on mobile */
}

.hero__photo {
  order: -1;
  margin-inline: calc(var(--space-4) * -1);
}

.hero__photo img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
  mask-image: linear-gradient(to right, transparent 0%, #000 45%);
}

@media (min-width: 1024px) {
  .hero--photo {
    position: relative;
    min-height: 34rem;
    justify-content: center;
    padding-top: var(--space-8);
  }

  .hero--photo .hero__content {
    position: relative;
    z-index: 1;
    max-width: 46%; /* keeps the copy on the fully faded side of the photo */
  }

  .hero__photo {
    order: 0;
    margin: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 62%;
  }

  .hero__photo img {
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }
}

.home-section {
  padding-block: var(--space-7);
  border-top: 1px solid var(--color-line);
}

.home-section__intro {
  max-width: 68ch;
}

/* Two-card variant of process.php's three-route grid -- reused for the homepage's two customer
   scenarios and its two builders. */
@media (min-width: 640px) {
  .routes-grid.routes-grid--two {
    grid-template-columns: repeat(2, 1fr);
  }
}

.route-card > p:not([class]) {
  margin: 0;
}

/* A card's call to action sits at the bottom of the card at its natural width, not stretched
   across it, and lines up across cards of different text length. */
.route-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.tile .route-card__icon {
  display: block;
  margin-bottom: var(--space-3);
}

.closing-cta p {
  margin: 0;
  color: var(--color-ink-muted);
}

/* ---------- Capabilities page sections ---------- */

.capability-section {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.capability-section:first-of-type {
  border-top: none;
}

.capability-section p {
  max-width: 68ch;
}

/* ---------- Closing CTA band ---------- */

/* Sixth feature wave: was a full-bleed dark band (the fourth-wave "more corporate" pass) --
   "should have a gray, full width background -> its width should be limited to the content and
   not use the dark gray color." Reads as a large light-gray card (.tile's own treatment) sitting
   inside the normal content column, not a full-width colored section -- .closing-cta-band no
   longer paints anything itself, .closing-cta (still also carrying .container, which is what
   actually constrains its width) carries the gray fill. */
.closing-cta-band {
  padding-block: var(--space-7);
}

.closing-cta {
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

/* ---------- Generic long-form prose pages (About, Contact, legal) ---------- */

/* No extra max-width here (fifth feature wave, item 2: "the About page should have the same
   width as all the other content") -- .prose-page used to cap itself to 72ch on top of
   .container's own 1120px, reading as narrower than the homepage's hero/tiles sections for no
   good reason a visitor would notice; .container alone is now the only width constraint these
   pages get, same as every other content section. */

.prose-page address {
  font-style: normal;
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--color-paper-dim);
  border-radius: var(--radius-md);
}

.prose-page h2 {
  margin-top: var(--space-6);
}

/* ---------- Section eyebrow label (sixth feature wave, "more corporate" pass) ---------- */

/* Small uppercase, letter-spaced label above a section heading -- the one typographic signal
   direct competitor benchmarking (Basler/Vision Components/PHYTEC/FRAMOS) found consistently used
   for a "serious industrial B2B" read; applied sparingly (one per major section), not on every
   heading site-wide. */
.section-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

/* ---------- 3D model viewer (homepage hero, product pages) ---------- */

/* Square (not 4:3) per stakeholder request. <model-viewer>'s own internal sizing logic doesn't
   reliably honor `aspect-ratio` set directly on the element (it collapsed to a fixed height
   regardless), so the 1:1 ratio is enforced on this plain wrapper div instead -- a normal element,
   no custom-element sizing quirks -- and .product-3d-viewer is absolutely positioned to fill it. */
.model-split__viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* Always used inside .model-split now (T28), which handles its own spacing via `gap` -- no
   margin of its own. Background matches the page background (--color-paper, not -dim) so the
   viewer's own bounding box isn't visible -- just the model appears to float on the page. */
.product-3d-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--color-paper);
  border-radius: var(--radius-lg);
}

/* ---------- Product spec list (xSOM-AM62A) ---------- */

.product-card__specs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.product-card__specs strong {
  color: var(--color-ink);
  font-weight: 600;
}

/* ---------- Applications page ---------- */

.application-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.application-card {
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

@media (min-width: 640px) {
  .application-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Process page ---------- */

/* Overview roadmap graphic (T28, "it needs proper graphics" -- a 3-item map of the whole page,
   shown once up top, before the reader works through each stage's own detail section below). */
.process-track {
  display: flex;
  align-items: flex-start;
  margin: var(--space-6) 0 var(--space-2);
}

.process-track__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.process-track__connector {
  flex: 0 1 var(--space-7);
  height: 2px;
  background: var(--color-line);
  margin-top: calc(var(--space-6) / 2 - 1px);
}

.process-track__label {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  max-width: 18ch;
}

.process-track__label strong {
  display: block;
  color: var(--color-ink);
  font-family: var(--font-display);
}

/* Shared numbered-badge treatment for both the roadmap graphic and each stage section's own
   heading -- same visual language as .steps-grid's counter circles elsewhere on the site. */
.process-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--space-6);
  height: var(--space-6);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-small);
}

.process-stage {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.process-stage:first-of-type {
  border-top: none;
}

.process-stage__heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.process-stage__heading h2 {
  margin: 0;
}

.process-stage > p {
  max-width: 68ch;
}

/* Six analysis sub-steps as icon cards instead of a plain ordered list -- each an equal deliverable
   of the offer, not a numbered instruction sequence. */
.substep-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.substep-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
}

.substep-card__icon {
  flex-shrink: 0;
  width: var(--space-6);
  height: var(--space-6);
  color: var(--color-accent);
}

.substep-card__icon svg {
  width: 100%;
  height: 100%;
}

.substep-card h3 {
  font-size: var(--text-body);
  margin-bottom: var(--space-1);
}

.substep-card p {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

@media (min-width: 640px) {
  .substep-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .substep-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Three parallel build routes (COTS-only / mixed / fully custom) -- a card per route, each its
   own short ordered stage list, side by side once there's room for three columns. */
.routes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.route-card {
  padding: var(--space-5);
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.route-card__icon {
  width: var(--space-6);
  height: var(--space-6);
  color: var(--color-accent);
}

.route-card__icon svg {
  width: 100%;
  height: 100%;
}

.route-card h3 {
  margin: 0;
}

.route-card__for {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.route-card__gauge-label {
  margin: 0;
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.route-card__gauge {
  height: 6px;
  border-radius: 999px;
  background: var(--color-paper);
  overflow: hidden;
}

.route-card__gauge > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent);
}

/* Fill levels as classes, not inline styles -- the site's CSP has no 'unsafe-inline' for style-src. */
.route-card__gauge > span.is-low {
  width: 10%;
}

.route-card__gauge > span.is-medium {
  width: 50%;
}

.route-card__gauge > span.is-high {
  width: 90%;
}

.route-card ol {
  margin: 0;
  padding-left: 1.25em;
}

.route-card li + li {
  margin-top: var(--space-2);
}

.route-card ol ol {
  margin-top: var(--space-2);
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-line);
}

@media (min-width: 1024px) {
  .routes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.process-notes {
  margin-top: var(--space-6);
  padding: var(--space-5);
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
}

.process-notes ul {
  margin: var(--space-2) 0 0;
  padding-left: 1.25em;
}

.process-notes li + li {
  margin-top: var(--space-2);
}

/* ---------- About page (D-073) ---------- */

.about-section {
  margin-top: var(--space-7);
  padding-bottom: 0;
}

.about-section h2 {
  margin-top: 0;
}

@media (min-width: 1024px) {
  .routes-grid.routes-grid--three {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Growth graph, redrawn from xdevelop.at's company-history image. The SVG's labels would shrink
   below legibility on a phone, so narrow screens get the same milestones as a plain list instead.
   On wider screens the list stays in the page, visually hidden, for screen readers (the SVG itself
   is aria-hidden). */
.growth-chart {
  margin: var(--space-6) 0 0;
}

.growth-chart svg {
  display: none;
  width: 100%;
  height: auto;
}

.growth-chart__stop-top {
  stop-color: var(--color-line);
}

.growth-chart__stop-bottom {
  stop-color: var(--color-paper);
}

.growth-chart__curve {
  fill: none;
  stroke: var(--color-ink-muted);
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.growth-chart__leader {
  stroke: var(--color-ink-muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.growth-chart__dot {
  fill: var(--color-accent);
  stroke: var(--color-ink);
  stroke-width: 1.5;
}

.growth-chart__year,
.growth-chart__label {
  text-anchor: middle;
}

.growth-chart__year {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  fill: var(--color-ink);
}

.growth-chart__text--end {
  text-anchor: end;
}

.growth-chart__year--now {
  fill: var(--color-accent);
}

.growth-chart__label {
  font-family: var(--font-body);
  font-size: 16px;
  fill: var(--color-ink-muted);
}

.growth-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-4);
  border-left: 2px solid var(--color-line);
}

.growth-list li {
  position: relative;
  padding-block: var(--space-2);
}

.growth-list li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-4) - 7px);
  top: calc(var(--space-2) + 0.45em);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
}

.growth-list strong {
  font-family: var(--font-display);
  margin-right: var(--space-2);
}

@media (min-width: 720px) {
  .growth-chart svg {
    display: block;
  }

  .growth-list {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.stat-grid {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-grid li {
  padding: var(--space-5);
  background: var(--color-paper-dim);
  border-radius: var(--radius-lg);
  color: var(--color-ink-muted);
}

.stat-grid__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-display);
  line-height: 1.1;
  color: var(--color-ink);
}
