/* ==========================================================
   Matrosskin Knit — styles.css
   Warm cashmere palette, responsive, mobile-first
   ========================================================== */

:root {
  --cream:       #FFF8F0;
  --warm-white:  #FEFCF8;
  --sand:        #E8DDD3;
  --cashmere:    #C4A882;
  --amber-warm:  #D4956A;
  --cocoa:       #6B5344;
  --charcoal:    #3A3230;
  --sage:        #8B9E82;

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

  --max-width: 1100px;
  --gap: 1.5rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--charcoal);
  background-color: var(--cream);
  line-height: 1.7;
  font-size: 16px;
}

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

/* Yarn background canvas */
#yarnCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Ensure all content layers above canvas */
main, .site-footer {
  position: relative;
  z-index: 1;
}

a {
  color: var(--amber-warm);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ==========================================================
   Header
   ========================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--sand);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--cocoa);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--amber-warm);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--charcoal);
  position: relative;
  padding-bottom: 2px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--amber-warm);
  transition: width 0.3s;
}

.main-nav a:hover::after {
  width: 100%;
}

.main-nav a:hover {
  color: var(--cocoa);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  background: none;
  border: 1px solid var(--sand);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.lang-btn:hover {
  border-color: var(--cashmere);
  color: var(--cocoa);
}

.lang-btn.active {
  background: var(--cashmere);
  border-color: var(--cashmere);
  color: var(--warm-white);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 1px;
  transition: all 0.3s;
}

/* ==========================================================
   Hero
   ========================================================== */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.hero-content {
  flex: 1;
  background: rgba(255, 248, 240, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  padding: 2rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--cocoa);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--charcoal);
  opacity: 0.8;
  margin-bottom: 2rem;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  flex: 0 0 auto;
  width: 380px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(107, 83, 68, 0.12);
}

/* ==========================================================
   Buttons
   ========================================================== */

.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--amber-warm);
  color: var(--warm-white);
  border: 1px solid var(--amber-warm);
}

.btn-primary:hover {
  background: var(--cocoa);
  border-color: var(--cocoa);
  color: var(--warm-white);
}

.btn-secondary {
  background: var(--cream);
  color: var(--cocoa);
  border: 1px solid var(--cashmere);
}

.btn-secondary:hover {
  background: var(--cashmere);
  color: var(--warm-white);
}

.btn-card {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.25rem;
  background: transparent;
  color: var(--amber-warm);
  border: 1px solid var(--sand);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-card:hover {
  border-color: var(--amber-warm);
  color: var(--cocoa);
}

/* ==========================================================
   Sections (general)
   ========================================================== */

.section {
  padding: 4rem 1.5rem;
  background: var(--cream);
}

.section:nth-child(even) {
  background: var(--warm-white);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--cocoa);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--charcoal);
  opacity: 0.7;
  margin-bottom: 2.5rem;
  max-width: 520px;
}

.section-footer-link {
  margin-top: 2rem;
  text-align: center;
}

.section-footer-link a {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--amber-warm);
}

.section-footer-link a:hover {
  color: var(--cocoa);
}

/* ==========================================================
   About
   ========================================================== */

.about-text p {
  margin-bottom: 1rem;
  max-width: 640px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-signature {
  font-style: italic;
  color: var(--cashmere);
}

/* ==========================================================
   Card grid
   ========================================================== */

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

.card {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.section:nth-child(even) .card {
  background: var(--warm-white);
  border-color: var(--sand);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(107, 83, 68, 0.1);
}

.card-body {
  padding: 1.5rem;
}

.card-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cocoa);
  margin-bottom: 0.5rem;
}

.card-body p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--charcoal);
  opacity: 0.85;
}

.card-meta {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--cashmere);
}

.favorites::before {
  content: '\2665 ';
}

/* ==========================================================
   Contact
   ========================================================== */

.contact-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--sand);
  border-radius: 6px;
  color: var(--charcoal);
  font-size: 0.95rem;
  font-weight: 400;
  transition: all 0.2s;
}

.contact-link:hover {
  border-color: var(--cashmere);
  color: var(--cocoa);
  background: var(--warm-white);
}

.contact-icon {
  font-size: 1.2rem;
}

/* ==========================================================
   Footer
   ========================================================== */

.site-footer {
  border-top: 1px solid var(--sand);
  padding: 1.5rem;
  text-align: center;
  background: var(--cream);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--cashmere);
}

/* ==========================================================
   Animations
   ========================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
}

.fade-in.visible {
  animation: fadeInUp 0.5s ease forwards;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 768px) {
  .main-nav,
  .lang-switcher {
    display: none;
  }

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

  /* Mobile menu open state — flex-wrap dropdown */
  .site-header.menu-open .header-inner {
    flex-wrap: wrap;
  }

  .site-header.menu-open .main-nav {
    display: flex;
    flex-direction: column;
    order: 10;
    flex-basis: 100%;
    padding: 1rem 0 0.75rem;
    gap: 0.75rem;
    border-top: 1px solid var(--sand);
  }

  .site-header.menu-open .lang-switcher {
    display: flex;
    order: 11;
    flex-basis: 100%;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--sand);
  }

  /* Hamburger → X animation */
  .mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

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

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

  .hero {
    flex-direction: column;
    padding: 2.5rem 1.5rem 2rem;
    gap: 2rem;
    text-align: center;
  }

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

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image {
    width: 100%;
    max-width: 400px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .contact-links {
    flex-direction: column;
    gap: 1rem;
  }
}

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

  .hero-subtitle {
    font-size: 1rem;
  }

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

/* Large screens */
@media (min-width: 1200px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-image {
    width: 440px;
  }
}
