:root {
  --brand: #592a00;
  --brand-hover: #462100;
  --white: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #3a3a3a;
  --footer: #111111;
  --sidebar-w: clamp(220px, 20vw, 280px);
  --footer-h: 2.5rem;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.45;
  background: var(--footer);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--footer-h);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* ——— Sidebar ——— */
.sidebar {
  grid-row: 1;
  grid-column: 1;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(0.6rem, 1.5vh, 1.1rem);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: clamp(0.9rem, 2vh, 1.5rem) 1.15rem clamp(0.75rem, 1.5vh, 1.1rem);
  background: var(--white);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  animation: fade-in 0.7s var(--ease) both;
}

.sidebar__top {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.8vh, 1.25rem);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  flex-shrink: 0;
}

.logo__icon {
  width: clamp(44px, 6.5vh, 60px);
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.logo__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.logo__studio {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.3vw, 1.25rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.logo__line {
  display: block;
  width: 100%;
  height: 1px;
  margin: 0.28rem 0 0.32rem;
  background: var(--ink);
}

.logo__name {
  font-family: var(--font-serif);
  font-size: clamp(0.55rem, 0.7vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  align-self: center;
  white-space: nowrap;
}

.sidebar__bio {
  font-size: clamp(0.82rem, 1.7vh, 0.95rem);
  line-height: 1.5;
  text-align: center;
  color: var(--ink-muted);
  font-weight: 400;
  overflow: hidden;
}

.sidebar__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: auto;
  flex-shrink: 0;
}

.sidebar__phone {
  font-size: clamp(0.78rem, 1.5vh, 0.9rem);
  font-weight: 500;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.sidebar__phone:hover {
  color: var(--brand);
}

.sidebar__social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link {
  display: inline-flex;
  color: var(--ink);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.social-link:hover {
  color: var(--brand);
  transform: translateY(-2px);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(89, 42, 0, 0.28);
}

.btn:active {
  transform: translateY(0);
}

.btn--sidebar {
  width: 100%;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  flex-shrink: 0;
}

.btn--cita {
  min-width: 9.5rem;
  animation: fade-up 0.8s var(--ease) 0.35s both;
}

/* ——— Main column ——— */
.main-column {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(rgba(20, 16, 12, 0.38), rgba(20, 16, 12, 0.38)),
    url("../imagenes/fder.jpeg") center / cover no-repeat;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.hero-mobile {
  display: none;
  margin: 0;
}

/* ——— Servicios ——— */
.services {
  position: relative;
  color: var(--white);
  margin-top: clamp(6rem, 22vh, 18rem);
  margin-inline: 0;
  width: 100%;
  flex-shrink: 0;
  background: var(--brand);
  /* Curva solo arriba/abajo; lados a tope con sidebar y borde derecho */
  border-radius: 100vw / clamp(1.75rem, 3.5vh, 2.75rem);
  padding: clamp(1.1rem, 2.4vh, 1.75rem) clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 2.6vh, 1.85rem);
  animation: fade-up 0.85s var(--ease) 0.12s both;
}

.services__inner {
  padding: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.6vh, 2.6rem);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: clamp(0.85rem, 2vh, 1.4rem);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  position: relative;
}

.services__grid::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 12.5%;
  right: 12.5%;
  border-top: 1.5px dashed rgba(255, 255, 255, 0.55);
  z-index: 0;
  pointer-events: none;
}

.service {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  min-width: 0;
}

.service__icon-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.service__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(46px, 5.8vh, 56px);
  height: clamp(46px, 5.8vh, 56px);
  border-radius: 50%;
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.35s var(--ease);
}

.service__icon svg {
  width: clamp(22px, 2.8vh, 26px);
  height: clamp(22px, 2.8vh, 26px);
}

.service:hover .service__icon {
  transform: scale(1.08);
}

.service__title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.4vh, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.service__list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: clamp(0.78rem, 1.65vh, 0.92rem);
  line-height: 1.35;
  font-weight: 300;
  opacity: 0.95;
  text-align: left;
  width: 100%;
  max-width: 17rem;
}

.service__list li {
  position: relative;
  padding-left: 0.85rem;
}

.service__list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.85;
}

/* ——— Agenda tu cita ——— */
.cita {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: clamp(0.75rem, 2.5vh, 1.75rem) 1.25rem;
  text-align: center;
  color: var(--white);
  overflow: hidden;
}

.cita__overlay {
  display: none;
}

.cita__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.45rem, 1.2vh, 0.85rem);
  max-width: 36rem;
}

.cita__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vh, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  animation: fade-up 0.8s var(--ease) 0.2s both;
}

.cita__subtitle {
  font-size: clamp(0.95rem, 2.1vh, 1.2rem);
  font-weight: 300;
  line-height: 1.45;
  opacity: 0.95;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  animation: fade-up 0.8s var(--ease) 0.28s both;
}

