/* ===== Knowmatics — Global Styles ===== */

:root {
  --dark-teal: #436264;
  --bright-teal: #197E86;
  --light-teal: #e8f4f5;
  --accent: #2AABAB;
  --bg: #fafbfc;
  --white: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --text-on-dark: #dfe6e9;
  --border: #dfe6e9;
  --shadow: 0 2px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.1);
  --radius: 12px;
  --transition: .3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--bright-teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--dark-teal); }

/* ===== Typography ===== */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--dark-teal); }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

.section-label {
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: 2.5px;
  font-weight: 600;
  color: var(--bright-teal);
  margin-bottom: .5rem;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 640px;
  margin: .75rem auto 0;
}

/* ===== Layout ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section--alt { background: var(--white); }
.section--dark { background: var(--dark-teal); color: var(--text-on-dark); }
.section--dark h2,
.section--dark h3,
.section--dark .section-label { color: var(--white); }
.section--dark .section-subtitle { color: var(--text-on-dark); }

.text-center { text-align: center; }

.grid { display: grid; gap: 2rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.nav__logo { height: 42px; width: auto; }
.nav__links { display: flex; gap: 2rem; list-style: none; }
.nav__links a {
  font-size: .9rem; font-weight: 500; color: var(--text);
  position: relative; padding: .25rem 0;
}
.nav__links a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--bright-teal); transition: width var(--transition);
}
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }
.nav__links a:hover { color: var(--bright-teal); }

.nav__cta {
  background: var(--bright-teal); color: var(--white) !important;
  padding: .55rem 1.4rem; border-radius: 8px; font-weight: 600; font-size: .9rem;
}
.nav__cta::after { display: none !important; }
.nav__cta:hover { background: var(--dark-teal); color: var(--white) !important; }

.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav__toggle span {
  display: block; width: 24px; height: 2px; background: var(--dark-teal);
  margin: 5px 0; transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--dark-teal) 0%, #1a5a5e 50%, var(--bright-teal) 100%);
  position: relative; overflow: hidden; padding-top: 72px;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(42,171,171,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(25,126,134,.2) 0%, transparent 50%);
}
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem;
  align-items: center; position: relative; z-index: 1;
}
.hero__content { color: var(--white); }
.hero__logo {
  height: 72px; width: auto; margin-bottom: 1.5rem;
}
.hero__tagline {
  font-size: .95rem; text-transform: uppercase; letter-spacing: 3px;
  color: var(--accent); font-weight: 600; margin-bottom: 1.25rem;
}
.hero h1 { color: var(--white); margin-bottom: 1.25rem; }
.hero h1 span { color: var(--accent); }
.hero__desc {
  font-size: 1.2rem; color: rgba(255,255,255,.85);
  line-height: 1.8; margin-bottom: 2rem; max-width: 520px;
}
.hero__buttons { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 2rem; border-radius: 8px; font-weight: 600;
  font-size: .95rem; transition: all var(--transition); border: 2px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--white); }
.btn--primary:hover { background: #22c9c9; color: var(--white); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(42,171,171,.4); }
.btn--outline { border-color: rgba(255,255,255,.4); color: var(--white); background: transparent; }
.btn--outline:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.1); }

/* Hero graphic — knowledge graph visualisation */
.hero__visual {
  display: flex; align-items: center; justify-content: center;
}
.kg-visual {
  width: 100%; max-width: 480px; aspect-ratio: 1;
  position: relative;
}
.kg-visual svg { width: 100%; height: 100%; }
.kg-node {
  fill: var(--accent); opacity: .9;
  animation: pulse 3s ease-in-out infinite;
}
.kg-node:nth-child(2) { animation-delay: .5s; }
.kg-node:nth-child(3) { animation-delay: 1s; }
.kg-node:nth-child(4) { animation-delay: 1.5s; }
.kg-node:nth-child(5) { animation-delay: 2s; }
.kg-edge { stroke: rgba(42,171,171,.4); stroke-width: 1.5; }

@keyframes pulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ===== Cards ===== */
.card {
  background: var(--white); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__icon {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--light-teal); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem; color: var(--bright-teal); font-size: 1.5rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--text-light); font-size: .95rem; }

/* Dark section cards */
.section--dark .card {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1);
}
.section--dark .card:hover { background: rgba(255,255,255,.12); }
.section--dark .card p { color: var(--text-on-dark); }
.section--dark .card__icon { background: rgba(42,171,171,.15); color: var(--accent); }

/* ===== Sectors ===== */
.sector-card {
  text-align: center; padding: 2.5rem 1.5rem;
}
.sector-card__icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--light-teal); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem; font-size: 2rem; color: var(--bright-teal);
  transition: all var(--transition);
}
.sector-card:hover .sector-card__icon {
  background: var(--bright-teal); color: var(--white);
  transform: scale(1.1);
}

