/* ========================================
   Quartic IT — Style System
   Aesthetic: Dark geometric precision
   ======================================== */

:root {
  /* Palette */
  --bg-deep:    #06090f;
  --bg-base:    #0a0e17;
  --bg-surface: #111827;
  --bg-card:    #151c2c;
  --bg-hover:   #1a2236;

  --text-primary:   #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted:     #4a5568;

  --accent:         #00e5a0;
  --accent-dim:     #00c488;
  --accent-glow:    rgba(0, 229, 160, 0.15);
  --secondary:      #7b61ff;
  --secondary-glow: rgba(123, 97, 255, 0.12);

  --border:       rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Type */
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  /* Spacing */
  --section-pad: clamp(80px, 12vw, 160px);
  --content-max: 1200px;
}

/* ── Reset ─────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img, svg { display: block; }

/* ── Canvas Background ─────────────────── */

#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* ── Navigation ────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 clamp(24px, 4vw, 48px);
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(6, 9, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.logo-q {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 800;
}

.logo-rest {
  color: var(--text-primary);
}

.logo-it {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
  font-size: 0.85em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a {
  transition: color 0.25s;
  position: relative;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  color: var(--accent) !important;
  border: 1px solid rgba(0, 229, 160, 0.3);
  padding: 8px 20px;
  border-radius: 6px;
  transition: all 0.3s !important;
}

.nav-cta:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(6, 9, 15, 0.95);
  backdrop-filter: blur(20px);
  padding: 24px;
  flex-direction: column;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.mobile-menu.open {
  display: flex;
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ── Buttons ───────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 32px;
  border-radius: 8px;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.05rem;
}

/* ── Hero ──────────────────────────────── */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px clamp(24px, 4vw, 48px) 80px;
  overflow: hidden;
}

.hero-content {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.hero-title span {
  display: block;
}

.hero-accent {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  max-width: 540px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 50%;
  max-width: 600px;
  opacity: 0.5;
  z-index: 1;
}

.quartic-curve {
  width: 100%;
  height: auto;
}

.curve-path {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawCurve 3s ease-out 0.8s forwards;
}

.curve-path-2 {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawCurve 3.5s ease-out 1.2s forwards;
}

@keyframes drawCurve {
  to { stroke-dashoffset: 0; }
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  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;
}

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

/* ── Section shared ────────────────────── */

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 16px;
  position: relative;
  padding-left: 24px;
}

.section-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ── Services ──────────────────────────── */

.services {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) clamp(24px, 4vw, 48px);
  max-width: calc(var(--content-max) + 96px);
  margin: 0 auto;
}

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

.service-card {
  background: var(--bg-card);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s;
  cursor: default;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.service-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.card-number {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.service-card:hover .card-icon {
  transform: scale(1.1);
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.service-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.01em;
}

.service-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Approach ──────────────────────────── */

.approach {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.approach-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 48px);
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
}

.approach-item {
  position: relative;
}

.approach-item::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--border-light);
}

.approach-item:last-child::after {
  display: none;
}

.approach-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.25;
  margin-bottom: 16px;
  line-height: 1;
}

.approach-item h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.approach-item p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

@media (max-width: 800px) {
  .approach-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  .approach-item::after { display: none; }
}

@media (max-width: 500px) {
  .approach-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Contact ───────────────────────────── */

.contact {
  position: relative;
  z-index: 1;
  padding: var(--section-pad) clamp(24px, 4vw, 48px);
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
}

.contact .section-header {
  margin-bottom: 40px;
}

.contact .section-tag::before {
  display: none;
}

.contact .section-tag {
  padding-left: 0;
}

.contact-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.contact-actions {
  margin-bottom: 48px;
}

.contact-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Footer ────────────────────────────── */

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 32px clamp(24px, 4vw, 48px);
}

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

.footer-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

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

/* ── Reveal Animations ─────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s,
              box-shadow 0.4s;
}

.service-card.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Utility ───────────────────────────── */

::selection {
  background: var(--accent);
  color: var(--bg-deep);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
