/* ============================================================
   IRONROK - Partenerul tău în sudură
   Self-contained stylesheet (no framework, no runtime). Holds the
   brand tokens, the layout, the stateful components (cards,
   buttons, logo), the cross-fading slideshow and the one-viewport
   "stage" layout for landscape / ≥992px.

   Mobile-first; min-width breakpoints only.
   ============================================================ */

:root {
  --navy: #2F2B4E;
  --red: #F9423A;
  --red-hover: #FF5147;
  --mauve: #BDB4BF;
  --paper: #EFF2EF;
  --ink: #16131F;
  --white: #FFFFFF;

  --pad: clamp(20px, 3.2vw, 56px);     /* shared horizontal gutter */
  --header-h: clamp(72px, 9vh, 104px); /* top bar height (stage)   */
  --card-h: clamp(196px, 26vh, 236px); /* service card height (stage) */
  --split: 54%;                        /* content/image divide (stage) */
  --btn-notch: 11px;                   /* depth of the arrow notch on button side edges */
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* buttons should speak the page's typeface, not the UA's */
button {
  font: inherit;
  color: inherit;
}

html,
body { height: 100%; }

body {
  font-family: 'IBM Plex Sans Condensed', system-ui, sans-serif;
  color: var(--navy);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   HERO SHELL - stacked on mobile, repositioned in the stage block
   ------------------------------------------------------------ */
.hero {
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------
   TOP BAR
   ------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--pad);
}

.logo {
  display: block;
  width: auto;
  height: 38px;

  & .cls-1 { fill: var(--red); }
  & .cls-2 { fill: var(--navy); }
}

.phone {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  padding: 13px 24px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: .01em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  transition: color .18s ease;

  /* the panel sits on a clipped layer so the focus ring + text stay intact;
     the side edges cave 10px inward at center -> two arrow-shaped cutouts */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--white);
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--btn-notch)) 50%, 100% 100%, 0 100%, var(--btn-notch) 50%);
    filter: drop-shadow(0 8px 12px rgba(47,43,78,.34));
  }

  &:hover { color: var(--red); }
  &:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
  }
}

/* ------------------------------------------------------------
   HERO CONTENT
   ------------------------------------------------------------ */
.hero-content {
  padding: 36px var(--pad);
}

.kicker {
  display: inline-block;
  margin-bottom: 22px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--red);
}

.headline {
  margin: 0 0 18px;
  font-family: 'Teko', sans-serif;
  font-weight: 400;
  font-size: clamp(46px, 12vw, 76px);
  line-height: .86;
  letter-spacing: -.01em;
  color: var(--navy);
  text-wrap: balance;
}

.lead {
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.62;
  color: #5B5870;
  text-wrap: pretty;
}

.btn-contact {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;   /* stay content-width inside the flex column (stage) */
  margin-top: 26px;
  padding: 14px 30px;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--white);
  transition: transform .18s ease;

  /* the fill sits on a clipped layer so the focus ring + text stay intact;
     the side edges cave 10px inward at center -> two arrow-shaped cutouts */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--red);
    clip-path: polygon(0 0, 100% 0, calc(100% - var(--btn-notch)) 50%, 100% 100%, 0 100%, var(--btn-notch) 50%);
    filter: drop-shadow(0 10px 14px rgba(249,66,58,.5));
    transition: background .18s ease, filter .18s ease;
  }

  &:hover {
    transform: translateY(-2px);

    &::before {
      background: var(--red-hover);
      filter: drop-shadow(0 14px 18px rgba(249,66,58,.55));
    }
  }
  &:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
  }
}

/* ------------------------------------------------------------
   MEDIA PANEL + CROSS-FADING SLIDESHOW
   ------------------------------------------------------------ */
.media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy);

  /* navy duotone wash for cohesion + caption legibility */
  &::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(47,43,78,.30), rgba(47,43,78,.04) 32%, rgba(47,43,78,.14) 68%, rgba(47,43,78,.46));
    pointer-events: none;
  }
}

.carousel {
  position: absolute;
  inset: 0;

  & img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .8s ease;

    &.is-on { opacity: 1; }
  }
}

.cat-caption {
  position: absolute;
  z-index: 5;
  left: var(--pad);
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Teko', sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--white);
  text-shadow: 0 2px 14px rgba(0,0,0,.5);

  & .idx {
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-weight: 700;
    font-size: 15px;
    opacity: .8;
  }
  & .name {
    font-size: 34px;
    line-height: 1;
  }
}

/* credit over the image - landscape/desktop only (mobile uses the footer) */
.credit {
  display: none;
  position: absolute;
  z-index: 5;
  right: var(--pad);
  bottom: 16px;
  font-size: 13px;
  letter-spacing: .02em;
  text-decoration: none;
  color: rgba(255,255,255,.72);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
  transition: color .18s ease;

  &:hover { color: var(--white); }
  &:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
    color: var(--white);
  }
}