/* ===== Process / How We Work ===== */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; position: relative; }
.process::before {
  content: ''; position: absolute; top: 44px; left: 12.5%; right: 12.5%; height: 2px;
  background: linear-gradient(to right, var(--accent), var(--bright-teal));
  z-index: 0;
}
.process__step { text-align: center; position: relative; z-index: 1; }
.process__num {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bright-teal); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; margin: 0 auto 1rem;
  box-shadow: 0 0 0 6px var(--bg);
}
.section--alt .process__num { box-shadow: 0 0 0 6px var(--white); }
.process__step h4 { margin-bottom: .35rem; color: var(--dark-teal); }
.process__step p { font-size: .9rem; color: var(--text-light); }

/* ===== About Image ===== */
.about-image {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--light-teal);
  aspect-ratio: 4/3;
}
.about-image__img {
  width: 100%; height: 100%; object-fit: cover;
}

/* ===== Case Studies ===== */
.case-study {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.case-study:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.case-study__img {
  width: 100%; height: 200px; overflow: hidden;
  background: linear-gradient(135deg, var(--light-teal) 0%, #d0e8ea 100%);
}
.case-study__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--transition);
}
.case-study:hover .case-study__img img { transform: scale(1.05); }
.case-study__header {
  padding: 2rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.case-study__tag {
  display: inline-block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--bright-teal); background: var(--light-teal);
  padding: .25rem .75rem; border-radius: 4px; margin-bottom: .75rem;
}
.case-study__header h3 { font-size: 1.15rem; }
.case-study__body { padding: 1.5rem 2rem 2rem; }
.case-study__body p { font-size: .95rem; color: var(--text-light); margin-bottom: 1rem; }
.case-study__tech {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem;
}
.case-study__tech span {
  font-size: .78rem; background: var(--light-teal); color: var(--dark-teal);
  padding: .2rem .6rem; border-radius: 4px; font-weight: 500;
}

/* ===== Team ===== */
.team-card { text-align: center; padding: 2rem 1.5rem; }
.team-card__avatar {
  width: 112px; height: 112px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bright-teal), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; color: var(--white); font-size: 1.8rem; font-weight: 700;
  overflow: hidden; position: relative;
  box-shadow: 0 4px 15px rgba(25,126,134,.25);
}
/* Show initials as fallback when no image */
.team-card__avatar::after {
  content: attr(data-initials);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: var(--white);
  z-index: 0;
}
.team-card__avatar img {
  width: 100%; height: 100%; object-fit: cover;
  position: relative; z-index: 1;
  border-radius: 50%;
}
.team-card h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.team-card__role { font-size: .85rem; color: var(--bright-teal); font-weight: 600; margin-bottom: .75rem; }
.team-card p { font-size: .88rem; color: var(--text-light); }

/* ===== Clients ===== */
.clients-strip {
  display: flex; flex-wrap: wrap; justify-content: center;
  align-items: center; gap: 3rem;
}
.clients-strip span {
  font-size: 1rem; font-weight: 600; color: var(--text-light);
  opacity: .6; transition: opacity var(--transition);
  white-space: nowrap;
}
.clients-strip span:hover { opacity: 1; }

/* ===== Stats ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; text-align: center; }
.stat__number {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800;
  color: var(--accent); line-height: 1;
}
.stat__label { font-size: .9rem; color: var(--text-on-dark); margin-top: .5rem; }

/* ===== Footer ===== */
.footer {
  background: #1a3a3c; color: var(--text-on-dark);
  padding: 4rem 0 2rem;
}
.footer__grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
  margin-bottom: 3rem;
}
.footer__brand p { color: var(--text-on-dark); font-size: .9rem; margin-top: 1rem; max-width: 300px; }
.footer h4 { color: var(--white); font-size: .95rem; margin-bottom: 1rem; }
.footer ul { list-style: none; }
.footer li { margin-bottom: .5rem; }
.footer li a { color: var(--text-on-dark); font-size: .9rem; }
.footer li a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem; text-align: center;
  font-size: .85rem; color: rgba(255,255,255,.5);
}
.footer__logo { height: 48px; width: auto; margin-bottom: .5rem; }

/* ===== Responsive ===== */
@media (max-width: 968px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__logo { margin-left: auto; margin-right: auto; }
  .hero__desc { margin-left: auto; margin-right: auto; }
  .hero__buttons { justify-content: center; }
  .hero__visual { order: -1; margin-bottom: 2rem; }
  .kg-visual { max-width: 320px; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process::before { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--white); padding: 1.5rem;
    box-shadow: var(--shadow-lg); gap: 1rem;
  }
  .nav__toggle { display: block; }
  .section { padding: 3.5rem 0; }
  .grid--3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .process { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__buttons { flex-direction: column; align-items: center; }
}
