/* ============================================
   Liberty Grain Co. — Premium Barnwood Flags
   ============================================ */

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

:root {
  --navy: #1B2838;
  --navy-deep: #0F1923;
  --barn-red: #8B2500;
  --barn-red-light: #A83210;
  --wood: #A0835C;
  --wood-light: #C4A97D;
  --cream: #F5F0E8;
  --cream-dark: #E8E0D2;
  --charcoal: #2C2C2C;
  --charcoal-light: #3A3A3A;
  --white: #FAFAF8;
  --gold: #D4A853;

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--cream);
  background: var(--navy-deep);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* --- Grain Overlay --- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--barn-red);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--barn-red-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 37, 0, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(245, 240, 232, 0.3);
}

.btn-ghost:hover {
  border-color: var(--cream);
  background: rgba(245, 240, 232, 0.08);
}

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

.btn-outline:hover {
  background: var(--wood);
  color: var(--navy);
}

.btn-full {
  width: 100%;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.5s var(--ease-out-expo);
}

.nav.scrolled {
  background: rgba(15, 25, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 0;
  border-bottom: 1px solid rgba(160, 131, 92, 0.1);
}

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

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.nav-logo-icon {
  color: var(--gold);
  font-size: 1.1rem;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.7);
  transition: color 0.3s;
}

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

.nav-cta {
  padding: 10px 24px !important;
  background: var(--barn-red);
  color: var(--cream) !important;
}

.nav-cta:hover {
  background: var(--barn-red-light) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cream);
  transition: all 0.3s;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.05);
  transition: filter 1.5s ease;
}

.hero-img.rainbow-active {
  filter: saturate(2) hue-rotate(0deg);
  animation: rainbowCycle 2s ease-in-out;
}

@keyframes rainbowCycle {
  0% { filter: saturate(1) hue-rotate(0deg); }
  15% { filter: saturate(2.5) hue-rotate(45deg) brightness(1.1); }
  30% { filter: saturate(2.5) hue-rotate(90deg) brightness(1.1); }
  45% { filter: saturate(2.5) hue-rotate(160deg) brightness(1.1); }
  60% { filter: saturate(2.5) hue-rotate(230deg) brightness(1.1); }
  75% { filter: saturate(2.5) hue-rotate(300deg) brightness(1.1); }
  85% { filter: saturate(2.5) hue-rotate(360deg) brightness(1.1); }
  100% { filter: saturate(1) hue-rotate(0deg) brightness(1); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 25, 35, 0.5) 0%,
    rgba(15, 25, 35, 0.3) 40%,
    rgba(15, 25, 35, 0.6) 70%,
    rgba(15, 25, 35, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 24px;
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s 0.3s var(--ease-out-expo) forwards;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--cream);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s 0.5s var(--ease-out-expo) forwards;
}

.hero-title em {
  font-style: italic;
  color: var(--wood-light);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(245, 240, 232, 0.7);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s 0.7s var(--ease-out-expo) forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s 0.9s var(--ease-out-expo) forwards;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.4);
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--wood), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

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

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

/* --- Section Base --- */
.section {
  padding: 120px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 72px;
}

.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--cream);
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.05rem;
  color: rgba(245, 240, 232, 0.6);
  line-height: 1.75;
}

/* --- Fade In Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Craft Section --- */
.section-craft {
  background: var(--navy);
}

.craft-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.craft-card {
  text-align: center;
  padding: 40px 24px;
  border: 1px solid rgba(160, 131, 92, 0.12);
  background: rgba(160, 131, 92, 0.03);
  transition: all 0.5s var(--ease-out-expo);
}

.craft-card:hover {
  border-color: rgba(160, 131, 92, 0.3);
  background: rgba(160, 131, 92, 0.06);
  transform: translateY(-4px);
}

.craft-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  color: var(--gold);
}

.craft-card h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--cream);
}

.craft-card p {
  font-size: 0.9rem;
  color: rgba(245, 240, 232, 0.55);
  line-height: 1.7;
}

/* --- Gallery Section --- */
.section-gallery {
  background: var(--navy-deep);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.gallery-item-lg {
  grid-column: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out-expo);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 16px;
  background: linear-gradient(to top, rgba(15, 25, 35, 0.85), transparent);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(245, 240, 232, 0.8);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out-expo);
}

.gallery-item:hover .gallery-caption {
  transform: translateY(0);
}

