@import 'scrollcraft.css';

:root {
  /* Brand Colors */
  --sc-canvas:     #0B0B0B;
  --sc-surface:    #111114;
  --sc-ink:        #ffffff;
  /* Increased contrast for supporting copy so it is clearly readable but remains secondary */
  --sc-ink-soft:   #b4b4bd;
  --sc-accent:     #E11D1D;
  --sc-accent-ink: #ffffff;
  
  /* Strong, clean typography */
  --sc-font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sc-font-text:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Restrained effects overrides */
  --sc-e1: 0 1px 2px hsl(0 0% 0% / 0.1);
  --sc-e2: 0 4px 12px hsl(0 0% 0% / 0.2);
  --sc-e3: 0 8px 24px hsl(0 0% 0% / 0.3);
  --sc-edge: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Base resets & layout */
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Hide grain to keep it minimal and clean */
.sc-grain { display: none !important; }

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Site header / Navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--sc-4) var(--sc-gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
}

.brand-logo {
  display: flex;
  align-items: center;
}

.header-logo-svg {
  height: 24px;
  width: auto;
  display: block;
}

@media (min-width: 860px) {
  .header-logo-svg {
    height: 28px;
  }
}

/* Hero Section */
.hero {
  min-height: 100vh;
  /* Use stable viewport height for mobile Safari if available */
  min-height: 100svh;
  display: flex;
  align-items: center;
  /* Remove center justification for an asymmetric layout */
  justify-content: flex-start;
  position: relative;
  /* Use clip instead of hidden to prevent scrollbars without breaking flex bounds */
  overflow-x: clip;
  
  /* Baseline progress matches raw scrollcraft progress on desktop pinned act */
  --hero-p: var(--sc-p, 0);
}

@media (max-width: 859px) {
  .hero {
    /* For a 100vh mobile flow act starting at y=0, raw progress goes ~0.5 -> 1.0 */
    /* Normalize it to start at 0 */
    --hero-p: min(1, max(0, calc((var(--sc-p, 0) - 0.5) * 2)));
  }
}

.hero-content {
  text-align: left;
  z-index: 10;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-left: var(--sc-gutter);
  padding-right: var(--sc-gutter);
  
  /* Scroll-linked content exit (begins at 60% progress) */
  opacity: min(1, max(0.25, calc(1 - (var(--hero-p, 0) - 0.6) * 1.875)));
  transform: translateY( min(0px, max(-30px, calc((var(--hero-p, 0) - 0.6) * -75px))) );
  will-change: transform, opacity;
}

@media (min-width: 860px) {
  .hero-content {
    /* Push the content box inward from the left to create purposeful whitespace
       and align visually with the top-left wordmark on desktop */
    padding-left: clamp(var(--sc-gutter), 12vw, 280px);
  }
}

.hero-content h1 {
  /* Pull supporting copy up closer to the headline */
  margin-bottom: var(--sc-3);
  /* Custom clamp ensures 'Automatización.' fits narrow mobile viewports natively */
  font-size: clamp(2.2rem, 10vw, 6.8rem);
  line-height: var(--sc-leading-none);
  word-break: keep-all; /* Prevent awkward mid-word breaks */
  white-space: pre-line; /* Renders literal newline characters from data-lang */
}

.hero-content p {
  font-size: var(--sc-t-lg);
  color: var(--sc-ink-soft);
  max-width: 580px;
  /* Pull CTAs up closer by reducing the bottom margin from sc-6 to sc-5 */
  margin: 0 0 var(--sc-5) clamp(2px, 4vw, 80px);
  padding-left: var(--sc-4);
  border-left: 1px solid rgba(255,255,255,0.1);
  line-height: 1.5;
  white-space: pre-line; /* Renders literal newline characters from data-lang */
}

.hero-ctas {
  display: flex;
  gap: var(--sc-4);
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  /* Align CTAs with the support copy */
  margin-left: clamp(2px, 4vw, 80px);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sc-ink);
  color: var(--sc-canvas);
  /* Understated premium sizing */
  padding: 10px 24px;
  font-size: var(--sc-t-sm);
  border-radius: var(--sc-r-pill);
  font-weight: 500;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-commercial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E11D1D;
  color: #FFFFFF;
  /* Understated premium sizing */
  padding: 10px 24px;
  font-size: var(--sc-t-sm);
  border-radius: var(--sc-r-pill);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-commercial:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--sc-ink);
  /* Understated premium sizing */
  padding: 10px 24px;
  font-size: var(--sc-t-sm);
  border-radius: var(--sc-r-pill);
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Official Brand Monogram (Hero) */
.hero-brand-mark {
  position: absolute;
  top: 50%;
  right: -6vw;
  left: auto;
  transform: translateY(-50%);
  width: clamp(180px, 52vw, 240px);
  height: auto;
  z-index: 1;
  pointer-events: none;
}

