/* WHY: This stack utility gives predictable vertical rhythm for textual blocks like contact and legal details. */
.stack {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

/* WHY: This brand block presents logo and claim consistently on all pages and languages. */
.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* WHY: The transparent logo carries the wordmark, so it fills the header height. */
.brand-block img {
  height: 72px;
  width: auto;
}

/* WHY: The enlarged logo already contains the wordmark, so the text title is redundant. */
.brand-title {
  display: none;
}

/* WHY: This mono caption communicates strategic positioning without competing with the logo. */
.brand-claim {
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  line-height: 1.45;
  max-width: 46ch;
}

/* WHY: This nav row keeps links readable and wrapped cleanly for bilingual labels on narrower layouts. */
.site-nav {
  margin-left: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.3rem;
}

/* WHY: This mono link styling keeps navigation quiet and technical on the warm header bar. */
.site-nav a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

/* WHY: This hover and current-page treatment uses the single terracotta accent for orientation. */
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--terra);
  border-bottom-color: var(--terra);
}

/* WHY: This language switch reads as a small technical control rather than a navigation item. */
.lang-switch {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--blue);
  border: 1px solid var(--slate-line);
  border-radius: var(--radius-button);
  padding: 0.3rem 0.7rem;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.lang-switch:hover {
  border-color: var(--terra);
  color: var(--terra);
}

/* WHY: This two-column hero pairs the message with the self-drawing schematic on the homepage. */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* WHY: Pages without a hero visual (services, contact, legal) use a single text column. */
.hero:not(:has(.hero-visual)) {
  grid-template-columns: 1fr;
  max-width: 46rem;
}

/* WHY: This eyebrow style adds context above headlines in a precise mono voice. */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.hero-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--slate);
  flex-shrink: 0;
}

.hero-copy .hero-eyebrow::before {
  background: var(--terra);
}

/* WHY: This heading scale keeps hero statements impactful while fitting typical laptop screens. */
.hero h1 {
  margin-top: 1.1rem;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.14;
  max-width: 22ch;
}

/* WHY: This lead treatment softens intro paragraphs and caps their line length. */
.hero-lead {
  margin-top: 1.2rem;
  font-size: 1.08rem;
  max-width: 56ch;
  color: var(--muted);
}

/* WHY: This button row keeps primary and secondary actions grouped and easy to scan. */
.cta-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* WHY: This button base class ensures consistent spacing, contrast and click affordance across call-to-actions. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius-button);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

