/* PHD Software — light, clean, high-tech.
   Rebuild from dark → light with real motion. Zero external assets beyond fonts. */

:root {
  /* Palette */
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-tint: #eef1f9;
  --line: #e5e8f2;
  --line-soft: #edeff7;
  --ink: #0b1020;
  --ink-2: #1e2340;
  --ink-3: #4a5170;
  --muted: #7b83a3;
  --brand: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #a855f7;
  --grad-1: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --grad-2: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  --grad-3: linear-gradient(135deg, #22d3ee 0%, #6366f1 60%, #a855f7 100%);
  --ring: 0 0 0 1px rgba(99,102,241,.15);
  --shadow-sm: 0 1px 2px rgba(11,16,32,.04), 0 2px 6px rgba(11,16,32,.05);
  --shadow-md: 0 4px 14px rgba(11,16,32,.06), 0 12px 32px rgba(11,16,32,.06);
  --shadow-lg: 0 12px 40px rgba(99,102,241,.14), 0 4px 12px rgba(11,16,32,.06);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --container: 1200px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
img, svg { display: block; }

/* ─────────────────────────────────────────────
   Background canvases (hero grid + soft aurora)
   ────────────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(99,102,241,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.06) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 45%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 45%, transparent 85%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 800px 500px at 15% 10%, rgba(99,102,241,.12), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 5%, rgba(34,211,238,.10), transparent 60%),
    radial-gradient(ellipse 900px 600px at 50% 100%, rgba(168,85,247,.08), transparent 60%);
  animation: glow-drift 22s ease-in-out infinite alternate;
}
@keyframes glow-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}

/* Hero canvas particles */
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* Cursor spotlight */
.spotlight {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 30%),
              rgba(99,102,241,.10), transparent 60%);
  transition: background .15s var(--ease);
}

/* ─────────────────────────────────────────────
   Header
   ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 16px 40px;
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 18px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #eef1ff, #e0f7fa);
  box-shadow: var(--ring);
}
.brand-accent { background: var(--grad-1); -webkit-background-clip: text; background-clip: text; color: transparent; }

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  position: relative;
  font-size: 14px; font-weight: 500; color: var(--ink-3);
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--grad-1);
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .3s var(--ease-out);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px; padding: 8px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--ink);
  border-radius: 1px; margin: 4px 0; transition: transform .3s var(--ease);
}

/* ─────────────────────────────────────────────
   Buttons
   ────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
  overflow: hidden;
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
  color: white;
  background: var(--grad-1);
  box-shadow: 0 10px 22px rgba(99,102,241,.28), 0 2px 6px rgba(99,102,241,.16);
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: var(--grad-2);
  opacity: 0; transition: opacity .3s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(99,102,241,.32); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary > * { position: relative; z-index: 1; }

.btn-ghost {
  color: var(--ink);
  background: white;
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ─────────────────────────────────────────────
   Layout / helpers
   ────────────────────────────────────────────── */
