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

:root {
  --cream:        #f5f0e8;
  --sage:         #8aa095;
  --rose:         #c9909a;
  --petal:        #edafb8;
  --forest:       #2f6f5e;
  --ink:          #1a1a1a;
  --card-bg:      #d8e2dc;
}

/* base*/
body {
  font-family: 'Inter', system-ui, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
}


.page {
  position: relative;
}

/* lateral flowers*/
.page::before,
.page::after {
  content: "";
  position: fixed;
  top: 60px;
  width: 300px;
  height: 90vh;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: var(--vine-opacity, 0.35);
  z-index: 0;
}
.page::before { left: -100px;  background-image: url("assets/vine-left.png"); }
.page::after  { right: -100px; background-image: url("assets/vine-right.png"); }

.hero, .piano-bar, .piano-divider, main, footer {
  position: relative;
  z-index: 1;
}

/* hero slideshow*/
.hero {
  position: relative;
  min-height: calc(100vh - 270px);
  display: flex;
  align-items: center;
}


.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.slide.active { opacity: 1; }



.slide-1 {
  background-image: url(./assets/cuadro1.jpg);
  background-size: cover;
  background-position: center;
}
.slide-2 {
  background-image: url(./assets/cuadro6.jpg);
  background-size: cover;
  background-position: center;  
}
.slide-3 {
  background-image: url(./assets/cuadro7.jpg);
  background-size: cover; 
  background-position: center;
    
}
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  opacity: 0.5;
}

/* Dots of slideshow */
.slide-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}
.dot.active {
  background: rgba(47,111,94,0.6);
  transform: scale(1.3);
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  background-color: #e7d9dcd8;
}

.hero-text { max-width: 600px; text-align: justify; }

.hero-header {
  border-top: 1px solid rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  padding: 20px 0;
  margin-bottom: 30px;
}
.hero-header h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
}
.hero-header h2 {
  margin-top: 10px;
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.75;
  letter-spacing: 0.01em;
  line-height: 1.6;
}
.hero-text h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 14px;
  
}
.hero-text p {
  font-size: 0.92rem;
  line-height: 1.75;
  opacity: 0.8;
  margin-bottom: 12px;
}

.bold {
  font-weight: bold;
  font-size: 15px;
}
.hero-image {
  flex-shrink: 0;
  transform: rotate(-2deg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-image img { width: 220px; height: 220px; object-fit: cover; display: block; }
.hero-image:hover { transform: rotate(1deg) translateY(-6px) scale(1.02); }

/* piano bar sticky in the top of the page*/
.piano-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 8px 0 12px;   
  background: rgba(247, 243, 238, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.piano {
  position: relative;
  width: 560px;
  height: 140px;
  margin: 16px auto 0;
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  background: #f7f3ee;
}
.piano button { font-family: system-ui, Arial; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; }

.piano .white { flex: 1; border: none; background: #fff; border-right: 1px solid rgba(0,0,0,0.08); position: relative; }
.piano .white:last-child { border-right: none; }
.piano .white:active { transform: translateY(2px); filter: brightness(0.97); }

.piano .black {
  position: absolute; top: 0;
  width: 48px; height: 98px;
  border: none; background: #121212;
  border-radius: 0 0 8px 8px; z-index: 2;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25); color: white;
}
.piano .black:active { transform: translateY(2px); filter: brightness(1.08); }

.piano .b1 { left: 56px; }
.piano .b2 { left: 136px; }
.piano .b4 { left: 296px; }
.piano .b5 { left: 376px; }
.piano .b6 { left: 456px; }

.piano-controls {
  display: flex; gap: 10px;
  justify-content: center; align-items: center;
  margin-top: 10px;
}
.button { transition: all 0.3s ease-in-out; }
.button:hover { background-color: var(--petal); }
.button.small {
  width: auto; padding: 8px 12px;
  border-radius: 10px; border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.7);
  font-size: 13px; font-family: 'Inter', sans-serif; cursor: pointer;
}

/* Piano container + kbd panel */
.piano-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: transform 0.4s ease;
}
.piano-container.shift { transform: translateX(-6%); }

.kbd-mini {
  position: absolute;
  top: 20px;
  left: calc(50% + 296px);
  width: 260px;
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.35s ease;
  pointer-events: none;
  background: rgba(247,243,238,0.97);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.09);
  z-index: 10;
}
.kbd-mini.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.kbd-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: baseline;
  margin: 6px 0;
}
.kbd-label { letter-spacing: 0.04em; font-weight: 600; }
.kbd-seq { font-family: Inter, sans-serif; letter-spacing: 0.12em; font-size: 12px; opacity: 0.8; line-height: 1.6; word-break: break-word; }
.kbd-hint { margin-top: 10px; font-size: 12px; font-family: Inter, sans-serif; opacity: 0.6; text-align: right; }

section { scroll-margin-top: 220px; }
.piano button.pressed { transform: translateY(2px); filter: brightness(0.95); }
.piano .black.pressed { filter: brightness(1.08); }

