/* ========================================
   Ventus — Real Estate Landing Page
   Design System: Exaggerated Minimalism
   Typography: Cinzel + Josefin Sans
   Colors: Premium Dark + Gold Accent
   ======================================== */

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

:root {
  --color-primary: #1C1917;
  --color-secondary: #44403C;
  --color-accent: #A16207;
  --color-accent-hover: #854D0E;
  --color-bg: #FAFAF9;
  --color-card: #FFFFFF;
  --color-text: #0C0A09;
  --color-text-muted: #78716C;
  --color-border: #D6D3D1;
  --color-hero-bg: #1C1917;
  --color-hero-text: #FAFAF9;

  --font-heading: 'Cinzel', serif;
  --font-body: 'Josefin Sans', sans-serif;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: 200ms ease-out;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  min-height: 48px;
  touch-action: manipulation;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

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

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

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-hero-text);
}

.btn-nav {
  padding: 10px 24px;
  min-height: 44px;
  background-color: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

.btn-nav:hover {
  background-color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: rgba(28, 25, 23, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-hero-text);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  color: var(--color-hero-text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-hero-text);
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --- */
.hero {
  display: flex;
  align-items: center;
  min-height: 100dvh;
  background-color: var(--color-hero-bg);
  background-image:
    linear-gradient(135deg, rgba(28, 25, 23, 0.85) 0%, rgba(28, 25, 23, 0.6) 100%),
    url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?w=1600&q=80');
  background-size: cover;
  background-position: center;
  color: var(--color-hero-text);
  padding: var(--space-4xl) var(--space-lg);
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-lg);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xl);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  line-height: 1.6;
  max-width: 520px;
  color: #A8A29E;
  margin-bottom: var(--space-2xl);
}

/* --- Section Shared --- */
.section-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  margin-bottom: var(--space-2xl);
}

/* --- Projects --- */
.projects {
  padding: var(--space-4xl) 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.project-card {
  background-color: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: #E7E5E4;
}

.project-info {
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}

.project-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.project-location {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.project-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.project-details {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.project-detail {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-secondary);
  padding: 6px 12px;
  background-color: var(--color-bg);
  border-radius: var(--radius-sm);
}

/* --- About --- */
.about {
  padding: var(--space-4xl) 0;
  background-color: var(--color-primary);
  color: var(--color-hero-text);
}

.about .section-title {
  color: var(--color-hero-text);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.about-text {
  font-size: 16px;
  line-height: 1.7;
  color: #A8A29E;
  margin-bottom: var(--space-xl);
}

.about-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.about-highlights li {
  font-size: 15px;
  font-weight: 400;
  color: #D6D3D1;
  padding-left: var(--space-lg);
  position: relative;
}

.about-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

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

.stat {
  text-align: center;
  padding: var(--space-xl);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-md);
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #A8A29E;
}

/* --- Contact --- */
.contact {
  padding: var(--space-4xl) 0;
  text-align: center;
}

.contact-inner {
  max-width: 600px;
}

.contact-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

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

/* --- Footer --- */
.footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

.footer-copy {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --- Screen reader only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Chatbot Widget --- */
.chatbot {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-md);
}

.chatbot-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: var(--color-accent);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
}

.chatbot-fab:hover {
  background-color: var(--color-accent-hover);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.chatbot-fab:active {
  transform: scale(0.93);
}

.chatbot-fab:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.chatbot-fab .chatbot-icon-close {
  display: none;
}

.chatbot-fab[aria-expanded="true"] .chatbot-icon-chat {
  display: none;
}

.chatbot-fab[aria-expanded="true"] .chatbot-icon-close {
  display: block;
}

/* Panel */
.chatbot-panel {
  display: none;
  flex-direction: column;
  width: 380px;
  max-height: 520px;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  margin: 0;
  padding: 0;
  position: absolute;
  bottom: 72px;
  right: 0;
  left: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 250ms ease-out, transform 250ms ease-out;
}

.chatbot-panel[open] {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbot-panel::backdrop {
  display: none;
}

/* Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-primary);
  color: var(--color-hero-text);
}

.chatbot-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
}

.chatbot-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.chatbot-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-hero-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.chatbot-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Messages */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-height: 300px;
  max-height: 360px;
}

/* Message entrance animation */
.chatbot-msg {
  animation: chatbot-msg-in 250ms ease-out both;
}

.chatbot-msg-user {
  animation-name: chatbot-msg-in-user;
}

@keyframes chatbot-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chatbot-msg-in-user {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-msg p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-msg-bot p {
  background-color: var(--color-bg);
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 2px;
  max-width: 85%;
}

.chatbot-msg-user p {
  background-color: var(--color-primary);
  color: var(--color-hero-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) 2px var(--radius-md);
  max-width: 85%;
  margin-left: auto;
}

.chatbot-msg-bot .chatbot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  max-width: 85%;
}

.chatbot-msg-bot .chatbot-buttons button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition);
  touch-action: manipulation;
  min-height: 36px;
}

