/**
 * Your First Website — Enhancements
 * 3D hero loop · tilt cards · AI section · capabilities bento
 */

/* HERO 3D RAINBOW LOOP */
.hero { perspective: 1400px; }
.hero-3d {
  position: relative;
  width: 100%;
  max-width: 980px;
  height: 100%;
  min-height: 520px;
  pointer-events: none;
  opacity: 0.92;
  display: block;
}
.hero .page { position: relative; z-index: 1; }

@media (max-width: 1100px) {
  .hero-3d {
    min-height: 440px;
    opacity: 0.88;
  }
}
@media (max-width: 900px) {
  .hero-3d {
    min-height: 340px;
    max-width: 100%;
    opacity: 0.78;
  }
}

/* 3D TILT CARDS */
.tilt-container {
  perspective: 1200px;
  transform-style: preserve-3d;
  display: inline-block;
  width: 100%;
}
.tilt-inner {
  transition: transform 320ms cubic-bezier(.2,.7,.1,1);
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt-container:hover .tilt-inner { transition-duration: 60ms; }

/* AI SECTION */
.ai-section {
  background: var(--color-off-white);
  border-top: 1px solid rgba(15,23,42,0.12);
  border-bottom: 1px solid rgba(15,23,42,0.12);
  padding: 110px 0;
  position: relative;
  overflow: hidden;
}
.ai-section::before {
  content: "";
  position: absolute;
  left: -200px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border-radius: 999px;
  background: var(--gradient-rainbow);
  filter: blur(60px);
  opacity: 0.16;
  pointer-events: none;
}

.ai-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 80px;
  align-items: start;
  position: relative;
  z-index: 1;
}
.ai-copy .lede {
  font-size: 22px;
  line-height: 1.5;
  color: var(--color-dark);
  max-width: 580px;
  margin-bottom: 22px;
}
.ai-copy .lede strong { font-weight: 700; }
.ai-copy p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-dark);
  max-width: 580px;
  margin-bottom: 24px;
}
.ai-copy p em {
  font-family: var(--font-serif);
  font-style: italic;
}
.ai-copy .muted-note {
  font-size: 14px;
  color: var(--color-muted);
  border-left: 2px solid var(--color-primary);
  padding-left: 14px;
  margin-top: 28px;
  max-width: 540px;
}
.ai-flex-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}
.ai-flex-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(15,23,42,0.16);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-dark);
  align-items: start;
}
.ai-flex-list li:last-child { border-bottom: 1px solid rgba(15,23,42,0.16); }
.ai-flex-list li .num {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--color-primary);
  padding-top: 3px;
}
.ai-flex-list li strong { font-weight: 700; color: var(--color-dark); }
.ai-flex-list li em {
  font-family: var(--font-serif);
  font-style: italic;
}

/* Flip card */
.ai-flip { position: sticky; top: 96px; }
.flip-card {
  perspective: 1600px;
  width: 100%;
  aspect-ratio: 4 / 5.2;
  cursor: pointer;
  outline: none;
}
.flip-card:focus-visible { box-shadow: 0 0 0 3px var(--color-primary); }
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 900ms cubic-bezier(.2,.85,.2,1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner,
.flip-card:hover .flip-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: var(--shadow-md);
}
.flip-face.front {
  background: var(--color-white);
  color: var(--color-dark);
}
.flip-face.back {
  background: var(--color-dark);
  color: var(--color-off-white);
  transform: rotateY(180deg);
}
.flip-face .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.flip-face.back .label { color: rgba(255,255,255,0.55); }
.flip-face h3 {
  font-family: var(--font-sans);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  line-height: 1.1;
}
.flip-face h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.flip-face ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.flip-face ul li {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(15,23,42,0.16);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.flip-face.back ul li { border-bottom-color: rgba(255,255,255,0.16); }
.flip-face ul li::before {
  content: "→";
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
}
.flip-face ul li em {
  font-family: var(--font-serif);
  font-style: italic;
}
.flip-face .turn-hint {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  color: var(--color-muted);
  text-align: right;
}
.flip-face.back .turn-hint { color: rgba(255,255,255,0.5); }

@media (max-width: 900px) {
  .ai-grid { grid-template-columns: 1fr; gap: 56px; }
  .ai-flip { position: static; }
  .flip-card { max-width: 360px; margin: 0 auto; }
}

/* CAPABILITIES BENTO */
.caps {
  padding: 110px 0;
  background: var(--color-off-white);
}
.caps-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.cap {
  background: var(--color-white);
  border: 1px solid rgba(15,23,42,0.12);
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: transform 220ms cubic-bezier(.2,.7,.1,1), box-shadow 220ms, border-color 220ms;
  box-shadow: var(--shadow-xs);
}
.cap:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15,23,42,0.2);
}
.cap-lg { grid-column: span 6; min-height: 380px; }
.cap-md { grid-column: span 4; }
.cap-lang { grid-column: span 7; }
.cap-members { grid-column: span 5; }

