/* ==========================================================================
   XSECURE — XDDOS PAGE NEW SECTIONS (services/xddos.html #materi-3 … #materi-6)
   Shared tokens, icons, badges and cards: product.css
   Existing sections (#materi-1 targets, #materi-2 infographic): services.css
   --------------------------------------------------------------------------
   1. DDoS attack landscape (bar charts)
   2. XSECURE Anti DDoS (without / with diagram)
   3. Anti DDoS features (notched panels)
   4. Why Anti DDoS
   5. DDoS report on a device
   6. Responsive
   ========================================================================== */

/* 1. DDOS ATTACK LANDSCAPE ================================================ */
.landscape {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--p-gap);
}

.chart {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 30px 32px;
}

.chart figcaption h3 {
    font-size: 1.1rem;
}

.chart figcaption p {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--color-text-muted);
}

.bars {
    --bar: var(--color-accent);
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
}

.bars--growth {
    --bar: #ff5c68;
}

.bar {
    display: grid;
    grid-template-columns: 170px 1fr 52px;
    align-items: center;
    gap: 14px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.92rem;
    transition: background var(--transition);
}

.bar:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bar__label {
    color: var(--color-text-muted);
}

.bar__track {
    height: 12px;
    border-radius: 0 4px 4px 0;
    background: rgba(255, 255, 255, 0.05);
}

.bar__fill {
    display: block;
    height: 100%;
    width: calc(var(--v) / var(--max) * 100%);
    border-radius: 0 4px 4px 0;
    background: var(--bar);
    opacity: 0.55;
    transform-origin: left;
    transition: opacity var(--transition);
}

.bar:first-child .bar__fill,
.bar:hover .bar__fill {
    opacity: 1;
}

.bar:first-child .bar__label,
.bar:hover .bar__label {
    color: #ffffff;
}

.bar__value {
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: right;
    color: #ffffff;
}

/* Bars grow in when the chart scrolls into view */
.js .chart.reveal .bar__fill {
    transform: scaleX(0);
    transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity var(--transition);
}

.js .chart.reveal.is-visible .bar__fill {
    transform: scaleX(1);
}

.bar:nth-child(2) .bar__fill { transition-delay: 0.08s; }
.bar:nth-child(3) .bar__fill { transition-delay: 0.16s; }
.bar:nth-child(4) .bar__fill { transition-delay: 0.24s; }
.bar:nth-child(5) .bar__fill { transition-delay: 0.32s; }
.bar:nth-child(6) .bar__fill { transition-delay: 0.40s; }
.bar:nth-child(7) .bar__fill { transition-delay: 0.48s; }
.bar:nth-child(8) .bar__fill { transition-delay: 0.56s; }
.bar:nth-child(9) .bar__fill { transition-delay: 0.64s; }

.impact-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px 30px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--p-blue), #0aa6d6 50%, var(--p-blue-deep));
    box-shadow: 0 18px 40px rgba(43, 70, 255, 0.3);
}

.impact-banner .ico {
    width: 34px;
    height: 34px;
    color: #ffffff;
}

/* 2. XSECURE ANTI DDOS DIAGRAM ============================================ */
.antiddos {
    display: grid;
    grid-template-columns: 0.8fr 2fr;
    align-items: center;
    gap: 50px;
}

.antiddos__list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    list-style: none;
}

.antiddos__list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 700;
    border: 1px solid var(--p-border);
    border-radius: var(--radius);
    background: var(--p-surface);
}

.compare-dg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--p-gap);
}

.compare-dg__panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 22px 22px 18px;
}

.compare-dg__panel figcaption {
    align-self: center;
    padding: 6px 18px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 999px;
}

.compare-dg__panel--down {
    --tone: var(--p-red);
    border-color: rgba(224, 38, 47, 0.45);
}

.compare-dg__panel--safe {
    --tone: var(--color-accent);
    border-color: rgba(0, 217, 232, 0.45);
}

.compare-dg__panel figcaption {
    color: var(--tone);
    border: 1px solid var(--tone);
}

/* Diagram drawing */
.dg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.dg-cap {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    fill: var(--color-text-muted);
}

