/* ============================================================
   KWorks — kworks.co.nz
   Palette drawn from the KWorks logo:
   navy #122657 / #0b4171, blue #1d77a1, teal #52a4c7,
   light #a6d7de / #f2fbfe
   ============================================================ */

:root {
  --navy-900: #0c1b3d;
  --navy-800: #122657;
  --navy-700: #0b4171;
  --blue-600: #1d77a1;
  --teal-500: #52a4c7;
  --teal-300: #a6d7de;
  --teal-100: #e5f6f1;
  --sky-050: #f2fbfe;
  --ink: #1b2a41;
  --ink-soft: #4a5a72;
  --white: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(12, 27, 61, 0.08), 0 4px 14px rgba(12, 27, 61, 0.06);
  --shadow-md: 0 4px 10px rgba(12, 27, 61, 0.10), 0 12px 30px rgba(12, 27, 61, 0.10);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(12, 27, 61, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: 0 4px 18px rgba(12, 27, 61, 0.45); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand .brand-name { height: 34px; width: auto; }
.brand .brand-cogs { height: 34px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 2px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav a:hover { color: var(--teal-300); border-bottom-color: var(--teal-500); }

.site-nav a.nav-cta {
  background: linear-gradient(90deg, var(--teal-500), var(--blue-600));
  color: var(--white);
  padding: 9px 20px;
  border-radius: 999px;
  border-bottom: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.site-nav a.nav-cta:hover { filter: brightness(1.12); transform: translateY(-1px); color: var(--white); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 170px 0 90px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(82, 164, 199, 0.35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(29, 119, 161, 0.30), transparent 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-700) 55%, #0d5580 100%);
  color: var(--white);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-grid { position: absolute; inset: 0; }

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-500);
  margin-bottom: 14px;
}
.hero .eyebrow { color: var(--teal-300); }

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.3rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.hero h1 .accent {
  background: linear-gradient(90deg, var(--teal-300), #7fd4e8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  font-size: 1.13rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 54ch;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 46px; }

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: linear-gradient(90deg, var(--teal-500), var(--blue-600));
  color: var(--white);
  box-shadow: 0 6px 20px rgba(82, 164, 199, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(82, 164, 199, 0.5); }
.btn-ghost {
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

.hero-stats { display: flex; gap: 44px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--teal-300);
  line-height: 1.1;
}
.stat-label { font-size: 0.86rem; color: rgba(255, 255, 255, 0.7); }

/* Hero code visual */
.hero-visual { position: relative; }
.code-card {
  background: rgba(9, 20, 46, 0.75);
  border: 1px solid rgba(166, 215, 222, 0.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.code-card-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(166, 215, 222, 0.15);
}
.code-card-bar span {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(166, 215, 222, 0.3);
}
.code-card-bar span:first-child { background: #e0705f; }
.code-card-bar span:nth-child(2) { background: #e5c07b; }
.code-card-bar span:nth-child(3) { background: #98c379; }
.code-card-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.75rem;
  color: rgba(166, 215, 222, 0.6);
  font-family: Consolas, Monaco, monospace;
}
.code-card pre {
  padding: 20px 22px;
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 0.83rem;
  line-height: 1.7;
  color: #d8e6eb;
  overflow-x: auto;
}
.c-kw { color: #7fd4e8; }
.c-ty { color: #e5c07b; }
.c-fn { color: #98c379; }
.c-cm { color: rgba(166, 215, 222, 0.5); font-style: italic; }

.chip {
  position: absolute;
  background: var(--white);
  color: var(--navy-700);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  animation: float 5s ease-in-out infinite;
}
.chip-1 { top: -18px; right: 8%; animation-delay: 0s; }
.chip-2 { bottom: 24px; left: -26px; animation-delay: 1.4s; }
.chip-3 { bottom: -16px; right: 14%; animation-delay: 2.8s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* ---------- Sections ---------- */
.section { padding: 92px 0; }
.section-tint { background: var(--sky-050); }

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2, .about-copy h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--navy-800);
  margin-bottom: 14px;
}
.section-sub { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Service cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  background: var(--white);
  border: 1px solid rgba(18, 38, 87, 0.08);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: rgba(82, 164, 199, 0.45);
}
.card-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-100), var(--teal-300));
  color: var(--navy-700);
  margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; }
.card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 10px;
  line-height: 1.35;
}
.card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Technologies (dark band) ---------- */
.section-dark {
  background:
    radial-gradient(800px 400px at 100% 0%, rgba(82, 164, 199, 0.22), transparent 55%),
    linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: var(--white);
}
.section-dark .section-head h2 { color: var(--white); }
.section-dark .section-sub { color: rgba(255, 255, 255, 0.72); }

.tech-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.tech-group {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(166, 215, 222, 0.18);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.tech-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--teal-300);
  margin-bottom: 18px;
}
.tech-group h3 svg { width: 22px; height: 22px; flex-shrink: 0; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; }
.tags li {
  background: rgba(166, 215, 222, 0.12);
  border: 1px solid rgba(166, 215, 222, 0.25);
  color: #e8f6fa;
  font-size: 0.86rem;
  padding: 7px 14px;
  border-radius: 999px;
}

/* ---------- Solutions ---------- */
.solution-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.solution {
  background: var(--sky-050);
  border: 1px solid rgba(18, 38, 87, 0.07);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.solution:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: var(--white);
}
.solution-num {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal-500);
  margin-bottom: 10px;
}
.solution p { font-size: 0.93rem; color: var(--ink); font-weight: 500; line-height: 1.5; }

/* ---------- About ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: start;
}
.about-copy p { color: var(--ink-soft); margin-bottom: 16px; font-size: 1.03rem; }
.about-copy strong { color: var(--navy-700); }

.about-industries {
  background: var(--white);
  border: 1px solid rgba(18, 38, 87, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 30px 28px;
}
.about-industries h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 18px;
}
.industry-list { list-style: none; display: grid; gap: 14px; }
.industry-list li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 16px;
  background: var(--sky-050);
  border-radius: 10px;
}
.industry-list svg { width: 24px; height: 24px; color: var(--blue-600); flex-shrink: 0; }

/* ---------- Values ---------- */
.values-list {
  list-style: none;
  counter-reset: value;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.values-list li {
  counter-increment: value;
  position: relative;
  background: var(--white);
  border: 1px solid rgba(18, 38, 87, 0.08);
  border-left: 4px solid var(--teal-500);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 24px 26px 74px;
}
.values-list li::before {
  content: counter(value, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 26px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal-500);
}
.values-list h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy-800); margin-bottom: 6px; }
.values-list p { color: var(--ink-soft); font-size: 0.94rem; }

/* ---------- Contact ---------- */
.section-contact {
  background:
    radial-gradient(700px 400px at 15% 0%, rgba(82, 164, 199, 0.3), transparent 55%),
    linear-gradient(160deg, var(--navy-800), var(--navy-700));
  color: var(--white);
  text-align: center;
}
.contact-inner h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin: 0 auto 14px;
}
.section-contact .section-sub { color: rgba(255, 255, 255, 0.75); margin-bottom: 44px; }

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 860px;
  margin-inline: auto;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(166, 215, 222, 0.22);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-decoration: none;
  color: var(--white);
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.contact-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--teal-300);
}
.contact-card svg { width: 30px; height: 30px; color: var(--teal-300); margin-bottom: 8px; }
.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}
.contact-value { font-weight: 600; font-size: 1.02rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.65);
  padding: 30px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand .brand-name { height: 26px; width: auto; }
.footer-brand .brand-cogs { height: 26px; width: auto; }
.footer-inner p { font-size: 0.88rem; }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chip { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 70px; }
  .hero-visual { max-width: 480px; margin-inline: auto; }
  .card-grid, .tech-groups { grid-template-columns: repeat(2, 1fr); }
  .solution-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .contact-cards { grid-template-columns: 1fr; max-width: 420px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy-900);
    box-shadow: var(--shadow-md);
    padding: 10px 6%;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .site-nav a.nav-cta { margin: 14px 0 8px; text-align: center; }
}

@media (max-width: 720px) {

  .brand { gap: 10px; }
  .brand .brand-name { height: 28px; }
  .brand .brand-cogs { height: 26px; }

  .hero { padding: 130px 0 70px; }
  .hero-stats { gap: 28px; }
  .chip-2 { left: -8px; }

  .section { padding: 64px 0; }
  .card-grid, .tech-groups, .solution-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}
