/* ==========================================================================
   DK Cloud Networks
   Palette is injected from PHP (BRAND_COLORS) as --purple, --silver, --ink ...
   ========================================================================== */

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

:root {
  --radius: 16px;
  --radius-sm: 10px;
  --shell: 1180px;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --glow: 0 0 0 1px rgba(139, 49, 239, .28), 0 18px 50px -22px rgba(139, 49, 239, .75);
}

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--silver);
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(139, 49, 239, .22), transparent 60%),
    radial-gradient(700px 480px at -10% 18%, rgba(90, 24, 154, .20), transparent 62%),
    var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--white); line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { margin: 0 0 1.1em; }
a  { color: var(--purple-light); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--white); }
img { max-width: 100%; height: auto; display: block; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82em; }

.shell { width: min(100% - 40px, var(--shell)); margin-inline: auto; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--purple); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 3px; border-radius: 4px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 15, 21, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background .25s ease, border-color .25s ease;
}
.site-header.is-stuck { background: rgba(14, 15, 21, .94); border-bottom-color: rgba(139, 49, 239, .3); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; position: relative; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-display); font-size: 1.06rem; font-weight: 700; letter-spacing: .01em; }
.brand-text em { font-style: normal; color: var(--purple-light); }
.brand-text small { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--silver-dim); }

.primary-nav { display: flex; align-items: center; gap: 6px; }
.primary-nav > a {
  padding: 9px 14px; border-radius: 999px; font-size: .94rem; font-weight: 500; color: var(--silver);
}
.primary-nav > a:hover { color: var(--white); background: rgba(255,255,255,.05); }
.primary-nav > a.is-current { color: var(--white); background: rgba(139, 49, 239, .18); box-shadow: inset 0 0 0 1px rgba(139,49,239,.4); }
.nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none; width: 44px; height: 40px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; background: transparent; cursor: pointer; padding: 10px 9px;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 2px; background: var(--silver); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-display); font-size: .95rem; font-weight: 600; letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple-light), var(--purple) 55%, var(--purple-deep));
  box-shadow: 0 14px 34px -16px rgba(139, 49, 239, .95);
}
.btn-primary:hover { color: #fff; box-shadow: 0 18px 42px -14px rgba(176, 107, 255, 1); transform: translateY(-2px); }
.btn-ghost { color: var(--silver); border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.03); }
.btn-ghost:hover { color: var(--white); border-color: var(--purple); background: rgba(139,49,239,.12); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-head { max-width: 680px; margin-bottom: 46px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 6px 14px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--purple-light);
  background: rgba(139, 49, 239, .12); border: 1px solid rgba(139, 49, 239, .3);
}
.lead { font-size: 1.08rem; color: var(--silver-dim); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(60px, 8vw, 104px) 0 clamp(56px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 span { background: linear-gradient(120deg, var(--purple-light), var(--purple) 45%, var(--silver)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.15rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-strap { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 38px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.07); list-style: none; padding-left: 0; }
.hero-strap li { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--silver-dim); }
.hero-strap li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 9px; border-radius: 50%; background: var(--purple); vertical-align: middle; }

.hero-visual { position: relative; display: grid; place-items: center; }
.hero-visual img { border-radius: 22px; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 40px 90px -40px rgba(139, 49, 239, .9); }
.hero-visual::after {
  content: ""; position: absolute; inset: -14% -8%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139,49,239,.4), transparent 72%);
  filter: blur(10px); animation: pulse 7s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.07); opacity: .75; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { padding: 26px 24px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--ink-3); }
.stat b { display: block; font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; color: var(--white); }
.stat b em { font-style: normal; color: var(--purple-light); }
.stat span { font-size: .84rem; color: var(--silver-dim); }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.card {
  position: relative; padding: 30px 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(31,34,48,.65), rgba(22,24,34,.9));
  border: 1px solid var(--ink-3);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(139,49,239,.5); box-shadow: var(--glow); }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--silver-dim); margin-bottom: 0; }
.card-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px;
  border-radius: 14px; color: var(--purple-light);
  background: rgba(139, 49, 239, .14); border: 1px solid rgba(139, 49, 239, .34);
}
.card-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; font-weight: 600; font-size: .92rem; }
.card-link::after { content: "\2192"; transition: transform .2s ease; }
.card:hover .card-link::after { transform: translateX(4px); }

