/* Colors: change them here. The dark mode colors are in the second block. */
:root {
  --page: #ffffff;
  --panel: #fff3ee;
  --text: #0b3954;
  --soft-text: #3d5a6c;
  --border: #0b3954;
  --orange: #f46036;
  --button: #c9431a;
  --button-ledge: #8f2c0e;
  --on-button: #ffffff;
  --red: #c62828;
  --red-tint: #fdecec;
  --yellow: #e0a800;
  --yellow-tint: #fff6d6;
  --green: #2e7d32;
  --green-tint: #e8f5e9;
  --highlight: #ffe08a;
}

[data-theme="dark"] {
  --page: #0a2230;
  --panel: #0f3245;
  --text: #f3f6f8;
  --soft-text: #c5d3dc;
  --border: #f3f6f8;
  --orange: #f46036;
  --button: #f46036;
  --button-ledge: #a63a1c;
  --on-button: #0a2230;
  --red: #ff6b6b;
  --red-tint: #3a1f2a;
  --yellow: #ffd23f;
  --yellow-tint: #38341f;
  --green: #5fd068;
  --green-tint: #16352a;
  --highlight: #7a5c00;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 137.5%;
}

html.big-text {
  font-size: 162.5%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Atkinson Hyperlegible", Verdana, sans-serif;
  line-height: 1.55;
  transition: background 0.3s, color 0.3s;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  font-size: 2.3rem;
  margin: 0 0 20px;
}

h2 {
  font-size: 1.4rem;
  margin: 0 0 20px;
}

h3 {
  font-size: 1.1rem;
  margin: 28px 0 10px;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.note {
  color: var(--soft-text);
  font-size: max(18px, 0.85rem);
}

:focus-visible {
  outline: 4px solid var(--orange);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */

.top-bar {
  border-bottom: 5px solid var(--orange);
}

.top-bar-inside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo img {
  height: 56px;
  width: auto;
}

.logo-for-dark {
  display: none;
}

[data-theme="dark"] .logo-for-light {
  display: none;
}

[data-theme="dark"] .logo-for-dark {
  display: block;
}

.ring {
  display: inline-block;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 10px solid;
  border-color: var(--orange) #ffffff var(--orange) #ffffff;
  box-shadow: 0 0 0 2px var(--orange), inset 0 0 0 2px var(--orange);
}

.ring.big {
  width: 84px;
  height: 84px;
  border-width: 20px;
  animation: spin 1.8s linear infinite;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
}

.theme-button {
  font: inherit;
  font-size: max(18px, 0.85rem);
  font-weight: 700;
  min-height: 48px;
  padding: 10px 20px;
  color: var(--text);
  background: var(--page);
  border: 3px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.theme-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}

/* Top of the page */

.hero {
  padding-top: 28px;
  padding-bottom: 28px;
}

.hero h1 {
  margin-bottom: 10px;
}

.lead {
  font-size: 1.15rem;
  color: var(--soft-text);
  max-width: 34em;
  margin: 0;
}

/* Message box and answer */

.checker {
  display: grid;
  gap: 32px;
  align-items: start;
  padding-bottom: 72px;
}

.box {
  border: 3px solid var(--border);
  border-radius: 24px;
  padding: 28px;
}

.ask {
  background: var(--page);
}

.answer {
  background: var(--panel);
  scroll-margin-top: 16px;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

textarea {
  display: block;
  width: 100%;
  font: inherit;
  padding: 16px;
  color: var(--text);
  background: var(--page);
  border: 3px solid var(--border);
  border-radius: 16px;
  box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.07);
  resize: vertical;
}

textarea:focus {
  border-color: var(--orange);
}

.button {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 18px 24px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--on-button);
  background: var(--button);
  border: 3px solid var(--button-ledge);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--button-ledge);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.button:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--button-ledge);
}

.button.plain {
  color: var(--text);
  background: var(--page);
  border-color: var(--border);
  box-shadow: 0 6px 0 var(--border);
}

.button.plain:active {
  box-shadow: 0 1px 0 var(--border);
}

#photo:focus-visible + label,
#voicemail:focus-visible + label {
  outline: 4px solid var(--orange);
  outline-offset: 3px;
}

.examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.example {
  padding: 0;
  overflow: hidden;
  font: inherit;
  font-size: max(18px, 0.9rem);
  font-weight: 700;
  text-align: left;
  color: var(--text);
  background: var(--page);
  border: 3px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--border);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.example:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--border);
}

.example img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.example span {
  display: block;
  padding: 12px 14px;
}

.empty img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 10px 10px 0 var(--orange);
}

.empty p {
  font-size: 1.1rem;
  color: var(--soft-text);
}

.loading {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 1.15rem;
  font-weight: 700;
}

.error {
  padding: 18px;
  font-weight: 700;
  background: var(--page);
  border: 3px solid var(--red);
  border-radius: 16px;
}

#result {
  animation: fade-in 0.4s ease-out;
}

#verdict-banner {
  display: flex;
  gap: 18px;
  padding: 20px;
  border: 3px solid;
  border-radius: 18px;
}

#verdict-banner.scam {
  --flag-color: var(--red);
  background: var(--red-tint);
  border-color: var(--red);
}

#verdict-banner.suspicious {
  --flag-color: var(--yellow);
  background: var(--yellow-tint);
  border-color: var(--yellow);
}