/* WHY: This primary style highlights strategic actions like contact requests using the strongest brand color. */
.button-primary {
  background: var(--blue);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

/* WHY: This secondary style supports less dominant actions while keeping visual consistency. */
.button-secondary {
  background: transparent;
  border-color: var(--slate-line);
  color: var(--blue);
}

.button-secondary:hover {
  border-color: var(--terra);
  color: var(--terra);
  transform: translateY(-1px);
}

/* WHY: The hero panel hosts the self-drawing schematic with drafting corner ticks. */
.hero-visual {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: clamp(0.8rem, 2vw, 1.2rem);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background:
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 12px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 1px 12px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 12px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 1px 12px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 12px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 1px 12px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 12px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 1px 12px;
  background-repeat: no-repeat;
}

.hero-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-visual .draw {
  fill: none;
  stroke: var(--slate);
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.hero-visual .draw.faint {
  stroke: var(--hair-strong);
  stroke-width: 1;
}

.hero-visual .lbl {
  font-family: var(--mono);
  fill: var(--muted);
  opacity: 0;
}

.hero-visual .dot {
  opacity: 0;
}

.hero-visual .cursor {
  fill: var(--slate);
}

html.anim .hero-visual .draw {
  animation: wp-draw 0.8s cubic-bezier(0.45, 0, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}

html.anim .hero-visual .draw.dash {
  animation-name: wp-draw-dash;
}

html.anim .hero-visual .lbl,
html.anim .hero-visual .dot {
  animation: wp-fade 0.45s ease forwards;
  animation-delay: var(--d, 1.4s);
}

html.anim .hero-visual .cursor {
  animation: wp-blink 1.1s steps(2, start) infinite;
  animation-delay: 2.2s;
}

/* WHY: Without animation the schematic rests in its fully drawn end state. */
html:not(.anim) .hero-visual .draw {
  stroke-dashoffset: 0;
}

html:not(.anim) .hero-visual .draw.dash {
  stroke-dasharray: 0.045 0.035;
}

html:not(.anim) .hero-visual .lbl,
html:not(.anim) .hero-visual .dot {
  opacity: 1;
}

@keyframes wp-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* WHY: Dashed connectors first draw as a solid stroke, then snap to the dash pattern. */
@keyframes wp-draw-dash {
  0% {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  89% {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
  90%,
  100% {
    stroke-dasharray: 0.045 0.035;
    stroke-dashoffset: 0;
  }
}

@keyframes wp-fade {
  to {
    opacity: 1;
  }
}

@keyframes wp-blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
  100% {
    opacity: 1;
  }
}

/* WHY: This section head introduces each homepage chapter as a drawing title block. */
.section-head {
  border-top: 1px solid var(--slate-line);
  padding-top: 1rem;
  max-width: 46rem;
}

/* WHY: This title row spans a hairline between eyebrow and section number. */
.title-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.title-rule {
  flex: 1;
  height: 1px;
  background: var(--hair-strong);
}

/* WHY: This terracotta mono number indexes the chapters like a technical drawing. */
.section-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--terra);
}

.section-head h2 {
  margin-top: 1rem;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  font-weight: 700;
}

.section-head p:not(.hero-eyebrow) {
  margin-top: 0.85rem;
  color: var(--muted);
  max-width: 42rem;
}

/* WHY: This card grid offers a clean and scalable layout for services and capability highlights. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* WHY: This card shell visually separates each topic with hairline border and corner ticks. */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.5rem;
  transition: border-color 0.18s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: -5px;
  pointer-events: none;
  background:
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 1px 10px;
  background-repeat: no-repeat;
  opacity: 0.55;
  transition: opacity 0.18s ease;
}

.card:hover {
  border-color: var(--slate-line);
}

.card:hover::before {
  opacity: 1;
}

.card h2,
.card h3 {
  font-size: 1.12rem;
  font-weight: 700;
}

.card p {
  color: var(--muted);
}

/* WHY: Coming-soon cards read as planned but not yet available: dashed frame, paler ink, small mono tag, increased background transparentcy. */
.card-soon {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.7);
}

.card-soon h3 {
  color: var(--muted);
}

.card-soon p {
  color: rgb(93 102 120 / 0.7);
}

.soon-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted) !important;
}

/* WHY: This muted mono line names concrete vendors without competing with the option heading. */
.option-examples {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--blue) !important;
}

/* WHY: This list styling keeps fact bullets inside cards compact and aligned. */
.option-facts {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.option-facts li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.93rem;
  color: var(--text);
}

.option-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--slate-line);
}

/* WHY: This fit line states the honest recommendation per option and closes each card. */
.option-fit {
  border-top: 1px dashed var(--hair-strong);
  padding-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text) !important;
}

/* WHY: This wide card hosts the risk facts and cost example as full-width blocks below the option grid. */
.wide-card strong {
  color: var(--text);
}

/* WHY: This definition layout presents the cost comparison as scannable label/value rows without chart code. */
.cost-table {
  display: grid;
}

.cost-row {
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr;
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--hair);
}

.cost-row:last-child {
  border-bottom: none;
}

.cost-row dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  padding-top: 0.2em;
}

.cost-row dd {
  font-weight: 600;
  color: var(--slate);
}

/* WHY: This callout carries the honesty statements with the single terracotta border accent. */
.callout {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--terra);
  border-radius: var(--radius-card);
  padding: 1.3rem 1.6rem;
  max-width: 52rem;
  display: grid;
  gap: 0.5rem;
}

