/* ============================================
   FlowStrap — Design System & Global Styles
   ============================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Inter:wght@300;400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary: #0D0D0D;
  --bg-secondary: #1A1A1A;
  --bg-card: #222222;
  --text-primary: #F5F0E8;
  --text-secondary: #8A8478;
  --accent-gold: #B8965A;
  --accent-gold-hover: #D4AD6A;
  --border-subtle: #2A2A2A;
  --transition-smooth: 0.3s ease;

  /* Typography */
  --font-heading: 'Syne', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  /* Spacing */
  --section-padding: clamp(4rem, 10vw, 8rem);
  --content-max-width: 1200px;
  --content-narrow: 800px;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grain texture overlay */
body::after {
  content: '';
  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: 256px 256px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

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

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

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 500;
}

p {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 65ch;
}

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

a:hover {
  color: var(--accent-gold-hover);
}

/* --- Pull Quotes & Accent Text --- */
.pull-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 500;
  color: var(--accent-gold);
  letter-spacing: 0.02em;
  line-height: 1.4;
  max-width: 50ch;
}

.accent-text {
  color: var(--accent-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-heading);
}

/* --- Layout --- */
main {
  position: relative;
  z-index: 1;
}

.section {
  padding: var(--section-padding) 1.5rem;
  position: relative;
}

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

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

.section--dark {
  background-color: var(--bg-secondary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--accent-gold-hover);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  transform: translateY(-1px);
}

/* --- Forms --- */
.email-form {
  display: flex;
  gap: 0;
  max-width: 480px;
  width: 100%;
}

.email-form input[type="email"] {
  flex: 1;
  padding: 0.875rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-right: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  border-radius: 2px 0 0 2px;
  outline: none;
  transition: border-color var(--transition-smooth);
}

.email-form input[type="email"]::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.email-form input[type="email"]:focus {
  border-color: var(--accent-gold);
}

.email-form button {
  padding: 0.875rem 1.5rem;
  background: var(--accent-gold);
  color: var(--bg-primary);
  border: 1px solid var(--accent-gold);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  transition: all var(--transition-smooth);
  white-space: nowrap;
}

.email-form button:hover {
  background: var(--accent-gold-hover);
  border-color: var(--accent-gold-hover);
}

.email-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-success {
  color: var(--accent-gold);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 0.875rem 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.4) contrast(1.1) saturate(0.9);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(13, 13, 13, 0.3) 0%,
    rgba(13, 13, 13, 0.6) 50%,
    rgba(13, 13, 13, 0.95) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-logo {
  width: 80px;
  height: auto;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  filter: brightness(1.1);
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.hero .email-form {
  margin: 0 auto 3rem;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-gold);
  stroke-width: 2;
  fill: none;
  opacity: 0.7;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.8; transform: translateX(-50%) translateY(6px); }
}

/* --- Practice Grid --- */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}

.practice-item {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 2px;
  cursor: pointer;
}

.practice-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
  filter: saturate(0.85) contrast(1.05);
}

.practice-item:hover img {
  transform: scale(1.05);
}

.practice-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(13, 13, 13, 0.8) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.practice-item:hover::after {
  opacity: 1;
}

.practice-item:hover {
  box-shadow: 0 0 0 1px var(--accent-gold);
}

.practice-label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-smooth);
}

.practice-item:hover .practice-label {
  opacity: 1;
  transform: translateY(0);
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

/* --- About Page --- */
.about-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: 4rem 1.5rem;
  overflow: hidden;
}

.about-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
  filter: brightness(0.7) contrast(1.05) saturate(0.9);
}

.about-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 13, 13, 0.05) 0%,
    rgba(13, 13, 13, 0.65) 100%
  );
  z-index: 1;
}

.about-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

.about-hero-content h1 {
  margin-bottom: 0.5rem;
}

.about-hero-content .hero-sub {
  margin-bottom: 0;
}

.about-story {
  display: grid;
  gap: 3rem;
}

.about-story p {
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  line-height: 1.8;
  color: var(--text-primary);
  opacity: 0.85;
}

.about-image-break {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 2px;
  margin: 2rem 0;
  filter: saturate(0.85) contrast(1.05);
}

/* --- Shop Page --- */
.shop-header {
  text-align: center;
  padding-top: calc(var(--section-padding) + 4rem);
}

.shop-header p {
  margin: 1rem auto 0;
}

.shop-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.shop-info h3 {
  margin-bottom: 1rem;
}

.shop-info p {
  line-height: 1.8;
}

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-stagger.revealed > *:nth-child(7) { transition-delay: 0.6s; }
.reveal-stagger.revealed > *:nth-child(8) { transition-delay: 0.7s; }
.reveal-stagger.revealed > *:nth-child(9) { transition-delay: 0.8s; }

.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1rem 2rem;
  border: 1px solid var(--accent-gold);
  border-radius: 2px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .email-form {
    flex-direction: column;
    gap: 0;
  }

  .email-form input[type="email"] {
    border-right: 1px solid var(--border-subtle);
    border-radius: 2px 2px 0 0;
  }

  .email-form button {
    border-radius: 0 0 2px 2px;
  }

  .shop-info {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-hero {
    min-height: 50vh;
  }
}

@media (max-width: 480px) {
  .practice-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

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

  h1 {
    font-size: 2rem;
  }
}

/* --- Image filter for visual cohesion --- */
img.cohesion {
  filter: saturate(0.85) contrast(1.05) brightness(0.95);
}

/* --- Selection --- */
::selection {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
