/* ============================================
   STEFANO PALLONI - ELEGANT DESIGN SYSTEM
   Institutional Elegance + Swiss Precision
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Gainsborough:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&family=Montserrat:wght@400;600;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  /* Colors */
  --slate: #2C2C2C;
  --slate-light: #4A4A4A;
  --navy: #1E3A5F;
  --navy-light: #2E5090;
  --cream: #F8F6F3;
  --cream-dark: #EDE9E3;
  --brass: #B8956B;
  --brass-light: #D4B896;
  --white: #FFFFFF;
  --text-muted: #6B6B6B;

  /* Typography */
  --font-display: 'Cormorant Gainsborough', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 10rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;

  /* Transitions */
  --ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.4s;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--slate);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--slate);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
}

h4 {
  font-size: 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--duration) var(--ease-elegant);
}

a:hover {
  color: var(--brass);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.text-center { text-align: center; }
.text-brass { color: var(--brass); }
.text-navy { color: var(--navy); }
.text-navy-light { color: var(--navy-light); }

/* --- Subtle Background Texture --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: -1;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--cream);
  border-bottom: 1px solid rgba(44, 44, 44, 0.08);
  transition: all var(--duration) var(--ease-elegant);
}

.header.scrolled {
  background: rgba(248, 246, 243, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo__image {
  height: 50px;
  width: auto;
}

.logo__text {
  display: flex;
  flex-direction: column;
}

.logo__name {
  font-family: 'Montserrat', var(--font-body);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--slate);
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.logo__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--navy);
  margin-top: 4px;
}

.nav__menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brass);
  transition: width var(--duration) var(--ease-elegant);
}

.nav__link:hover,
.nav__link.active {
  color: var(--slate);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--slate);
  transition: all var(--duration) var(--ease-elegant);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--space-3xl) 0 var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
  opacity: 0.05;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s var(--ease-elegant) forwards;
}

.hero__badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--brass);
  border-radius: 50%;
}

.hero__title {
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-elegant) 0.1s forwards;
}

.hero__title span {
  display: block;
  color: var(--brass);
  font-size: 0.4em;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-elegant) 0.2s forwards;
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s var(--ease-elegant) 0.3s forwards;
}

/* Diagonal Accent Line */
.hero__accent {
  position: absolute;
  bottom: var(--space-2xl);
  left: 50%;
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, var(--brass), transparent);
  transform: rotate(30deg);
  opacity: 0;
  animation: fadeIn 1s var(--ease-elegant) 0.5s forwards;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 1rem 2rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease-elegant);
}

.btn--primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn--primary:hover {
  background: var(--slate);
  border-color: var(--slate);
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--slate);
  border-color: var(--slate);
}

.btn--outline:hover {
  background: var(--slate);
  color: var(--white);
}

.btn--brass {
  background: var(--brass);
  color: var(--white);
  border-color: var(--brass);
}

.btn--brass:hover {
  background: var(--brass-light);
  border-color: var(--brass-light);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: var(--space-2xl) 0;
}

.section--cream {
  background: var(--cream);
}

.section--white {
  background: var(--white);
}

.section--dark {
  background: var(--slate);
  color: var(--white);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.7);
}

.section__header {
  margin-bottom: var(--space-xl);
}

.section__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass);
  margin-bottom: var(--space-sm);
}

.section__title {
  margin-bottom: var(--space-sm);
}

.section__subtitle {
  font-size: 1.125rem;
  max-width: 600px;
}

.section__header.text-center .section__subtitle {
  margin: 0 auto;
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.service-card {
  background: var(--white);
  padding: var(--space-xl);
  border: 1px solid rgba(44, 44, 44, 0.08);
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease-elegant);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--brass);
  transition: height var(--duration) var(--ease-elegant);
}

.service-card:hover {
  border-color: rgba(44, 44, 44, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(44, 44, 44, 0.08);
}

.service-card:hover::before {
  height: 100%;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--navy);
}

.service-card__icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
}

.service-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.service-card__text {
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.service-card__link {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.service-card__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--duration) var(--ease-elegant);
}

.service-card:hover .service-card__link svg {
  transform: translateX(4px);
}

/* ============================================
   CREDENTIALS / WHY CHOOSE
   ============================================ */
.credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.credentials__image {
  position: relative;
}

.credentials__image::before {
  content: '';
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  right: calc(var(--space-md) * -1);
  bottom: calc(var(--space-md) * -1);
  border: 1px solid var(--brass);
  z-index: -1;
}

