/* ============================================================================
   PAGE: IT SOLUTIONS (it-solutions.html)
   Sections: hero over live cables · server rack · floor plan ·
             cabled zig-zag · expanding panels · tipping scale ·
             conic-border card · plug-in CTA
   ============================================================================ */

@layer sections {

  /* ===================== DECODE HERO + CABLES ===================== */
  .sol-hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
    min-height: min(100svh, 64rem);
    display: grid;
    align-items: center;
    padding-block: calc(var(--header-h) + 3rem) clamp(3rem, 6vw, 5rem);
    text-align: center;
  }
  .cables {
    position: absolute; inset: 0; z-index: -1; inline-size: 100%; block-size: 100%;
    /* Fade the cables out behind the headline so it stays readable */
    -webkit-mask: radial-gradient(48% 34% at 50% 34%, transparent 35%, #000 85%);
            mask: radial-gradient(48% 34% at 50% 34%, transparent 35%, #000 85%);
  }
  .cable { fill: none; stroke-linecap: round; }
  .cable--fire { stroke: url(#cblFire); stroke-width: 14; opacity: .85; }
  .cable--k    { stroke: url(#cblK); stroke-width: 18; opacity: .7; }
  .cable--thin { stroke: var(--ink-mute); stroke-width: 4; stroke-dasharray: .01 .015; }
  .cable-pulse { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: .04 .96; opacity: 0; filter: drop-shadow(0 0 6px var(--k-amber)); }

  .sol-hero__inner { display: grid; justify-items: center; }
  .sol-hero__title {
    font-size: clamp(2.5rem, 1.2rem + 5.2vw, 6.2rem);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: .96;
    max-inline-size: 16ch;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    text-wrap: balance;
  }
  .sol-hero__copy {
    display: grid;
    gap: 1rem;
    max-inline-size: 52rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    text-align: start;
  }
  .sol-hero__copy p:first-child { font-size: var(--fs-lg); line-height: 1.4; letter-spacing: -.01em; }
  .sol-hero__copy p + p { color: var(--ink-soft); }

  /* ===================== SERVER RACK ===================== */
  .rack-sec__grid { display: grid; gap: 3rem; align-items: center; }
  @media (min-width: 960px) { .rack-sec__grid { grid-template-columns: .9fr 1.1fr; gap: 5rem; } }
  .rack-sec__copy { display: grid; gap: 1.1rem; color: var(--ink-soft); }
  .rack-sec__title { color: var(--ink); font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: .75rem; }
  .rack-sec__title em { color: var(--accent); font-weight: inherit; }

  .rack {
    padding: clamp(1rem, 2.5vw, 1.75rem);
    border-radius: 18px;
    background: #17102c;
    border: 3px solid var(--line);
    box-shadow: 12px 12px 0 var(--k-amber);
    color: #e8deef;
  }
  .rack__label { font-size: var(--fs-sm); font-weight: 600; color: var(--k-amber); margin: .25rem .25rem 1rem; }
  .rack__units { display: grid; gap: .6rem; }
  .unit {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.25rem 1rem 2rem;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a1f4a, #1f1638);
    border: 1px solid rgb(255 255 255 / .08);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: translate .5s var(--ease-spring), background .3s;
  }
  /* Rack "screws" */
  .unit::before, .unit::after {
    content: "";
    position: absolute;
    left: .65rem;
    inline-size: .45rem;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #4a3d74;
  }
  .unit::before { top: .55rem; }
  .unit::after { bottom: .55rem; }
  .unit:hover { translate: 1.25rem 0; background: linear-gradient(180deg, #3a2a66, #2a1f4a); }
  .unit__leds { flex: none; display: flex; gap: .3rem; }
  .unit__leds i { inline-size: .45rem; aspect-ratio: 1; border-radius: 50%; background: #3fe08a; box-shadow: 0 0 8px #3fe08a; }
  .unit__leds i:nth-child(2) { background: var(--k-amber); box-shadow: 0 0 8px var(--k-amber); }
  .unit__leds i:nth-child(3) { background: #4a3d74; box-shadow: none; }
  .rack__after { margin: 1.25rem .25rem .25rem; font-size: var(--fs-sm); color: #c8bdd9; }

  /* ===================== FLOOR PLAN ===================== */
  .floor__grid { display: grid; gap: 3rem; align-items: center; }
  @media (min-width: 960px) { .floor__grid { grid-template-columns: 1fr 1fr; gap: 6rem; } }
  .floor__copy { display: grid; gap: 1.1rem; color: var(--ink-soft); }
  .floor__title { color: var(--ink); font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: .75rem; }
  .plan {
    padding: clamp(.75rem, 2vw, 1.25rem);
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 2px solid var(--line);
    box-shadow: var(--shadow-soft);
  }
  .plan svg { overflow: visible; }
  .plan__wall { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
  .plan__desks rect { fill: var(--bg-alt); stroke: var(--ink-mute); stroke-width: 2; }
  .plan__dot { fill: var(--k-magenta); stroke: var(--bg); stroke-width: 3; }
  .plan__ripple { fill: none; stroke: var(--k-orange); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; }

  /* ===================== CABLED ZIG-ZAG ===================== */
  .wired__title { font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
  .wired__title em { color: var(--accent); font-weight: inherit; }
  .wired__stage { position: relative; display: grid; gap: 2rem; padding-left: 2.5rem; }
  /* The SVG covers the whole stage at 1:1 pixel scale; JS draws the path port → port.
     Hidden until JS has drawn it (no stray line without JS). */
  .wired__cable { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
  .wired__cable:not(.is-drawn) { display: none; }
  .wired__cable path { fill: none; stroke: var(--k-orange); stroke-width: 4; stroke-linecap: round; }
  .wired__card {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    background: var(--surface-solid);
    border: 2px solid var(--line);
    max-inline-size: 40rem;
  }
  .wired__card p { color: var(--ink-soft); }
  .wired__port {
    position: absolute;
    top: 1.75rem;
    left: -14px;
    inline-size: 24px;
    block-size: 18px;
    border-radius: 4px;
    background: var(--k-indigo);
    border: 2px solid var(--line);
    box-shadow: inset 0 0 0 3px var(--k-amber);
  }
  @media (min-width: 900px) {
    .wired__stage { padding-left: 0; gap: 0; }
    .wired__card { inline-size: 46%; }
    .wired__card--l { justify-self: start; }
    .wired__card--r { justify-self: end; margin-block: -1.5rem; }
    .wired__card--l .wired__port { left: auto; right: -14px; }
  }

  /* ===================== EXPANDING PANELS ===================== */
  .expand__title { font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: clamp(2rem, 4vw, 3rem); }
  .expand__row { display: grid; gap: 1.25rem; }
  /* Icon top-left, text starting right beside it (no tall empty area above the text) */
  .expand__panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(1rem, 2vw, 1.5rem);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--radius);
    /* Both panels: outline + orange offset shadow */
    border: 2px solid var(--line);
    box-shadow: 8px 8px 0 var(--k-orange);
  }
  .expand__panel p { font-size: var(--fs-md); line-height: 1.55; max-inline-size: 52ch; }
  .expand__art { inline-size: clamp(3rem, 4.5vw, 4rem); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
  .expand__panel--k { background: var(--grad-k); color: #f5eee4; }
  .expand__panel--k .expand__art { stroke: var(--k-amber); }
  .expand__panel--paper { background: var(--surface-solid); }
  .expand__panel--paper .expand__art { stroke: var(--accent); }
  @media (min-width: 900px) {
    /* Static layout (no hover animation): the second, longer panel is the wider one */
    .expand__row { display: flex; gap: 1.75rem; }
    .expand__panel { flex: .9 1 0; }
    .expand__panel--paper { flex-grow: 1.25; }
  }

  /* ===================== TIPPING SCALE ===================== */
  .balance__grid { display: grid; gap: 3rem; align-items: center; }
  @media (min-width: 960px) { .balance__grid { grid-template-columns: 1.1fr .9fr; gap: 6rem; } }
  .balance__copy { display: grid; gap: 1.1rem; color: var(--ink-soft); }
  .balance__title { color: var(--ink); font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: .75rem; }
  .balance__title em { color: var(--accent); font-weight: inherit; }
  .scale svg { overflow: visible; }
  .scale__base, .scale__bar, .scale__pan path:first-child { fill: none; stroke: var(--line); stroke-width: 5; stroke-linecap: round; }
  .scale__beam { transform-box: view-box; transform-origin: 200px 80px; }
  .scale__dish { fill: var(--k-magenta); stroke: var(--line); stroke-width: 3; }
  .scale__dish--fire { fill: var(--k-amber); }
  .scale__pivot { fill: var(--k-orange); stroke: var(--line); stroke-width: 3; }
  /* Pans counter-rotate so they always hang straight */
  .scale__pan--l { transform-box: view-box; transform-origin: 60px 80px; }
  .scale__pan--r { transform-box: view-box; transform-origin: 340px 80px; }

  /* ===================== CONIC-BORDER CARD ===================== */
  @property --glow-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
  .glow__card {
    padding: 3px;                                    /* = border thickness */
    border-radius: calc(var(--radius) + 3px);
    background: conic-gradient(from var(--glow-angle), var(--k-amber), var(--k-orange), var(--k-magenta), var(--k-indigo), var(--k-amber));
    box-shadow: 0 30px 80px -40px rgb(242 107 42 / .55);
  }
  .glow__inner {
    display: grid;
    gap: 1.25rem 4rem;
    padding: clamp(2rem, 5vw, 4.5rem);
    border-radius: var(--radius);
    background: var(--surface-solid);
  }
  @media (min-width: 900px) { .glow__inner { grid-template-columns: 1fr 1fr; } .glow__title { grid-column: 1 / -1; } }
  .glow__title { font-size: var(--fs-xl); letter-spacing: -.035em; margin-bottom: .75rem; }
  .glow__title em { color: var(--accent); font-weight: inherit; }
  .glow__inner p { color: var(--ink-soft); }

  /* ===================== PLUG-IN CTA ===================== */
  .plug-cta {
    padding-block: clamp(4rem, 9vw, 8rem);
    margin-top: var(--section);
    background: var(--k-indigo);
    background-image: radial-gradient(50rem circle at 0% 100%, rgb(156 10 94 / .6), transparent 60%);
    color: #e8deef;
  }
  .plug-cta__grid { display: grid; gap: 3rem; align-items: center; }
  @media (min-width: 960px) { .plug-cta__grid { grid-template-columns: 1.2fr .8fr; gap: 5rem; } }
  .plug-cta__copy { display: grid; gap: 1.1rem; }
  .plug-cta__title { font-size: clamp(2.2rem, 1.2rem + 4vw, 5rem); letter-spacing: -.05em; line-height: .95; color: #f5eee4; }
  .plug-cta__title em { color: var(--k-amber); font-weight: inherit; }
  .plug-cta__copy p { color: #c8bdd9; max-inline-size: 58ch; }
  .plug-cta__copy strong { color: #f5eee4; }

  .plug { display: flex; align-items: center; justify-self: center; }
  .plug__cable { inline-size: clamp(7rem, 14vw, 11rem); overflow: visible; margin-right: -.4rem; }
  .plug__cable path:first-child { fill: none; stroke: var(--k-amber); stroke-width: 6; stroke-linecap: round; }
  .plug__head { fill: var(--k-orange); stroke: #f5eee4; stroke-width: 2; }
  .plug__pins { stroke: #f5eee4; stroke-width: 4; stroke-linecap: round; }
  .plug__cable > :not(path:first-child) { transition: translate .5s var(--ease-spring); }
  /* The button is the "socket" */
  .plug__btn {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: 1.3rem 1.8rem 1.3rem 2.2rem;
    border-radius: 14px;
    background: #f5eee4;
    color: var(--k-indigo);
    font-weight: 700;
    border: 3px solid var(--k-amber);
    box-shadow: inset 6px 0 0 var(--k-indigo);       /* socket slot */
    transition: background-color .3s, box-shadow .4s;
  }
  .plug:is(:hover, :focus-within) .plug__head,
  .plug:is(:hover, :focus-within) .plug__pins { translate: 14px 0; }
  .plug:is(:hover, :focus-within) .plug__btn { background: var(--k-amber); box-shadow: inset 6px 0 0 var(--k-indigo), 0 0 40px rgb(251 176 59 / .55); }
}

@layer motion {
  @keyframes cable-draw  { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes pulse-run   { 0% { stroke-dashoffset: 1.04; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
  @keyframes led         { 50% { opacity: .25; } }
  @keyframes ripple      { from { scale: 1; opacity: .9; } to { scale: 6; opacity: 0; } }
  @keyframes glow-spin   { to { --glow-angle: 360deg; } }
  @keyframes tip         { 0% { rotate: -10deg; } 45% { rotate: 7deg; } 75% { rotate: -3deg; } 100% { rotate: 0deg; } }
  @keyframes tip-counter { 0% { rotate: 10deg; } 45% { rotate: -7deg; } 75% { rotate: 3deg; } 100% { rotate: 0deg; } }

  @media (prefers-reduced-motion: no-preference) {
    /* Cables draw in on load, then light pulses run along them */
    .cable--fire, .cable--k { stroke-dasharray: 1; animation: cable-draw 2.2s var(--ease-out) both; }
    .cable--k { animation-delay: .3s; }
    .cable-pulse { animation: pulse-run 3.2s linear 2.2s infinite; }
    .cable-pulse--late { animation-duration: 3.8s; animation-delay: 2.9s; }

    .unit__leds i:nth-child(1) { animation: led 1.4s steps(2) infinite; }
    .unit:nth-child(2n) .unit__leds i:nth-child(2) { animation: led .9s steps(2) infinite; }

    .plan__ripple { animation: ripple 2.6s ease-out infinite; }
    .plan__ripple--late { animation-delay: 1.3s; }

    .glow__card { animation: glow-spin 6s linear infinite; }

    @supports (animation-timeline: view()) {
      /* Cable between the zig-zag cards plugs in with scroll */
      .wired__cable path { stroke-dasharray: 1; animation: cable-draw linear both; animation-timeline: view(); animation-range: entry 30% cover 70%; }

      /* The scale tips and settles as it scrolls through the viewport */
      .scale__beam  { animation: tip linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
      .scale__pan--l, .scale__pan--r { animation: tip-counter linear both; animation-timeline: view(); animation-range: entry 0% cover 60%; }
    }
  }
}