.callout p {
  color: var(--text);
}

.callout strong {
  color: var(--slate);
}

/* WHY: This flow grid anchors the dashed connectors that draft themselves between steps. */
.flow-grid {
  position: relative;
}

/* WHY: This numbered badge shows the worked example as an ordered flow at a glance. */
.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--slate-line);
  border-radius: 5px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 2.55rem;
  left: calc(100% + 1px);
  width: calc(var(--gap) - 2px);
  border-top: 1px dashed var(--slate-line);
}

.flow-step:last-child::after {
  display: none;
}

html.anim .flow-step::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.35, 0, 0.15, 1);
  transition-delay: calc(var(--i, 0) * 0.25s + 0.3s);
}

html.anim .flow-grid.is-drafted .flow-step::after {
  transform: scaleX(1);
}

html.anim .flow-step-number {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.28s cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 0.25s);
}

html.anim .flow-grid.is-drafted .flow-step-number {
  opacity: 1;
  transform: scale(1);
}

/* WHY: This closing band uses deep slate for a confident finish that avoids clinical white/red. */
.cta-band {
  background: var(--slate);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  padding-inline: max(4vw, calc((100% - 1140px) / 2));
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}

.cta-band h2 {
  color: #ffffff;
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  max-width: 26ch;
}

.cta-band p {
  color: rgb(255 255 255 / 0.8);
  max-width: 60ch;
}

/* WHY: This inverse button stays legible on the dark slate band while reusing the shared button base. */
.cta-band .button-inverse {
  margin-top: 0.7rem;
  background: var(--paper);
  color: var(--slate);
}

.cta-band .button-inverse:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.cta-band .button-inverse:focus-visible {
  outline-color: #ffffff;
}

/* WHY: This legal container improves readability for dense compliance content and required disclosures. */
.legal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.5rem;
  max-width: 52rem;
  display: grid;
  gap: 0.5rem;
}

/* WHY: Corner ticks tie the legal panels to the same drafting language as the cards. */
.legal-card::before {
  content: "";
  position: absolute;
  inset: -5px;
  pointer-events: none;
  background:
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top left / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) top right / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom left / 1px 10px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 10px 1px,
    linear-gradient(var(--slate-tick), var(--slate-tick)) bottom right / 1px 10px;
  background-repeat: no-repeat;
  opacity: 0.55;
}

.legal-card h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

.legal-card p {
  color: var(--muted);
}

/* WHY: This reveal gives sections a crisp fade with a 12px rise, staggered via --i. */
html.anim [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
  transition-delay: calc(var(--i, 0) * 90ms);
}

html.anim [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* WHY: This utility class supports screen-reader-only labels for accessibility and legal best practice alignment. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* WHY: Responsive overrides live in this file, after the component base rules, because pages load
   components.css last — media queries add no specificity, so only this order makes them win. */

/* WHY: This responsive tweak stacks hero and card grids and turns flow connectors vertical. */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 34rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    max-width: 36rem;
  }

  .flow-step::after {
    top: calc(100% + 1px);
    left: 2.55rem;
    width: 0;
    height: calc(var(--gap) - 2px);
    border-top: 0;
    border-left: 1px dashed var(--slate-line);
  }

  html.anim .flow-step::after {
    transform: scaleY(0);
    transform-origin: top center;
  }

  html.anim .flow-grid.is-drafted .flow-step::after {
    transform: scaleY(1);
  }

  .cost-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* WHY: This mobile header keeps the logo prominent, moves navigation to its own row and
   enlarges tap targets so links and buttons stay comfortable on touch screens. */
@media (max-width: 620px) {
  .brand-block img {
    height: 56px;
  }

  .brand-claim {
    display: none;
  }

  .site-nav {
    margin-left: 0;
    order: 3;
    width: 100%;
  }

  .site-nav a {
    padding-block: 0.6rem;
  }

  .lang-switch {
    margin-left: auto;
    padding: 0.5rem 0.8rem;
  }

  .cta-row .button {
    width: 100%;
  }
}