/* Divider */
.piano-divider { display: flex; flex-direction: column; gap: 4px; }
.divider-line { height: 1px; background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent); }

/* Section titles*/
.section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 40px; font-weight: 500;
  text-align: center;
  margin: 80px 0 30px;
  letter-spacing: 0.04em;
  position: relative;
}
.section-title::after {
  content: ""; display: block;
  width: 60px; height: 1px;
  background: rgba(0,0,0,0.3);
  margin: 18px auto 0;
}

/* studies */
.about-stack {
  max-width: 1100px;
  margin: 60px auto 130px;
  display: flex; flex-direction: column; gap: 15px;
  position: relative;
}
.about-card {
  background: var(--card-bg);
  width: 80%; padding: 20px 30px;
  position: relative; border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: all 0.6s ease;
  opacity: 0; transform: translateY(40px);
  display: grid; grid-template-columns: 180px 1fr;
  gap: 20px; align-items: start;
}
.about-card:nth-child(odd)  { align-self: flex-start; transform: translateX(-30px) translateY(30px); text-align: center; }
.about-card:nth-child(even) { align-self: flex-end;   transform: translateX(30px)  translateY(30px); text-align: center; }
.about-card.visible { opacity: 1; transform: translateY(0); }

.about-card h3 { font-family: "Cormorant Garamond", serif; font-weight: 600; margin-bottom: 4px; font-size: 22px; }
.about-card h3::after { content: ""; display: block; width: 40px; height: 2px; background: var(--sage); margin: 8px auto 12px; }
.about-card h4 { font-family: "Inter", sans-serif; font-size: 14px; opacity: 0.6; margin-bottom: 16px; text-align: center; letter-spacing: 0.03em; }
.about-card p  { font-family: "Inter", sans-serif; font-size: 14px; opacity: 0.75; text-align: justify; line-height: 1.6; margin-bottom: 10px; }
.about-card li { font-family: "Inter", sans-serif; font-size: 14px; opacity: 0.75; text-align: left; margin-left: 20px; margin-bottom: 6px; }
.card-left { text-align: center; }
.card-right { text-align: left; }

.about-stack::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: 2px; height: 100%;
  background: linear-gradient(to bottom, rgba(120,140,130,0.1), rgba(120,140,130,0.4), rgba(120,140,130,0.1));
  transform: translateX(-50%);
}
.about-card::before {
  content: ""; position: absolute; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--sage); box-shadow: 0 0 0 6px rgba(138,160,149,0.08);
  transition: all 0.4s ease;
}
.about-card:nth-child(odd)::before  { right: -42px; }
.about-card:nth-child(even)::before { left: -42px; }
.about-card:hover { transform: translateY(-6px); box-shadow: 0 14px 35px rgba(0,0,0,0.1); }
.about-card:hover::before { background: #b07c85; box-shadow: 0 0 18px rgba(176,124,133,0.4); }

.thesis-box { margin-top: 12px; background: rgba(255,255,255,0.35); border-radius: 6px; padding: 10px 14px; }
.thesis-box summary { cursor: pointer; font-weight: 600; font-family: "Inter", sans-serif; list-style: none; }
.thesis-box summary::-webkit-details-marker { display: none; }
.thesis-box summary::after { content: " +"; font-weight: 400; }
.thesis-box[open] summary::after { content: " −"; }
.thesis-box p { margin-top: 10px; }
.logo { width: 70px; margin-bottom: 8px; }
.summary { text-align: center; font-style: italic; opacity: 0.8; margin-bottom: 14px; }
.skills { max-width: 600px; margin: 0 auto 12px; padding-left: 18px; }
.skills li { margin-bottom: 6px; }
.thesis-title { font-weight: 600; text-align: center; margin-bottom: 8px; }

/* Exercises */
#exercises { position: relative; padding: 5px 0 130px; }
#exercises::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 100%; height: 500px;
  background: var(--petal); opacity: 0.15; z-index: 0;
  pointer-events: none;
}
.exercise-bubbles {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 95px;
  margin: 80px 20px 100px; width: 100%;
  position: relative; z-index: 1;
}
.bubble {
  width: 200px; height: 200px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  background: linear-gradient(145deg, #ca99a1, #c28c94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: black;
  font-family: "Cormorant Garamond", serif; font-size: 30px; text-align: center;
  transition: all 0.5s ease; position: relative;
  /*animation: float 4s ease-in-out infinite;*/
}
.bubble span { font-size: 25px; margin-bottom: 12px; }
.bubble:nth-child(2) { animation-delay: 1.5s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.bubble:hover { background: rgba(138,160,149,0.08); transform: scale(1.05); box-shadow: 0 0 30px rgba(138,160,149,0.15); }
.bubble::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); opacity: 0; transition: opacity 0.4s ease; }
.bubble:hover::after { opacity: 1; }
.logo3 { width: 80px; height: auto; margin-top: 10px; transition: transform 0.4s ease; }
.bubble:hover .logo3 { transform: scale(1.15); }