/* ------------------------------------------------------------
   SERVICE CARDS
   Mobile/portrait: draggable horizontal row (never stacked).
   ------------------------------------------------------------ */
.services {
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;             /* Firefox */
  cursor: grab;

  &::-webkit-scrollbar { display: none; }   /* WebKit */
  &.is-dragging { cursor: grabbing; }
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: min(80%, 320px);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 2vw, 30px) clamp(22px, 1.9vw, 34px);
  scroll-snap-align: start;
  border: 0;
  text-align: left;
  color: var(--white);
  background: var(--navy);
  cursor: pointer;
  overflow: hidden;
  transition: background .25s ease;

  &:hover { background: #3A3559; }
  &:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: -2px;
  }

  &.is-active {
    background: var(--red);

    & .card-icon svg { fill: var(--white); }
    & .card-body { color: rgba(255,255,255,.92); }
  }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  display: block;
  font-family: 'Teko', sans-serif;
  font-weight: 400;
  font-size: 30px;
  line-height: .9;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.card-icon {
  flex: 0 0 auto;
  width: clamp(44px, 3.6vw, 56px);
  height: clamp(44px, 3.6vw, 56px);

  & svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: var(--red);
    transition: fill .25s ease;
  }
}

.card-body {
  margin-top: auto;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mauve);
  text-wrap: pretty;
}

/* ------------------------------------------------------------
   FOOTER - mobile + portrait tablet only
   ------------------------------------------------------------ */
.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 28px var(--pad);
  background: var(--paper);
}

.footer-copy {
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--navy);
}

.footer-credit {
  font-size: 13px;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--navy);
  transition: color .18s ease;

  &:hover { color: var(--red); }
  &:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
    color: var(--red);
  }
}

/* Small screens and up: a touch more breathing room (matches the
   old sm: gutters). Stage overrides these paddings below anyway. */
@media (min-width: 640px) {
  .topbar { padding-block: 24px; }
  .hero-content { padding-block: 48px; }
}

/* ============================================================
   STAGE - one-viewport split layout.
   Fires on any screen ≥992px OR on landscape from 761px up
   (landscape tablets and wider). Tablet sizing is the base here;
   it scales up at ≥992px and ≥1440px below. id-scoped so it
   cleanly overrides the mobile layout.
   ============================================================ */
@media (min-width: 992px),
       (min-width: 761px) and (orientation: landscape) {

  #hero {
    position: relative;
    height: 100dvh;
    min-height: 600px;
    overflow: hidden;
    isolation: isolate;
  }

  #hero .topbar {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 30;
  }

  #hero .media {
    position: absolute;
    inset: 0 0 0 auto;
    width: calc(100% - var(--split));
    aspect-ratio: auto;
    z-index: 1;
  }

  #hero .hero-content {
    position: absolute;
    left: 0;
    top: var(--header-h);
    bottom: var(--card-h);
    z-index: 10;
    width: var(--split);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: clamp(28px, 4vw, 80px);
  }

  #hero .cat-caption {
    bottom: calc(var(--card-h) + 26px);
  }

  #hero .credit {
    display: block;
    bottom: clamp(14px, 2vh, 22px);
  }

  /* cards: 3-up grid anchored bottom-left, bridging onto the image */
  #hero .services {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 20;
    width: 85vw;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    cursor: auto;
  }

  #hero .card {
    width: auto;
    height: var(--card-h);
    min-height: 0;
    gap: 10px;
    padding: 16px 22px;
    justify-content: flex-start;
  }
  #hero .card-head { align-items: flex-start; }
  #hero .card-title { font-size: 27px; }
  #hero .card-body { font-size: 14px; line-height: 1.42; }

  /* In the fixed-height bottom band the icons crowd the copy and clip the
     descriptions, so the cards run icon-free across landscape and desktop. */
  #hero .card-icon { display: none; }

  /* footer is a sibling of #hero; specificity beats Tailwind's .flex */
  body > .site-footer { display: none; }
}

/* Desktop and large portrait tablets (≥992px): full treatment */
@media (min-width: 992px) {
  :root { --split: 57%; }

  #hero .services { width: 75vw; }
}

/* From 1024px: shorter cards (-10%), larger description text and
   even (22px) padding on all sides */
@media (min-width: 1024px) {
  :root { --card-h: calc(clamp(196px, 26vh, 236px) * 0.9); }

  #hero .card { padding: 22px; }
  #hero .card-body { font-size: 16px; line-height: 1.5; }
}

/* Real desktops (≥1280px): enough room to bring the card icons back.
   They stay hidden only on the narrower landscape-tablet range. */
@media (min-width: 1280px) {
  #hero .card-icon { display: block; }
}

/* Large desktop: full-size hero typography */
@media (min-width: 1440px) {
  #hero .kicker { font-size: 16px; }
  #hero .headline { font-size: 96px; }
  #hero .lead { font-size: 20px; }
}

/* ------------------------------------------------------------
   Motion preference
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