main { display: block; }
section { padding: 100px 40px; }
.section-head {
  max-width: 720px; margin: 0 auto 56px; text-align: center;
}
.section-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 4.2vw, 46px); font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 12px 0 14px;
  color: var(--ink);
}
.section-head p { color: var(--ink-3); font-size: 17px; margin: 0; }
.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(99,102,241,.08);
  color: var(--brand);
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   Hero
   ────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 90px 40px 130px;
  overflow: hidden;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 980px; margin: 0 auto; text-align: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px; border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.7);
  animation: pulse 1.8s var(--ease-out) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(40px, 6.4vw, 80px);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.035em;
  margin: 26px 0 24px;
  color: var(--ink);
}
.grad, .grad2, .grad3 {
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: grad-shift 8s ease-in-out infinite;
}
.grad  { background-image: linear-gradient(90deg,#6366f1,#22d3ee,#6366f1); }
.grad2 { background-image: linear-gradient(90deg,#a855f7,#ec4899,#a855f7); animation-delay: -3s; }
.grad3 { background-image: linear-gradient(90deg,#22d3ee,#10b981,#22d3ee); animation-delay: -6s; }
@keyframes grad-shift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.lede {
  max-width: 720px; margin: 0 auto 36px;
  font-size: 18px; color: var(--ink-3); line-height: 1.6;
}
.hero-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 64px auto 0;
  max-width: 820px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-stats div { text-align: center; }
.hero-stats dt {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700; letter-spacing: -0.02em;
  background: var(--grad-1); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats dd { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ─────────────────────────────────────────────
   Section reveal (JS toggles .in-view)
   ────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .05s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .12s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .19s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .26s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .33s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .40s; }
.reveal-stagger.in-view > *:nth-child(7) { transition-delay: .47s; }
.reveal-stagger.in-view > *:nth-child(8) { transition-delay: .54s; }
.reveal-stagger.in-view > * { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────────
   Services
   ────────────────────────────────────────────── */
.services { background: var(--bg-soft); }
.service-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
  position: relative;
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s var(--ease-out);
  will-change: transform;
  overflow: hidden;
}
.service-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(500px circle at var(--px,50%) var(--py,50%),
              rgba(99,102,241,.10), transparent 55%);
  opacity: 0; transition: opacity .35s var(--ease-out);
  pointer-events: none;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,.30); }
.service-card:hover::before { opacity: 1; }
.service-card.featured {
  background: linear-gradient(180deg, #ffffff 0%, #f6f7ff 100%);
}
.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.10), rgba(34,211,238,.10));
  color: var(--brand);
  margin-bottom: 20px;
  transition: transform .5s var(--ease-out);
}
.service-card:hover .service-icon { transform: rotate(-8deg) scale(1.08); }
.service-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.service-card p { margin: 0 0 16px; color: var(--ink-3); font-size: 15px; }
.service-card ul { margin: 0; padding-left: 18px; color: var(--ink-3); font-size: 14px; }
.service-card li { margin: 6px 0; }

/* ─────────────────────────────────────────────
   Products
   ────────────────────────────────────────────── */
.product-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.product-card {
  position: relative;
  padding: 26px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
  overflow: hidden;
}
.product-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--px,50%) var(--py,50%),
              rgba(99,102,241,.10), transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease-out);
  pointer-events: none;
}
.product-card:hover::before { opacity: 1; }
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,.35);
  box-shadow: var(--shadow-lg);
}
.product-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  margin-bottom: 14px;
  color: white;
  background: var(--grad-1);
}
.product-icon.habitron { background: linear-gradient(135deg,#10b981,#22d3ee); }
.product-icon.pdf { background: linear-gradient(135deg,#ef4444,#f97316); }
.product-icon.talents { background: linear-gradient(135deg,#6366f1,#a855f7); }
.product-icon.ember { background: linear-gradient(135deg,#f43f5e,#a855f7); }
.product-icon.paw { background: linear-gradient(135deg,#6366f1,#22d3ee); }
.product-icon.paws { background: linear-gradient(135deg,#22d3ee,#10b981); }
.product-icon.vpn { background: linear-gradient(135deg,#0ea5e9,#6366f1); }
.product-icon.more-icon { background: linear-gradient(135deg,#a855f7,#ec4899); }
.product-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(99,102,241,.08);
  color: var(--brand);
  margin-bottom: 10px;
}
.product-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  margin: 4px 0 8px;
}
.product-card p { margin: 0 0 16px; color: var(--ink-3); font-size: 14px; line-height: 1.55; }
.product-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.product-card.more { background: linear-gradient(160deg, #f5f6ff, #ffffff); }
.more-link { color: var(--brand); font-weight: 600; }

/* ─────────────────────────────────────────────
   About
   ────────────────────────────────────────────── */
.about { background: var(--bg-soft); }
.about-grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center;
}
.about-copy h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.02em;
  margin: 12px 0 16px;
}
.about-copy p { color: var(--ink-3); font-size: 17px; margin: 0 0 16px; }
.about-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.about-tags span {
  padding: 8px 14px; border-radius: 999px;
  background: white; border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; color: var(--ink-3);
}
.about-card {
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.about-card::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--grad-1); opacity: .14; filter: blur(30px);
}
.about-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 700; margin: 0 0 18px;
}
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding: 10px 0 10px 32px;
  font-size: 15px; color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: ''; position: absolute; left: 0; top: 14px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad-1);
  box-shadow: 0 0 0 4px rgba(99,102,241,.10);
}
.check-list li::after {
  content: ''; position: absolute; left: 5px; top: 18px;
  width: 10px; height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
}

/* ─────────────────────────────────────────────
   Contact — FIXED grid so email / hours can't overlap
   ────────────────────────────────────────────── */
.contact { background: var(--bg); }
.contact-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px;
  align-items: start;
}
.contact-copy h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -0.02em;
  margin: 12px 0 14px;
}
.contact-copy p { color: var(--ink-3); font-size: 17px; }
.contact-details {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}
.contact-details h4 {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 8px;
}
.contact-details p, .contact-details a {
  font-size: 14px; color: var(--ink-2); margin: 0;
  line-height: 1.5; word-break: break-word;
}
.contact-details a:hover { color: var(--brand); }
.contact-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 32px;
  display: grid; gap: 18px;
}
.field { display: grid; gap: 6px; }
.field label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase;
}
.field input, .field select, .field textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  font-family: inherit; font-size: 15px; color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-note {
  margin: 6px 0 0;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(16,185,129,.08); color: #047857;
  font-size: 14px; font-weight: 500;
}

/* ─────────────────────────────────────────────
   Footer
   ────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(180deg, #0b1020 0%, #131936 100%);
  color: rgba(255,255,255,.72);
  padding: 60px 40px 30px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.6), transparent);
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start;
}
.footer-tag { color: rgba(255,255,255,.5); font-size: 13px; margin: 8px 0 0; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: rgba(255,255,255,.72); font-size: 14px; }
.footer-links a:hover { color: white; }
.copy {
  grid-column: 1 / -1;
  padding-top: 24px; margin: 40px 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; color: rgba(255,255,255,.5);
  text-align: center;
}
.site-footer .brand-name { color: white; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; }

/* ─────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */
@media (max-width: 960px) {
  .service-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  section { padding: 72px 20px; }
  .site-header { padding: 12px 20px; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: white; flex-direction: column; gap: 0; padding: 8px 20px 16px;
    border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a::after { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-header .btn { display: none; }
  .hero { padding: 60px 20px 90px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .service-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .contact-details { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; }
}
