/* ==========================================================================
   Base8-Algo — styles
   ========================================================================== */

:root {
  --c-light: #f6f7eb;
  --c-accent: #e94f37;
  --c-dark: #393e41;
  --c-blue: #3f88c5;
  --c-teal: #44bba4;

  --bg-base: #202225;
  --bg-raised: #2a2d31;
  --bg-raised-2: #33373b;
  --border-soft: rgba(246, 247, 235, 0.1);
  --text-main: var(--c-light);
  --text-muted: rgba(246, 247, 235, 0.65);

  --font-heading: "Red Hat Display", sans-serif;
  --font-body: "Work Sans", sans-serif;

  --container-width: 1180px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--c-light);
  margin: 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 28px;
}

.text-accent {
  color: var(--c-accent);
}

.text-blue {
  color: var(--c-blue);
}

.text-teal {
  color: var(--c-teal);
}

/* -------------------- Reveal-on-scroll -------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------------------- Shared section bits -------------------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-teal);
  margin-bottom: 18px;
}
.section-label::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--c-accent);
  display: inline-block;
}

.section-title {
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: 20px;
}

.section-subtitle {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.section-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}

.section-heading {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 64px;
}
.section-heading .section-text {
  max-width: 620px;
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 32px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--c-accent);
  color: var(--c-light);
  box-shadow: 0 8px 24px rgba(233, 79, 55, 0.35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(233, 79, 55, 0.45);
}
.btn-primary:active {
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-main);
}
.btn-ghost:hover {
  border-color: var(--c-teal);
  color: var(--c-teal);
  transform: translateY(-3px);
}

.btn-block {
  width: 100%;
  border: none;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.scrolled {
  padding: 12px 0;
  background: rgba(32, 34, 37, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-soft);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-blue));
  color: var(--c-light);
  font-weight: 900;
  font-size: 1.15rem;
  transform: rotate(-6deg);
  flex-shrink: 0;
}

.logo-accent {
  color: var(--c-accent);
}

.logo-secondary {
  color: var(--c-teal);
}

.logo-highlight {
  color: var(--c-blue);
}

.logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover {
  color: var(--c-light);
}
.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: var(--c-light);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 20%, #2c343a 0%, var(--bg-base) 55%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(32, 34, 37, 0.1) 0%, rgba(32, 34, 37, 0.55) 78%, var(--bg-base) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  padding-top: 110px;
  padding-bottom: 90px;
}

.hero-title {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 900;
  max-width: 880px;
  margin-bottom: 26px;
  letter-spacing: -0.02em;
}

.hero-text {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--border-soft);
  border-radius: 20px;
  z-index: 3;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-teal);
  transform: translateX(-50%);
  animation: scroll-cue-move 1.8s ease-in-out infinite;
}
@keyframes scroll-cue-move {
  0% { top: 8px; opacity: 1; }
  70% { top: 22px; opacity: 0.4; }
  100% { top: 8px; opacity: 1; }
}

/* ==========================================================================
   Services
   ========================================================================== */
.services {
  position: relative;
  padding: 130px 0;
  background: var(--bg-base);
}

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

.tile {
  position: relative;
  height: 220px;
  border-radius: var(--radius-md);
  perspective: 1200px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.tile-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  backface-visibility: hidden;
  transition: transform 0.6s var(--ease), opacity 0.5s var(--ease);
}

.tile-front {
  align-items: flex-start;
  gap: 18px;
}

.tile-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(233, 79, 55, 0.12);
  color: var(--c-accent);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.4s var(--ease);
}
.tile-icon svg {
  width: 26px;
  height: 26px;
}

.tile-front h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.tile-back {
  transform: translateY(100%);
  background: linear-gradient(135deg, var(--c-blue), var(--c-teal));
  justify-content: center;
}
.tile-back p {
  color: var(--c-dark);
  font-weight: 500;
  font-size: 0.98rem;
}

.tile:hover .tile-front,
.tile:focus-within .tile-front {
  transform: translateY(-100%);
  opacity: 0;
}
.tile:hover .tile-back,
.tile:focus-within .tile-back {
  transform: translateY(0);
}
.tile:hover .tile-icon {
  background: var(--c-accent);
  color: var(--c-light);
  transform: scale(1.08) rotate(-6deg);
}
.tile:nth-child(4n+2) .tile-back { background: linear-gradient(135deg, var(--c-accent), var(--c-blue)); }
.tile:nth-child(4n+3) .tile-back { background: linear-gradient(135deg, var(--c-teal), var(--c-accent)); }
.tile:nth-child(4n+3) .tile-back p,
.tile:nth-child(4n+2) .tile-back p { color: var(--c-light); }

.tile {
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.tile:hover {
  transform: translateY(-6px);
  border-color: rgba(246, 247, 235, 0.25);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   About
   ========================================================================== */
.about {
  padding: 130px 0;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 70px;
  align-items: center;
}

.about-stats {
  display: flex;
  gap: 42px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--c-teal);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.about-visual {
  position: relative;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--border-soft);
  animation: spin linear infinite;
}
.ring-1 {
  width: 300px;
  height: 300px;
  animation-duration: 30s;
  border-color: rgba(63, 136, 197, 0.35);
}
.ring-2 {
  width: 220px;
  height: 220px;
  animation-duration: 22s;
  animation-direction: reverse;
  border-color: rgba(68, 187, 164, 0.4);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.orbit-core {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--c-light);
  box-shadow: 0 25px 60px rgba(233, 79, 55, 0.35);
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  padding: 130px 0;
  background: var(--bg-base);
}

.contact-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 70px;
  align-items: start;
}

.contact-copy {
  position: sticky;
  top: 140px;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 44px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-row-full {
  grid-column: 1 / -1;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.req {
  color: var(--c-accent);
}
.optional {
  font-weight: 400;
  color: rgba(246, 247, 235, 0.4);
}

.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-main);
  background: var(--bg-raised-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 13px 16px;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.form-row input::placeholder,
.form-row textarea::placeholder {
  color: rgba(246, 247, 235, 0.35);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(68, 187, 164, 0.18);
  background: var(--bg-raised);
}
.form-row input.is-invalid,
.form-row textarea.is-invalid {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(233, 79, 55, 0.16);
}

.form-status {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 1.2em;
  color: var(--c-teal);
}
.form-status.error {
  color: var(--c-accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--border-soft);
  padding: 60px 0 26px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  padding-bottom: 40px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.footer-address {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}
.footer-links a:hover {
  color: var(--c-teal);
}

.footer-copy {
  font-size: 0.82rem;
  color: rgba(246, 247, 235, 0.45);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .about-inner,
  .contact-inner {
    grid-template-columns: 1fr;
  }
  .about-visual {
    order: -1;
    height: 260px;
  }
  .contact-copy {
    position: static;
  }
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-raised);
    border-left: 1px solid var(--border-soft);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    padding: 100px 32px;
    z-index: 99;
  }
  .main-nav.is-open {
    transform: translateX(0);
  }
  .main-nav ul {
    flex-direction: column;
    gap: 6px;
  }
  .nav-link {
    display: block;
    padding: 14px 4px;
    font-size: 1.05rem;
  }
  .nav-toggle {
    display: flex;
  }
  .contact-form {
    grid-template-columns: 1fr;
    padding: 30px;
  }
}

@media (max-width: 620px) {
  .tiles-grid {
    grid-template-columns: 1fr;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .about-stats {
    gap: 28px;
  }
  .services, .about, .contact {
    padding: 90px 0;
  }
}
