/* ============================================================
   IDEASTREAM — Design System
   South Africa · Niche Software Development
   Aesthetic: Dark Editorial Luxury + SA Earth Tones
   ============================================================ */

/* --- Google Fonts ---
   Loaded via <link> in HTML:
   - Cormorant Garamond (display serif — hero headlines)
   - Syne (geometric sans — section titles, labels)
   - IBM Plex Sans (technical body copy)
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Palette */
  --bg-deep:        #0A0A0F;
  --bg-surface:     #111118;
  --bg-elevated:    #17171F;
  --bg-card:        #1C1C26;

  --accent:         #C8922A;
  --accent-light:   #DBA63E;
  --accent-dim:     rgba(200, 146, 42, 0.12);
  --accent-glow:    rgba(200, 146, 42, 0.25);

  --text-primary:   #E8E0D4;
  --text-secondary: #9B9585;
  --text-muted:     #5E5A52;
  --text-inverse:   #0A0A0F;

  --border:         #2A2A36;
  --border-light:   #3A3A48;

  --success:        #6BCB77;
  --error:          #E74C3C;

  /* Typography */
  --font-display:   'Cormorant Garamond', Georgia, serif;
  --font-heading:   'Syne', 'Trebuchet MS', sans-serif;
  --font-body:      'IBM Plex Sans', 'Segoe UI', sans-serif;

  /* Spacing */
  --section-pad:    clamp(80px, 12vh, 140px);
  --container:      1140px;
  --gap:            clamp(16px, 2vw, 32px);

  /* Motion */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration:       0.8s;
  --stagger:        0.12s;

  /* Radius */
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      16px;
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--accent-light);
}

::selection {
  background: var(--accent);
  color: var(--text-inverse);
}


/* ============================================================
   UTILITY
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Section numbering accent */
.section-marker {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.section-marker::after {
  content: '';
  height: 1px;
  width: 48px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.section-title span {
  color: var(--accent);
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  position: relative;
}
.divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  background: var(--bg-deep);
}

/* Reveal animation base */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration) var(--ease-out-expo),
              transform var(--duration) var(--ease-out-expo);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   NOISE TEXTURE OVERLAY
   ============================================================ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}


/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: background 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

.site-header.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.3s ease;
}
.logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s var(--ease-out-expo);
}
.nav-links a:hover {
  color: var(--text-primary);
}
.nav-links a:hover::after {
  width: 100%;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.4s var(--ease-out-expo), opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(30px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}
.mobile-nav a:hover {
  color: var(--accent);
}


/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Geometric lattice pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30Z' fill='none' stroke='%23C8922A' stroke-width='0.5'/%3E%3Cpath d='M30 10 L50 30 L30 50 L10 30Z' fill='none' stroke='%23C8922A' stroke-width='0.3'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}

/* Gradient atmosphere overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(200, 146, 42, 0.06), transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(100, 80, 40, 0.04), transparent 60%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(10, 10, 15, 0.8), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 1s var(--ease-out-expo) 0.3s forwards;
}
.hero-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.hero-title .line {
  display: block;
  overflow: hidden;
}

.hero-title .line-inner {
  display: block;
  opacity: 0;
  transform: translateY(100%);
}
.hero-title .line:nth-child(1) .line-inner {
  animation: lineSlideUp 1.2s var(--ease-out-expo) 0.5s forwards;
}
.hero-title .line:nth-child(2) .line-inner {
  animation: lineSlideUp 1.2s var(--ease-out-expo) 0.7s forwards;
}

.hero-title .accent-letter {
  color: var(--accent);
  font-style: italic;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 520px;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 1s var(--ease-out-expo) 1s forwards;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 48px;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 1s var(--ease-out-expo) 1.2s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: var(--accent);
  border: none;
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 146, 42, 0.25);
  color: var(--text-inverse);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
  text-decoration: none;
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: heroReveal 1s var(--ease-out-expo) 1.8s forwards;
  z-index: 1;
}
.hero-scroll span {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}


/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about {
  padding: var(--section-pad) 0;
  position: relative;
}

.about-layout {
  margin-top: 40px;
}

.about-layout .section-title {
  max-width: 720px;
}

.about-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.about-lead {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.8;
}

.about-body p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-body strong {
  color: var(--accent);
  font-weight: 600;
}


/* ============================================================
   SERVICES SECTION
   ============================================================ */
.services {
  padding: var(--section-pad) 0;
  position: relative;
}

.services-intro {
  max-width: 560px;
  margin-bottom: 64px;
}

.services-intro p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(28px, 3vw, 44px);
  position: relative;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out-expo),
              border-color 0.4s ease,
              box-shadow 0.5s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out-expo);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-light);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(200, 146, 42, 0.08);
}
.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.service-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: 2px;
  margin-top: 20px;
}


/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact {
  padding: var(--section-pad) 0;
  position: relative;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.contact-info {
  padding-top: 8px;
}

.contact-info p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-detail-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}
.contact-detail-icon svg {
  width: 100%;
  height: 100%;
}

.contact-detail-text {
  display: flex;
  flex-direction: column;
}

.contact-detail-label {
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.contact-detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Form */
.contact-form-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(28px, 3vw, 44px);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* Turnstile container */
.turnstile-wrapper {
  margin-bottom: 24px;
}

/* Submit */
.form-submit {
  width: 100%;
  padding: 16px 36px;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.form-submit:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 146, 42, 0.25);
}
.form-submit:active {
  transform: translateY(0);
}
.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Status messages */
.form-status {
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}
.form-status.success {
  display: block;
  color: var(--success);
}
.form-status.error {
  display: block;
  color: var(--error);
}
.form-status.sending {
  display: block;
  color: var(--text-muted);
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover {
  color: var(--accent);
}


/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineSlideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.4;
    transform: scaleY(0.6);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delays for service cards */
.service-card:nth-child(1) { transition-delay: 0s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.2s; }
.service-card:nth-child(4) { transition-delay: 0.3s; }

.reveal.stagger-1 { transition-delay: calc(var(--stagger) * 1); }
.reveal.stagger-2 { transition-delay: calc(var(--stagger) * 2); }
.reveal.stagger-3 { transition-delay: calc(var(--stagger) * 3); }
.reveal.stagger-4 { transition-delay: calc(var(--stagger) * 4); }
.reveal.stagger-5 { transition-delay: calc(var(--stagger) * 5); }


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

/* Tablet */
@media (max-width: 900px) {
  .about-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .mobile-nav {
    display: flex;
  }

  .hero-title {
    font-size: clamp(2.6rem, 12vw, 4.5rem);
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