.dg-cap--bad   { fill: #ff8a93; }
.dg-cap--good  { fill: var(--color-accent); }
.dg-cap--muted { font-weight: 400; letter-spacing: 0.5px; }

.dg-ico            { color: #e8ecff; }
.dg-ico--bad       { color: #ff5c68; }
.dg-ico--good      { color: var(--color-accent); }
.dg-ico--on-scrub  { color: var(--color-bg); }
.dg-ico--wall      { color: #f2a37b; }
.dg-ico--cust      { color: var(--tone); }

.dg-feed {
    fill: none;
    stroke-width: 3;
    stroke-dasharray: 3 6;
    animation: dg-dash 0.9s linear infinite;
}

.dg-feed--bad  { stroke: #ff5c68; }
.dg-feed--good { stroke: var(--color-accent); }

.dg-cloud {
    fill: rgba(255, 255, 255, 0.06);
    stroke: #6f86ff;
    stroke-width: 3;
}

.dg-pipe {
    fill: none;
    stroke: var(--tone);
    stroke-opacity: 0.25;
    stroke-width: 18;
    stroke-linecap: round;
}

.dg-pipe-flow {
    fill: none;
    stroke: var(--tone);
    stroke-width: 3;
    stroke-dasharray: 6 8;
    animation: dg-dash 0.6s linear infinite;
}

.dg--down .dg-pipe { stroke-opacity: 0.45; animation: dg-throb 0.8s ease-in-out infinite alternate; }

.dg-jam {
    fill: rgba(224, 38, 47, 0.2);
    stroke: #ff5c68;
    stroke-width: 3;
}

.dg-chev {
    fill: none;
    stroke: #ff5c68;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: dg-jam 0.5s ease-in-out infinite alternate;
}

.dg-node {
    fill: #121a44;
    stroke: #6f86ff;
    stroke-width: 2.5;
}

.dg-scrub {
    fill: var(--color-accent);
    filter: drop-shadow(0 0 12px var(--color-accent-glow));
}

.dg-scrub-ring {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 3;
    transform-box: fill-box;
    transform-origin: center;
    animation: dg-ring 1.8s ease-out infinite;
}

.dg-branch {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 2.5;
    stroke-dasharray: 2 6;
    stroke-linecap: round;
    animation: dg-dash 1.2s linear infinite;
}

.dg-customer {
    fill: rgba(255, 255, 255, 0.04);
    stroke: var(--tone);
    stroke-width: 3;
}

.dg--down .dg-customer { animation: dg-alarm 1.2s ease-in-out infinite; }

.dg-badge rect { stroke: none; }
.dg-badge text {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    fill: #ffffff;
}

.dg-badge--ok rect   { fill: #1fa94b; }
.dg-badge--down rect { fill: var(--p-red); }
.dg-badge--down      { animation: dg-blink 1s steps(2, jump-none) infinite; }

.pk--bad  { fill: #ff6b76; filter: drop-shadow(0 0 5px #ff3347); }
.pk--good { fill: #d9fcff; filter: drop-shadow(0 0 5px var(--color-accent)); }

@keyframes dg-dash  { to { stroke-dashoffset: -28; } }
@keyframes dg-throb { from { stroke-width: 16; } to { stroke-width: 22; } }
@keyframes dg-jam   { from { transform: translateY(-2px); } to { transform: translateY(2px); } }
@keyframes dg-ring  { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes dg-alarm { 0%, 100% { fill: rgba(255, 255, 255, 0.04); } 50% { fill: rgba(224, 38, 47, 0.16); } }
@keyframes dg-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* 3. ANTI DDOS FEATURES =================================================== */
.feature-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--p-gap);
}

/* Card with a clipped top-right corner, as on slide 5 */
.notch-panel {
    position: relative;
    padding: 34px 32px 30px;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--radius);
    clip-path: polygon(0 0, calc(100% - 56px) 0, 100% 56px, 100% 100%, 0 100%);
}

.notch-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 79px;
    border-top: 1px solid var(--p-border);
    transform: rotate(45deg);
    transform-origin: top left;
    translate: -56px 0;
}

.notch-panel__title {
    margin-bottom: 22px;
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--color-accent);
}

.notch-panel ul {
    display: flex;
    flex-direction: column;
    gap: 22px;
    list-style: none;
}

.notch-panel li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.notch-panel h4 {
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.notch-panel p {
    font-size: 0.94rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.notch-panel .is-highlight {
    margin: -6px -12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(224, 38, 47, 0.1);
}

.notch-panel .is-highlight strong {
    color: #ff8a93;
}

/* 4. WHY ANTI DDOS ======================================================== */
.why-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--p-gap);
    list-style: none;
}

/* Animated dashed connector behind the badges */
.why-steps::before {
    content: '';
    position: absolute;
    top: 66px;
    left: 16.6%;
    right: 16.6%;
    height: 3px;
    background: repeating-linear-gradient(90deg, rgba(140, 160, 255, 0.6) 0 10px, transparent 10px 18px);
    background-size: 36px 3px;
    animation: why-run 1.2s linear infinite;
}

@keyframes why-run {
    to { background-position: 36px 0; }
}

.why-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 18px 30px;
    text-align: center;
}

.why-step__no {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--color-accent);
}

.why-step h3 {
    font-size: 1.15rem;
}

.why-step p {
    max-width: 340px;
    font-size: 0.96rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .dg *,
    .why-steps::before,
    .device *,
    .device *::before,
    .device *::after { animation: none !important; }
    .js .device.reveal .device__lid { transform: none; transition: none; }
    .dg-packets { display: none; }
    .js .chart.reveal .bar__fill { transform: none; transition: none; }
}

/* 5. DDOS REPORT ON A DEVICE ============================================== */
.device {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    perspective: 2200px;
}

/* The lid opens when the section scrolls into view */
.device__lid {
    position: relative;
    padding: 22px 22px 26px;
    border-radius: 22px 22px 8px 8px;
    background: linear-gradient(160deg, #2a3150, #12172e);
    border: 1px solid rgba(140, 160, 255, 0.35);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(43, 70, 255, 0.25);
    transform-origin: bottom center;
    transition: transform 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .device.reveal .device__lid          { transform: rotateX(-75deg); }
.js .device.reveal.is-visible .device__lid { transform: none; }

.device__cam {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: #0b0f20;
    box-shadow: inset 0 0 0 1.5px #3a4270, 0 0 6px var(--color-accent);
    animation: cam-on 3s ease-in-out infinite;
}

@keyframes cam-on {
    0%, 100% { box-shadow: inset 0 0 0 1.5px #3a4270, 0 0 3px rgba(0, 217, 232, 0.3); }
    50%      { box-shadow: inset 0 0 0 1.5px #3a4270, 0 0 9px var(--color-accent); }
}

.device__screen {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    background: #0d111e;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* The scrollable report */
.device__view {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 217, 232, 0.5) transparent;
}

.device__view img {
    display: block;
    width: 100%;
    height: auto;
}

.device__view:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
}

.device__view::-webkit-scrollbar       { width: 8px; }
.device__view::-webkit-scrollbar-thumb { border-radius: 4px; background: rgba(0, 217, 232, 0.5); }

/* Slow scan line over the screen */
.device__scan {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 70px;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(0, 217, 232, 0.08), transparent);
    animation: screen-scan 5s linear infinite;
}

@keyframes screen-scan {
    from { transform: translateY(-70px); }
    to   { transform: translateY(700px); }
}

.device__base {
    position: relative;
    height: 22px;
    margin: 0 -6%;
    border-radius: 2px 2px 18px 18px;
    background: linear-gradient(to bottom, #3a4266, #1a1f36);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.5);
}

.device__base span {
    position: absolute;
    left: 50%;
    top: 0;
    width: 16%;
    height: 8px;
    border-radius: 0 0 10px 10px;
    background: #12172e;
    transform: translateX(-50%);
}

/* Lid follows the scroll (main.js sets --open 0→1) ---------------------- */
.device.is-scrub .device__lid {
    transform: rotateX(calc((1 - var(--open, 0)) * -86deg));
    transition: none;
}

/* the report lights up as the lid opens */
.device.is-scrub .device__view {
    opacity: calc(0.15 + var(--open, 0) * 0.85);
    filter: brightness(calc(0.35 + var(--open, 0) * 0.65));
}

.device.is-scrub .device__screen {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06),
                0 0 calc(var(--open, 0) * 40px) rgba(0, 217, 232, calc(var(--open, 0) * 0.25));
}

/* scan line only once the lid is fully open */
.device.is-scrub:not(.is-open) .device__scan { opacity: 0; }

/* Visual summary under the laptop */
.viz-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--p-gap);
}

.viz-card {
    --v: var(--color-accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 20px;
    border: 1px solid var(--p-border);
    border-radius: var(--radius);
    background: var(--p-surface);
    transition: transform var(--transition), border-color var(--transition);
}

.viz-card:hover { transform: translateY(-4px); border-color: var(--v); }

.viz--red    { --v: #ff5c68; }
.viz--cyan   { --v: var(--color-accent); }
.viz--green  { --v: #2fd17a; }
.viz--violet { --v: #8f80ff; }

.viz-card svg { width: 100%; max-width: 220px; height: auto; overflow: visible; }

.viz-card figcaption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.viz-card figcaption b {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--v);
    text-shadow: 0 0 18px var(--v);
}

.viz-card figcaption span { font-size: 0.9rem; color: var(--color-text-muted); }

.viz-axis text, .viz-axis-t { font-size: 9px; fill: var(--color-text-muted); }
.viz-big { font-family: var(--font-heading); font-size: 13px; font-weight: 800; fill: #ffffff; }
.viz-big.dim { fill: var(--color-text-muted); }

/* Animated parts (start state; .on is added when the card scrolls into view) */
.viz-bar {
    fill: var(--v);
    opacity: 0.85;
    transform-box: fill-box;
    transform-origin: bottom;
    transform: scaleY(0);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i) * 90ms);
}

.viz-bar:hover { opacity: 1; }

.viz-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 12; stroke-linecap: round; }

.viz-gauge {
    fill: none;
    stroke: var(--v);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 0 6px var(--v));
}

.viz-needle {
    transform-origin: 80px 80px;
    transform: rotate(-90deg);
    transition: transform 1.6s cubic-bezier(0.3, 1.4, 0.4, 1);
}

.viz-needle path   { stroke: #ffffff; stroke-width: 3; stroke-linecap: round; }
.viz-needle circle { fill: #ffffff; }

.viz-ring {
    fill: none;
    stroke: var(--v);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: var(--len);
    stroke-dashoffset: var(--len);
    transition: stroke-dashoffset 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 0 6px var(--v));
}

.viz-check {
    fill: none;
    stroke: var(--v);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 0.6s ease 1.4s;
}

.viz-shield { fill: rgba(143, 128, 255, 0.15); stroke: var(--v); stroke-width: 3; }

.viz-rules rect {
    fill: var(--v);
    transform-box: fill-box;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.6s ease;
}

.viz-rules rect:nth-child(2) { transition-delay: 0.2s; }
.viz-rules rect:nth-child(3) { transition-delay: 0.4s; }

.viz-card.on .viz-bar,
.viz-card.on .viz-rules rect { transform: none; }
.viz-card.on .viz-gauge  { stroke-dashoffset: calc(var(--len) - var(--val)); }
.viz-card.on .viz-needle { transform: rotate(88deg); }
.viz-card.on .viz-ring,
.viz-card.on .viz-check  { stroke-dashoffset: 0; }

/* Without JS or with reduced motion: show final state */
html:not(.js) .viz-card .viz-bar,
html:not(.js) .viz-card .viz-rules rect { transform: none; }
html:not(.js) .viz-card .viz-gauge  { stroke-dashoffset: calc(var(--len) - var(--val)); }
html:not(.js) .viz-card .viz-needle { transform: rotate(88deg); }
html:not(.js) .viz-card .viz-ring,
html:not(.js) .viz-card .viz-check  { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
    .viz-card .viz-bar, .viz-card .viz-rules rect { transform: none; transition: none; }
    .viz-card .viz-gauge  { stroke-dashoffset: calc(var(--len) - var(--val)); transition: none; }
    .viz-card .viz-needle { transform: rotate(88deg); transition: none; }
    .viz-card .viz-ring, .viz-card .viz-check { stroke-dashoffset: 0; transition: none; }
}

/* 6. RESPONSIVE =========================================================== */
@media (max-width: 1200px) {
    .antiddos { grid-template-columns: 1fr; }
    .antiddos__list { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
    .landscape,
    .feature-panels { grid-template-columns: 1fr; }

    .why-steps { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
    .why-steps::before { display: none; }
}

@media (max-width: 768px) {
    .device__lid { padding: 12px 12px 16px; border-radius: 14px 14px 6px 6px; }
    .device__screen { aspect-ratio: 3 / 4; }
    .viz-grid { grid-template-columns: 1fr 1fr; }
    .viz-card { padding: 16px 10px; }
    .viz-card figcaption b { font-size: 1.35rem; white-space: nowrap; }
    .viz-card figcaption span { font-size: 0.8rem; }

    .compare-dg { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; width: 100%; }
    .antiddos__list { grid-template-columns: 1fr; }
    .impact-banner { flex-direction: column; gap: 10px; font-size: 1.1rem; }
}

@media (max-width: 576px) {
    .chart { padding: 24px 18px; }
    .bar { grid-template-columns: 128px 1fr 42px; gap: 8px; font-size: 0.8rem; padding: 4px; }
    .notch-panel { padding: 28px 20px 24px; }
}
