:root {
  --blue-600: #0046FF;
  --blue-700: #001BB7;
  --blue-50: #F5F1DC;
  --accent-600: #FF8040;
  --text-900: #0b1220;
  --text-600: #334155;
  --white: #ffffff;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-900);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.site-header { position: sticky; top: 0; background: var(--white); border-bottom: 1px solid var(--border); z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo-img { display: block; height: clamp(68px, 8.7vw, 72px); width: auto; }
.nav { display: flex; align-items: center; }
.nav a { margin-left: 20px; text-decoration: none; color: var(--text-900); font-weight: 600; }
.nav a:hover { color: var(--accent-600); }
/* Active nav state */
.nav a.active, .nav a[aria-current="page"] { color: var(--accent-600); }
.nav .btn { margin-left: 24px; }
.nav .btn.btn-outline.active, .nav .btn.btn-outline[aria-current="page"] { border-color: var(--accent-600); color: var(--accent-600); }
.nav-toggle { display: none; height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); color: var(--text-900); cursor: pointer; font-weight: 600; }

.hero { background: var(--white); }
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; padding: 64px 0; align-items: center; }
.hero h1 { font-size: 42px; line-height: 1.1; margin: 0 0 16px; }
.hero p { color: var(--text-600); margin: 0 0 24px; }

.cta-group { display: flex; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--blue-600); color: var(--white); }
.btn-primary:hover { background: var(--blue-700); }
.btn-outline { border-color: var(--blue-600); color: var(--blue-700); }
.btn-ghost { background: transparent; color: var(--blue-700); }

.hero-art { display: flex; align-items: center; justify-content: center; }
.card { width: 100%; max-width: 420px; height: 280px; border-radius: 16px; background: var(--white); box-shadow: 0 10px 30px rgba(8, 87, 204, 0.15); border: 1px solid var(--border); padding: 20px; }
.card-line { height: 16px; background: var(--blue-50); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 12px; }
.card-line:nth-child(1) { width: 60%; }
.card-line:nth-child(2) { width: 80%; }
.card-line:nth-child(3) { width: 40%; }
.card-line:nth-child(4) { width: 70%; }
.card-line:nth-child(5) { width: 50%; }

.section { padding: 64px 0; }
.section h2 { margin: 0 0 24px; font-size: 28px; position: relative; }
.section h2::after { content: ""; display: block; width: 48px; height: 3px; background: var(--accent-600); border-radius: 2px; margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

/* FAQ styles */
.faq { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--white); transition: border-color 200ms ease, box-shadow 200ms ease; }
.faq-item summary { font-weight: 600; color: var(--blue-700); cursor: pointer; list-style: none; display: flex; align-items: center; }
/* Hide default marker and use custom icon */
summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "▸"; display: inline-block; width: 16px; margin-right: 8px; color: var(--text-600); transform: rotate(0deg); transition: transform 200ms ease, color 200ms ease; }
.faq-item[open] summary::before { transform: rotate(90deg); color: var(--accent-600); }
.faq-content { height: 0; overflow: hidden; opacity: 0; transform: translateY(-2px); transition: height 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease, transform 420ms ease; will-change: height, opacity, transform; }
.faq-item[open] .faq-content { opacity: 1; transform: translateY(0); }

/* Back to Top button */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--accent-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms ease, transform 280ms ease, background-color 200ms ease;
  pointer-events: none;
}
.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
.back-to-top:hover {
  transform: translateY(0) scale(1.04);
}
.back-to-top svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .back-to-top { width: 40px; height: 40px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .back-to-top svg { width: 18px; height: 18px; }
}
.faq-item[open], .faq-item:hover, .faq-item:focus-within { border-color: var(--accent-600); box-shadow: 0 6px 14px rgba(0, 70, 255, 0.08); }
.faq-item p { color: var(--text-600); margin: 8px 0 0; }

.service, .project { border: 1px solid var(--border); border-radius: 12px; padding: 20px; background: var(--white); }
.project { transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease; will-change: transform, box-shadow; transform: translateY(0) scale(1); box-shadow: 0 0 0 rgba(0, 70, 255, 0); }
.service { transition: transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease; will-change: transform, box-shadow; transform: translateY(0) scale(1); box-shadow: 0 0 0 rgba(0, 70, 255, 0); }
.service:hover,
.service:focus-within { transform: translateY(-1px) scale(1.015); box-shadow: 0 6px 14px rgba(0, 70, 255, 0.10); border-color: var(--accent-600); }
.service h3, .project h3 { margin: 0 0 8px; font-size: 18px; color: var(--blue-700); }
.service p, .project p { margin: 0; color: var(--text-600); }
.project-thumb { height: 120px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); margin-bottom: 12px; }

.section-alt { background: var(--blue-50); }

.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.stats { list-style: none; margin: 0; padding: 0; }
.stats li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stat { display: inline-block; min-width: 64px; text-align: center; padding: 8px 12px; background: var(--white); color: var(--blue-700); border: 1px solid var(--border); border-radius: 8px; font-weight: 700; }