.chatbot-msg-bot .chatbot-buttons button:hover {
  background-color: var(--color-accent);
  color: #FFFFFF;
}

.chatbot-msg-bot .chatbot-buttons button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.chatbot-msg-bot img {
  max-width: 85%;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
}

/* Markdown content in bot messages */
.chatbot-msg-bot .chatbot-md {
  background-color: var(--color-bg);
  color: var(--color-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 2px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-md p {
  margin: 0 0 var(--space-sm) 0;
}

.chatbot-md p:last-child {
  margin-bottom: 0;
}

.chatbot-md h4,
.chatbot-md h5,
.chatbot-md h6 {
  font-family: var(--font-body);
  font-weight: 600;
  margin: var(--space-sm) 0 var(--space-xs) 0;
  line-height: 1.3;
}

.chatbot-md h4 {
  font-size: 15px;
}

.chatbot-md h5 {
  font-size: 14px;
}

.chatbot-md h6 {
  font-size: 13px;
}

.chatbot-md h4:first-child,
.chatbot-md h5:first-child,
.chatbot-md h6:first-child {
  margin-top: 0;
}

.chatbot-md strong {
  font-weight: 600;
}

.chatbot-md em {
  font-style: italic;
}

.chatbot-md code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  background-color: var(--color-border);
  padding: 1px 5px;
  border-radius: 3px;
}

.chatbot-md pre {
  margin: var(--space-sm) 0;
  background-color: var(--color-primary);
  color: var(--color-hero-text);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
}

.chatbot-md pre:last-child {
  margin-bottom: 0;
}

.chatbot-md pre code {
  background: none;
  padding: 0;
  font-size: 12px;
  color: inherit;
}

.chatbot-md ul {
  margin: var(--space-xs) 0 var(--space-sm) 0;
  padding-left: var(--space-lg);
  list-style: disc;
}

.chatbot-md ul:last-child {
  margin-bottom: 0;
}

.chatbot-md li {
  margin-bottom: 2px;
  font-size: 14px;
  line-height: 1.5;
}

.chatbot-md a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.chatbot-md a:hover {
  color: var(--color-accent-hover);
}

.chatbot-md a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Typing indicator */
.chatbot-typing p {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
}

.chatbot-typing span {
  width: 6px;
  height: 6px;
  background-color: var(--color-text-muted);
  border-radius: 50%;
  animation: chatbot-bounce 1.2s infinite;
}

.chatbot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chatbot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Error message */
.chatbot-msg-error p {
  background-color: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* Input */
.chatbot-input-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border);
}

.chatbot-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  min-height: 44px;
  transition: border-color var(--transition);
}

.chatbot-input:focus {
  border-color: var(--color-accent);
}

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

.chatbot-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  background-color: var(--color-accent);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition), transform var(--transition);
  touch-action: manipulation;
}

.chatbot-send:hover {
  background-color: var(--color-accent-hover);
}

.chatbot-send:active {
  transform: scale(0.93);
}

.chatbot-send:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.chatbot-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  .projects-grid {
    gap: var(--space-lg);
  }

  .about-grid {
    gap: var(--space-2xl);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: rgba(28, 25, 23, 0.98);
    padding: var(--space-lg);
    gap: var(--space-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    min-height: 90dvh;
    padding: var(--space-3xl) var(--space-md);
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .projects {
    padding: var(--space-3xl) 0;
  }

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

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

  .about {
    padding: var(--space-3xl) 0;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
  }

  .contact {
    padding: var(--space-3xl) 0;
  }

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

  .chatbot {
    bottom: var(--space-md);
    right: var(--space-md);
  }

  .chatbot-panel {
    position: fixed;
    left: var(--space-md);
    right: var(--space-md);
    bottom: 80px;
    width: auto;
    max-height: 70dvh;
  }
}

/* Small phone */
@media (max-width: 375px) {
  .container {
    padding: 0 var(--space-md);
  }

  .about-stats {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
