/* ==========================================================================
   Valcode — Main Stylesheet
   Color scheme derived from Logo.png: steel blue, deep navy, silver grey
   ========================================================================== */

/* ——— CSS Custom Properties (Theming) ——— */
:root {
  /* Colors */
  --color-primary:    #406080;
  --color-primary-hover: #4d7499;
  --color-dark:       #202040;
  --color-darkest:    #000020;
  --color-bg:         #f4f4f6;
  --color-bg-alt:     #e8e8ec;
  --color-bg-card:    #ffffff;
  --color-accent:     #206080;
  --color-accent-glow: rgba(32, 96, 128, 0.15);
  --color-text:       #1a1a2e;
  --color-text-muted: #5a5a7a;
  --color-text-light: rgba(255, 255, 255, 0.85);
  --color-border:     rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --container-max: 1100px;
  --container-pad: 1.5rem;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

img {
  max-width: none;
  height: auto;
  display: block;
}

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

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

/* ——— Utility ——— */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* ——— Section Heading ——— */
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-darkest);
  margin-bottom: var(--space-3xl);
}

.section-heading--light {
  color: #fff;
}

.section-heading--light .section-heading__overline {
  color: rgba(255, 255, 255, 0.6);
}

.section-heading--center {
  text-align: center;
}

.section-heading__overline {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.85em 1.6em;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--primary:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--color-accent-glow);
}

.btn--large {
  font-size: 1.15rem;
  padding: 1em 2.2em;
}

.btn__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

.btn:hover .btn__arrow {
  transform: translateY(3px);
}

.btn--large:hover .btn__arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.nav--scrolled {
  background: rgba(0, 0, 32, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: var(--space-sm) 0;
}

.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo img {
  height: 100px;
  width: auto;
}

.nav__links {
  list-style: none;
  display: flex;
  gap: var(--space-xl);
}

.nav__links a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out-expo);
}

.nav__links a:hover,
.nav__links a.nav--active {
  color: #fff;
}

.nav__links a:hover::after,
.nav__links a.nav--active::after {
  width: 100%;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-darkest);
  overflow: hidden;
  padding: var(--space-4xl) 0;
}

/* Background grid pattern */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 96, 128, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 96, 128, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 70%);
}

.hero__gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(32, 96, 128, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(64, 96, 128, 0.08) 0%, transparent 50%);
}

/* Hero content */
.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  padding: 0 var(--container-pad);
  animation: hero-fade-in 0.8s var(--ease-out-expo) both;
}

@keyframes hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__logo {
  margin-bottom: var(--space-3xl);
  animation: hero-logo-in 0.8s var(--ease-out-expo) 0.1s both;
}

@keyframes hero-logo-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hero__logo img {
  margin: 0 auto;
  height: 300px;
  width: auto;
}

.hero__tagline {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: var(--space-lg);
  animation: hero-fade-in 0.8s var(--ease-out-expo) 0.2s both;
}

.hero__tagline-accent {
  color: var(--color-accent);
  /* Gradient text fallback for browsers that support it */
  background: linear-gradient(135deg, #4080b0, #206080);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.2rem;
  color: var(--color-text-light);
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
  animation: hero-fade-in 0.8s var(--ease-out-expo) 0.3s both;
}

.hero__separator {
  position: absolute;
  bottom: -0.5px;
  left: 0;
  right: 0;
  z-index: 2;
  line-height: 0;
}

.hero__separator svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Services
   ========================================================================== */
.services {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--space-2xl);
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  border-color: rgba(64, 96, 128, 0.2);
}

.service-card__icon {
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
}

.service-card__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-darkest);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.service-card__desc {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ==========================================================================
   About
   ========================================================================== */
.about {
  position: relative;
  padding: var(--space-4xl) 0;
  background: var(--color-darkest);
  overflow: hidden;
}

.about__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.about__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.08;
  filter: grayscale(0.6);
}

.about__bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 32, 0.95) 0%,
    rgba(0, 0, 32, 0.75) 50%,
    rgba(0, 0, 32, 0.95) 100%
  );
}

.about__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4xl);
  align-items: center;
}

.about__text {
  color: var(--color-text-light);
}

.about__text p {
  margin-bottom: var(--space-md);
  font-size: 1.05rem;
}

.about__text p:last-child {
  margin-bottom: 0;
}

/* Code block visual (decorative) */
.about__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(64, 96, 128, 0.2);
  border-radius: 10px;
  padding: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: #a0bdd0;
  overflow-x: auto;
  white-space: pre;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.code-keyword { color: #7aa2f7; }
.code-func    { color: #9ece6a; }
.code-string  { color: #e0af68; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: var(--space-4xl) 0;
  background: var(--color-bg);
}

.contact__inner {
  text-align: center;
  max-width: 600px;
}

.contact__text {
  color: var(--color-text-muted);
  font-size: 1.15rem;
  margin-bottom: var(--space-2xl);
}

.contact__location {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2xl);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--color-darkest);
  padding: var(--space-xl) 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer__copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer__version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Scroll-triggered animations (via Intersection Observer in JS)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

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

/* Stagger children */
.reveal--stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
}

.reveal--stagger.reveal--visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal--stagger.reveal--visible > *:nth-child(2) { transition-delay: 0.15s; }
.reveal--stagger.reveal--visible > *:nth-child(3) { transition-delay: 0.25s; }
.reveal--stagger.reveal--visible > * { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --space-4xl: 4rem;
  }

  .nav__links {
    gap: var(--space-md);
  }

  .nav__links a {
    font-size: 0.8rem;
  }

  .hero {
    min-height: auto;
    padding: 120px 0 var(--space-4xl);
  }

  .hero__tagline {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__logo img {
    height: 200px;
  }

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

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .about__visual {
    order: -1;
  }

  .code-block {
    font-size: 0.7rem;
    padding: var(--space-md);
  }

  .section-heading {
    font-size: 1.75rem;
    margin-bottom: var(--space-2xl);
  }

  .contact__text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .hero__tagline {
    font-size: 1.5rem;
  }

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