.section-cta { background: var(--white); }
.contact-form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; transition: border-color 200ms ease, box-shadow 200ms ease; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent-600); outline: none; box-shadow: 0 0 0 3px rgba(255, 128, 64, 0.20); }
.contact-form input:focus-visible, .contact-form textarea:focus-visible { border-color: var(--accent-600); outline: none; box-shadow: 0 0 0 3px rgba(255, 128, 64, 0.20); }
.contact-form button { justify-self: start; }

.site-footer { border-top: 1px solid var(--border); background: var(--white); margin-top: auto;}
.footer-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.footer-links a { margin-left: 16px; text-decoration: none; color: var(--text-600); position: relative; transition: color 250ms ease; }
.footer-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent-600); transition: width 250ms ease; }
.footer-links a:hover { color: var(--accent-600); }
.footer-links a:hover::after { width: 100%; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .header-inner { height: auto; padding: 12px 0; position: relative; }
  .nav-toggle { display: inline-block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); display: none; flex-direction: column; padding: 8px 16px; }
  .nav.open { display: flex; }
  .nav a { margin: 8px 0; }
  .nav .btn { margin-left: 0; }
  .hero-inner { padding-top: 80px; }
  .cta-group { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .cta-group .btn { width: 100%; }
  .btn-ghost { border-color: var(--border); }
  .site-footer { padding: 12px 0; }
  .footer-inner { height: auto; padding: 8px 16px; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
  .footer-links { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
  .footer-links a { margin-left: 0; }
}

.anim { opacity: 0; will-change: transform, opacity; }
.anim.is-visible { opacity: 1; }

/* Slide in from bottom */
.anim-slide-in-bottom.is-visible { animation: slide-in-bottom 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
@keyframes slide-in-bottom {
  0% { transform: translateY(60px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Slide in from right */
.anim-slide-in-right.is-visible { animation: slide-in-right 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
@keyframes slide-in-right {
  0% { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Fade in + up */
.anim-fade-in-up.is-visible { animation: fade-in-up 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
@keyframes fade-in-up {
  0% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Simple fade-in (no movement) */
.anim-fade-in.is-visible { animation: fade-in 0.8s ease-out both; }
@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Scale up (for cards/items) */
.anim-scale-up.is-visible { animation: scale-up 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both; }
@keyframes scale-up {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Hover animations for service cards */
@keyframes scale-up-center-hover {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}
@keyframes card-shadow-soft {
  0% { box-shadow: 0 0 0 rgba(0, 70, 255, 0.00); }
  100% { box-shadow: 0 8px 20px rgba(0, 70, 255, 0.14); }
}

/* Slide in forward from center (on-scroll reveal) */
.anim-slide-in-fwd-center.is-visible { animation: slide-in-fwd-center 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
@keyframes slide-in-fwd-center {
  0% { transform: perspective(800px) translateZ(-60px); opacity: 0; }
  100% { transform: perspective(800px) translateZ(0); opacity: 1; }
}

/* Delays to create staggered reveal */
.delay-100.is-visible { animation-delay: 0.10s; }
.delay-200.is-visible { animation-delay: 0.20s; }
.delay-300.is-visible { animation-delay: 0.30s; }
.delay-400.is-visible { animation-delay: 0.40s; }

/* Button hover subtle shadow pop */
.btn { transition: transform 150ms ease; }
.btn:hover { animation: shadow-drop-2-center 0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
@keyframes shadow-drop-2-center {
  0% { box-shadow: 0 0 0 rgba(0, 70, 255, 0.0); }
  100% { box-shadow: 0 10px 20px rgba(0, 70, 255, 0.18); }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1 !important; }
  .anim.is-visible { animation: none !important; }
}

@keyframes slide-fwd-center {
  0% { transform: perspective(800px) translateZ(0) scale(1); }
  100% { transform: perspective(800px) translateZ(100px) scale(1.09); }
}
.hero-art .card:hover { animation: slide-fwd-center 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both; }
.project:hover, .project:focus-within { transform: translateY(-1px) scale(1.015); box-shadow: 0 6px 14px rgba(0, 70, 255, 0.10); border-color: var(--accent-600); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.page-btn, .page-number {
  height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--white); color: var(--text-900); cursor: pointer; font-weight: 600;
}
.page-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.page-number[aria-current="page"] { background: var(--blue-600); color: var(--white); border-color: var(--blue-600); }
/* Responsive enhancements */
.hero h1 { font-size: clamp(24px, 4.5vw, 42px); }
@media (max-width: 900px) {
  .container { padding: 0 16px; }
}

/* Limit hero-card hover effect on small screens or coarse pointers */
@media (max-width: 900px), (pointer: coarse) {
  .hero-art { overflow: visible; }
  .hero-art .card { max-width: min(420px, 90vw); transform: none; transform-origin: center; transition: transform 180ms ease, box-shadow 180ms ease; }
  .hero-art .card:hover { animation: none !important; transform: scale(1.03); box-shadow: 0 12px 28px rgba(8, 87, 204, 0.18); }
}
