/* ========================================
   Unify Labs — Design Tokens & Reset
   ======================================== */

:root {
  --bg: #060606;
  --text: #fafafa;
  --text-muted: rgba(255,255,255,0.4);
  --accent: #2a6b45;
  --accent-glow: rgba(42,107,69,0.3);
  --surface: rgba(255,255,255,0.04);
  --surface-border: rgba(255,255,255,0.08);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

@property --star-x {
  syntax: '<percentage>';
  inherits: false;
  initial-value: -10%;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ─── Full-page canvas background ─── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}
#bg-canvas canvas {
  display: block;
  width: 100%; height: 100%;
  will-change: transform, opacity;
  transform: translateZ(0);
}

#page-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgb(6 6 6 / var(--overlay-alpha, 0));
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
  pointer-events: none;
  will-change: opacity;
  transition: backdrop-filter 0.6s ease, -webkit-backdrop-filter 0.6s ease;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,0.5) 8%, black 18%, black 82%, rgba(0,0,0,0.5) 92%, transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,0.5) 8%, black 18%, black 82%, rgba(0,0,0,0.5) 92%, transparent 100%);
}

#page-overlay.blurred {
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }

/* ========================================
   Layout
   ======================================== */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  position: relative;
  z-index: 1;
  padding: 160px 0;
}

.nav { z-index: 1000; }
.hero { position: relative; z-index: 1; }
.footer { position: relative; z-index: 1; background: var(--bg); }

/* ========================================
   Typography
   ======================================== */

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(42,107,69,0.15);
}

.section-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 40px;
}

/* ========================================
   Nav
   ======================================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
  background: transparent;
  backdrop-filter: blur(16px);
}

.nav::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: calc(100% + 120px);
  background: linear-gradient(to bottom, rgba(6,6,6,0.8) 0%, rgba(6,6,6,0.4) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: -1;
}

.nav.scrolled::after {
  opacity: 1;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1001;
}

.nav-wordmark {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.nav-links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav-cta {
  padding: 8px 20px;
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  color: var(--text) !important;
  transition: background 0.2s, border-color 0.2s;
}

.nav-cta:hover {
  background: var(--surface);
  border-color: rgba(255,255,255,0.15);
}

.nav-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s, opacity 0.3s;
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 22vh;
  pointer-events: none;
  z-index: 10;
  will-change: transform, opacity;
}

.hero-title {
  text-align: center;
  line-height: 1;
}

.hero-title-main {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 6rem);
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 0 60px var(--accent-glow);
}

.hero-title-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.7rem, 1.2vw, 1rem);
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.6rem;
}


.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 10;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ─── Shooting star dividers ─── */
.section::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 60%);
  height: 3px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  --star-x: -10%;
  background:
    radial-gradient(circle 4px at var(--star-x) 50%,
      #9bffb8 0%, #5cb97a 40%, transparent 100%),
    linear-gradient(90deg,
      transparent 0%,
      transparent calc(var(--star-x) - 15%),
      rgba(92,185,122,0.25) calc(var(--star-x) - 8%),
      rgba(92,185,122,0.5) calc(var(--star-x) - 2%),
      #5cb97a var(--star-x),
      transparent calc(var(--star-x) + 1%));
}