@media (min-width: 860px) {
  .hero-brand-mark {
    right: 10vw;
    width: min(70vw, 75vh);
  }
}

.hero-monogram {
  width: 100%;
  height: auto;
  opacity: 0.15; /* Subtle depth, not overpowering */
  
  /* Scroll-linked transformation using Scrollcraft progress */
  transform: translateY(calc(var(--hero-p, 0) * -12px)) 
             scale(calc(1 + (var(--hero-p, 0) * 0.03))) 
             rotate(calc(var(--scroll-vh, 0) * 22.857deg));
             
  will-change: transform;
}

@media (max-width: 859px) {
  .hero-monogram {
    opacity: calc(0.15 + (var(--hero-p, 0) * 0.13));
    transform: translateY(calc(var(--hero-p, 0) * -20px)) 
               scale(calc(1 + (var(--hero-p, 0) * 0.06))) 
               rotate(calc(var(--scroll-vh, 0) * 25deg));
    will-change: transform, opacity;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-monogram {
    transform: none !important;
  }
}

/* Section Shared */
.section-content {
  max-width: 900px;
  margin: 0 auto;
}

/* Podcast Section */
.podcast-section {
  padding: var(--sc-11) var(--sc-gutter);
  background: var(--sc-surface);
  position: relative;
  z-index: 20; /* Sit above the pinned hero when flowing over */
}

.podcast-container {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.05); /* Editorial separator */
  padding-top: var(--sc-8);
}

@media (max-width: 859px) {
  .podcast-section {
    padding-top: var(--sc-6);
    padding-bottom: var(--sc-8);
  }

  .podcast-container {
    padding-top: var(--sc-5);
  }
}

.podcast-header-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: var(--sc-8);
}

@media (min-width: 860px) {
  .podcast-header-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.podcast-header-row h2 {
  margin-bottom: var(--sc-2);
}

.podcast-header-row p {
  color: var(--sc-ink-soft);
  max-width: 500px;
  font-size: var(--sc-t-lg);
  margin: 0;
}

/* Global Language Toggle */
.global-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sc-2);
}

.g-lang-btn {
  background: transparent;
  border: none;
  color: var(--sc-ink-soft);
  padding: 0;
  font-size: var(--sc-t-xs);
  font-family: var(--sc-font-display);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
  letter-spacing: var(--sc-track-wide);
}

.g-lang-btn:hover {
  color: var(--sc-ink);
}

.g-lang-btn.active {
  color: var(--sc-ink);
  font-weight: 700;
}

.g-lang-divider {
  color: rgba(255,255,255,0.1);
  font-size: var(--sc-t-xs);
}

/* Podcast Links */
.podcast-links-wrapper {
  width: 100%;
}

.podcast-links {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.05);
}

@media (min-width: 860px) {
  .podcast-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: none;
  }
}

/* CRITICAL FIX: The previous bug occurred because the class in HTML was 
   'podcast-links hidden', but the CSS selector targeted '.podcast-link.hidden' (singular). */
.podcast-links.hidden {
  display: none !important;
}

.podcast-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 16px;
  text-decoration: none;
  color: var(--sc-ink);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s ease, transform 0.2s ease;
}

.podcast-link:active {
  transform: scale(0.99);
  background: rgba(255, 255, 255, 0.015);
}

@media (min-width: 860px) {
  .podcast-link {
    padding: 28px 32px;
    border-bottom: none;
    border-left: 1px solid rgba(255,255,255,0.05);
  }
  .podcast-link:last-child {
    border-right: 1px solid rgba(255,255,255,0.05);
  }
  .podcast-link:hover {
    background: rgba(255,255,255,0.025);
  }
}

.podcast-platform {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: var(--sc-ink-soft);
  transition: color 0.2s ease;
}

.icon-container {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-container svg {
  display: block;
  flex: none;
}

.platform-icon-spotify { width: 36px; height: 36px; }
.platform-icon-apple   { width: 44px; height: 44px; }
.platform-icon-youtube { width: 44px; height: 44px; }



.platform-icon {
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

@media (min-width: 860px) {
  .podcast-link:hover .podcast-platform {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  color: var(--sc-ink-soft);
  transition: color 0.2s ease;
}
  .podcast-link:hover .podcast-platform .platform-icon {
    opacity: 1;
  }
}

.podcast-link-icon {
  opacity: 0.3;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  font-family: var(--sc-font-display);
}

@media (min-width: 860px) {
  .podcast-link:hover .podcast-link-icon {
    opacity: 1;
    transform: translateX(5px);
    color: #E11D1D;
  }
}

/* Newsletter Section */
.newsletter-section {
  padding: var(--sc-11) var(--sc-gutter);
  background: var(--sc-canvas);
}

.newsletter-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sc-7);
  border-top: 1px solid rgba(255,255,255,0.05); /* Connects to the editorial system */
  padding-top: var(--sc-8);
}

