/* =========================================================
   Qilla Security - main stylesheet (Devixo Task 02)
   1. Colour variables  2. Base  3. Header/nav  4. Buttons
   5. Hero + terminal  6. Counters  7. Lists  8. Slider
   9. FAQ  10. Layout helpers  11. Form  12. Footer + top button
   13. Responsive (mobile)  14. Reduced motion
   ========================================================= */
/* 1. COLOURS: light theme is default; dark theme overrides below */
:root {
  --bg: #EEF2F7;
  --ink: #0F1F3D;
  --mut: #56647f;
  --card: #fff;
  --line: #cdd7e6;
  --acc: #0B5FCC;
  --on: #fff;
  --warn: #B45F00;
  --term: #0A1428;
  --tt: #BFE9FF;
}

/* Dark mode: main.js sets data-theme="dark" on <html> */
[data-theme=dark] {
  --bg: #0A1428;
  --ink: #E6EDF7;
  --mut: #93a4c3;
  --card: #101d38;
  --line: #223457;
  --acc: #4CC9F0;
  --on: #06142b;
  --warn: #FFB020;
  --term: #050B18;
}

/* 2. BASE styles */
* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font: 400 1rem/1.7 'Sora',system-ui,sans-serif;
  background: var(--bg);
  color: var(--ink);
  transition: background .3s,color .3s;
}

a {
  color: var(--acc);
}

:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 2px;
}

.wrap {
  width: min(1080px,92%);
  margin: auto;
}

h1 {
  font-size: clamp(2.1rem,5.5vw,3.6rem);
  line-height: 1.1;
  letter-spacing: -.03em;
  max-width: 15ch;
}

h2 {
  font-size: clamp(1.5rem,3.2vw,2.1rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .8rem;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: .3rem;
}

p {
  max-width: 62ch;
  color: var(--mut);
}

section {
  padding: 4rem 0;
}

/* 3. HEADER and NAVIGATION (sticky at top) */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.logo img {
  width: 26px;
}

nav {
  display: flex;
  gap: 1.4rem;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}

nav a:hover,nav a.on {
  border-color: var(--acc);
}

.ib {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* Hamburger button is hidden on desktop, shown on mobile (see section 13) */
#menu {
  display: none;
}

/* 4. BUTTONS */
.btn {
  display: inline-block;
  background: var(--acc);
  color: var(--on);
  padding: .8rem 1.4rem;
  border-radius: 8px;
  font: 600 1rem 'Sora',sans-serif;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.btn.alt {
  background: none;
  color: var(--ink);
  border: 1px solid var(--ink);
}

/* 5. HERO section + terminal window */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 4.5rem 0;
}

.hero p {
  margin: 1.2rem 0 1.6rem;
}

.row {
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
}

.term {
  background: var(--term);
  color: var(--tt);
  border-radius: 10px;
  font: .9rem/1.7 'JetBrains Mono',monospace;
  box-shadow: 0 18px 40px -18px #0006;
  overflow: hidden;
}

.term b {
  display: block;
  padding: .6rem 1rem;
  background: #ffffff14;
  font-weight: 400;
  font-size: .8rem;
  color: #8fb3d6;
}

.term pre {
  padding: 1rem;
  min-height: 12.5rem;
  white-space: pre-wrap;
  font: inherit;
}

.term .warn {
  color: #FFB020;
}

/* Blinking cursor for the typing animation */
.cur {
  display: inline-block;
  width: .6ch;
  background: var(--tt);
  animation: bl 1s steps(2) infinite;
}

@keyframes bl {
  50% {
    opacity: 0;
  }
}

/* 6. COUNTERS row */
.stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border-block: 1px solid var(--line);
}

.stats div {
  padding: 1.6rem 1rem;
  border-right: 1px solid var(--line);
}

.stats div:last-child {
  border: 0;
}

.stats strong {
  display: block;
  font-size: 2.2rem;
  letter-spacing: -.03em;
}

.stats span {
  color: var(--mut);
  font-size: .9rem;
}

/* 7. LIST rows used for services, process and portfolio */
.list {
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
}

.item {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.tag {
  font-size: .8rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: .1rem .7rem;
  color: var(--mut);
  height: fit-content;
}

/* 8. IMAGE SLIDER */
.slider {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 4.5rem;
  min-height: 15rem;
  overflow: hidden;
}

.slide {
  display: none;
}

.slide.on {
  display: block;
  animation: fi .5s;
}

@keyframes fi {
  from {
    opacity: 0;
  }
}

.slide img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.2rem;
}

.slide blockquote {
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: 44ch;
}

.slide cite {
  display: block;
  margin-top: 1rem;
  color: var(--mut);
  font-style: normal;
}

.ctl {
  position: absolute;
  left: 1.2rem;
  bottom: 1.2rem;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: var(--line);
  cursor: pointer;
  padding: 0;
}

.dot.on {
  background: var(--acc);
}

/* 9. FAQ ACCORDION: answer panel animates open with grid-template-rows */
.faq {
  border-top: 1px solid var(--line);
  margin-top: 1.2rem;
}

.faq button {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  padding: 1.1rem 0;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.faq button::after {
  content: '+';
  font-size: 1.3rem;
  transition: transform .25s;
}

.faq button[aria-expanded=true]::after {
  transform: rotate(45deg);
}

.faq .a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s;
}

.faq .a.open {
  grid-template-rows: 1fr;
}

.faq .a p {
  overflow: hidden;
}

.faq .a.open p {
  padding: 1rem 0;
}

/* 10. LAYOUT helpers: two columns, team grid */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.team {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.team div {
  border-left: 3px solid var(--acc);
  padding-left: 1rem;
}

/* 11. CONTACT FORM */
form {
  display: grid;
  gap: 1rem;
}

label {
  font-weight: 600;
  font-size: .9rem;
  display: grid;
  gap: .3rem;
}

input,textarea {
  font: inherit;
  padding: .75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

/* Red/orange border when a field fails validation */
input.bad,textarea.bad {
  border-color: var(--warn);
}

.err {
  color: var(--warn);
  font-size: .85rem;
  font-weight: 400;
  min-height: 1.1em;
}

.ok {
  background: var(--card);
  border-left: 4px solid var(--acc);
  padding: 1rem;
  border-radius: 6px;
  display: none;
}

/* 12. FOOTER and SCROLL-TO-TOP button */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--mut);
  font-size: .9rem;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

#top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  background: var(--acc);
  color: var(--on);
  border-color: var(--acc);
}

#top.show {
  opacity: 1;
  pointer-events: auto;
}

/* 13. RESPONSIVE: tablets and phones (screens under 800px) */
@media (max-width:800px) {
  #menu {
    display: block;
  }
  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem 4%;
    border-bottom: 1px solid var(--line);
    gap: .6rem;
  }
  nav.open {
    display: flex;
  }
  .hero,.two {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats div:nth-child(2) {
    border-right: 0;
  }
  .stats div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }
  .item {
    grid-template-columns: 1fr;
  }
  .team {
    grid-template-columns: 1fr;
  }
}

/* 14. ACCESSIBILITY: turn off animations for users who prefer less motion */
@media (prefers-reduced-motion:reduce) {
  * {
    animation: none!important;
    transition: none!important;
    scroll-behavior: auto!important;
  }
}