/* ——— Footer ——— */
.footer {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: var(--footer-h);
  /* Alineado con la columna de Agenda tu cita (no bajo el sidebar) */
  padding: 0 1.15rem 0 var(--sidebar-w);
  background: var(--footer);
  color: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.footer__copy {
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer__systek {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.25s var(--ease);
}

.footer__systek:hover {
  color: var(--white);
}

.footer__top {
  display: none;
}

.mobile-bar {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.mobile-cta {
  display: none;
}

/* ——— Scroll reveal ——— */
.reveal {
  opacity: 1;
  transform: none;
}

@media (max-width: 768px) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .reveal.reveal--delay-1 {
    transition-delay: 0.08s;
  }

  .reveal.reveal--delay-2 {
    transition-delay: 0.16s;
  }

  .reveal.reveal--delay-3 {
    transition-delay: 0.24s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ——— Animations ——— */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— Tablet ——— */
@media (max-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: clamp(0.6rem, 1.5vh, 1rem);
  }

  .services__grid::before {
    display: none;
  }

  .service:nth-child(1) .service__icon-wrap,
  .service:nth-child(3) .service__icon-wrap {
    position: relative;
  }

  .service:nth-child(1) .service__icon-wrap::after,
  .service:nth-child(3) .service__icon-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(50% + 30px);
    width: calc(100% - 30px);
    border-top: 1.5px dashed rgba(255, 255, 255, 0.45);
    transform: translateY(-50%);
  }

  .sidebar__bio {
    font-size: clamp(0.78rem, 1.5vh, 0.9rem);
  }
}

/* ——— Mobile: menú hamburguesa + scroll ——— */
@media (max-width: 768px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  .page {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .mobile-bar {
    display: flex;
    align-items: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 70;
    width: auto;
    height: auto;
    padding: 0.75rem;
    background: transparent;
    border: none;
    box-shadow: none;
    pointer-events: none;
  }

  .menu-toggle {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    pointer-events: auto;
  }

  .menu-toggle__line {
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    height: 2.5px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 1px;
    background-color: #1a1a1a;
    transition: transform 0.3s var(--ease), top 0.3s var(--ease);
    transform-origin: center;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
  }

  .menu-toggle__line:nth-child(1) {
    top: calc(50% - 6px);
  }

  .menu-toggle__line:nth-child(2) {
    top: calc(50% + 3.5px);
  }

  body.menu-open .menu-toggle__line:nth-child(1) {
    top: calc(50% - 1.25px);
    transform: rotate(45deg);
  }

  body.menu-open .menu-toggle__line:nth-child(2) {
    top: calc(50% - 1.25px);
    transform: rotate(-45deg);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
  }

  body.menu-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    grid-row: unset;
    grid-column: unset;
    width: min(86vw, 320px);
    height: 100dvh;
    max-height: 100dvh;
    padding: 4rem 1.15rem 1.15rem;
    border-right: none;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
    transform: translateX(-105%);
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar__top {
    overflow: visible;
    gap: 1.25rem;
  }

  .main-column {
    grid-row: 1;
    grid-column: 1;
    height: auto;
    overflow: visible;
    min-height: calc(100dvh - var(--footer-h));
    background: transparent;
  }

  .hero-mobile {
    display: block;
    width: 100%;
    margin: 0;
    line-height: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 0;
  }

  .hero-mobile img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center top;
  }

  .services {
    margin-top: -1.75rem;
    margin-inline: 0;
    border-radius: 100vw / 2rem;
    padding: 1.5rem 1.15rem 1.6rem;
    position: relative;
    z-index: 1;
  }

  .cita {
    position: relative;
    z-index: 0;
    margin-top: -2.75rem;
    min-height: 280px;
    padding: 3.75rem 1.15rem 3.5rem;
    overflow: hidden;
    background: transparent;
  }

  .cita::before {
    content: "";
    position: absolute;
    inset: -18% -10% 0 -10%;
    z-index: 0;
    background: url("../imagenes/segunda_celular.jpeg") center 88% / cover no-repeat;
    transform: scale(1.15) translateY(12%);
    transform-origin: center top;
    pointer-events: none;
    filter: brightness(0.55);
  }

  .cita::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
  }

  .cita__content {
    position: relative;
    z-index: 1;
  }

  .main {
    overflow: hidden;
  }

  .footer {
    grid-row: 2;
    grid-column: 1;
    position: relative;
    z-index: 5;
    height: auto;
    min-height: var(--footer-h);
    padding: 0.85rem 1rem 4.75rem;
    justify-content: center;
    background: var(--footer);
  }

  .logo {
    justify-content: flex-start;
  }

  .logo__icon {
    width: 52px;
  }

  .sidebar__bio {
    font-size: 0.92rem;
    max-width: none;
    margin-inline: 0;
  }

  .btn--sidebar {
    display: inline-flex;
  }

  .services__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .service:nth-child(1) .service__icon-wrap::after,
  .service:nth-child(3) .service__icon-wrap::after {
    display: none;
  }

  .service__list {
    max-width: 22rem;
    margin-inline: auto;
    font-size: 0.9rem;
  }

  .footer__copy {
    white-space: normal;
    font-size: 0.7rem;
    line-height: 1.35;
    padding-right: 0.5rem;
  }

  .mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 40;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    background: var(--brand);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }
}

@media (max-width: 420px) {
  .logo__studio {
    font-size: 0.95rem;
    letter-spacing: 0.1em;
  }

  .logo__name {
    font-size: 0.55rem;
    letter-spacing: 0.12em;
  }
}
