/* ========================================
   CANNON CONSULTING - CLEAN CSS
   ======================================== */

/* CSS Variables */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e5e7eb;
  --primary: #0d7bd0;
  --primary-600: #0a68b1;
  --accent: #d32f2f;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #0f172a;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2a44;
    --primary: #4cc3ff;
    --primary-600: #36a7df;
    --accent: #ff7b7b;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
  }
}

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  flex: 1;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

h4 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1rem 0;
}

/* Container System */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.narrow {
  max-width: 800px;
}

/* Background Image */
.background-image {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url(./images/sf3d.png) center/cover no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

/* ========================================
   HEADER / NAVIGATION
   ======================================== */

.top-bar {
  position: sticky;
  top: 0;
  width: 100%;
  backdrop-filter: saturate(180%) blur(10px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  min-height: 72px;
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.brand {
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
}

.top-logo-img {
  height: 48px;
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

.hamburger {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  position: absolute;
  left: 1rem;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

.contact-bar-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 14rem;
  background: var(--surface);
  box-shadow: 2px 0 16px rgba(0,0,0,0.08);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--border);
}

.sidebar.open {
  transform: translateX(0);
}

.close {
  background: none;
  border: none;
  font-size: 2rem;
  align-self: flex-end;
  cursor: pointer;
  margin-bottom: 2rem;
  color: var(--muted);
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 1.25rem;
}

.sidebar a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.2s;
}

.sidebar a:hover {
  color: var(--primary);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.05);
  border: none;
  font-family: inherit;
  font-size: 1rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-600);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  position: relative;
  padding: clamp(2rem, 8vw, 5rem) 0;
  overflow: hidden;
  width: 100%;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.hero-copy {
  max-width: 100%;
}

.hero-title {
  margin-bottom: 0.75rem;
}

.hero-sub {
  color: var(--muted);
  margin: 0.5rem 0 1.25rem;
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-media {
  position: relative;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-graphic {
  position: relative;
  z-index: 2;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(13, 123, 208, 0.15));
  animation: float 6s ease-in-out infinite;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.75;
  mix-blend-mode: multiply;
  z-index: 1;
}

.orb-a {
  width: 240px;
  height: 240px;
  right: 10%;
  top: 5%;
  background: radial-gradient(circle at 30% 30%, #93c5fd, transparent 60%),
              radial-gradient(circle at 70% 70%, #a7f3d0, transparent 60%);
  animation: float 8s ease-in-out infinite;
}

.orb-b {
  width: 180px;
  height: 180px;
  right: 0;
  bottom: -10%;
  background: radial-gradient(circle at 30% 30%, #fda4af, transparent 60%),
              radial-gradient(circle at 70% 70%, #fef08a, transparent 60%);
  animation: float 7s ease-in-out -2s infinite;
}

.grid-mesh {
  position: absolute;
  inset: -20%;
  background-image: 
    linear-gradient(transparent 23px, color-mix(in srgb, var(--border) 45%, transparent) 24px),
    linear-gradient(90deg, transparent 23px, color-mix(in srgb, var(--border) 45%, transparent) 24px);
  background-size: 24px 24px;
  mask: radial-gradient(ellipse at 60% 40%, #000 40%, transparent 70%);
  opacity: .7;
}

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

/* ========================================
   SECTIONS
   ======================================== */

.section {
  width: 100%;
  margin: 2.5rem 0;
  padding: 0;
}

.section h3 {
  text-align: center;
  margin-bottom: .25rem;
}

.section-lead {
  color: var(--muted);
  max-width: 60ch;
  margin: 0.25rem auto 1.25rem;
  text-align: center;
}

/* Services & Projects Grid */
.service-list,
.project-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 18px rgba(2,6,23,0.04);
  text-align: left;
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.card h4 {
  margin: 0 0 0.5rem 0;
}

.card p {
  color: var(--muted);
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
}

.card ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
  list-style: disc;
}

.card li {
  margin: 0.3rem 0;
  line-height: 1.4;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  margin-bottom: .75rem;
  font-size: 1.25rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link .card {
  height: 100%;
}

.learn-more {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.learn-more:hover {
  text-decoration: underline;
}

/* ========================================
   ABOUT SECTION
   ======================================== */

.about-section .container {
  text-align: left;
}

.about-section p {
  margin: 0 0 0.8rem 0;
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta {
  padding: 2.5rem 0;
}

.cta-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, 
    color-mix(in srgb, var(--primary) 7%, var(--surface)), 
    var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.cta-inner h3 {
  margin-bottom: 0.5rem;
}

.cta-inner p {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
}

.footer-nav {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.2s;
}

.footer-nav a:hover {
  border-bottom-color: currentColor;
}

/* ========================================
   CONTACT FORM
   ======================================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-form label {
  font-weight: 500;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1000px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  
  .hero-media {
    display: none;
  }
}

@media (max-width: 900px) {
  .service-list,
  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .service-list,
  .project-list {
    grid-template-columns: 1fr;
  }
  
  .top-logo-img {
    height: 40px;
    max-height: 40px;
  }
  
  .hamburger {
    left: 0.5rem;
  }
  
  .contact-bar-btn {
    right: 0.5rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero-inner {
    padding: 0 1rem;
  }
  
  .sidebar {
    width: 80%;
    max-width: 320px;
  }
  
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-nav {
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .btn {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }
  
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
