
/* =========================================
   RANTY — STYLE.CSS
   ========================================= */

/* FONTS */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* =========================================
   1. VARIABLES
   ========================================= */

:root {
  --color-yellow: #FDBB59;
  --color-coral: #F27545;
  --color-red: #C4352C;
  --color-burgundy: #4E1623;
  --color-clay: #865A4F;

  --color-cream: #FFF5ED;
  --color-white: #FFFFFF;

  --phone-frame: #25171C;
  --phone-screen: #160F14;
  --phone-surface: #24191F;
  --phone-surface-light: #34252D;

  --message-received: #392931;
  --message-sent: #F27545;

  --text-primary: #FFF7F4;
  --text-secondary: #B9A6AE;
  --text-muted: #827079;

  --border-color: rgba(255, 255, 255, 0.08);

  --font-body: 'DM Sans', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --phone-width: 390px;
  --phone-height: 790px;

  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =========================================
   2. RESET
   ========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--color-cream);
  color: var(--color-burgundy);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   3. MAIN PAGE
   ========================================= */

.page {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 70px);

  padding: 55px clamp(30px, 6vw, 110px);

  position: relative;
  overflow: hidden;

  background:
    radial-gradient(
      ellipse at 45% 45%,
      rgba(253, 187, 89, 0.19),
      transparent 48%
    ),
    radial-gradient(
      ellipse at 90% 95%,
      rgba(242, 117, 69, 0.13),
      transparent 40%
    ),
    var(--color-cream);
}

/* Subtle decorative glow */

.page::before {
  content: "";
  position: absolute;

  width: 550px;
  height: 550px;

  left: -300px;
  bottom: -250px;

  background: rgba(242, 117, 69, 0.08);
  border-radius: 50%;
  filter: blur(65px);

  pointer-events: none;
}

/* =========================================
   4. PAGE INTRO
   ========================================= */

.page__intro {
  width: 100%;
  max-width: 440px;
  justify-self: end;
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;

  color: var(--color-red);

  margin-bottom: 22px;
}

.page__intro h1 {
  font-family: var(--font-heading);
  font-size: clamp(65px, 7vw, 120px);
  font-weight: 900;

  line-height: 0.9;
  letter-spacing: -0.09em;

  color: var(--color-burgundy);
}

.title-dot {
  color: var(--color-coral);
}

.page__intro > p:last-child {
  max-width: 340px;

  margin-top: 30px;

  font-size: clamp(15px, 1.3vw, 19px);
  line-height: 1.7;
  font-weight: 500;

  color: var(--color-clay);
}

/* =========================================
   5. PAGE OUTRO
   ========================================= */

.page__outro {
  align-self: end;
  justify-self: start;

  padding-bottom: 25px;

  position: relative;
  z-index: 1;
}

.page__outro p {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;

  color: var(--color-red);

  margin-bottom: 10px;
}

.page__outro span {
  display: block;
  max-width: 200px;

  color: var(--color-clay);
  font-size: 13px;
  line-height: 1.6;
}

/* =========================================
   6. PHONE FRAME
   ========================================= */

.phone {
  width: var(--phone-width);
  height: min(var(--phone-height), 90dvh);

  padding: 8px;

  background: linear-gradient(
    145deg,
    #62434B 0%,
    #25171C 25%,
    #120D11 65%,
    #53343D 100%
  );

  border: 2px solid #50343C;
  border-radius: 52px;

  box-shadow:
    0 55px 100px rgba(78, 22, 35, 0.21),
    0 15px 35px rgba(78, 22, 35, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);

  position: relative;
  z-index: 2;

  overflow: hidden;

  animation: phone-entrance 0.9s var(--ease-smooth) both;
}

/* Side buttons */

.phone::before {
  content: "";
  position: absolute;

  left: -3px;
  top: 140px;

  width: 3px;
  height: 55px;

  background: #50343C;
  border-radius: 3px 0 0 3px;
}

/* =========================================
   7. PHONE SCREEN
   ========================================= */

