:root {
  --color-bg:          #050505;  /* nero assoluto più profondo */
  --color-surface:     #0D0D0D;  /* superficie card/sezioni */
  --color-surface-alt: #121212;  /* alternanza sezioni */
  --color-text:        #F2EFE9;  /* bianco avorio spinto */
  --color-text-muted:  #7A7870;
  --color-accent:      #D00000;  /* rosso sangue / imperiale spinto */
  --color-accent-glow: rgba(208,0,0,0.25); /* alone rosso per effetti */
  --color-gold:        #D4AF37;  /* oro puro, più acceso */
  --color-border:      #333333;
  --color-border-gold: rgba(212,175,55,0.4);
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Raleway', sans-serif;
  overflow-x: hidden;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  background-size: 150px 150px;
  background-blend-mode: overlay;
}

body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-bg);
  opacity: 0.95;
  z-index: -1;
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
}

.font-cinzel { font-family: 'Cinzel', serif; }
.font-cormorant { font-family: 'Cormorant Garamond', serif; }

.text-gold { color: var(--color-gold); }
.text-accent { color: var(--color-accent); }
.bg-surface { background-color: var(--color-surface); }
.bg-surface-alt { background-color: var(--color-surface-alt); }
.border-gold { border-color: var(--color-border-gold); }
.border-gold-solid { border-color: var(--color-gold); }

/* Typography */
.epigraph-label {
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(212,175,55,0.2);
}

.hero-headline {
  font-size: clamp(3.5rem, 10vw, 8rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-headline .dot {
  color: var(--color-accent);
  text-shadow: 0 0 20px var(--color-accent-glow);
}

.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Hero specific */
.hero-overlay {
  background: linear-gradient(to bottom, rgba(13,13,11,0.4) 0%, rgba(13,13,11,0.8) 100%);
}

.hero-img {
  filter: brightness(0.65) contrast(1.1);
  object-fit: cover;
  object-position: center;
}

/* Decorators */
.line-separator {
  height: 1px;
  background-color: var(--color-border-gold);
  width: 100%;
}

.gold-line-vertical {
  width: 1px;
  background-color: var(--color-gold);
  height: 0;
  transition: height 1.5s ease;
}
.gold-line-vertical.visible {
  height: 100px;
}

/* Service cards */
.service-card {
  border: 1px solid var(--color-border-gold);
  background-color: rgba(13, 13, 13, 0.5);
  backdrop-filter: blur(5px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.service-card:hover {
  border-color: var(--color-gold);
  background-color: var(--color-surface);
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(212,175,55,0.05);
}

.service-card::after {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 25px; height: 25px;
  border-top: 2px solid transparent;
  border-right: 2px solid transparent;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover::after {
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent);
  width: 40px; height: 40px;
}

/* Buttons */
.btn-outline-accent {
  border: 1px solid var(--color-accent);
  color: var(--color-text);
  transition: all 0.3s ease;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.btn-outline-accent:hover {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.btn-ghost-gold {
  color: var(--color-gold);
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
}

.btn-ghost-gold::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-gold);
  transition: width 0.3s ease;
}

.btn-ghost-gold:hover::after {
  width: 100%;
}

/* Form */
.input-lapideo {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border-gold);
  color: var(--color-text);
  font-family: 'Raleway', sans-serif;
  padding: 10px 0;
  width: 100%;
  transition: border-color 0.3s ease;
}

.input-lapideo:focus {
  outline: none;
  border-bottom-color: var(--color-gold);
}

.input-lapideo::placeholder {
  color: var(--color-text-muted);
}

/* Images filters */
.portfolio-img {
  filter: brightness(0.6) contrast(1.2) saturate(0.5) sepia(0.2);
  transition: filter 0.8s ease, transform 0.8s ease;
}
.portfolio-img:hover {
  filter: brightness(0.9) contrast(1.1) saturate(1) sepia(0);
}
.about-img     { filter: brightness(0.6) contrast(1.2) sepia(0.1); }

/* Clip path for about image */
.clip-path-angled {
  clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%);
  border: 1px solid var(--color-gold);
}

/* Nav */
#navbar {
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}
#navbar.scrolled {
  background-color: rgba(13, 13, 11, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-gold);
}

/* Typewriter */
.typewriter-text {
  border-right: 2px solid var(--color-gold);
  white-space: nowrap;
  overflow: hidden;
  animation: typing 2s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--color-gold); }
}