/* --- Parallax Divider --- */
.parallax-divider {
  position: relative;
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.parallax-img {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  object-fit: cover;
}

.parallax-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 25, 35, 0.75);
}

.parallax-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.parallax-content blockquote {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  color: var(--cream);
  max-width: 700px;
}

/* --- Pricing Section --- */
.section-pricing {
  background: var(--navy);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}

.pricing-card {
  padding: 40px 28px;
  border: 1px solid rgba(160, 131, 92, 0.15);
  background: rgba(160, 131, 92, 0.03);
  text-align: center;
  position: relative;
  transition: all 0.5s var(--ease-out-expo);
}

.pricing-card:hover {
  border-color: rgba(160, 131, 92, 0.35);
  transform: translateY(-4px);
}

.pricing-card-featured {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.06);
  padding-top: 52px;
}

.pricing-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  background: var(--gold);
  color: var(--navy);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 20px;
  white-space: nowrap;
}

.pricing-tag {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--wood-light);
  margin-bottom: 8px;
}

.pricing-card h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 4px;
}

.pricing-size {
  font-size: 0.85rem;
  color: rgba(245, 240, 232, 0.5);
  margin-bottom: 16px;
}

.pricing-price {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  font-size: 0.85rem;
  color: rgba(245, 240, 232, 0.6);
  padding: 8px 0;
  border-bottom: 1px solid rgba(160, 131, 92, 0.08);
}

.pricing-features li:last-child {
  border-bottom: none;
}

/* --- Testimonials --- */
.section-testimonials {
  background: var(--navy-deep);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.testimonial-card {
  padding: 40px;
  border: 1px solid rgba(160, 131, 92, 0.1);
  background: rgba(160, 131, 92, 0.03);
  transition: all 0.5s var(--ease-out-expo);
}

.testimonial-card:hover {
  border-color: rgba(160, 131, 92, 0.25);
}

.testimonial-stars {
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.testimonial-card p {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.75;
  color: rgba(245, 240, 232, 0.8);
  margin-bottom: 24px;
}

.testimonial-author strong {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--cream);
}

.testimonial-author span {
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.4);
}

/* --- About Section --- */
.section-about {
  background: var(--charcoal);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-image {
  position: relative;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

.about-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(160, 131, 92, 0.2);
  pointer-events: none;
}

.about-content p {
  font-size: 1rem;
  color: rgba(245, 240, 232, 0.65);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-content .section-eyebrow,
.about-content .section-title {
  text-align: left;
}

.about-content .section-title {
  margin-bottom: 28px;
}

.about-sig {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(160, 131, 92, 0.2);
}

.about-sig-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--wood-light);
}

/* --- Contact Section --- */
.section-contact {
  background: var(--navy);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.5);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(160, 131, 92, 0.06);
  border: 1px solid rgba(160, 131, 92, 0.2);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.3s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(245, 240, 232, 0.25);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--wood);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23A0835C' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.form-group select option {
  background: var(--navy);
  color: var(--cream);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 8px;
}

.contact-info-item h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 6px;
}

.contact-info-item p {
  font-size: 0.9rem;
  color: rgba(245, 240, 232, 0.5);
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(160, 131, 92, 0.1);
  padding: 60px 0 40px;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
}

.footer-tagline {
  width: 100%;
  font-size: 0.75rem;
  color: rgba(245, 240, 232, 0.35);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-left: 30px;
  margin-top: -4px;
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  font-size: 0.8rem;
  color: rgba(245, 240, 232, 0.4);
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--cream);
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(160, 131, 92, 0.15);
  color: rgba(245, 240, 232, 0.5);
  transition: all 0.3s;
}

.footer-social a:hover {
  border-color: var(--wood);
  color: var(--cream);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(160, 131, 92, 0.08);
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(245, 240, 232, 0.25);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .craft-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--navy-deep);
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 40px;
    transition: right 0.5s var(--ease-out-expo);
    border-left: 1px solid rgba(160, 131, 92, 0.1);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-cta {
    margin-top: 16px;
  }

  .section {
    padding: 80px 0;
  }

  .section-header {
    margin-bottom: 48px;
  }

  .craft-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .gallery-item-lg {
    grid-column: span 2;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

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

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

  .about-image img {
    height: 350px;
  }

  .about-content .section-eyebrow,
  .about-content .section-title {
    text-align: center;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-tagline {
    padding-left: 0;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .parallax-divider {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

  .gallery-item-lg {
    grid-column: span 1;
  }
}