/* ---------- Service detail ---------- */
.service-row {
  display: grid; grid-template-columns: 280px 1fr; gap: 34px; align-items: start;
  padding: 38px 0; border-top: 1px solid var(--ink-3);
}
.service-row:first-of-type { border-top: 0; padding-top: 0; }
.service-row .num { font-family: var(--font-display); font-size: .8rem; letter-spacing: .2em; color: var(--purple-light); display: block; margin-bottom: 10px; }
.service-row h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { position: relative; padding-left: 30px; color: var(--silver-dim); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(139,49,239,.18); border: 1px solid var(--purple);
}
.checks li::after { content: ""; position: absolute; left: 5px; top: .72em; width: 6px; height: 3px; border-left: 2px solid var(--purple-light); border-bottom: 2px solid var(--purple-light); transform: rotate(-45deg); }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px 24px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--ink-3); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(139, 49, 239, .55); display: block; margin-bottom: 14px;
}
.step p { margin: 0; color: var(--silver-dim); font-size: .95rem; }

/* ---------- Palette strip ---------- */
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 16px; }
.palette-card { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--ink-3); background: var(--ink-2); }
.palette-card .chip { height: 92px; }
.palette-card .meta { padding: 14px 16px; }
.palette-card .meta strong { display: block; font-family: var(--font-display); font-size: .95rem; color: var(--white); }
.palette-card .meta code { color: var(--purple-light); }
.palette-card .meta small { display: block; font-size: .76rem; color: var(--silver-dim); margin-top: 4px; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; text-align: center; border-radius: 26px;
  padding: clamp(44px, 6vw, 72px) 28px;
  background: linear-gradient(135deg, rgba(90,24,154,.55), rgba(61,11,114,.35) 55%, rgba(22,24,34,.9));
  border: 1px solid rgba(139, 49, 239, .4);
}
.cta h2 { max-width: 20ch; margin-inline: auto; }
.cta p { max-width: 56ch; margin-inline: auto; color: var(--silver-dim); }
.cta .hero-actions { justify-content: center; }

/* ---------- Forms ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr .85fr; gap: 40px; align-items: start; }
.form-card { padding: 32px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--ink-3); }
.field { margin-bottom: 20px; position: relative; }
.field label { display: block; margin-bottom: 8px; font-size: .85rem; font-weight: 600; color: var(--white); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--radius-sm);
  background: rgba(14, 15, 21, .8); color: var(--white);
  border: 1px solid var(--ink-3); font-family: var(--font-body); font-size: .96rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(139, 49, 239, .22);
}
.field .error { display: block; margin-top: 7px; font-size: .82rem; color: #ff8a8a; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #ff8a8a; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hp { position: absolute; left: -9999px; }

.alert { padding: 16px 18px; border-radius: var(--radius-sm); margin-bottom: 24px; font-size: .95rem; }
.alert-ok { background: rgba(139, 49, 239, .14); border: 1px solid var(--purple); color: var(--white); }
.alert-bad { background: rgba(255, 138, 138, .1); border: 1px solid rgba(255, 138, 138, .5); color: #ffc4c4; }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.info-list li { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--ink-2); border: 1px solid var(--ink-3); }
.info-list strong { display: block; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--silver-dim); margin-bottom: 6px; }
.info-list a, .info-list span { font-family: var(--font-display); font-size: 1.05rem; color: var(--white); }
.info-list a:hover { color: var(--purple-light); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--ink-3); background: rgba(10, 11, 16, .7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; padding: 62px 0 40px; }
.footer-brand img { border-radius: 12px; border: 1px solid rgba(255,255,255,.08); margin-bottom: 18px; }
.footer-brand p { color: var(--silver-dim); font-size: .93rem; max-width: 42ch; }
.palette-note { font-size: .8rem !important; color: var(--silver-dim); margin-bottom: 10px !important; }
.swatches { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.swatches li { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--silver-dim); }
.swatch { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(255,255,255,.16); }
.footer-col h3 { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--silver-dim); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--silver); font-size: .94rem; }
.footer-col a:hover { color: var(--purple-light); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 20px 0 30px; border-top: 1px solid var(--ink-3);
}
.footer-bottom p { margin: 0; font-size: .82rem; color: var(--silver-dim); }

/* ---------- Reveal on scroll ----------
   Only hidden when JavaScript is running, so the content survives a JS failure. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; max-width: 460px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .service-row { grid-template-columns: 1fr; gap: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; left: -20px; right: -20px; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 20px 22px; background: var(--ink);
    border-bottom: 1px solid var(--ink-3); display: none;
  }
  .primary-nav.is-open { display: flex; }
  .nav-cta { margin: 8px 0 0; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 20px; }
}

@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .brand-text small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .reveal.is-visible { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
