:root {
  /* Colors & Surface Philosophy */
  --primary: #ffb77c;
  --primary-container: #d27c27;
  --burnt-orange: #CC7722;

  --surface: #131313;
  --surface-container-lowest: #0e0e0e;
  --surface-container-low: #131313;
  /* Guessed between lowest and regular */
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  /* Guessed for tonal stacking */
  --surface-container-highest: #333333;

  --surface-dim: #0a0a0a;
  --surface-bright: #393939;

  --on-surface: #ffffff;
  --on-surface-variant: #b3b3b3;

  --outline-variant: rgba(255, 255, 255, 0.15);
  /* 15% opacity ghost border */

  /* Typography */
  --font-display: 'Epilogue', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-label: 'Space Grotesk', sans-serif;

  /* Spacing Scale */
  --spacing-4: 1.4rem;
  --spacing-8: 2rem;
  --spacing-12: 4rem;
  --spacing-16: 5.5rem;

  /* Radii */
  --radius-md: 0.375rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Elevations & Shadows */
  --shadow-ambient: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  overflow: hidden;
  min-height: 100vh;
}

/* Typography Classes */
.display-lg {
  font-family: var(--font-display);
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.1;
}

.display-lgc {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--spacing-4);
  text-align: center;
}

.body-lg {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--on-surface-variant);
}

.label-md {
  font-family: var(--font-label);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: var(--surface-container-lowest);
  box-shadow: 0 4px 15px rgba(210, 124, 39, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(210, 124, 39, 0.4);
  filter: brightness(1.1);
}

.btn-secondary {
  background-color: var(--surface-bright);
  color: var(--on-surface);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: var(--surface-container-highest);
}

.btn-tertiary {
  background: transparent;
  color: var(--primary);
  font-family: var(--font-label);
  font-size: 0.875rem;
  padding: 0;
  position: relative;
}

.btn-tertiary::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.btn-tertiary:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Layout Utilities */
.container {
  margin: 0 auto;
}

/* .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-4) var(--spacing-8);
} */


/* Glassmorphism */
.glass-panel {
  background: rgba(32, 31, 31, 0.6);
  /* surface_container at 60% */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-ambient);
  border-radius: var(--radius-xl);
  /* The "Ghost Border" Fallback */
  border: 1px solid var(--outline-variant);
}

/* Rhythmic Fade Animations */
.animate-rhythm {
  opacity: 0;
  transform: translateY(10px);
  animation: rhythmicFadeIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes rhythmicFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-4) var(--spacing-16);
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-lockup img {
  height: 48px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: 0.02em;
}

.logo-text .brand-sub {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary-container);
}

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

.nav-links a {
  color: var(--on-surface);
  text-decoration: none;
  font-family: var(--font-label);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Home Page Specifics */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 120px);
  align-items: center;
}



.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  max-width: 600px;
  margin-left: var(--spacing-16);
}

.hero-label {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: var(--radius-xl);
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  width: fit-content;
}

.hero-title {
  font-size: 4.5rem;
  /* Larger than default display-lg for hero */
  line-height: 1.05;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  max-width: 80%;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-4);
}

/* Figma-Based Auto Layout (Flexbox) Logo Grid */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 200px);
  grid-template-rows: repeat(5, 200px);
  gap: 20px;
  justify-content: center;
  align-content: center;
  /* Rotate the whole grid by 45 degrees */
  transform: rotate(45deg) scale(.9);
  transform-origin: center center;
  position: absolute;
  right: -200px;
  /* Offset to the right to create the edge crop effect */
  bottom: -180px;
  /* Offset downwards for the bottom crop */
}

.rotated-line {
  display: contents;
  /* Grid items will ignore this wrapper and align directly to .hero-grid */
}

.grid-item {
  width: 200px;
  height: 200px;
  background: rgba(32, 31, 31, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 13.63px;
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-ambient);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s ease;
  overflow: hidden;
}

