/* Nordic Stone & Ember Architecture Studio - Custom Styles */

:root {
  --primary-color: #2E3440;
  --secondary-color: #D08770;
  --light-gray: #ECEFF4;
  --medium-gray: #D8DEE9;
  --dark-gray: #4C566A;
  --accent-warm: #BF616A;
  --accent-light: #88C0D0;
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 10px 40px rgba(46, 52, 64, 0.15);
  --shadow-hover: 0 15px 50px rgba(46, 52, 64, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--primary-color);
  line-height: 1.7;
  overflow-x: hidden;
  background-color: #ffffff;
}

/* Typography Enhancements */
.display-2, .display-3, .display-4, .display-5, .display-6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--primary-color) !important;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--dark-gray) !important;
}

/* Navbar Styling */
.navbar {
  background-color: var(--primary-color) !important;
  padding: 1.2rem 0;
  transition: var(--transition-base);
  box-shadow: 0 2px 20px rgba(46, 52, 64, 0.1);
}

.navbar.shadow {
  box-shadow: 0 4px 30px rgba(46, 52, 64, 0.2) !important;
}

.navbar-dark .navbar-brand {
  color: #ffffff !important;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: var(--transition-base);
}

.navbar-dark .navbar-brand:hover {
  color: var(--secondary-color) !important;
  transform: translateY(-2px);
}

.navbar-dark .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
  font-weight: 500;
  padding: 0.5rem 1.2rem !important;
  margin: 0 0.2rem;
  position: relative;
  transition: var(--transition-base);
}

.navbar-dark .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  transition: var(--transition-base);
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
  color: #ffffff !important;
}

.navbar-dark .nav-link:hover::after,
.navbar-dark .nav-link.active::after {
  width: 80%;
}

.navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(208, 135, 112, 0.3) !important;
}

/* Hero Section */
.hero-section {
  min-height: 90vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-gray) 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0L50 50L0 100" stroke="%23D08770" stroke-width="0.5" fill="none" opacity="0.1"/></svg>');
  opacity: 0.1;
  animation: movePattern 60s linear infinite;
}

@keyframes movePattern {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 100px); }
}

.hero-section .position-absolute {
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: overlay;
}

.hero-section .object-fit-cover {
  object-fit: cover;
  object-position: center;
}

.rune-overlay {
  position: relative;
  z-index: 2;
}

.hero-section .display-2 {
  color: #ffffff !important;
  text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-section .lead {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 1px 2px 10px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1.2s ease-out;
}

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

.min-vh-75 {
  min-height: 75vh;
}

/* Buttons */
.btn {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  transition: var(--transition-base);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-lg {
  font-size: 1rem;
}

.btn-primary,
.btn.btn-primary {
  background-color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.btn.btn-primary:hover {
  background-color: #c67862 !important;
  border-color: #c67862 !important;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(208, 135, 112, 0.4) !important;
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.8) !important;
  color: #ffffff !important;
  background-color: transparent !important;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2) !important;
}

.btn-light {
  background-color: #ffffff !important;
  color: var(--primary-color) !important;
  border-color: #ffffff !important;
}

.btn-light:hover {
  background-color: var(--light-gray) !important;
  color: var(--primary-color) !important;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover) !important;
}

/* Sections */
section {
  position: relative;
}

.py-5 {
  padding-top: 5rem !important;
  padding-bottom: 5rem !important;
}

.bg-light {
  background-color: var(--light-gray) !important;
}

/* Portfolio Masonry */
.portfolio-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  height: 400px;
  transition: var(--transition-base);
  box-shadow: 0 5px 20px rgba(46, 52, 64, 0.1);
}

.portfolio-tall {
  grid-row: span 2;
  height: 820px;
}