@media (min-width: 860px) {
  .newsletter-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.newsletter-text {
  max-width: 680px;
}

.newsletter-text h2 {
  margin-bottom: var(--sc-4);
}

.newsletter-text p.sc-lede {
  color: var(--sc-ink-soft);
  margin: 0;
}

.newsletter-action {
  display: flex;
  align-items: center;
}

.newsletter-editorial-cta {
  display: inline-flex;
  align-items: center;
  color: var(--sc-ink);
  font-family: var(--sc-font-display);
  font-size: var(--sc-t-lg);
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding-bottom: var(--sc-2);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.newsletter-editorial-cta:hover {
  opacity: 0.9;
}

.editorial-cta-icon {
  margin-left: var(--sc-3);
  color: var(--sc-accent); /* Restrained use of accent */
  transition: transform 0.2s ease;
}

.newsletter-editorial-cta:hover .editorial-cta-icon {
  transform: translateX(4px) rotate(-45deg); /* Elegant directional shift */
}

.btn-accent {
  display: inline-flex;
  background: var(--sc-accent);
  color: var(--sc-accent-ink);
  padding: var(--sc-4) var(--sc-7);
  border-radius: var(--sc-r-pill);
  font-weight: 600;
  font-size: var(--sc-t-base);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-accent:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

/* About Section */
.about-section {
  padding: var(--sc-11) var(--sc-gutter);
  background: var(--sc-surface);
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p.sc-lede {
  color: var(--sc-ink-soft);
  margin-top: var(--sc-4);
  margin-bottom: var(--sc-7);
}

.brand-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-6);
  margin-top: var(--sc-7);
  padding-top: var(--sc-7);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.pillar {
  font-family: var(--sc-font-display);
  font-size: var(--sc-t-lg);
  font-weight: 300;
  letter-spacing: var(--sc-track-wide);
  color: var(--sc-ink);
}

/* Contact Section */
.contact-section {
  padding: var(--sc-11) var(--sc-gutter);
  background: var(--sc-canvas);
}

.contact-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sc-7);
}

@media (min-width: 860px) {
  .contact-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.contact-text {
  max-width: 680px;
}

.contact-text h2 {
  margin-bottom: var(--sc-4);
}

.contact-text p.sc-lede {
  color: var(--sc-ink-soft);
  margin: 0;
}

.contact-ctas {
  display: flex;
  gap: var(--sc-4);
  flex-wrap: wrap;
  align-items: center;
}

.contact-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 16px;
  color: var(--sc-ink-soft);
  text-decoration: none;
  font-size: var(--sc-t-xs);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--sc-r-pill);
  background: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.contact-social-link:hover {
  color: #E11D1D;
  border-color: rgba(225, 29, 29, 0.4);
  transform: translateY(-1px);
}

.contact-social-icon {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.contact-social-link:hover .contact-social-icon {
  opacity: 1;
}

/* Footer */
.site-footer {
  padding: var(--sc-8) var(--sc-gutter);
  background: var(--sc-canvas);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content {
  max-width: var(--sc-maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sc-6);
}

@media (min-width: 860px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand h3 {
  font-family: var(--sc-font-display);
  font-size: var(--sc-t-base);
  margin: 0 0 var(--sc-2) 0;
  font-weight: 600;
}

.footer-brand p {
  margin: 0;
  color: var(--sc-ink-soft);
  font-size: var(--sc-t-sm);
  letter-spacing: var(--sc-track-wide);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-6);
}

.footer-links a {
  color: var(--sc-ink-soft);
  font-size: var(--sc-t-sm);
  transition: color 0.2s ease;
}

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

.footer-bottom {
  margin-top: var(--sc-6);
  color: var(--sc-ink-soft);
  font-size: var(--sc-t-xs);
  opacity: 0.6;
}

/* Desktop layout & sizes */
@media (min-width: 860px) {
  .podcast-platform {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .icon-container {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
  }
  .platform-icon-spotify { width: 48px; height: 48px; }
  .platform-icon-apple   { width: 56px; height: 56px; } /* ~46px optical height */
  .platform-icon-youtube { width: 56px; height: 56px; } /* ~46px optical width */
}