.grid-item-visible {
  width: 200px;
  height: 200px;
  background: rgba(32, 31, 31, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 13.63px;
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-ambient);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.grid-item-invisible {
  visibility: hidden;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.grid-item:hover {
  background: rgba(255, 183, 124, 0.1);
  transform: scale(1.02);
  z-index: 10;
}

.grid-item img {
  transform: rotate(-45deg);
  width: 60%;
  height: 60%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.grid-item:hover img {
  transform: rotate(-45deg) scale(1.1);
}

.grid-crop-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 800px;
  /*overflow: hidden;*/
  overflow-x: hidden;
  overflow-y: hidden;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* Forms */
.contact-section {
  overflow: scroll;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  margin-top: var(--spacing-8);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
}

.form-container {
  padding: var(--spacing-8);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--on-surface-variant);
  margin-bottom: 2px;
}

.input-field {
  background-color: var(--surface-container-low);
  border: none;
  /* explicitly no bottom border per guidelines */
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: none;
}

.input-field:focus {
  background-color: var(--surface-container-high);
  box-shadow: 0 0 2px var(--primary);
  /* subtle primary glow */
}

.input-field::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.5;
}

/* Custom Checkbox Group Styling */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
  user-select: none;
}

.checkbox-label:hover {
  opacity: 0.8;
}

/* Custom Checkbox Appearance */
.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background-color: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 183, 124, 0.3);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--surface-container-lowest);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label span {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--on-surface-variant);
  transition: color 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked+span {
  color: var(--on-surface);
}

/* Validation styling */
.checkbox-group.invalid {
  border: 1px solid rgba(255, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 0, 0, 0.05);
}


@media (max-width: 1200px) {
  body {
    overflow-y: auto;
  }

  .hero-section {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    row-gap: 0;
    min-height: calc(100vh - 120px);
    align-items: flex-start;
  }

  .hero-content {
    margin: var(--spacing-8);
    margin-bottom: -100px;
    /* Fully compensates for the 0.7 scale phantom space */
    max-width: none;
    width: 100%;
    transform: scale(0.9);
    transform-origin: left top;
    z-index: 2;
  }

  .hero-desc {
    max-width: none;
  }

  /* .hero-title {
    font-size: 4rem;
  } */


  /*Grid Properties*/
  .grid-crop-wrapper {
    height: 420px;
    overflow: hidden;
    align-self: flex-end;
  }

  .hero-grid {
    transform: rotate(45deg) scale(.6);
    right: -300px;
    bottom: -300px;
  }


  nav {
    padding: var(--spacing-4) var(--spacing-8);
  }

  .logo-lockup {
    transform: scale(0.7);
    transform-origin: left center;
  }
}

@media (max-width: 800px) {
  .contact-section {
    align-items: flex-start;
    transform: scale(.9);
    margin-top: -30px;
  }

  .display-lgc {
    font-size: 2rem;
  }
}


@media (max-width: 500px) {
  body {
    overflow-y: auto;
  }

  nav {
    padding: 0 var(--spacing-4);
  }

  .logo-lockup {
    transform: scale(0.6);
    transform-origin: left center;
  }


  .hero-section {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    row-gap: 0;
    min-height: calc(100vh - 80px);
    align-items: flex-start;
  }

  .hero-content {
    margin: var(--spacing-8);
    margin-bottom: -100px;
    /* Fully compensates for the 0.7 scale phantom space */
    max-width: none;
    width: 120%;
    transform: scale(0.7);
    transform-origin: left top;
    z-index: 2;
  }

  .hero-desc {
    max-width: none;
  }

  .hero-title {
    font-size: 4rem;
  }


  /*Grid Properties*/
  .grid-crop-wrapper {
    height: 380px;
    overflow: hidden;
    align-self: flex-end;
  }

  .hero-grid {
    transform: rotate(45deg) scale(.5);
    right: -340px;
    bottom: -340px;
  }


  .form-container {
    padding: var(--spacing-8) 16px;
  }
}