/* Reuses the task-control illustrations already presented on Engines. */
.eng-flow-heading { max-width:820px; margin-inline:auto; text-align:center; }
.eng-flow-heading .lead { margin-inline:auto; }
.eng-benefits .card { padding:28px; overflow:hidden; background:linear-gradient(150deg,#131827,#0b101c); }
.eng-ui { height:188px; position:relative; display:flex; align-items:center; justify-content:center; margin:-4px -4px 28px; pointer-events:none; user-select:none; background:radial-gradient(ellipse at center,rgba(124,151,240,.1),transparent 72%); }
.eng-ui-window,.eng-ui-sheet { width:220px; max-width:90%; border:1px solid #333e58; border-radius:12px; background:linear-gradient(145deg,#1c2435,#101622); box-shadow:0 16px 36px #0005; overflow:hidden; }
.eng-ui-bar { display:flex; gap:4px; align-items:center; height:26px; padding-inline:12px; border-bottom:1px solid #ffffff09; }
.eng-ui-bar i { width:4px; height:4px; border-radius:50%; background:#63708a; }
.eng-ui-bar i:first-child { background:#aabaff; }
.eng-ui-canvas { height:85px; margin:12px 16px 8px; border-radius:5px; background:linear-gradient(135deg,#24334b,#3b4b65 55%,#1a263a); display:grid; place-items:center; }
.eng-ui-crop { width:62%; height:65px; border:1px solid #bbcaff; box-shadow:0 0 0 12px #0b112b40; position:relative; background:linear-gradient(150deg,transparent 55%,#98acce22 56%); }
.eng-ui-crop::before,.eng-ui-crop::after { content:''; position:absolute; inset:0 33%; border-inline:1px solid #aabaff30; }
.eng-ui-crop::after { inset:33% 0; border-inline:0; border-block:1px solid #aabaff30; }
.eng-ui-ratios { display:flex; justify-content:center; align-items:center; gap:17px; height:29px; margin-bottom:6px; }
.eng-ui-ratios i { width:13px; height:16px; border:1px solid #606e87; border-radius:2px; }
.eng-ui-ratios i:nth-child(2) { width:16px; }
.eng-ui-ratios i:nth-child(3) { width:22px; height:14px; border-color:#aabaff; background:#aabaff18; }
.eng-ui-ratios i:nth-child(4) { width:26px; height:12px; }
.eng-ui-sheet { position:absolute; width:190px; height:142px; }
.eng-ui-sheet-back { transform:translate(-20px,-15px) rotate(-7deg); opacity:.65; }
.eng-ui-sheet-front { transform:translate(18px,14px); }
.eng-ui-skeleton { margin:16px; width:70%; height:5px; background:#64748b; border-radius:4px; box-shadow:0 17px #64748b55,0 34px #64748b33; }
.eng-ui-row { display:flex; gap:16px; align-items:center; margin:13px 15px; }
.eng-ui-row b { width:43%; height:4px; border-radius:4px; background:#8997b34d; }
.eng-ui-row span { flex:1; height:17px; border:1px solid #46516a; border-radius:4px; background:#253048; }
.eng-ui-row:nth-child(3) span { border-color:#aabaff99; background:#aabaff18; }
.eng-ui-adjust .eng-ui-window { padding-bottom:13px; }
.eng-ui-slider { margin:23px 20px; height:3px; background:#354058; border-radius:4px; position:relative; }
.eng-ui-slider::before { content:''; display:block; height:100%; width:var(--value); background:#8fa6df; }
.eng-ui-slider i { position:absolute; left:var(--value); top:50%; transform:translate(-50%,-50%); width:10px; height:10px; border-radius:50%; background:#c0cefa; box-shadow:0 0 0 4px #aabaff0a; }
.eng-ui-options { display:flex; gap:8px; margin:0 20px; }
.eng-ui-options i { height:12px; flex:1; border:1px solid #46516a; border-radius:3px; }
.eng-ui-options i:nth-child(2) { background:#aabaff22; border-color:#8fa6df; }
.eng-benefits h3 { margin-bottom:16px; }
.eng-benefits p { color:var(--txt-2); line-height:1.65; margin:0; }

.home-controls { --eng-accent:#aabaff; margin-block:clamp(64px,8vw,112px); }
.home-controls .eng-kicker { display:block; color:var(--eng-accent); font-size:.8rem; font-weight:700; text-transform:uppercase; margin-bottom:24px; }
.home-profile-intro { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:clamp(32px,6vw,88px); }
.home-profile-intro .lead { margin-top:24px; max-width:48ch; }
.home-avatar-gallery { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(10px,1.5vw,22px); padding:24px 0; }
.home-avatar-gallery img { width:100%; height:auto; aspect-ratio:1; object-fit:cover; border-radius:50%; border:3px solid #ffffff12; box-shadow:0 12px 28px #0004; }
.home-avatar-gallery img:nth-child(even) { transform:translateY(20px); }
.home-profile-features { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:28px; margin-top:64px; padding-top:36px; border-top:1px solid var(--line); }
.home-profile-feature { display:flex; gap:18px; align-items:flex-start; min-width:0; }
.home-profile-feature > img { width:64px; height:64px; border-radius:50%; flex-shrink:0; object-fit:cover; }
.home-profile-feature h3 { margin-bottom:12px; }
.home-profile-feature p { color:var(--txt-2); line-height:1.6; }
@media(max-width:900px) {
 .home-profile-intro { grid-template-columns:1fr; }
 .home-avatar-gallery { max-width:560px; margin-inline:auto; }
 .home-profile-features { grid-template-columns:1fr; gap:28px; }
}
@media(max-width:640px) {
 .home-controls .eng-benefits { grid-template-columns:1fr; }
 .home-profile-features { margin-top:36px; }
 .home-profile-feature > img { width:52px; height:52px; }
}

/* ==========================================================================
   Home Hero 1080p & Viewport Fold Calibration
   Ensures copy, buttons, and bottom tab strip sit 100% within the fold on 1080p screens.
   ========================================================================== */
#hero {
  justify-content: flex-end;
  min-height: min(100vh, 1000px);
}

#hero .hero-tabs {
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
  padding-inline: 0;
}

/* Keep the hero tabs readable while letting them blend into the artwork. */
#hero .hero-tab,
#hero .hero-tab:hover,
#hero .hero-tab.is-on,
#hero .hero-tab.is-on:hover {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#hero .hero-tab::before {
  inset: -12px -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--accent, var(--blue)) 18%, transparent), transparent 72%);
}
#hero .hero-tab:hover::before { opacity: .8; }
#hero .hero-tab::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2.5px;
  z-index: 1;
  background: rgba(226, 232, 240, .24);
  pointer-events: none;
}
#hero .hero-tab:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 10px color-mix(in oklab, var(--accent, var(--blue)) 38%, transparent));
}
#hero .pillars { font-size: calc(.82rem + 4px); }
#hero .hero-tab-k { font-size: calc(.98rem + 4px); }
#hero .hero-tab-d { font-size: calc(.9rem + 4px); }
body:has(#hero) .nav a { font-size: calc(.96rem + 4px); }
body:has(#hero) .logo { transform: translateY(2px); }

@media (max-width: 1440px) {
  body:has(#hero) .nav a { font-size: calc(1.04rem + 4px); }
}

@media (max-height: 1040px) and (min-width: 901px) {
  #hero .hero-x-inner {
    transform: translateY(-148px);
  }
  #hero .hero-x-inner {
    padding-top: calc(var(--nav-h) + 14px);
    padding-bottom: 10px;
  }
  #hero .pillars {
    margin-bottom: 6px;
  }
  #hero h1.d1 {
    font-size: clamp(2.4rem, 4vw, 4rem);
    line-height: 1.06;
    margin: 0 0 12px;
    max-width: 17ch;
  }
  #hero .lead {
    font-size: 1.36rem;
    line-height: 1.45;
    max-width: 48ch;
  }
  #hero .btn-row {
    margin-top: 16px;
  }
  #hero .hero-note {
    margin-top: 8px;
    font-size: .8rem;
  }
  #hero .hero-tabs {
    padding-bottom: clamp(48px, 6vh, 60px);
    gap: 8px;
    padding-inline: 0;
  }
  #hero .hero-tab {
    padding: 10px 8px 12px;
    border-radius: 14px;
  }
  #hero .hero-tab-k {
    font-size: calc(.9rem + 4px);
  }
  #hero .hero-tab-d {
    font-size: calc(.82rem + 4px);
    line-height: 1.35;
    margin-top: 3px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  #hero .hero-x-inner {
    padding-top: calc(var(--nav-h) + 6px);
    padding-bottom: 6px;
  }
  #hero h1.d1 {
    font-size: clamp(2.1rem, 3.3vw, 3.2rem);
    margin: 0 0 8px;
  }
  #hero .lead {
    font-size: 1.22rem;
    line-height: 1.42;
  }
  #hero .btn-row {
    margin-top: 12px;
  }
  #hero .hero-tabs {
    padding-bottom: clamp(32px, 4vh, 44px);
  }
  #hero .hero-tab {
    padding: 7px 10px 9px;
  }
  #hero .hero-tab-d {
    display: none;
  }
}

/* ==========================================================================
   Refine Section: Overlapping Action Cards ("Cards Superpuestas")
   ========================================================================== */
.refine-cards-stage {
  position: relative;
  width: 100%;
  min-height: 510px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.refine-stack-glow {
  position: absolute;
  inset: 4% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(192, 132, 252, 0.16) 40%, rgba(34, 211, 238, 0.14) 75%, transparent 90%);
  filter: blur(55px);
  pointer-events: none;
  z-index: 0;
}

.refine-cards-deck {
  position: relative;
  width: 100%;
  max-width: 580px;
  height: 480px;
}

.refine-action-card {
  position: absolute;
  width: clamp(265px, 28vw, 305px);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(22, 28, 44, 0.94) 0%, rgba(12, 16, 26, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 10px 10px 13px 10px;
  box-shadow:
    0 12px 28px -6px rgba(0, 0, 0, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.25s ease,
              opacity 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  user-select: none;
}

/* Individual card placement in the stack */
.refine-action-card.card-popart {
  top: 0;
  left: 0;
  transform: rotate(-6deg);
  z-index: 2;
}

.refine-action-card.card-patio {
  top: 18px;
  right: 0;
  transform: rotate(5deg);
  z-index: 1;
}

.refine-action-card.card-outpaint {
  bottom: 12px;
  left: 10px;
  transform: rotate(-3deg);
  z-index: 3;
}

.refine-action-card.card-erase {
  bottom: 0;
  right: 8px;
  transform: rotate(3deg);
  z-index: 4;
}

/* Hover and active states */
.refine-cards-deck:hover .refine-action-card {
  opacity: 0.86;
}

.refine-action-card:hover {
  opacity: 1 !important;
  z-index: 20 !important;
  transform: translateY(-10px) scale(1.05) rotate(0deg) !important;
  border-color: var(--c-card, rgba(255, 255, 255, 0.35));
  box-shadow:
    0 24px 55px -8px rgba(0, 0, 0, 0.9),
    0 0 35px var(--card-glow, rgba(255, 255, 255, 0.25));
}

.refine-card-thumb {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #090d16;
}

.refine-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.refine-action-card:hover .refine-card-thumb img {
  transform: scale(1.05);
}

.refine-card-pill {
  position: absolute;
  top: 9px;
  left: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(8, 12, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
}

.refine-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-card, #fbbf24);
  box-shadow: 0 0 8px var(--c-card, #fbbf24);
  flex-shrink: 0;
}

.refine-card-body {
  margin-top: 10px;
  padding-inline: 4px;
}

.refine-card-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin: 0 0 3px;
  letter-spacing: normal;
}

.refine-card-desc {
  font-size: 0.81rem;
  line-height: 1.38;
  color: #94a3b8;
  margin: 0;
}

/* Floating interactive center chip */
.refine-floating-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(14, 20, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  font-size: 0.77rem;
  font-weight: 700;
  pointer-events: none;
  animation: pulse-chip 3.5s ease-in-out infinite alternate;
}

@keyframes pulse-chip {
  0% { transform: translate(-50%, -50%) scale(0.98); box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 12px rgba(245, 158, 11, 0.15); }
  100% { transform: translate(-50%, -50%) scale(1.02); box-shadow: 0 12px 30px rgba(0,0,0,0.7), 0 0 24px rgba(245, 158, 11, 0.35); }
}

/* Responsive adjustments */
@media (max-width: 1080px) {
  .refine-cards-deck {
    max-width: 510px;
    height: 450px;
  }
  .refine-action-card {
    width: clamp(240px, 26vw, 275px);
  }
}

@media (max-width: 768px) {
  .refine-cards-stage {
    min-height: 430px;
    margin-top: 18px;
  }
  .refine-cards-deck {
    max-width: 390px;
    height: 410px;
  }
  .refine-action-card {
    width: 225px;
    padding: 8px 8px 11px 8px;
  }
  .refine-card-title {
    font-size: 0.88rem;
  }
  .refine-card-desc {
    font-size: 0.76rem;
  }
}

@media (max-width: 480px) {
  .refine-cards-deck {
    max-width: 330px;
    height: 380px;
  }
  .refine-action-card {
    width: 195px;
  }
  .refine-action-card.card-popart { top: 0; left: 0; }
  .refine-action-card.card-patio { top: 10px; right: 0; }
  .refine-action-card.card-outpaint { bottom: 5px; left: 0; }
  .refine-action-card.card-erase { bottom: 0; right: 0; }
  .refine-floating-chip { display: none; }
}


/* ---------- Hero: launch film card + lightbox (js/hero-film.js) ---------- */
#hero .hero-film {
  position: absolute;
  /* Toward the middle of the frame, centred on the copy block. */
  right: clamp(0px, 10vw, 220px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(340px, 33vw, 600px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10, 12, 20, .55);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .8);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
#hero .hero-film:hover,
#hero .hero-film:focus-visible {
  transform: translateY(calc(-50% - 3px));
  border-color: rgba(156, 132, 255, .7);
  box-shadow: 0 22px 60px -16px rgba(77, 124, 254, .6);
}
#hero .hero-film-media { position: relative; display: block; aspect-ratio: 16 / 9; }
#hero .hero-film-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
#hero .hero-film-play {
  position: absolute; left: 50%; top: 50%;
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad-brand, linear-gradient(100deg, #4D7CFE, #8B5CF6, #C084FC));
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .14), 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .25s var(--ease);
}
#hero .hero-film:hover .hero-film-play { transform: scale(1.08); }
#hero .hero-film-play svg { margin-left: 3px; }
#hero .hero-film-txt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px; }
#hero .hero-film-k { font-weight: 700; font-size: 1.2rem; }
#hero .hero-film-d { font-size: .98rem; color: rgba(255, 255, 255, .65); }

@media (max-width: 900px) {
  #hero .hero-film { position: relative; right: auto; top: auto; transform: none; width: min(100%, 420px); margin-top: 22px; }
  #hero .hero-film:hover, #hero .hero-film:focus-visible { transform: translateY(-3px); }
}

body.film-open { overflow: hidden; }
.film-box {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(4, 5, 10, .86);
  backdrop-filter: blur(6px);
}
.film-box[hidden] { display: none; }
.film-box-inner { position: relative; width: min(1200px, 100%); }
.film-box-frame { aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 30px 90px rgba(0, 0, 0, .7); }
.film-box-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.film-box-close {
  position: absolute; top: -48px; right: 0;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  /* The × glyph sits low in its line box; centre the box, then lift the glyph. */
  display: grid; place-items: center; padding: 0 0 3px 2px;
}
.film-box-close:hover { background: rgba(255, 255, 255, .18); }

/* One-time consent before anything loads from YouTube (legal.html#cookies). */
.film-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: clamp(20px, 5vw, 64px); text-align: center; border-radius: 14px;
  background: linear-gradient(rgba(4, 6, 12, .78), rgba(4, 6, 12, .9)), url(../assets/home/film-poster.webp) center / cover;
}
.film-consent[hidden] { display: none; }
.film-consent p { max-width: 46ch; margin: 0; color: var(--txt); font-size: clamp(.95rem, 1.4vw, 1.1rem); line-height: 1.55; }
.film-consent .btn-row { justify-content: center; }
.film-consent-more { color: var(--txt-3); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
