:root {
  --ink: #15332f;
  --ink-soft: #58706c;
  --green-950: #062f2a;
  --green-900: #0b3d36;
  --green-800: #145b4f;
  --green-600: #26977f;
  --mint: #a9dbc8;
  --mint-soft: #e6f3ed;
  --cream: #f4f8f6;
  --cream-deep: #e4eeea;
  --gold: #c49a43;
  --white: #ffffff;
  --line: rgba(11, 61, 54, 0.12);
  --shadow: 0 24px 70px rgba(8, 53, 47, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 17px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(38, 151, 127, 0.12), transparent 27rem),
    radial-gradient(circle at 100% 90%, rgba(28, 90, 128, 0.08), transparent 32rem),
    linear-gradient(145deg, #fbfdfc 0%, #f3f8f6 55%, #eef5f3 100%);
  font-family: "IBM Plex Sans Arabic", Tahoma, "Segoe UI", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.ambient-one {
  top: 8rem;
  left: -8rem;
  width: 19rem;
  height: 19rem;
  background: rgba(169, 219, 200, 0.2);
}

.ambient-two {
  right: -8rem;
  bottom: 8rem;
  width: 22rem;
  height: 22rem;
  background: rgba(196, 154, 67, 0.1);
}

.site-header {
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  padding-top: max(12px, var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.university-mark {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
}

.university-mark img {
  display: block;
  width: clamp(150px, 25vw, 218px);
  max-height: 59px;
  object-fit: contain;
  object-position: right center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prototype-badge {
  padding: 7px 11px;
  border: 1px solid rgba(196, 154, 67, 0.25);
  border-radius: 999px;
  color: #765b22;
  background: rgba(255, 250, 234, 0.78);
  font-size: 0.72rem;
  white-space: nowrap;
}

.language-toggle {
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-900);
  background: rgba(255, 254, 250, 0.78);
  cursor: pointer;
  box-shadow: 0 7px 24px rgba(11, 61, 54, 0.07);
}

.language-toggle:active {
  transform: translateY(1px);
}

.language-toggle__globe {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}

.page-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 20px auto 0;
  display: grid;
  gap: 16px;
}

.welcome-panel,
.assistant-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.welcome-panel {
  min-height: 345px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 42%),
    linear-gradient(150deg, var(--green-900), var(--green-950));
}

.welcome-panel::before {
  content: "";
  position: absolute;
  top: -6rem;
  left: -4rem;
  width: 17rem;
  height: 17rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.025), 0 0 0 84px rgba(255, 255, 255, 0.018);
}

.welcome-panel__topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9eee5;
  font-size: 0.86rem;
}

.spark {
  color: #e2bf70;
}

.door-mark {
  position: absolute;
  top: 42px;
  left: 30px;
  width: 95px;
  height: 132px;
  opacity: 0.96;
}

[dir="ltr"] .door-mark {
  right: 30px;
  left: auto;
  transform: scaleX(-1);
}

.door-mark__frame {
  position: absolute;
  inset: 0 20px 0 0;
  border: 3px solid rgba(239, 224, 183, 0.82);
  border-bottom: 0;
  border-radius: 52px 52px 0 0;
}

.door-mark__leaf {
  position: absolute;
  right: 14px;
  bottom: 0;
  width: 53px;
  height: 100px;
  border: 2px solid rgba(255, 248, 224, 0.88);
  border-radius: 34px 34px 0 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  transform: skewY(-7deg);
  transform-origin: bottom right;
}

.door-mark__light {
  position: absolute;
  right: 25px;
  bottom: 0;
  width: 52px;
  height: 77px;
  background: linear-gradient(90deg, rgba(255, 238, 181, 0.22), transparent);
  clip-path: polygon(100% 0, 0 17%, 0 100%, 100% 100%);
}

.welcome-copy {
  position: relative;
  z-index: 1;
  max-width: 32rem;
  padding-top: 74px;
}

.program-name {
  margin: 0 0 9px;
  color: #d1e9df;
  font-size: 0.86rem;
}

.welcome-copy h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.8rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.055em;
  font-family: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tahoma, sans-serif;
}

[dir="ltr"] .welcome-copy h1 {
  letter-spacing: -0.04em;
}

.welcome-lead {
  max-width: 36ch;
  margin: 17px 0 0;
  color: #d9ebe4;
  font-size: 0.98rem;
  line-height: 1.85;
}

