/*
 * Stylesheet for the 3D version of the Totteng Communications site.
 * It extends the previous aesthetic with a full‑screen WebGL hero,
 * subtle paper texture and interactive tilt on project cards.
 */

:root {
  --font-main: 'Montserrat', sans-serif;
  --font-hand: 'Permanent Marker', cursive;
  --color-text: #111;
  --color-accent: #f5e663;
  --color-muted: #f7f7f7;
  --max-width: 1300px;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: #fff;
  overflow-x: hidden;
}

/* Paper texture overlay */
.texture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url('paper_texture.png');
  background-size: cover;
  background-repeat: repeat;
  opacity: 0.35;
  mix-blend-mode: multiply;
  z-index: -1;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.logo {
  display: flex;
  align-items: baseline;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: lowercase;
}
.logo-sub {
  font-size: 0.7rem;
  margin-left: 0.25rem;
  font-weight: 400;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.nav-links li a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  position: relative;
  text-transform: lowercase;
}
.nav-links li a:hover::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
}
.nav-links .cta {
  background-color: var(--color-accent);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  color: #111;
  font-weight: 700;
}

/* Hero Section with 3D canvas */
.hero {
  position: relative;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.hero-inner {
  z-index: 1;
  max-width: 800px;
  padding: 0 1rem;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 1rem 0;
  text-transform: lowercase;
}
.highlight {
  background-color: var(--color-accent);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-hand);
  font-size: 1.1em;
}
.hero-subtitle {
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  border: none;
}
.btn.primary {
  background-color: var(--color-accent);
  color: #111;
}
.btn.secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}
.btn:hover {
  transform: translateY(-3px);
}
.btn.primary:hover {
  background-color: #fffa9e;
}
.btn.secondary:hover {
  background-color: var(--color-text);
  color: #fff;
}

/* Generic section styling */
section {
  padding: 4rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-weight: 900;
  text-transform: lowercase;
  line-height: 1.2;
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.service-card {
  background-color: var(--color-muted);
  padding: 2rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
  transition: transform 0.3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
}
.service-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.service-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  font-weight: 700;
}
.service-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #555;
}

/* Work section */
.work-section .work-carousel {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.work-wrapper {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 0;
}
.work-wrapper::-webkit-scrollbar {
  height: 8px;
}
.work-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--color-accent);
  border-radius: 4px;
}
.work-item {
  min-width: 260px;
  flex: 0 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  perspective: 1000px;
}
.work-img {
  height: 180px;
  background-size: cover;
  background-position: center;
}
/* Placeholder backgrounds */
.work-offside {
  background-image: linear-gradient(135deg, #1f1f1f, #444444);
}
.work-insideit {
  background-image: linear-gradient(135deg, #004e64, #008793);
}
.work-fairdrive {
  background-image: linear-gradient(135deg, #d72638, #ff4d5a);
}
.work-keedlee {
  background-image: linear-gradient(135deg, #345995, #5fa3e0);
}
.work-odd {
  background-image: linear-gradient(135deg, #8f2d56, #d81159);
}
.work-info {
  padding: 1rem;
}
.work-info h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: capitalize;
}
.work-info p {
  margin: 0.3rem 0 0;
  color: #555;
  font-size: 0.9rem;
  text-transform: lowercase;
}
.carousel-btn {
  background-color: rgba(255,255,255,0.8);
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  font-size: 1.2rem;
  color: #333;
  transition: background-color 0.2s ease;
}
.carousel-btn:hover {
  background-color: var(--color-accent);
  color: #111;
}
.view-all {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  position: relative;
  transition: color 0.3s ease;
}
.view-all::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.view-all:hover {
  color: #000;
}
.view-all:hover::after {
  transform: scaleX(1);
}

/* Process section */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  text-align: center;
}
.step-number {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
  font-family: var(--font-hand);
}
.process-steps h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: capitalize;
}
.process-steps p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #555;
}

/* Contact section */
.contact-section {
  text-align: center;
}
.contact-section p {
  margin-bottom: 2rem;
  color: #444;
}

/* Footer */
footer {
  background-color: #111;
  color: #f1f1f1;
  padding: 3rem 2rem 1rem;
  margin-top: 4rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-col h3,
.footer-col h4 {
  margin-top: 0;
  font-weight: 700;
  margin-bottom: 0.8rem;
  text-transform: capitalize;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col ul li {
  margin-bottom: 0.4rem;
}
.footer-col ul li a {
  text-decoration: none;
  color: #f1f1f1;
  transition: color 0.3s ease;
}
.footer-col ul li a:hover {
  color: var(--color-accent);
}
.social-links li {
  display: inline-block;
  margin-right: 0.6rem;
}
.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: #bbb;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.active {
  display: flex;
}
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
}
.modal-content {
  position: relative;
  background-color: #fff;
  border-radius: 8px;
  padding: 1rem;
  max-width: 800px;
  width: 90%;
  z-index: 1;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Tilt effect placeholder: will be controlled by JS */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-links {
    flex-wrap: wrap;
    margin-top: 1rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}