* {
  box-sizing: border-box;
}

:root {
  --black: #101010;
  --grey: #6b6b6b;
  --light-grey: #f5f5f3;
  --border: #dededb;
  --white: #ffffff;
  --accent: #eeff00;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family:
    Arial,
    Helvetica,
    sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* PAGE */

.page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
}


/* HERO */

.hero {
  padding: 90px 0 60px;
  max-width: 900px;
  margin: auto;
  text-align: center;
}

.badge {
  display: inline-block;
  margin-bottom: 24px;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 0;

  font-size: clamp(
    42px,
    7vw,
    82px
  );

  line-height: 0.98;
  letter-spacing: -3px;
}

h1 span {
  color: #767676;
}

.intro {
  max-width: 600px;
  margin: 26px auto 40px;

  color: var(--grey);

  font-size: 19px;
  line-height: 1.6;
}


/* SEARCH */

.search-card {
  max-width: 760px;
  margin: auto;

  padding: 10px;

  border: 1px solid var(--border);
  border-radius: 20px;

  background: white;

  box-shadow:
    0 20px 60px
    rgba(0, 0, 0, 0.08);
}

textarea {
  display: block;

  width: 100%;
  min-height: 130px;

  padding: 20px;

  border: 0;
  outline: 0;
  resize: none;

  color: var(--black);

  font-size: 18px;
  line-height: 1.5;
}

textarea::placeholder {
  color: #aaa;
}

#askButton {
  display: flex;

  width: 100%;

  align-items: center;
  justify-content: space-between;

  padding: 17px 22px;

  border: 0;
  border-radius: 13px;

  background: var(--black);
  color: white;

  font-weight: 700;

  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

#askButton:hover {
  transform: translateY(-1px);
}

#askButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.arrow {
  font-size: 22px;
}


/* SUGGESTIONS */

.suggestions {
  display: flex;

  flex-wrap: wrap;
  gap: 8px;

  justify-content: center;

  margin-top: 18px;
}

.suggestion {
  padding: 9px 13px;

  border: 1px solid var(--border);
  border-radius: 100px;

  background: white;

  color: #444;

  font-size: 13px;
}

.suggestion:hover {
  background: var(--light-grey);
}


/* LOADING */

.loading {
  padding: 50px 0;
  text-align: center;
  color: var(--grey);
}

.spinner {
  width: 30px;
  height: 30px;

  margin: 0 auto 18px;

  border: 3px solid #eee;
  border-top-color: var(--black);

  border-radius: 50%;

  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* RESULT */

.result {
  max-width: 820px;

  margin:
    20px auto
    100px;

  padding-top: 40px;

  border-top: 1px solid var(--border);
}

.result-label {
  margin-bottom: 24px;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.answer {
  font-size: 17px;
  line-height: 1.8;

  white-space: pre-wrap;
}


/* SOURCES */

.sources {
  margin-top: 45px;
}

.sources-title {
  margin-bottom: 16px;

  font-size: 20px;
  font-weight: 800;
}

.sources-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 12px;
}

.source-card {
  display: block;

  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 14px;

  color: inherit;
  text-decoration: none;

  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.source-card:hover {
  border-color: #999;

  transform:
    translateY(-2px);
}

.source-label {
  margin-bottom: 8px;

  color: #888;

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.source-title {
  font-weight: 700;
  line-height: 1.4;
}


/* ERROR */

.error {
  max-width: 760px;

  margin: 20px auto;

  padding: 15px 18px;

  border-radius: 10px;

  background: #fff0f0;
  color: #a40000;
}


/* FOOTER */

footer {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 30px 0 40px;

  border-top: 1px solid var(--border);

  color: #888;

  font-size: 12px;
}


/* UTIL */

.hidden {
  display: none !important;
}


/* MOBILE */

@media (max-width: 650px) {

  .page {
    width:
      min(
        100% - 24px,
        1100px
      );
  }

  .hero {
    padding:
      60px 0
      40px;
  }

  h1 {
    letter-spacing: -2px;
  }

  .intro {
    font-size: 16px;
  }

  textarea {
    min-height: 150px;
    padding: 16px;
    font-size: 16px;
  }

  .sources-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }
}
