/* ── TerraWatt ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --white:   #ffffff;
  --grey:    #f5f5f7;
  --mid:     #e8e8ed;
  --dark:    #1d1d1f;
  --sub:     #6e6e73;
  --amber:   #d4a017;
  --amber-l: #f0c040;
  --radius:  12px;
  --max:     1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--white); color: var(--dark); -webkit-font-smoothing: antialiased; }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background .3s;
}
.nav-logo { font-size: 1.1rem; font-weight: 600; letter-spacing: .18em; color: var(--dark); text-decoration: none; }
.nav-logo span { color: var(--amber); }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a { font-size: .875rem; font-weight: 400; color: var(--dark); text-decoration: none; opacity: .75; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.lang-switcher { display: flex; gap: 8px; }
.lang-btn { background: none; border: none; font-size: .75rem; font-weight: 500; letter-spacing: .08em; color: var(--sub); cursor: pointer; padding: 4px 0; transition: color .2s; }
.lang-btn.active { color: var(--dark); border-bottom: 1.5px solid var(--amber); }
.nav-cta { background: var(--dark); color: var(--white); border: none; padding: 10px 22px; border-radius: 100px; font-size: .8rem; font-weight: 500; cursor: pointer; transition: background .2s, transform .15s; letter-spacing: .04em; }
.nav-cta:hover { background: var(--amber); transform: translateY(-1px); }

/* ── HERO ── */
#hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 120px 40px 80px;
  background: linear-gradient(160deg, #ffffff 0%, #f5f5f7 60%, #eeeef0 100%);
  position: relative; overflow: hidden;
}
#hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(212,160,23,.07) 0%, transparent 70%);
}
.hero-eyebrow { font-size: .75rem; font-weight: 500; letter-spacing: .2em; color: var(--amber); text-transform: uppercase; margin-bottom: 28px; }
.hero-title { font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 300; line-height: 1.08; letter-spacing: -.02em; color: var(--dark); margin-bottom: 28px; max-width: 900px; }
.hero-title strong { font-weight: 600; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); font-weight: 300; color: var(--sub); max-width: 560px; line-height: 1.65; margin-bottom: 48px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.btn-primary { background: var(--dark); color: var(--white); padding: 16px 36px; border-radius: 100px; font-size: .9rem; font-weight: 500; text-decoration: none; transition: background .2s, transform .15s; letter-spacing: .03em; }
.btn-primary:hover { background: var(--amber); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--dark); padding: 16px 36px; border-radius: 100px; font-size: .9rem; font-weight: 400; text-decoration: none; border: 1.5px solid rgba(0,0,0,.18); transition: border-color .2s, transform .15s; }
.btn-secondary:hover { border-color: var(--amber); transform: translateY(-2px); }
.hero-scroll { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: .4; }
.hero-scroll span { font-size: .7rem; letter-spacing: .15em; color: var(--sub); }
.scroll-line { width: 1px; height: 40px; background: linear-gradient(to bottom, var(--sub), transparent); animation: scrollAnim 2s ease-in-out infinite; }
@keyframes scrollAnim { 0%,100%{opacity:.4;transform:scaleY(1)} 50%{opacity:1;transform:scaleY(.6)} }

/* ── SECTION BASE ── */
section { padding: 100px 40px; }
.section-inner { max-width: var(--max); margin: 0 auto; }
.section-eyebrow { font-size: .7rem; font-weight: 500; letter-spacing: .22em; color: var(--amber); text-transform: uppercase; margin-bottom: 16px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; line-height: 1.15; letter-spacing: -.015em; color: var(--dark); margin-bottom: 16px; }
.section-sub { font-size: 1rem; color: var(--sub); font-weight: 300; line-height: 1.7; max-width: 560px; }

/* ── PILLARS ── */
#pillars { background: var(--grey); }
.pillars-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; margin-top: 64px; }
.pillar {
  background: var(--white); padding: 56px 44px;
  transition: transform .2s;
}
.pillar:hover { transform: translateY(-4px); }
.pillar:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.pillar:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.pillar-icon { width: 48px; height: 48px; margin-bottom: 32px; }
.pillar-icon svg { width: 100%; height: 100%; }
.pillar-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }
.pillar-text  { font-size: .9rem; color: var(--sub); line-height: 1.7; font-weight: 300; }

