/*
  Joseph S. Alicata Architect
  Modern Architectural Design System
  ==================================
*/

/* ===== CSS VARIABLES ===== */
:root {
  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Colors - Refined Architectural Palette */
  --color-charcoal: #1a1a1a;
  --color-stone: #f7f5f2;
  --color-cream: #faf9f7;
  --color-terracotta: #b8755c;
  --color-terracotta-dark: #9a5f4a;
  --color-border: #e5e1dc;
  --color-text: #1a1a1a;
  --color-text-secondary: #6b6560;
  --color-text-light: #948e88;

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

  /* Layout */
  --max-width: 1200px;
  --header-height: 80px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-terracotta-dark);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-charcoal);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.lead {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--color-text);
}

.text-accent {
  color: var(--color-terracotta);
}

.text-light {
  color: var(--color-text-light);
}

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

.section {
  padding: var(--space-2xl) 0;
}

.section--stone {
  background-color: var(--color-stone);
}

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

.section--charcoal h1,
.section--charcoal h2,
.section--charcoal h3,
.section--charcoal h4 {
  color: var(--color-cream);
}

.section--charcoal p {
  color: rgba(250, 249, 247, 0.8);
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--transition-medium);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

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

.header__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.header__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-cream);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header__subtitle {
  font-size: 0.7rem;
  color: rgba(250, 249, 247, 0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  align-items: center;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(250, 249, 247, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition-fast);
  position: relative;
  padding: var(--space-xs) var(--space-sm);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-terracotta);
  transition: width var(--transition-medium);
}

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

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

/* Mobile Navigation */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-cream);
  transition: all var(--transition-fast);
}

@media (max-width: 768px) {
  .nav__toggle {
    display: flex;
    z-index: 1001;
  }

  .nav__links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a;
    padding-top: calc(var(--header-height) + var(--space-xl));
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
    z-index: 999;
  }

  .nav__links--open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    font-size: 1.2rem;
    padding: var(--space-md) var(--space-lg);
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background-color: #1a1a1a;
  }

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

  .nav__link::after {
    display: none;
  }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-charcoal);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(184, 117, 92, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(184, 117, 92, 0.1) 0%, transparent 50%);
}

.hero__content {
  position: relative;
  text-align: center;
  max-width: 900px;
  padding: var(--space-xl) var(--space-md);
  animation: fadeInUp 1s ease forwards;
}

.hero__tagline {
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-terracotta);
  margin-bottom: var(--space-md);
}

.hero__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400;
  color: var(--color-cream);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
}

.hero__description {
  font-size: 1.2rem;
  color: rgba(250, 249, 247, 0.7);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  line-height: 1.8;
}

/* ===== PAGE HEADER ===== */
.page-header {
  padding-top: calc(var(--header-height) + var(--space-2xl));
  padding-bottom: var(--space-xl);
  background: var(--color-charcoal);
  text-align: center;
}

.page-header__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-cream);
  margin-bottom: var(--space-sm);
}

.page-header__subtitle {
  color: rgba(250, 249, 247, 0.6);
  font-size: 1.1rem;
}

/* ===== CONTENT ===== */
.content {
  padding-top: var(--header-height);
}

.content__block {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 4px;
  padding: var(--space-lg);
  box-shadow: 0 2px 20px rgba(26, 26, 26, 0.06);
  transition: all var(--transition-medium);
}

.card:hover {
  box-shadow: 0 8px 40px rgba(26, 26, 26, 0.1);
  transform: translateY(-4px);
}

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

.card__text {
  color: var(--color-text-secondary);
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ===== SERVICES ===== */
.service {
  padding: var(--space-lg);
  border-left: 3px solid var(--color-terracotta);
  background: white;
  transition: all var(--transition-medium);
}

.service:hover {
  background: var(--color-stone);
}

.service__title {
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
  color: var(--color-charcoal);
}

.service__text {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

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

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

.form__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form__input,
.form__textarea {
  width: 100%;
  padding: var(--space-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(184, 117, 92, 0.1);
}

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

.form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-medium);
}

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

.btn--primary:hover {
  background: var(--color-terracotta-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(184, 117, 92, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--color-charcoal);
  border: 1px solid var(--color-charcoal);
}

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

.btn--light {
  background: transparent;
  color: var(--color-cream);
  border: 1px solid rgba(250, 249, 247, 0.3);
}

.btn--light:hover {
  background: var(--color-cream);
  color: var(--color-charcoal);
}

/* ===== CONTACT INFO ===== */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-info__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.contact-info__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-terracotta);
  flex-shrink: 0;
}

.contact-info__text {
  color: var(--color-text-secondary);
}

/* ===== PROJECTS ===== */
.projects__embed {
  width: 100%;
  aspect-ratio: 16/10;
  border: none;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(26, 26, 26, 0.1);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--color-charcoal);
  padding: var(--space-xl) 0;
  text-align: center;
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-cream);
  letter-spacing: 0.05em;
}

.footer__contact {
  color: rgba(250, 249, 247, 0.6);
  font-size: 0.9rem;
}

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

.footer__copyright {
  color: rgba(250, 249, 247, 0.4);
  font-size: 0.8rem;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

/* ===== ERROR PAGE ===== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 10rem);
  color: var(--color-terracotta);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.error-page__title {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.error-page__text {
  max-width: 500px;
  margin-bottom: var(--space-lg);
}

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

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

.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

/* Staggered animations */
.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }

/* ===== DIVIDER ===== */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-terracotta);
  margin: var(--space-md) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* ===== QUOTE ===== */
.quote {
  position: relative;
  padding: var(--space-lg);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--color-text);
  text-align: center;
}

.quote::before {
  content: '"';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6rem;
  color: var(--color-terracotta);
  opacity: 0.2;
  line-height: 1;
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
  :root {
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }

  .hero__title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .header__subtitle {
    display: none;
  }

  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .header__title {
    font-size: 0.9rem;
  }

  .btn {
    width: 100%;
  }
}
