:root{
  --bg:#fff;
  --text:#111;
  --accent:#8b0000;
  --accent-light:#c41e3a;
  --muted:#666;
  --card:#f8f8f8;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;
  margin:0;
  color:var(--text);
  background:linear-gradient(135deg, #fff 0%, #fef5f5 50%, #fff 100%);
  background-attachment:fixed;
  line-height:1.5;
  overflow-x:hidden
}

.container{max-width:980px;margin:0 auto;padding:20px;width:100%}

.site-header{
  background:rgba(255,255,255,0.95);
  border-bottom:1px solid #eee;
  position:sticky;
  top:0;
  z-index:100;
  backdrop-filter:blur(10px);
  transition:all 0.3s ease;
  box-shadow:0 2px 10px rgba(0,0,0,0)
}

.site-header.scrolled{
  box-shadow:0 2px 10px rgba(0,0,0,0.1);
  background:rgba(255,255,255,0.98)
}

.site-header .container{display:flex;align-items:center;justify-content:space-between}

.brand{
  font-weight:700;
  margin:0;
  font-size:24px;
  background:linear-gradient(135deg, #8b0000 0%, #c41e3a 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:brandPulse 3s ease-in-out infinite
}

@keyframes brandPulse{
  0%, 100%{opacity:1}
  50%{opacity:0.85}
}

.brand .accent{
  color:var(--accent);
  display:inline-block;
  transition:transform 0.3s ease
}

.brand:hover .accent{transform:scale(1.05)}

nav a{
  margin-left:18px;
  color:var(--muted);
  text-decoration:none;
  position:relative;
  padding:4px 0;
  transition:color 0.3s ease;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent
}

nav a::after{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:0;
  height:2px;
  background:var(--accent);
  transition:width 0.3s ease
}

nav a:hover{color:var(--accent)}
nav a:hover::after{width:100%}

.hero{
  padding:60px 0;
  text-align:left;
  opacity:0;
  animation:fadeInUp 0.8s ease forwards;
  animation-delay:0.2s;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:40px;
  align-items:center;
  min-height:400px
}

.hero-content{
  z-index:2
}

.hero-3d{
  position:relative;
  width:100%;
  height:400px;
  z-index:2
}

#hero-canvas{
  width:100%;
  height:100%;
  cursor:grab
}

#hero-canvas:active{
  cursor:grabbing
}

@keyframes fadeInUp{
  from{opacity:0;transform:translateY(30px)}
  to{opacity:1;transform:translateY(0)}
}

.hero h2{
  font-size:32px;
  margin:0 0 10px;
  background:linear-gradient(135deg, #111 0%, #8b0000 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  line-height:1.3
}

.cta{
  display:inline-block;
  padding:12px 24px;
  border-radius:8px;
  background:linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color:#fff;
  text-decoration:none;
  font-weight:600;
  transition:all 0.3s ease;
  box-shadow:0 4px 15px rgba(139,0,0,0.3);
  position:relative;
  overflow:hidden;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  user-select:none
}

.cta::before{
  content:'';
  position:absolute;
  top:0;
  left:-100%;
  width:100%;
  height:100%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition:left 0.5s ease
}

.cta:hover::before{left:100%}

.cta:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 20px rgba(139,0,0,0.4)
}

.cta:active{transform:translateY(0)}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
  margin-top:40px
}

.card{
  background:var(--card);
  padding:24px;
  border-radius:16px;
  box-shadow:0 4px 6px rgba(0,0,0,0.05);
  transition:all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border:1px solid transparent;
  position:relative;
  overflow:hidden;
  opacity:0;
  transform:translateY(20px);
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent
}

.card.visible{
  animation:cardFadeIn 0.6s ease forwards
}

@keyframes cardFadeIn{
  to{opacity:1;transform:translateY(0)}
}

.card::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg, var(--accent), var(--accent-light));
  transform:scaleX(0);
  transition:transform 0.3s ease;
  transform-origin:left
}

.card:hover::before{transform:scaleX(1)}

.card:hover{
  transform:translateY(-8px) scale(1.02);
  box-shadow:0 12px 24px rgba(139,0,0,0.15);
  border-color:rgba(139,0,0,0.1)
}

.card h3{
  margin-top:0;
  color:var(--accent);
  font-size:20px;
  transition:transform 0.3s ease
}

.card:hover h3{transform:translateX(4px)}

.about, .contact{
  margin-top:50px;
  opacity:0;
  transform:translateY(20px)
}

.about.visible, .contact.visible{
  animation:fadeInUp 0.6s ease forwards
}

.about h2, .contact h2{
  color:var(--accent);
  position:relative;
  display:inline-block;
  padding-bottom:8px
}

.about h2::after, .contact h2::after{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:60%;
  height:3px;
  background:linear-gradient(90deg, var(--accent), transparent);
  border-radius:2px
}

.site-footer{
  border-top:1px solid #eee;
  padding:20px 0;
  margin-top:50px;
  color:var(--muted);
  font-size:14px;
  text-align:center;
  background:rgba(248,248,248,0.5)
}

/* Particle canvas background */
#particle-canvas{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:0;
  opacity:0.4
}

/* Floating shapes animation */
.floating-shape{
  position:fixed;
  border-radius:50%;
  opacity:0.05;
  pointer-events:none;
  z-index:1
}

.shape-1{
  width:300px;
  height:300px;
  background:var(--accent);
  top:10%;
  right:5%;
  animation:float 20s ease-in-out infinite
}

.shape-2{
  width:200px;
  height:200px;
  background:var(--accent-light);
  bottom:15%;
  left:10%;
  animation:float 15s ease-in-out infinite reverse
}