.phone__screen {
  width: 100%;
  height: 100%;

  display: flex;
  flex-direction: column;

  background: var(--phone-screen);
  border-radius: 43px;

  overflow: hidden;

  position: relative;
}

/* =========================================
   8. STATUS BAR
   ========================================= */

.phone__status {
  width: 100%;
  height: 48px;
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 6px 27px 0;

  position: relative;
  z-index: 5;

  color: var(--color-white);
}

.phone__time {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.phone__island {
  position: absolute;

  width: 92px;
  height: 25px;

  top: 12px;
  left: 50%;
  transform: translateX(-50%);

  background: #050405;
  border-radius: 30px;
}

.phone__signals {
  display: flex;
  align-items: center;
  gap: 5px;

  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.signal {
  font-size: 12px;
}

.wifi {
  font-size: 15px;
}

.battery {
  font-size: 17px;
}

/* =========================================
   9. CHAT HEADER
   ========================================= */

.chat-header {
  min-height: 78px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 17px 15px;

  border-bottom: 1px solid var(--border-color);

  position: relative;
  z-index: 4;

  background: rgba(22, 15, 20, 0.94);
}

.chat-header__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.avatar {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    135deg,
    var(--color-yellow),
    var(--color-coral)
  );

  border-radius: 50%;

  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.07em;

  color: var(--color-burgundy);
}

.avatar span {
  color: var(--color-white);
}

.chat-header__contact > div:last-child {
  text-align: center;
}

.chat-header__name {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;

  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.online-dot {
  width: 6px;
  height: 6px;

  display: inline-block;

  background: #8CCF9B;
  border-radius: 50%;
}

.chat-header__status {
  margin-top: 4px;

  color: var(--text-secondary);
  font-size: 9px;
}

.icon-button {
  width: 35px;
  height: 35px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: none;

  color: var(--color-coral);

  font-size: 25px;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.icon-button:hover {
  opacity: 0.7;
  transform: scale(1.08);
}

/* =========================================
   10. CHAT SCROLL AREA
   ========================================= */

.chat-content {
  flex: 1;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 20px 18px;

  scrollbar-width: thin;
  scrollbar-color: #503842 transparent;

  overscroll-behavior: contain;
}

.chat-content::-webkit-scrollbar {
  width: 4px;
}

.chat-content::-webkit-scrollbar-thumb {
  background: #503842;
  border-radius: 5px;
}

.chat-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* =========================================
   11. WELCOME SCREEN
   ========================================= */

.welcome {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding: 35px 8px;
}

.welcome__avatar {
  width: 88px;
  height: 88px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 32px;

  background: linear-gradient(
    145deg,
    var(--color-yellow),
    var(--color-coral) 75%
  );

  border: 5px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;

  color: var(--color-burgundy);

  font-family: var(--font-heading);
  font-size: 47px;
  font-weight: 900;
  letter-spacing: -0.1em;

  box-shadow: 0 16px 45px rgba(242, 117, 69, 0.2);

  transform: rotate(-5deg);
}

.welcome__eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.17em;

  color: var(--color-coral);

  margin-bottom: 17px;
}

.welcome h2 {
  font-family: var(--font-heading);
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 800;

  line-height: 1.15;
  letter-spacing: -0.05em;

  color: var(--text-primary);

  margin-bottom: 18px;
}

.welcome > p:not(.welcome__eyebrow):not(.welcome__note) {
  max-width: 285px;

  font-size: 13px;
  line-height: 1.8;

  color: var(--text-secondary);
}

.primary-button {
  width: 100%;
  max-width: 265px;
  min-height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;

  margin-top: 35px;
  padding: 14px 24px;

  background: var(--color-coral);
  color: var(--color-burgundy);

  border: 1px solid transparent;
  border-radius: 15px;

  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.primary-button:hover {
  background: var(--color-yellow);

  transform: translateY(-3px);

  box-shadow: 0 12px 25px rgba(242, 117, 69, 0.2);
}

.primary-button span {
  font-size: 21px;
  font-weight: 500;
}

.welcome__note {
  margin-top: 18px;

  color: var(--text-muted);
  font-size: 10px;
}

/* =========================================
   12. DATE DIVIDER
   ========================================= */

.date-divider {
  margin: 8px 0 25px;

  text-align: center;

  color: var(--text-muted);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

/* =========================================
   13. MESSAGE AREA
   ========================================= */

.messages {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 9px;

  width: 100%;
  padding-bottom: 12px;
}

/* Individual message */

.message {
  display: flex;
  flex-direction: column;

  max-width: 85%;

  animation: message-appear 0.35s var(--ease-smooth) both;
}

/* Ranty messages */

.message--received {
  align-self: flex-start;
}

/* User messages */

.message--sent {
  align-self: flex-end;
}

.message__bubble {
  padding: 12px 15px;

  font-size: 13px;
  line-height: 1.6;
  font-weight: 500;

  overflow-wrap: anywhere;
  white-space: pre-wrap;

  border-radius: 18px;
}

.message--received .message__bubble {
  background: var(--message-received);
  color: var(--text-primary);

  border-bottom-left-radius: 5px;
}

.message--sent .message__bubble {
  background: var(--message-sent);
  color: #28121B;

  border-bottom-right-radius: 5px;
}

.message__time {
  margin: 5px 5px 0;

  font-size: 9px;
  color: var(--text-muted);
}

.message--sent .message__time {
  text-align: right;
}

/* Consecutive messages */

.message--received + .message--received {
  margin-top: -5px;
}

.message--sent + .message--sent {
  margin-top: -5px;
}

/* =========================================
   14. ONBOARDING ANSWERS
   ========================================= */

.answer-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;

  gap: 8px;

  margin-top: 15px;
  padding-bottom: 20px;

  animation: message-appear 0.4s var(--ease-smooth) both;
}

.answer-button {
  padding: 11px 15px;

  background: rgba(242, 117, 69, 0.08);
  border: 1px solid rgba(242, 117, 69, 0.42);

  border-radius: 14px;

  color: #FFC5AA;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.answer-button:hover {
  background: var(--color-coral);
  color: var(--color-burgundy);
  border-color: var(--color-coral);

  transform: translateY(-2px);
}

.answer-button:active {
  transform: scale(0.97);
}

.answer-button:disabled {
  opacity: 0.4;
}

/* =========================================
   15. TYPING INDICATOR
   ========================================= */

.typing-indicator {
  align-self: flex-start;

  width: fit-content;
  min-width: 62px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  padding: 10px 14px;

  background: var(--message-received);

  border-radius: 18px;
  border-bottom-left-radius: 5px;

  margin: 5px 0 10px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--text-secondary);

  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

/* =========================================
   16. CHAT FOOTER
   ========================================= */

.chat-footer {
  flex-shrink: 0;

  width: 100%;

  padding: 13px 15px 12px;

  background: rgba(28, 19, 25, 0.98);

  border-top: 1px solid var(--border-color);

  position: relative;
  z-index: 3;
}

.message-form {
  display: flex;
  align-items: flex-end;

  gap: 9px;

  width: 100%;
}

.message-form textarea {
  width: 100%;
  min-width: 0;

  min-height: 42px;
  max-height: 125px;

  padding: 11px 15px;

  resize: none;

  background: var(--phone-surface-light);

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;

  color: var(--text-primary);

  font-size: 13px;
  line-height: 1.5;

  outline: none;

  scrollbar-width: thin;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}


.message-form textarea {
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-y: auto;
}

.message-form textarea::-webkit-scrollbar {
  display: none;
}


.message-form textarea::placeholder {
  color: var(--text-muted);
}

.message-form textarea:focus {
  border-color: rgba(242, 117, 69, 0.6);
  background: #3A2A32;
}

.message-form textarea:disabled {
  opacity: 0.5;
}

.send-button {
  width: 42px;
  height: 42px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-coral);
  border: none;
  border-radius: 50%;

  color: var(--color-burgundy);

  font-size: 25px;
  font-weight: 700;

  transition:
    background 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.send-button:hover:not(:disabled) {
  background: var(--color-yellow);
  transform: translateY(-2px);
}

.send-button:disabled {
  opacity: 0.35;
}

.chat-footer__hint {
  margin-top: 10px;

  text-align: center;

  font-size: 9px;
  color: var(--text-muted);
}

.home-indicator {
  width: 105px;
  height: 4px;

  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;

  margin: 15px auto 0;
}

/* =========================================
   17. ABOUT DIALOG
   ========================================= */

.about-dialog {
  width: min(90%, 390px);

  padding: 30px;

  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: #24191F;
  color: var(--text-primary);

  border: 1px solid #59404B;
  border-radius: 25px;

  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.4);
}

.about-dialog::backdrop {
  background: rgba(13, 6, 10, 0.75);
  backdrop-filter: blur(8px);
}

.about-dialog h2 {
  font-family: var(--font-heading);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;

  margin-bottom: 15px;
}

.about-dialog p {
  font-size: 13px;
  line-height: 1.8;

  color: var(--text-secondary);
}

.about-dialog .primary-button {
  max-width: none;
  margin-top: 25px;
}

/* =========================================
   18. ANIMATIONS
   ========================================= */

@keyframes phone-entrance {
  from {
    opacity: 0;
    transform: translateY(35px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes message-appear {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* =========================================
   19. LAPTOPS & TABLETS
   ========================================= */

@media (max-width: 1150px) {
  .page {
    grid-template-columns: 1fr auto;
    gap: 35px;

    padding: 40px;
  }

  .page__intro {
    justify-self: center;
  }

  .page__outro {
    display: none;
  }

  .page__intro h1 {
    font-size: clamp(65px, 8vw, 100px);
  }
}

@media (max-width: 800px) {
  .page {
    grid-template-columns: 1fr;
    justify-items: center;

    gap: 35px;
    padding: 45px 20px;
  }

  .page__intro {
    text-align: center;
    justify-self: center;
  }

  .page__intro h1 {
    font-size: 75px;
  }

  .page__intro > p:last-child {
    margin: 20px auto 0;
  }

  .phone {
    width: min(390px, 100%);
    height: min(790px, 82dvh);
  }
}

/* =========================================
   20. MOBILE — FULL SCREEN APP
   ========================================= */

@media (max-width: 520px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .page {
    display: block;

    width: 100%;
    height: 100dvh;
    min-height: 0;

    padding: 0;

    overflow: hidden;
    background: var(--phone-screen);
  }

  .page__intro,
  .page__outro {
    display: none;
  }

  .phone {
    width: 100%;
    height: 100%;
    max-width: none;

    padding: 0;

    background: var(--phone-screen);

    border: none;
    border-radius: 0;
    box-shadow: none;

    animation: none;
  }

  .phone::before {
    display: none;
  }

  .phone__screen {
    border-radius: 0;
  }

  .phone__status {
    padding-top: max(6px, env(safe-area-inset-top));
    height: calc(48px + env(safe-area-inset-top));
    min-height: calc(48px + env(safe-area-inset-top));
  }

  .chat-content {
    padding: 20px 17px;
  }

  .chat-footer {
    padding-bottom: max(
      12px,
      env(safe-area-inset-bottom)
    );
  }

  .welcome {
    padding: 30px 10px;
  }

  .welcome h2 {
    font-size: 30px;
  }
}

/* =========================================
   21. SHORT SCREENS
   ========================================= */

@media (max-height: 700px) and (min-width: 521px) {
  .page {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .phone {
    height: 94dvh;
  }

  .welcome {
    padding: 15px 8px;
  }

  .welcome__avatar {
    width: 65px;
    height: 65px;

    font-size: 36px;

    margin-bottom: 18px;
  }

  .welcome h2 {
    font-size: 25px;
  }

  .primary-button {
    margin-top: 20px;
  }
}

/* =========================================
   22. REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;

    scroll-behavior: auto !important;

    transition-duration: 0.01ms !important;
  }
}