/* ── SERVICES ── */
#services .services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 64px; }
.service-card {
  background: var(--grey); padding: 72px 56px;
  position: relative; overflow: hidden; cursor: default;
  transition: background .3s;
}
.service-card:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.service-card:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.service-card:hover { background: var(--dark); }
.service-card:hover .service-title,
.service-card:hover .service-text,
.service-card:hover .service-tag { color: rgba(255,255,255,.85); }
.service-card:hover .service-title { color: var(--white); }
.service-tag { font-size: .7rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--amber); margin-bottom: 20px; display: block; }
.service-title { font-size: 2rem; font-weight: 300; letter-spacing: -.015em; margin-bottom: 20px; }
.service-text { font-size: .9rem; color: var(--sub); line-height: 1.7; font-weight: 300; max-width: 400px; }

/* ── TECH ── */
#tech { background: var(--dark); color: var(--white); }
#tech .section-title { color: var(--white); }
#tech .section-sub { color: rgba(255,255,255,.55); }
.tech-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin-top: 64px; background: rgba(255,255,255,.08); border-radius: var(--radius); overflow: hidden; }
.tech-item { background: var(--dark); padding: 48px 40px; transition: background .2s; }
.tech-item:hover { background: #2a2a2d; }
.tech-brand { font-size: .75rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); margin-bottom: 16px; }
.tech-name { font-size: 1.5rem; font-weight: 500; color: var(--white); margin-bottom: 12px; letter-spacing: -.01em; }
.tech-desc { font-size: .875rem; color: rgba(255,255,255,.5); line-height: 1.7; font-weight: 300; }

/* ── REGIONS ── */
#regions .regions-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-top: 64px; }
.region-card { background: var(--grey); border-radius: var(--radius); padding: 48px 40px; position: relative; overflow: hidden; }
.region-card::after { content:''; position:absolute; bottom:-20px; right:-20px; width:120px; height:120px; border-radius: 50%; background: rgba(212,160,23,.08); }
.region-name { font-size: 1.6rem; font-weight: 300; letter-spacing: -.015em; margin-bottom: 8px; }
.region-desc { font-size: .875rem; color: var(--sub); line-height: 1.65; font-weight: 300; }

/* ── PROCESS ── */
#process { background: var(--grey); }
.process-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; margin-top: 64px; position: relative; }
.process-steps::before { content:''; position:absolute; top: 24px; left: 12.5%; right: 12.5%; height: 1px; background: var(--mid); z-index:0; }
.step { text-align: center; padding: 0 24px; position: relative; z-index:1; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--white); border: 1.5px solid var(--amber); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; font-size: .8rem; font-weight: 600; color: var(--amber); }
.step-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; letter-spacing: -.01em; }
.step-desc { font-size: .825rem; color: var(--sub); line-height: 1.6; font-weight: 300; }

/* ── CONTACT CTA ── */
#contact-cta { text-align: center; padding: 120px 40px; }
#contact-cta .section-title { margin: 0 auto 24px; }
#contact-cta .section-sub { margin: 0 auto 48px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 680px; margin: 0 auto; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1/-1; }
label { font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--sub); }
input, textarea, select {
  background: var(--grey); border: 1.5px solid transparent;
  border-radius: var(--radius); padding: 14px 18px;
  font-family: 'Inter', sans-serif; font-size: .9rem; color: var(--dark);
  outline: none; transition: border-color .2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--amber); }
textarea { resize: vertical; min-height: 120px; }
.btn-submit { grid-column: 1/-1; background: var(--dark); color: var(--white); border: none; padding: 16px; border-radius: 100px; font-size: .9rem; font-weight: 500; cursor: pointer; transition: background .2s, transform .15s; letter-spacing: .04em; }
.btn-submit:hover { background: var(--amber); transform: translateY(-2px); }

