@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

::view-transition-old(root) {
  animation: fade-out 0.4s ease forwards; /* The old page fades out */
}

::view-transition-new(root) {
  animation: fade-in 0.4s ease forwards; /* The new page fades in */
}

/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

/* CSS Variables - Color Palette */
:root {
  /* Main Colors */
  --color-primary: #faf7f0;
  --color-secondary: #d8d2c2;
  --color-accent: #b17457;
  --color-dark: #4a4947;

  /* Semantic Colors */
  --color-bg: #faf7f0;
  --color-bg-secondary: #d8d2c2;
  --color-text: #4a4947;
  --color-text-light: #6b6968;
  --color-border: #d8d2c2;

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

  /* Typography */
  --font-primary: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;

  /* Font Sizes */
  --font-xs: 0.875rem;
  --font-sm: 1rem;
  --font-md: 1.125rem;
  --font-lg: 1.5rem;
  --font-xl: 2rem;
  --font-2xl: 2.5rem;
  --font-3xl: 3.5rem;

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

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(74, 73, 71, 0.08);
  --shadow-md: 0 4px 16px rgba(74, 73, 71, 0.12);
  --shadow-lg: 0 8px 32px rgba(74, 73, 71, 0.16);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1050;
  --z-tooltip: 1070;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: var(--font-3xl);
}
h2 {
  font-size: var(--font-2xl);
}
h3 {
  font-size: var(--font-xl);
}
h4 {
  font-size: var(--font-lg);
}
h5 {
  font-size: var(--font-md);
}
h6 {
  font-size: var(--font-sm);
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-light);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition-normal);
}

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-family: var(--font-primary);
  font-size: var(--font-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  background-color: #9d5f43;
  border-color: #9d5f43;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

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

.btn-outline:hover {
  background-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-dark);
  border: none;
  padding: 0.5rem 1rem;
}

.btn-ghost:hover {
  color: var(--color-accent);
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

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

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-md);
}

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

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-title h2 {
  font-size: var(--font-2xl);
  margin-bottom: var(--spacing-sm);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.section-title p {
  font-size: var(--font-md);
  color: var(--color-text-light);
  max-width: 600px;
  margin: var(--spacing-md) auto 0;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -1rem;
}

.col {
  flex: 1;
  padding: 0 1rem;
}

.col-2 {
  flex: 0 0 50%;
  max-width: 50%;
}
.col-3 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}
.col-4 {
  flex: 0 0 25%;
  max-width: 25%;
}

/* ============================================
   CARD COMPONENT
   ============================================ */

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  border: 1px solid var(--color-border);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.card-title {
  font-size: var(--font-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--color-dark);
}

.card-text {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
}

/* ============================================
   UTILITIES
   ============================================ */

/* Text Alignment */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* Spacing */
.mt-1 {
  margin-top: var(--spacing-xs);
}
.mt-2 {
  margin-top: var(--spacing-sm);
}
.mt-3 {
  margin-top: var(--spacing-md);
}
.mt-4 {
  margin-top: var(--spacing-lg);
}

.mb-1 {
  margin-bottom: var(--spacing-xs);
}
.mb-2 {
  margin-bottom: var(--spacing-sm);
}
.mb-3 {
  margin-bottom: var(--spacing-md);
}
.mb-4 {
  margin-bottom: var(--spacing-lg);
}

/* Display */
.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}

/* Flexbox */
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.align-center {
  align-items: center;
}
.align-start {
  align-items: flex-start;
}
.align-end {
  align-items: flex-end;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.slide-in-left {
  animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
  animation: slideInRight 0.6s ease forwards;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark);
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
  background-color: var(--color-accent);
  color: #fff;
}

::-moz-selection {
  background-color: var(--color-accent);
  color: #fff;
}