.portfolio-wide {
  grid-column: span 2;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(46, 52, 64, 0.95) 0%, rgba(46, 52, 64, 0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  opacity: 0;
  transition: var(--transition-base);
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-overlay h3 {
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  transform: translateY(20px);
  transition: transform 0.4s ease-out 0.1s;
}

.portfolio-overlay p {
  color: rgba(255, 255, 255, 0.9) !important;
  transform: translateY(20px);
  transition: transform 0.4s ease-out 0.15s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
  transform: translateY(0);
}

.badge {
  background-color: var(--secondary-color) !important;
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.5em 1em;
  border-radius: 6px;
}

/* Cards */
.card {
  border: none !important;
  border-radius: 12px;
  transition: var(--transition-base);
  background-color: #ffffff;
}

.card.shadow-sm {
  box-shadow: 0 5px 20px rgba(46, 52, 64, 0.08) !important;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover) !important;
}

.card-body {
  padding: 2rem;
}

/* Icons */
.bi {
  vertical-align: middle;
}

.bi-telephone-fill,
.bi-envelope-fill,
.bi-geo-alt-fill,
.bi-facebook,
.bi-instagram,
.bi-linkedin,
.bi-send-fill,
.bi-car-front-fill,
.bi-bus-front-fill,
.bi-bicycle-fill,
.bi-search,
.bi-hammer,
.bi-eye {
  color: var(--secondary-color) !important;
}

.fs-1 { font-size: 3rem !important; }
.fs-3 { font-size: 1.75rem !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }

/* Forms */
.form-control,
.form-select {
  border: 2px solid var(--medium-gray);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition-base);
  background-color: #ffffff;
  color: var(--primary-color) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--secondary-color) !important;
  box-shadow: 0 0 0 0.25rem rgba(208, 135, 112, 0.15) !important;
  background-color: #ffffff;
  color: var(--primary-color) !important;
}

.form-label {
  font-weight: 600;
  color: var(--primary-color) !important;
  margin-bottom: 0.5rem;
}

.form-check-input:checked {
  background-color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(208, 135, 112, 0.15) !important;
}

.form-check-label {
  color: var(--primary-color) !important;
}

/* Images */
.img-fluid {
  border-radius: 12px;
}

.rounded {
  border-radius: 12px !important;
}

.rounded-3 {
  border-radius: 16px !important;
}

.shadow-lg {
  box-shadow: var(--shadow-soft) !important;
}

/* Ratio Container */
.ratio {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(46, 52, 64, 0.1);
}

.ratio iframe {
  border: none;
}

/* Text Colors */
.text-white {
  color: #ffffff !important;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.text-muted {
  color: var(--dark-gray) !important;
}

.text-decoration-none {
  text-decoration: none !important;
}

.text-decoration-none:hover {
  color: var(--secondary-color) !important;
}

a {
  color: var(--secondary-color) !important;
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  color: var(--accent-warm) !important;
  text-decoration: underline;
}

/* Lists */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

.list-unstyled li {
  padding: 0.5rem 0;
  color: var(--primary-color) !important;
}

/* Footer */
footer {
  background-color: var(--primary-color) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

footer a {
  color: rgba(255, 255, 255, 0.8) !important;
}

footer a:hover {
  color: var(--secondary-color) !important;
}

footer h5, footer h6 {
  color: #ffffff !important;
}

.border-top {
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Sticky Elements */
.position-sticky {
  position: sticky !important;
  top: 100px;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Loading Animation */
.loading {
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: rgba(46, 52, 64, 0.98);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }
  
  .navbar-nav {
    gap: 0.5rem;
  }
  
  .nav-link {
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
  }
  
  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .display-2 {
    font-size: 2.5rem !important;
  }
  
  .display-3 {
    font-size: 2.2rem !important;
  }
  
  .display-4 {
    font-size: 2rem !important;
  }
  
  .display-5 {
    font-size: 1.8rem !important;
  }
  
  .display-6 {
    font-size: 1.5rem !important;
  }
  
  .hero-section {
    min-height: 70vh;
  }
  
  .py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  .portfolio-masonry {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .portfolio-tall,
  .portfolio-wide {
    grid-row: span 1;
    grid-column: span 1;
    height: 400px;
  }
  
  .position-sticky {
    position: relative !important;
    top: 0;
  }
}

@media (max-width: 767.98px) {
  .btn-lg {
    padding: 0.75rem 2rem !important;
    font-size: 0.9rem;
  }
  
  .lead {
    font-size: 1.1rem;
  }
  
  .portfolio-item {
    height: 350px;
  }
  
  .card-body {
    padding: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .display-2 {
    font-size: 2rem !important;
  }
  
  .hero-section {
    min-height: 60vh;
  }
  
  .btn-lg {
    padding: 0.65rem 1.5rem !important;
    font-size: 0.85rem;
  }
  
  .gap-3 {
    gap: 0.75rem !important;
  }
  
  .portfolio-masonry {
    gap: 1rem;
  }
  
  .portfolio-item {
    height: 300px;
  }
}

/* Utility Classes */
.object-fit-cover {
  object-fit: cover;
}

.overflow-hidden {
  overflow: hidden;
}

.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background-color: var(--secondary-color);
  color: #ffffff;
}

::-moz-selection {
  background-color: var(--secondary-color);
  color: #ffffff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-warm);
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  footer {
    display: none !important;
  }
  
  body {
    color: #000;
    background: #fff;
  }
}