/* ── FOOTER ── */
footer { background: var(--dark); color: rgba(255,255,255,.5); padding: 60px 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px; }
.footer-logo { font-size: 1rem; font-weight: 600; letter-spacing: .18em; color: var(--white); }
.footer-logo span { color: var(--amber); }
.footer-copy { font-size: .8rem; }

/* ── CHATBOT ── */
#chat-bubble { position: fixed; bottom: 32px; right: 32px; z-index: 200; }
.chat-toggle { width: 56px; height: 56px; border-radius: 50%; background: var(--dark); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 32px rgba(0,0,0,.2); transition: background .2s, transform .15s; }
.chat-toggle:hover { background: var(--amber); transform: scale(1.06); }
.chat-toggle svg { width: 24px; height: 24px; }
.chat-window { position: absolute; bottom: 72px; right: 0; width: 360px; background: var(--white); border-radius: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.14); overflow: hidden; display: none; flex-direction: column; }
.chat-window.open { display: flex; }
.chat-header { background: var(--dark); padding: 20px 24px; color: var(--white); }
.chat-header h4 { font-size: .9rem; font-weight: 500; margin-bottom: 2px; }
.chat-header p { font-size: .75rem; color: rgba(255,255,255,.5); }
.chat-messages { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; }
.msg { max-width: 85%; font-size: .85rem; line-height: 1.55; padding: 10px 14px; border-radius: 14px; }
.msg.bot { background: var(--grey); color: var(--dark); align-self: flex-start; border-radius: 4px 14px 14px 14px; }
.msg.user { background: var(--dark); color: var(--white); align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.chat-input-row { display: flex; gap: 8px; padding: 16px; border-top: 1px solid var(--mid); }
.chat-input-row input { flex: 1; background: var(--grey); border: none; border-radius: 100px; padding: 10px 16px; font-size: .85rem; outline: none; }
.chat-send { background: var(--dark); border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; flex-shrink: 0; }
.chat-send:hover { background: var(--amber); }
.chat-send svg { width: 16px; height: 16px; }

/* ── RESPONSIVE ── */
@media(max-width:900px){
  nav { padding: 0 24px; }
  .nav-links { display: none; }
  section { padding: 72px 24px; }
  .pillars-grid, .tech-grid, .regions-grid, .process-steps, #services .services-grid { grid-template-columns: 1fr; }
  .pillar, .service-card, .tech-item { border-radius: var(--radius) !important; }
  .process-steps::before { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .chat-window { width: 300px; }
}

/* ── IMAGE SECTIONS ── */
#hero {
  background-image: linear-gradient(to bottom, rgba(255,255,255,0.82) 0%, rgba(245,245,247,0.88) 100%), url('/images/hero.jpg');
  background-size: cover;
  background-position: center 40%;
}
#hero::before { display: none; }

.service-card.residential {
  background-image: linear-gradient(to bottom right, rgba(245,245,247,0.92), rgba(245,245,247,0.75)), url('/images/residential.jpg');
  background-size: cover; background-position: center;
}
.service-card.corporate {
  background-image: linear-gradient(to bottom right, rgba(245,245,247,0.92), rgba(245,245,247,0.75)), url('/images/corporate.jpg');
  background-size: cover; background-position: center;
}
.service-card.residential:hover {
  background-image: linear-gradient(to bottom right, rgba(29,29,31,0.94), rgba(29,29,31,0.88)), url('/images/residential.jpg');
}
.service-card.corporate:hover {
  background-image: linear-gradient(to bottom right, rgba(29,29,31,0.94), rgba(29,29,31,0.88)), url('/images/corporate.jpg');
}

.region-card.lisbon {
  background-image: linear-gradient(to bottom right, rgba(245,245,247,0.88), rgba(245,245,247,0.7)), url('/images/lisbon.jpg');
  background-size: cover; background-position: center;
}
.region-card.ericeira {
  background-image: linear-gradient(to bottom right, rgba(245,245,247,0.88), rgba(245,245,247,0.7)), url('/images/ericeira.jpg');
  background-size: cover; background-position: center;
}
.region-card.algarve {
  background-image: linear-gradient(to bottom right, rgba(245,245,247,0.88), rgba(245,245,247,0.7)), url('/images/algarve.jpg');
  background-size: cover; background-position: center;
}