#verdict-banner.safe {
  --flag-color: var(--green);
  background: var(--green-tint);
  border-color: var(--green);
}

.flag {
  position: relative;
  flex: none;
  width: 56px;
  height: 76px;
  border-left: 6px solid var(--text);
}

.flag::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 36px;
  background: var(--flag-color);
  animation: raise-flag 0.8s ease-out;
}

#verdict {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

#summary {
  margin: 0;
}

.message-quote {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  background: var(--page);
  border-radius: 14px;
}

mark {
  color: var(--text);
  background: var(--highlight);
  padding: 0 3px;
  border-radius: 4px;
}

li {
  margin-bottom: 10px;
}

.result-buttons {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.result-buttons .button {
  margin-top: 0;
}

.report-box {
  margin-top: 24px;
  padding: 4px 20px 6px;
  background: var(--page);
  border-left: 6px solid var(--orange);
  border-radius: 14px;
}

.report-box h3 {
  margin-top: 16px;
}

.report-box a {
  color: var(--text);
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
select {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  font: inherit;
  color: var(--text);
  background: var(--page);
  border: 3px solid var(--border);
  border-radius: 14px;
}

input[type="text"]:focus,
input[type="tel"]:focus,
select:focus {
  border-color: var(--orange);
}

.language-label {
  margin-top: 24px;
}

#language-line {
  margin: 10px 0 0;
}

/* Links we checked */

.link-list {
  padding: 0;
  list-style: none;
}

.link-list li {
  padding: 12px 16px;
  background: var(--page);
  border-left: 6px solid var(--soft-text);
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.link-list li.risk-high {
  border-left-color: var(--red);
}

.link-list li.risk-medium {
  border-left-color: var(--yellow);
}

.link-list li.risk-low {
  border-left-color: var(--green);
}

#trusted-hint {
  margin-top: 14px;
}

#trusted-hint a {
  color: var(--text);
}

/* Follow-up questions */

.followup {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 3px dashed var(--border);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  min-height: 48px;
  padding: 8px 16px;
  font: inherit;
  font-size: max(18px, 0.85rem);
  font-weight: 700;
  text-align: left;
  color: var(--text);
  background: var(--page);
  border: 3px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

.chip:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}

.followup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.bubble {
  max-width: 90%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
}

.bubble.user {
  align-self: flex-end;
  color: var(--on-button);
  background: var(--button);
}

.bubble.model {
  align-self: flex-start;
  background: var(--page);
  border: 2px solid var(--border);
}

.followup-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.followup-row .button {
  width: auto;
  margin-top: 0;
  padding: 10px 22px;
}

.followup-row .button:disabled {
  opacity: 0.6;
}

/* Trusted person and practice */

#trusted,
#practice {
  padding-bottom: 48px;
}

.trusted {
  background: var(--panel);
}

.trusted-fields {
  display: grid;
  gap: 16px;
}

.practice {
  background: var(--page);
}

.practice-message {
  font-size: 1.15rem;
  border: 3px solid var(--border);
}

.practice-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.practice-result {
  margin: 20px 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
}

.practice-result.right {
  color: var(--green);
}

.practice-result.wrong {
  color: var(--red);
}

/* How Lifeguard uses Gemini */

.gemini {
  padding-bottom: 64px;
}

.gemini-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.gemini-list li {
  margin: 0;
  padding: 14px 18px;
  background: var(--panel);
  border-left: 6px solid var(--orange);
  border-radius: 14px;
}

#again-button {
  margin-top: 24px;
}

/* Tips at the bottom */

.tips {
  padding-top: 24px;
  padding-bottom: 72px;
}

.tip-grid {
  display: grid;
  gap: 40px;
}

.tip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 20px;
}

.tip h3 {
  margin-top: 20px;
}

.tip p {
  margin: 0;
  color: var(--soft-text);
}

.footer {
  padding: 32px 0;
  background: var(--panel);
  border-top: 5px solid var(--orange);
}

/* Fade in while scrolling */

.can-animate .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.can-animate .reveal.shown {
  opacity: 1;
  transform: none;
}

.tip:nth-child(2) {
  transition-delay: 0.15s;
}

.tip:nth-child(3) {
  transition-delay: 0.3s;
}

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

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes raise-flag {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

/* Bigger screens: message on the left, answer on the right */

@media (min-width: 900px) {
  .trusted-fields,
  .gemini-list {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (min-width: 600px) {
  .result-buttons {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phones */

@media (max-width: 700px) {
  html {
    font-size: 118.75%;
  }

  h1 {
    font-size: 1.9rem;
  }

  .hero {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .logo img {
    height: 44px;
  }

  html.big-text {
    font-size: 140%;
  }

  .box {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .can-animate .reveal {
    opacity: 1;
    transform: none;
  }
}

.practice-sender {
  margin: 12px 0 8px;
  font-weight: 700;
  color: var(--soft-text);
}

/* Recording from the microphone */

.button.plain.recording {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 6px 0 var(--border);
  animation: pulse 1.6s ease-in-out infinite;
}

.mic-status {
  font-weight: 700;
}

@keyframes pulse {
  50% {
    opacity: 0.75;
  }
}

.family-status {
  white-space: pre-wrap;
  font-weight: 700;
}