@keyframes float{
  0%, 100%{transform:translate(0, 0) rotate(0deg)}
  33%{transform:translate(30px, -30px) rotate(120deg)}
  66%{transform:translate(-20px, 20px) rotate(240deg)}
}

/* Text glow effect for headings */
.hero h2, .about h2, .contact h2{
  text-shadow:0 0 30px rgba(139, 0, 0, 0.3);
  animation:textGlow 3s ease-in-out infinite
}

@keyframes textGlow{
  0%, 100%{text-shadow:0 0 30px rgba(139, 0, 0, 0.3)}
  50%{text-shadow:0 0 40px rgba(139, 0, 0, 0.5), 0 0 60px rgba(139, 0, 0, 0.3)}
}

/* Enhanced card effects */
.card{
  will-change:transform;
  transform-style:preserve-3d
}

.card h3, .card p{
  transform:translateZ(20px)
}

/* Parallax scroll effect */
main{
  position:relative;
  z-index:2
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Large tablets and small desktops (1024px and below) */
@media (max-width:1024px){
  .container{
    max-width:100%;
    padding:16px
  }

  .hero{
    gap:30px;
    padding:40px 0
  }

  .hero h2{
    font-size:28px
  }

  .cards{
    gap:18px;
    grid-template-columns:repeat(auto-fit,minmax(200px,1fr))
  }
}

/* Tablets (900px and below) */
@media (max-width:900px){
  .hero{
    grid-template-columns:1fr;
    gap:30px;
    text-align:center
  }

  .hero-content{
    order:2
  }

  .hero-3d{
    order:1;
    height:350px;
    max-width:500px;
    margin:0 auto
  }

  .cards{
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:20px
  }

  .cta{
    display:inline-block;
    width:auto
  }

  .brand{
    font-size:22px
  }

  nav a{
    margin-left:14px;
    font-size:14px
  }
}

/* Small tablets and large phones (768px and below) */
@media (max-width:768px){
  .site-header{
    position:relative
  }

  .hero{
    padding:30px 0;
    gap:20px
  }

  .hero h2{
    font-size:24px;
    line-height:1.4
  }

  .hero p{
    font-size:15px
  }

  .hero-3d{
    height:300px
  }

  .cards{
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    margin-top:30px
  }

  .card{
    padding:20px
  }

  .card h3{
    font-size:18px
  }

  .about, .contact{
    margin-top:40px
  }

  .cta{
    padding:10px 20px;
    font-size:15px
  }
}

/* Mobile devices (600px and below) */
@media (max-width:600px){
  .site-header .container{
    flex-direction:column;
    gap:12px;
    padding:12px
  }

  .brand{
    font-size:20px
  }

  nav{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:center
  }

  nav a{
    margin-left:0;
    padding:6px 12px;
    background:rgba(139,0,0,0.05);
    border-radius:6px;
    font-size:13px
  }

  .hero{
    grid-template-columns:1fr;
    padding:20px 0;
    gap:20px
  }

  .hero h2{
    font-size:22px;
    margin-bottom:12px
  }

  .hero p{
    font-size:14px;
    line-height:1.6
  }

  .hero-3d{
    height:280px;
    width:100%
  }

  .cta{
    padding:12px 24px;
    font-size:14px;
    width:100%;
    text-align:center;
    box-sizing:border-box
  }

  .cards{
    grid-template-columns:1fr;
    gap:16px;
    margin-top:24px
  }

  .card{
    padding:18px;
    border-radius:12px
  }

  .card h3{
    font-size:18px;
    margin-bottom:8px
  }

  .card p{
    font-size:14px
  }

  /* Disable 3D effects on mobile for better performance */
  .card:hover{
    transform:translateY(-4px) scale(1.01);
    box-shadow:0 8px 16px rgba(139,0,0,0.12)
  }

  .about, .contact{
    margin-top:30px
  }

  .about h2, .contact h2{
    font-size:22px
  }

  .site-footer{
    margin-top:40px;
    padding:16px 0;
    font-size:12px
  }

  .floating-shape{
    display:none
  }

  #particle-canvas{
    opacity:0.15
  }

  /* Reduce animations on mobile */
  .hero h2, .about h2, .contact h2{
    animation:none;
    text-shadow:0 0 20px rgba(139, 0, 0, 0.2)
  }

  .brand{
    animation:none
  }
}

/* Extra small devices (400px and below) */
@media (max-width:400px){
  .container{
    padding:12px
  }

  .hero h2{
    font-size:20px
  }

  .hero p{
    font-size:13px
  }

  .hero-3d{
    height:240px
  }

  .card{
    padding:16px
  }

  .card h3{
    font-size:16px
  }

  .card p{
    font-size:13px
  }

  nav a{
    padding:4px 10px;
    font-size:12px
  }

  .cta{
    padding:10px 20px;
    font-size:13px
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse){
  .card{
    transition:all 0.3s ease
  }

  .card:active{
    transform:scale(0.98);
    box-shadow:0 6px 12px rgba(139,0,0,0.1)
  }

  nav a:active{
    background:rgba(139,0,0,0.1)
  }

  .cta:active{
    transform:scale(0.96)
  }
}

/* Landscape orientation on mobile */
@media (max-width:900px) and (orientation:landscape){
  .hero{
    grid-template-columns:1fr 1fr;
    text-align:left
  }

  .hero-content{
    order:1
  }

  .hero-3d{
    order:2;
    height:300px
  }
}

/* Print styles */
@media print{
  #particle-canvas, .floating-shape, .hero-3d{
    display:none
  }

  .site-header{
    position:relative;
    box-shadow:none
  }

  body{
    background:#fff
  }
}