.cap-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 18px;
}
.cap h3 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: auto;
  line-height: 1.2;
  margin-bottom: 8px;
}
.cap h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}
.cap p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-muted);
  margin-bottom: 0;
}
.cap p strong { color: var(--color-dark); font-weight: 700; }
.cap-vis {
  flex: 1;
  margin-bottom: 22px;
  position: relative;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* booking calendar */
.cap-vis-booking {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 280px;
  padding: 14px;
  background: var(--color-off-white);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 6px;
}
.cap-vis-booking .day {
  aspect-ratio: 1;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-dark);
  background: var(--color-white);
  transition: all 200ms;
}
.cap-vis-booking .day.head {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  background: transparent;
  aspect-ratio: auto;
  padding: 2px 0;
}
.cap-vis-booking .day.off { color: var(--color-muted); opacity: 0.45; }
.cap-vis-booking .day.taken {
  background: rgba(15,23,42,0.06);
  color: var(--color-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(15,23,42,0.4);
}
.cap-vis-booking .day.selected {
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(14,165,233,0.4);
  animation: cal-pulse 2.2s ease-in-out infinite;
}
@keyframes cal-pulse {
  0%, 100% { transform: scale(1.08); }
  50% { transform: scale(1.16); }
}

/* chat */
.cap-chat-window {
  width: 100%;
  max-height: 220px;
  min-height: 170px;
  background: var(--color-off-white);
  border: 1px solid rgba(15,23,42,0.1);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  font-size: 12.5px;
  scroll-behavior: smooth;
}
.chat-msg {
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.45;
  animation: msg-in 280ms ease-out;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--color-dark);
  color: var(--color-off-white);
  border-bottom-right-radius: 2px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--color-white);
  border: 1px solid rgba(15,23,42,0.1);
  color: var(--color-dark);
  border-bottom-left-radius: 2px;
}
.chat-msg.thinking { opacity: 0.65; font-style: italic; }
.chat-msg.thinking::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--color-muted);
  animation: dot 1.2s ease-in-out infinite;
}
@keyframes dot {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.chat-suggestions button {
  background: transparent;
  border: 1px solid rgba(15,23,42,0.22);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  color: var(--color-dark);
  transition: all 150ms;
}
.chat-suggestions button:hover {
  border-color: var(--color-dark);
  background: var(--color-dark);
  color: var(--color-off-white);
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stripe */
.cap-stripe {
  background: linear-gradient(135deg, #635bff 0%, #4a44dd 60%, #322a9c 100%);
  border-radius: 10px;
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1.6 / 1;
  color: white;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 14px 36px rgba(99,91,255,0.36);
  animation: card-tilt 5s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes card-tilt {
  0%, 100% { transform: perspective(500px) rotateY(-8deg) rotateX(6deg); }
  50% { transform: perspective(500px) rotateY(8deg) rotateX(-6deg); }
}
.cap-stripe .chip {
  width: 30px; height: 22px;
  background: linear-gradient(135deg,#ffd700 0%, #daa520 100%);
  border-radius: 4px;
  position: relative;
}
.cap-stripe .chip::after {
  content: ""; position: absolute; inset: 4px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 2px;
}
.cap-stripe .num {
  font-size: 13px;
  letter-spacing: 0.16em;
  font-weight: 500;
}
.cap-stripe .row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.14em;
  opacity: 0.82;
}

/* Calculator */
.cap-calc {
  background: var(--color-dark);
  color: var(--color-off-white);
  padding: 18px;
  border-radius: 8px;
  width: 100%;
  max-width: 230px;
  font-family: var(--font-mono);
  box-shadow: 0 12px 28px rgba(15,23,42,0.18);
}
.cap-calc .row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.cap-calc .row .l { color: rgba(255,255,255,0.7); }
.cap-calc .row.total {
  border-top: 1px dashed rgba(255,255,255,0.3);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}
.cap-calc .row .v {
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
  transition: color 200ms;
}
.cap-calc .row.total .v { color: var(--color-off-white); }

/* 3D cube */
.cap-3d {
  width: 100%;
  height: 180px;
  position: relative;
  overflow: visible;
}
.cap-3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* Members lock */
.cap-members-vis {
  position: relative;
  width: 100%;
  height: 150px;
  display: grid;
  place-items: center;
}
.cap-members-vis .lock {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: var(--color-dark);
  display: grid;
  place-items: center;
  color: var(--color-off-white);
  position: relative;
  animation: lock-pulse 2.6s ease-in-out infinite;
}
.cap-members-vis .lock svg { width: 36px; height: 36px; }
@keyframes lock-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14,165,233,0.45); }
  60%      { box-shadow: 0 0 0 22px rgba(14,165,233,0); }
}
.cap-members-vis .ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px dashed rgba(15,23,42,0.18);
  width: 130px;
  height: 130px;
  margin: auto;
  animation: ring-spin 18s linear infinite;
}
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Language cycle */
.cap-lang-vis {
  width: 100%;
  height: 150px;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 400;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.cap-lang-vis .word {
  position: absolute;
  white-space: nowrap;
  animation: lang-cycle 12s linear infinite;
  opacity: 0;
  background: var(--gradient-rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: -0.005em;
}
.cap-lang-vis .word:nth-child(1) { animation-delay: 0s; }
.cap-lang-vis .word:nth-child(2) { animation-delay: 2s; }
.cap-lang-vis .word:nth-child(3) { animation-delay: 4s; }
.cap-lang-vis .word:nth-child(4) { animation-delay: 6s; }
.cap-lang-vis .word:nth-child(5) { animation-delay: 8s; }
.cap-lang-vis .word:nth-child(6) { animation-delay: 10s; }
@keyframes lang-cycle {
  0%      { opacity: 0; transform: translateY(24px); }
  4%, 14% { opacity: 1; transform: translateY(0); }
  18%, 100% { opacity: 0; transform: translateY(-24px); }
}

@media (max-width: 1000px) {
  .cap-lg { grid-column: span 12; }
  .cap-md { grid-column: span 6; min-height: 300px; }
  .cap-lang, .cap-members { grid-column: span 12; }
}
@media (max-width: 600px) {
  .cap-md { grid-column: span 12; }
}