.trust-note {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #d8e9e3;
  font-size: 0.8rem;
}

.trust-note p {
  margin: 0;
}

.trust-note__icon {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210, 235, 225, 0.28);
  border-radius: 50%;
  color: #f2ce7f;
}

.assistant-card {
  min-height: 550px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 254, 250, 0.93);
  backdrop-filter: blur(18px);
}

.assistant-header {
  min-height: 78px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.assistant-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: var(--green-900);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-weight: 800;
  font-size: 1.2rem;
}

.assistant-avatar i {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--gold);
}

.assistant-kicker {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.assistant-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.online-dot {
  width: 9px;
  height: 9px;
  margin-inline-start: auto;
  border-radius: 50%;
  background: #37b38f;
  box-shadow: 0 0 0 5px rgba(55, 179, 143, 0.12);
}

.conversation {
  flex: 1;
  padding: 20px 16px 28px;
  overflow: visible;
  overscroll-behavior: auto;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(88%, 31rem);
  margin-bottom: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  font-size: 0.91rem;
  line-height: 1.72;
  animation: message-in 320ms ease both;
}

.message p {
  margin: 0;
}

.message p + p {
  margin-top: 3px;
}

.answer-link {
  width: fit-content;
  min-height: 40px;
  margin-top: 11px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(20, 91, 79, 0.18);
  border-radius: 11px;
  color: var(--green-800);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
}

.answer-media {
  margin: 16px 0 2px;
}

.answer-media .guide-image-link {
  max-width: 260px;
  margin-inline: auto;
  padding: 10px;
  border: 1px solid rgba(11, 61, 54, 0.1);
  border-radius: 15px;
  background: #fff;
}

.answer-media img {
  width: 100%;
  max-height: 310px;
  display: block;
  object-fit: contain;
}

.answer-media figcaption {
  max-width: 34rem;
  margin: 9px auto 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.65;
  text-align: center;
}

.guide-image-link {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

.guide-image-link > span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(6, 47, 42, 0.86);
  font-size: 0.6rem;
  line-height: 1;
  backdrop-filter: blur(7px);
}

[dir="ltr"] .guide-image-link > span {
  right: auto;
  left: 8px;
}

.guide-steps {
  margin: 16px 0 2px;
  padding: 0;
  display: grid;
  gap: 13px;
  list-style: none;
}

.guide-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.guide-step__number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--green-800);
  font-size: 0.7rem;
  font-weight: 700;
}

.guide-step__content {
  min-width: 0;
}

.guide-step__content p {
  padding-top: 2px;
  font-size: 0.8rem;
}

.guide-step__content img {
  width: 100%;
  height: auto;
  margin-top: 0;
  display: block;
  border: 1px solid rgba(11, 61, 54, 0.12);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(8, 53, 47, 0.08);
}

.guide-step__content .guide-image-link {
  width: 100%;
  margin-top: 9px;
  margin-inline: auto;
  border-radius: 13px;
}

.message--bot {
  margin-inline-end: auto;
  border-bottom-inline-end-radius: 6px;
  color: var(--ink);
  background: var(--mint-soft);
}

.message--user {
  margin-inline-start: auto;
  border-bottom-inline-start-radius: 6px;
  color: white;
  background: var(--green-900);
}

.message--intro {
  max-width: 90%;
}

.student-context {
  margin-top: 15px;
  padding: 13px;
  border: 1px solid rgba(20, 91, 79, 0.12);
  border-radius: 17px;
  background: rgba(230, 243, 237, 0.52);
}

.student-context__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.student-context__copy {
  min-width: 0;
}

.student-context__title {
  margin: 0;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.student-context__hint {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.55;
}

.audience-options {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(20, 91, 79, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
}

.audience-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  white-space: nowrap;
}

.audience-button[aria-pressed="true"] {
  color: #fff;
  background: var(--green-900);
  box-shadow: 0 5px 13px rgba(11, 61, 54, 0.16);
}

.topic-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.topic-button,
.follow-up-button,
.restart-button {
  border: 0;
  cursor: pointer;
}

.topic-button {
  min-height: 104px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #fff;
  text-align: start;
  box-shadow: 0 8px 24px rgba(16, 68, 60, 0.045);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.topic-button:active {
  transform: scale(0.985);
}

.topic-button__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--green-800);
  background: var(--mint-soft);
  font-size: 1rem;
}