.credentials__image img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(20%);
}

.credentials__list {
  list-style: none;
}

.credentials__item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(44, 44, 44, 0.1);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.credentials__item:last-child {
  border-bottom: none;
}

.credentials__number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--brass);
  line-height: 1;
  min-width: 40px;
}

.credentials__content h4 {
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.credentials__content p {
  font-size: 0.9rem;
  margin: 0;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
  color: var(--white);
  text-align: center;
  padding: var(--space-2xl) 0;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.cta__content {
  position: relative;
  z-index: 1;
}

.cta__title {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.cta__text {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-lg);
}

.cta__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.cta .btn--outline {
  color: var(--white);
  border-color: var(--white);
}

.cta .btn--outline:hover {
  background: var(--white);
  color: var(--navy);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--slate);
  color: var(--white);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer__brand .logo__name {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.footer__brand .logo__name .text-navy {
  color: var(--brass);
}

.footer__brand .logo__title {
  color: var(--brass);
  margin-bottom: var(--space-md);
}

.footer__brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer__title {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass);
  margin-bottom: var(--space-md);
}

.footer__links {
  list-style: none;
}

.footer__links li {
  margin-bottom: var(--space-xs);
}

.footer__links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  transition: color var(--duration) var(--ease-elegant);
}

.footer__links a:hover {
  color: var(--white);
}

.footer__contact {
  list-style: none;
}

.footer__contact li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer__contact svg {
  width: 18px;
  height: 18px;
  color: var(--brass);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer__contact a {
  color: rgba(255, 255, 255, 0.7);
}

.footer__contact a:hover {
  color: var(--white);
}

.footer__bottom {
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.footer__credit {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.footer__credit a {
  color: var(--brass);
  transition: color var(--duration) var(--ease-elegant);
}

.footer__credit a:hover {
  color: var(--white);
}

/* ============================================
   PAGE HERO (for internal pages)
   ============================================ */
.page-hero {
  padding: calc(var(--space-3xl) + 80px) 0 var(--space-2xl);
  background: var(--white);
  border-bottom: 1px solid rgba(44, 44, 44, 0.08);
}

.page-hero__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brass);
  margin-bottom: var(--space-sm);
}

.page-hero__title {
  margin-bottom: var(--space-sm);
}

.page-hero__subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
}

/* ============================================
   FORMS
   ============================================ */
.form {
  max-width: 600px;
}

.form__group {
  margin-bottom: var(--space-md);
}

.form__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin-bottom: var(--space-xs);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--slate);
  background: var(--white);
  border: 1px solid rgba(44, 44, 44, 0.15);
  transition: all var(--duration) var(--ease-elegant);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form__textarea {
  min-height: 150px;
  resize: vertical;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ============================================
   CONTENT BLOCKS
   ============================================ */
.content-block {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.content-block h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.content-block p {
  margin-bottom: var(--space-md);
}

.content-block ul,
.content-block ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
}

.content-block li {
  margin-bottom: var(--space-xs);
  color: var(--text-muted);
}

/* Feature List */
.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--brass);
}

/* ============================================
   BLOG CARDS
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.blog-card {
  background: var(--white);
  border: 1px solid rgba(44, 44, 44, 0.08);
  transition: all var(--duration) var(--ease-elegant);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(44, 44, 44, 0.08);
}

.blog-card__image {
  height: 200px;
  background: var(--cream-dark);
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration) var(--ease-elegant);
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.05);
}

.blog-card__content {
  padding: var(--space-md);
}

.blog-card__date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin-bottom: var(--space-xs);
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.blog-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s var(--ease-elegant);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .credentials {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .credentials__image {
    order: -1;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-2xl: 4rem;
    --space-3xl: 6rem;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    gap: 0;
    padding: var(--space-md);
    border-bottom: 1px solid rgba(44, 44, 44, 0.08);
    display: none;
  }

  .nav__menu.active {
    display: flex;
  }

  .nav__link {
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(44, 44, 44, 0.05);
  }

  .hero {
    min-height: auto;
    padding: calc(var(--space-3xl) + 60px) 0 var(--space-xl);
  }

  .hero::before {
    display: none;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .service-card {
    padding: var(--space-lg);
  }

  .cta__actions {
    flex-direction: column;
  }

  .cta__actions .btn {
    width: 100%;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .form__row {
    grid-template-columns: 1fr;
  }
}
