/* 
  Page: Rene Morales Portfolio
  Aesthetic: Slumber.fm inspired - soft, modern, warm, intuitive
  Fonts: Outfit (Display), Inter (Body)
  Colors: Warm peach, soft teal, deep slate, off-white
  Breakpoints: mobile-first
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* Color System */
  --blue-slate: #4f6d7aff;
  --pale-sky: #c0d6dfff;
  --alice-blue: #dbe9eeff;
  --smart-blue: #4a6fa5ff;
  --baltic-blue: #166088ff;

  --color-bg: #dbe9eeb3;
  --color-surface: #FFFFFF;
  --color-text: var(--baltic-blue);
  --color-text-muted: var(--blue-slate);
  --color-accent: var(--smart-blue);
  --color-accent-hover: var(--baltic-blue);
  --color-secondary: var(--pale-sky);
  --color-border: var(--pale-sky);
}

[data-theme="dark"] {
  --color-bg: #111A22;
  --color-surface: #1E2B38;
  --color-text: var(--alice-blue);
  --color-text-muted: var(--pale-sky);
  --color-accent: var(--smart-blue);
  --color-accent-hover: #5A84BD;
  --color-secondary: var(--baltic-blue);
  --color-border: #2B3D4F;
}

:root {
  /* Typography Scale (Modular) */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --text-display: clamp(2.5rem, 5vw, 4rem);
  --text-h1: clamp(2rem, 4vw, 3rem);
  --text-h2: clamp(1.5rem, 3vw, 2.25rem);
  --text-h3: clamp(1.25rem, 2vw, 1.75rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-caption: 0.75rem;

  /* Spacing System */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --section-padding: clamp(4rem, 8vw, 8rem);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar,
.card,
.timeline-item,
.skill-pill,
.footer,
.soundcloud-widget {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6,
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

ul,
ol {
  list-style: none;
}

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

/* Layout Core */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--section-padding) 0;
}

.section-alt {
  background-color: #F8F9FA;
}

[data-theme="dark"] .section-alt {
  background-color: rgba(0, 0, 0, 0.2);
  /* Darken section background slightly */
}

/* Typography Utilities */
.text-display {
  font-size: var(--text-display);
}

.text-h1 {
  font-size: var(--text-h1);
}

.text-h2 {
  font-size: var(--text-h2);
}

.text-h3 {
  font-size: var(--text-h3);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 159, 28, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 159, 28, 0.3);
}

.btn-secondary {
  background-color: white;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: #F8F9FA;
  transform: translateY(-2px);
  border-color: #E2E2EA;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(219, 233, 238, 0.9);
  /* Alice blue transparent */
  backdrop-filter: blur(12px);
  z-height: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

[data-theme="dark"] .navbar {
  background: rgba(17, 26, 34, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .skill-pill,
[data-theme="dark"] .timeline-item {
  background: var(--color-surface);
}

.theme-toggle-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
}

.nav-brand span {
  color: #73d305;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  font-weight: 500;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  /* Account for nav */
}

/* Gentle animated background blob */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(192, 214, 223, 0.3) 0%, rgba(74, 111, 165, 0.1) 100%);
  filter: blur(80px);
  border-radius: 50%;
  z-index: -1;
  animation: float 10s ease-in-out infinite alternate;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-30px, 30px) scale(1.05);
  }
}

.hero-content {
  max-width: 600px;
}

.hero-eyebrow {
  display: inline-block;
  padding: 0.25rem 1rem;
  background-color: rgba(192, 214, 223, 0.3);
  color: #b7d305;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero .display {
  margin-bottom: var(--space-4);
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 500px;
}

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

/* Soundcloud Floating Widget */
.soundcloud-widget {
  position: absolute;
  right: 5%;
  bottom: 10%;
  width: 320px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  padding: var(--space-4);
  transition: transform 0.3s ease;
  z-index: 10;
}

.soundcloud-widget:hover {
  transform: translateY(-4px);
}

.soundcloud-widget iframe {
  border-radius: 8px;
  width: 100%;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.skill-pill {
  padding: 0.5rem 1.25rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-pill:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Works & Goods Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-7);
}

.card {
  background: var(--color-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background-color: #F8F9FA;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-3);
  transition: transform 0.3s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: var(--space-4);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.card-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Experience / Credit Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 600px;
  margin: var(--space-7) auto 0;
}

.timeline-item {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  background: white;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(8px);
  border-color: var(--color-secondary);
}

.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(192, 214, 223, 0.3);
  color: #73d30542;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-4);
  font-weight: bold;
}

.timeline-content h3 {
  font-size: 1.125rem;
  margin-bottom: 2px;
}

/* Footer / Contact */
.footer {
  background: var(--color-surface);
  padding: var(--space-8) 0 var(--space-6);
  border-top: 1px solid var(--color-border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.contact-info h2 {
  margin-bottom: var(--space-3);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 500;
  color: var(--color-text);
}

.contact-link:hover {
  color: var(--color-accent);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Entry Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

.reveal {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-play-state: paused;
}

.reveal.in-view {
  animation-play-state: running;
}

/* Animations delays */
.d-1 {
  animation-delay: 100ms;
}

.d-2 {
  animation-delay: 200ms;
}

.d-3 {
  animation-delay: 300ms;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    justify-content: center;
    padding-top: 120px;
    text-align: center;
  }

  .hero-content {
    margin: 0 auto;
  }

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

  .hero p {
    margin: 0 auto var(--space-6);
  }

  .soundcloud-widget {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 400px;
    margin: var(--space-8) auto 0;
  }
}

@media (max-width: 768px) {

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--color-surface);
    flex-direction: column;
    padding: var(--space-5);
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, background-color 0.3s ease;
    border-bottom: 1px solid var(--color-border);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

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

@media (max-width: 480px) {
  :root {
    --section-padding: 4rem;
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}