.topic-button__title {
  display: block;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1.45;
}

.topic-button__hint {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.65rem;
  line-height: 1.5;
}

.follow-up-list {
  margin: 6px 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: message-in 360ms ease both;
}

.follow-up-button,
.restart-button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(20, 91, 79, 0.2);
  border-radius: 13px;
  color: var(--green-800);
  background: #fff;
  font-size: 0.78rem;
}

.follow-up-button:disabled {
  cursor: default;
  opacity: 0.55;
  color: var(--ink-soft);
  background: var(--mint-soft);
}

.restart-button {
  margin-top: 2px;
  color: var(--ink-soft);
  background: transparent;
}

.question-box {
  margin: 0 12px max(12px, var(--safe-bottom));
  padding: 6px 6px 6px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(11, 61, 54, 0.15);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(8, 53, 47, 0.09);
}

[dir="ltr"] .question-box {
  padding: 6px 13px 6px 6px;
}

.question-box input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.question-box input::placeholder {
  color: #81928f;
}

.question-box button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--green-900);
  cursor: pointer;
}

.send-glyph {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
}

[dir="ltr"] .send-glyph {
  transform: scaleX(-1);
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 20px auto 0;
  padding: 0 0 calc(26px + var(--safe-bottom));
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.72rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  .topic-button:hover {
    transform: translateY(-2px);
    border-color: rgba(38, 151, 127, 0.32);
    box-shadow: 0 13px 30px rgba(16, 68, 60, 0.09);
  }

  .language-toggle:hover,
  .follow-up-button:hover,
  .restart-button:hover {
    border-color: rgba(38, 151, 127, 0.4);
  }
}

@media (min-width: 720px) {
  .site-header {
    min-height: 92px;
  }

  .page-shell {
    margin-top: 26px;
    grid-template-columns: minmax(0, 0.85fr) minmax(390px, 1.15fr);
    gap: 20px;
    align-items: stretch;
  }

  [dir="ltr"] .page-shell {
    grid-template-columns: minmax(390px, 1.15fr) minmax(0, 0.85fr);
  }

  [dir="ltr"] .welcome-panel {
    grid-column: 2;
  }

  [dir="ltr"] .assistant-card {
    grid-column: 1;
    grid-row: 1;
  }

  .welcome-panel,
  .assistant-card {
    min-height: 685px;
  }

  .welcome-panel {
    padding: 38px;
  }

  .welcome-copy {
    padding-top: 170px;
  }

  .door-mark {
    top: 72px;
    left: 40px;
    width: 120px;
    height: 165px;
    transform: scale(1.12);
  }

  [dir="ltr"] .door-mark {
    right: 40px;
    transform: scaleX(-1) scale(1.12);
  }

  .welcome-copy h1 {
    font-size: clamp(2.7rem, 5.5vw, 4.25rem);
  }

  .assistant-header {
    min-height: 88px;
    padding-inline: 24px;
  }

  .conversation {
    padding: 25px 22px 30px;
  }

  .topic-grid {
    gap: 11px;
  }

  .topic-button {
    min-height: 112px;
  }

  .question-box {
    margin-inline: 18px;
    margin-bottom: 18px;
  }
}

@media (min-width: 1020px) {
  .page-shell {
    grid-template-columns: 0.88fr 1.12fr;
  }

  .topic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 410px) {
  .site-header {
    width: min(100% - 24px, 1120px);
  }

  .university-mark img {
    width: 132px;
  }

  .prototype-badge {
    display: none;
  }

  .page-shell {
    width: min(100% - 18px, 1120px);
    margin-top: 12px;
  }

  .welcome-panel {
    min-height: 318px;
    padding: 23px;
  }

  .welcome-copy h1 {
    font-size: 2.15rem;
  }

  .door-mark {
    left: 20px;
    transform: scale(0.88);
    transform-origin: top left;
  }

  [dir="ltr"] .door-mark {
    right: 20px;
    left: auto;
    transform: scaleX(-1) scale(0.88);
    transform-origin: top right;
  }

  .assistant-card {
    min-height: 600px;
    border-radius: 26px;
  }

  .student-context__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .audience-options {
    width: 100%;
  }

  .audience-button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