/* Music cassette tape */
#music { padding: 5px 0 130px; }

.section-subtitle {
  max-width: 650px; margin: 20px auto 50px;
  text-align: center;
  font-family: "Cormorant Garamond", serif; font-size: 25px;
  opacity: 0.75; line-height: 1.6;
}

.tape-outer {
  position: relative; width: 100%;
  background: #2a2218;
  border-top: 3px solid #1a1510; border-bottom: 3px solid #1a1510;
  padding: 28px 0; overflow: hidden;
  box-shadow: inset 0 6px 18px rgba(0,0,0,0.45), inset 0 -6px 18px rgba(0,0,0,0.45);
}
.tape-outer::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  background-size: 200px 180px; pointer-events: none; z-index: 0;
}
.tape-outer::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0px, rgba(255,255,255,0.04) 2px, transparent 2px, transparent 8px);
  z-index: 1;
}

.tape-reel { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; pointer-events: none; }
.tape-reel-left  { left: 18px; }
.tape-reel-right { right: 18px; }
.reel-ring {
  width: 80px; height: 75px; border-radius: 50%;
  border: 3px solid #3d3020;
  background: radial-gradient(circle at 35% 35%, #4a3c28, #1e1810);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: reel-spin 8s linear infinite;
}
.reel-hub { width: 18px; height: 18px; border-radius: 50%; background: #2a2218; border: 2px solid #5a4a30; }
@keyframes reel-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.tape-track { position: relative; z-index: 2; overflow: hidden; padding: 0 80px; cursor: grab; }
.tape-track:active { cursor: grabbing; }

.tape-strip {
  display: flex; gap: 16px; align-items: center;
  width: max-content;
  animation: tape-scroll 60s linear infinite;
  will-change: transform;
}
@keyframes tape-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.tape-card {
  flex-shrink: 0; width: 300px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tape-card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 12px 30px rgba(0,0,0,0.6); }
.tape-card iframe { display: block; width: 100%; height: 80px; border: none; }

.tape-track::before,
.tape-track::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 3; pointer-events: none;
}
.tape-track::before { left:  0; background: linear-gradient(to right, #2a2218, transparent); }
.tape-track::after  { right: 0; background: linear-gradient(to left,  #2a2218, transparent); }

/* Contact */
#contact { padding: 3px 0 130px; display: flex; flex-direction: column; align-items: center; }
.contact-form {
  max-width: 600px; width: 100%;
  background: #eef2ef; padding: 30px;
  border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 15px;
}
.contact-form input,
.contact-form textarea { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #d0d6d2; font-size: 14px; font-family: inherit; }
.contact-form button { width: 220px; align-self: center; padding: 12px; border-radius: 8px; border: none; background: var(--forest); color: white; font-weight: 500; cursor: pointer; transition: 0.2s; }
.contact-form button:hover { background: #255c4e; transform: translateY(-2px); }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 2px rgba(47,111,94,0.15); }

/* footer*/
footer { text-align: center; padding: 30px 20px; font-size: 13px; opacity: 0.5; border-top: 1px solid rgba(0,0,0,0.07); }

/* responsive */
@media (max-width: 1100px) {
  .piano-container { transform: none !important; flex-direction: column; align-items: center; }
  .kbd-mini { position: static; width: 100%; max-width: 360px; margin: 10px auto 0; left: auto; opacity: 0; transform: translateY(-6px); }
  .kbd-mini.show { opacity: 1; transform: translateY(0); }
}
@media (max-width: 820px) {
  .hero-content { flex-direction: column; align-items: center; padding: 40px 24px 30px; gap: 30px; }
  .hero-text { max-width: 100%; }
  .hero-text p { text-align: left; }
  .piano { width: 100%; max-width: 340px; height: 110px; }
  .piano .b1 { left: calc(56/560*100%); } .piano .b2 { left: calc(136/560*100%); }
  .piano .b4 { left: calc(296/560*100%); } .piano .b5 { left: calc(376/560*100%); }
  .piano .b6 { left: calc(456/560*100%); }
  .piano .black { width: calc(48/560*100%); height: 72px; }
  .about-card { width: 95%; grid-template-columns: 1fr; align-self: center !important; }
  .about-card:nth-child(odd), .about-card:nth-child(even) { transform: translateY(30px); }
  .about-card::before, .about-stack::before { display: none; }
  .exercise-bubbles { gap: 40px; }
}
@media (max-width: 600px) {
  .tape-card { width: 200px; }
  .reel-ring { width: 38px; height: 38px; } .reel-hub { width: 12px; height: 12px; }
  .tape-reel-left { left: 6px; } .tape-reel-right { right: 6px; }
}
@media (max-width: 520px) {
  .hero-header h1 { font-size: 1.55rem; }
  .exercise-bubbles { flex-direction: column; align-items: center; }
}