.section.star-fired::before {
  opacity: 1;
  animation: shootingStar 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.contact::before { display: none; }

@keyframes shootingStar {
  0%   { --star-x: -5%; opacity: 0; }
  5%   { opacity: 1; }
  85%  { opacity: 1; }
  100% { --star-x: 105%; opacity: 0; }
}

.section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 60%);
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(42,107,69,0.15) 20%,
    rgba(42,107,69,0.4) 50%,
    rgba(42,107,69,0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(42,107,69,0.2), 0 0 30px rgba(42,107,69,0.08);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.section.star-fired::after {
  clip-path: inset(0 0% 0 0);
}

.contact::after {
  display: none;
}

/* hero::after removed — #page-overlay handles darkening */

/* ========================================
   About
   ======================================== */

.about .container {
  max-width: 720px;
  text-align: center;
}

.about .section-heading {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

.about-body {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: rgba(255,255,255,0.6);
  line-height: 1.8;
}

/* ========================================
   Services — Card Grid
   ======================================== */

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

.card {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, rgba(42,107,69,0.25), rgba(255,255,255,0.06) 50%, rgba(42,107,69,0.12)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 36px 28px;
  will-change: transform;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.4s ease, border-color 0.3s, background 0.3s;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-4px) scale(1.01);
}

.card-icon {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.card-body {
  font-size: 0.925rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

/* ========================================
   Approach
   ======================================== */

.approach-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-left: 60px;
}

.approach-timeline-line {
  position: absolute;
  left: 19px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
    transparent, rgba(42,107,69,0.4) 10%,
    rgba(42,107,69,0.4) 90%, transparent);
}

.approach-item {
  position: relative;
  padding: 0;
}

.approach-marker {
  position: absolute;
  left: -60px;
  top: 4px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(42,107,69,0.1);
  border: 1px solid rgba(42,107,69,0.3);
  border-radius: 50%;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.approach-content {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 28px;
  transition: transform 0.3s ease, background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.approach-item:hover .approach-content {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  transform: translateX(4px);
  box-shadow: 0 0 24px rgba(42,107,69,0.12);
}

.approach-item:hover .approach-marker {
  background: rgba(42,107,69,0.2);
  border-color: rgba(42,107,69,0.6);
  box-shadow: 0 0 12px rgba(42,107,69,0.3);
}

.approach-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.approach-body {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
}

/* ========================================
   Work
   ======================================== */

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

.work-card {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, rgba(42,107,69,0.25), rgba(255,255,255,0.06) 50%, rgba(42,107,69,0.12)) border-box;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.4s ease, border-color 0.3s;
}

.work-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-4px) scale(1.01);
}

.work-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.work-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
}

.work-card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.badge-live {
  background: rgba(42,107,69,0.2);
  color: #5cb97a;
}

.badge-dev {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.work-card-body {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  flex: 1;
}

.work-card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.work-card-tech span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: 4px;
}

.work-card-teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
}

.work-card-teaser-text {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.work-card-teaser-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.25);
  margin-top: 8px;
}

/* ========================================
   Contact
   ======================================== */

.contact .container {
  max-width: 640px;
}

.contact-intro {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 40px;
  line-height: 1.7;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}

.form-group input,
.form-group textarea {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  transition: border-color 0.2s;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
}

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

.btn-submit {
  align-self: flex-start;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  transition: background 0.2s, transform 0.1s;
}

.btn-submit:hover {
  background: #348a58;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.form-status {
  font-size: 14px;
  min-height: 20px;
}

.form-status.success { color: #5cb97a; }
.form-status.error { color: #e05555; }

/* ========================================
   Footer
   ======================================== */

.footer {
  border-top: 1px solid var(--surface-border);
  padding: 48px 0;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-wordmark {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
}

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

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.2);
}

/* ========================================
   Responsive — Tablet (< 1024px)
   ======================================== */

@media (max-width: 1024px) {
  .card-grid,
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }

  .approach-timeline {
    padding-left: 48px;
  }

  .approach-marker {
    left: -48px;
    width: 36px; height: 36px;
  }

  .approach-timeline-line {
    left: 17px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Responsive — Mobile (< 640px)
   ======================================== */

@media (max-width: 640px) {
  .section {
    padding: 100px 0;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(6,6,6,0.95);
    backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 18px;
    color: var(--text);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .card-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .approach-timeline {
    padding-left: 48px;
  }

  .approach-marker {
    left: -48px;
    width: 36px; height: 36px;
    font-size: 11px;
  }

  .approach-timeline-line {
    left: 17px;
  }

  .approach-content {
    padding: 20px;
  }

  .form-group input,
  .form-group textarea {
    font-size: 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .scroll-cue {
    animation: none;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .section::after { clip-path: none; transition: none; }
  .section::before { display: none; }
}
