/*
Theme Name: Starta
Theme URI: https://starta.hus
Author: Kyle Cua
Description: Starta Creative Technologists Theme, pixel perfect Figma layout.
Version: 1.0.0
*/

@font-face {
  font-family: "Gilroy";
  src: url("./fonts/Gilroy-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gilroy";
  src: url("./fonts/Gilroy-ExtraBold.otf") format("opentype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Alro";
  src: url("./fonts/alro-alro-regular-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Alro";
  src: url("./fonts/alro-alro-bold-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

h1,
h2,
h3,
.font-heading {
  font-family: "Gilroy", "Inter Tight", sans-serif;
}

@media (min-width: 769px) {
  .project-row > .grid {
    grid-template-columns:
      minmax(420px, 45vw)
      minmax(280px, 34vw)
      clamp(3rem, 4vw, 5rem) !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    row-gap: clamp(0.75rem, 1.2vw, 1.25rem) !important;
    column-gap: clamp(1rem, 3vw, 4rem) !important;
    padding-top: clamp(0.75rem, 1.4vw, 1.5rem) !important;
    padding-bottom: clamp(0.75rem, 1.4vw, 1.5rem) !important;
  }

  .project-row > .grid > :nth-child(1) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    height: auto !important;
    min-height: 0 !important;
    order: 1 !important;
  }

  .project-row > .grid > :nth-child(2) {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
    justify-self: start !important;
    width: min(34vw, 560px) !important;
    height: 100% !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    order: 2 !important;
  }

  .project-row > .grid > :nth-child(2) > div {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    aspect-ratio: 16 / 10 !important;
  }

  .project-image-card {
    inset: auto !important;
    left: 50% !important;
    top: 50% !important;
    width: calc(100% / 1.3) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    transform: translate(-50%, -50%) scale(1.3);
    transform-origin: center center;
  }

  .project-row::after {
    content: attr(data-project-index);
    position: absolute;
    right: clamp(0.75rem, 2vw, 1.5rem);
    bottom: clamp(0.75rem, 1.4vw, 1.5rem);
    font-family: "Gilroy", "Inter Tight", sans-serif;
    font-size: clamp(2rem, 3.3vw, 4rem);
    font-weight: 900;
    line-height: 0.9;
    color: #ffffff;
    z-index: 40;
    pointer-events: none;
  }
}

@media (min-width: 769px) and (max-width: 1279px) {
  .project-row > .grid {
    grid-template-columns:
      minmax(420px, 45vw)
      minmax(260px, 38vw)
      clamp(3rem, 4vw, 5rem) !important;
  }

  .project-row > .grid > :nth-child(2) {
    width: min(38vw, 480px) !important;
  }
}

@media (max-width: 768px) {
  .mobile-text-backdrop {
    background: rgba(24, 24, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.5rem 0;
    width: 100vw;
    margin-left: calc(-1 * clamp(0.75rem, 2vw, 1.5rem));
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
  }
}

@media (min-width: 769px) {
  #hww-title-wrap {
    padding-right: clamp(2.5rem, 6vw, 7rem) !important;
  }
}

.chat-box-shell {
  position: absolute;
  left: 50%;
  bottom: clamp(0.75rem, 1.5vw, 1.25rem);
  width: min(calc(100vw - (2 * clamp(0.75rem, 2vw, 1.5rem))), 600px);
  z-index: 300;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(1rem);
  isolation: isolate;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 280ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-box-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.chat-box-shell.is-visible {
  max-height: min(78dvh, 620px);
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.chat-box-panel {
  position: relative;
  z-index: 1;
  background: transparent;
  padding: clamp(0.5rem, 1vw, 0.75rem) clamp(1rem, 2.5vw, 1.75rem) 0;
}

.chat-prompt-bubble {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chat-content-block {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.chat-composer-wrap {
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.chat-content-block:not(.hidden) ~ .chat-composer-wrap {
  margin-top: clamp(0.5rem, 1.5vw, 1rem);
}

.chat-message-text {
  font-size: 18px;
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.chat-choice-chip {
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.chat-input-placeholder {
  font-size: 22px;
  line-height: 1.1;
}

.chat-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
}

.chat-input-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  padding-bottom: 0.4rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
}

.footer-conversation-switch {
  height: 2.45rem;
  overflow: hidden;
  pointer-events: auto;
}

.footer-conversation-track {
  display: flex;
  flex-direction: column;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.footer-conversation-switch.is-chat-open .footer-conversation-track {
  transform: translateY(-50%);
}

.footer-conversation-state {
  min-height: 2.45rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.footer-status-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.05;
}

.final-note {
  overflow: hidden;
}

.final-note-copy {
  display: inline-block;
  will-change: transform, opacity;
}

.final-statement {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(8.5rem, 15vh, 11rem);
  width: fit-content;
  max-width: calc(100vw - 2rem);
  margin-inline: auto;
  z-index: 20;
}

.final-statement-line {
  display: block;
  opacity: 0;
  transform: translateY(72px);
  will-change: transform, opacity;
}

.final-statement-line:nth-child(1) {
  font-size: clamp(1.1rem, 3.25vw, 3.35rem);
}

.final-statement-line:nth-child(2) {
  font-size: clamp(1.25rem, 3.7vw, 3.75rem);
}

.final-statement-line:nth-child(3) {
  font-size: clamp(1.4rem, 4.15vw, 4.15rem);
}

.final-statement-line:nth-child(4) {
  font-size: clamp(1.55rem, 4.65vw, 4.65rem);
}

.final-statement-line:nth-child(5) {
  font-size: clamp(1.75rem, 6.5vw, 5.35rem);
  white-space: nowrap;
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.interlude-bg {
  clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  will-change: clip-path;
}

.interlude-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity, transform, filter;
}

.interlude-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.24) saturate(0.86) brightness(0.48);
}

.interlude-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(24, 24, 26, 0.08) 0 34%, rgba(24, 24, 26, 0.58) 100%),
    linear-gradient(90deg, rgba(24, 24, 26, 0.72), transparent 34% 66%, rgba(24, 24, 26, 0.72));
  pointer-events: none;
}

@media (max-width: 768px) {
  .chat-box-shell {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    transform: translateX(0) translateY(1rem);
  }

  .chat-box-shell.is-visible {
    max-height: none;
    transform: translateX(0) translateY(0);
  }

  .chat-message-text {
    font-size: 15px;
  }

  .chat-input-placeholder {
    font-size: 19px;
  }

  .chat-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .final-statement {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

.badge-pill {
  display: inline-block;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgb(113 113 122); /* zinc-500 */
  font-size: 11px;
  color: rgb(212 212 216); /* zinc-300 */
  letter-spacing: 0.1em;
  transition-property: color, background-color;
  transition-duration: 200ms;
  cursor: pointer;
  text-align: center;
  width: max-content;
  background-color: rgba(24, 24, 26, 0.6); /* brand-bg/60 */
  backdrop-filter: blur(4px);
}

@media (min-width: 768px) {
  .badge-pill {
    background-color: transparent;
    backdrop-filter: none;
  }
}

.badge-pill:hover {
  background-color: white;
  color: black;
}

.footer-mobile-glide {
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ========================================
   INTERACTIVE AI CHAT - LOG & BUBBLES
   ======================================== */

#chat-log-container {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-right: 2px;
  scroll-behavior: smooth;
}

#chat-log-container::-webkit-scrollbar {
  width: 3px;
}

#chat-log-container::-webkit-scrollbar-track {
  background: transparent;
}

#chat-log-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
}

/* Chat message rows */
.chat-msg-row {
  display: flex;
  width: 100%;
  margin-bottom: 12px;
  animation: chatBubbleIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes chatBubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg-row.user-row   { justify-content: flex-end; }
.chat-msg-row.ai-row     { justify-content: flex-start; }

/* Bubbles */
.chat-bubble-user {
  max-width: 78%;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.chat-bubble-ai {
  max-width: 78%;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 2px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.chat-bubble-ai .ai-sender-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
  font-weight: 600;
}

/* Typing indicator */
.chat-typing-indicator {
  display: none; /* hidden by default — shown via .chat-typing-active */
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  margin-bottom: 8px;
}

.chat-typing-indicator.chat-typing-active {
  display: flex;
}

.chat-typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.chat-typing-indicator span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: 0.5; }
  40%           { transform: translateY(-5px); opacity: 1;   }
}

/* Input active state */
.chat-input-placeholder:not([disabled]) {
  pointer-events: auto;
  cursor: text;
  color: rgba(255,255,255,0.88);
}

/* AI suggestion chips (dynamic) */
.chat-ai-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.chat-ai-chip:hover {
  background: rgba(255,255,255,0.92);
  border-color: rgba(255,255,255,0.92);
  color: #18181a;
}

/* AI response body — markdown rendered text */
.chat-ai-body {
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.65;
}

.chat-ai-body p {
  margin: 0 0 6px 0;
}

.chat-ai-body strong {
  color: #ffffff;
  font-weight: 600;
}

.chat-ai-body em {
  color: rgba(255,255,255,0.8);
  font-style: italic;
}

.chat-ai-body ul,
.chat-ai-body ol {
  margin: 6px 0;
  padding-left: 18px;
}

.chat-ai-body li {
  margin-bottom: 3px;
}

.chat-ai-body pre {
  background: rgba(255,255,255,0.08);
  padding: 10px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  margin: 8px 0;
}

.chat-ai-body code {
  background: rgba(255,255,255,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.chat-ai-body hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.15);
  margin: 10px 0;
}
