:root {
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --ink: #211E1B;
  --ink-muted: #837E78;
  --accent: #F01E8C;
  --accent-ink: #FFFFFF;
  --border: #E4E0DA;
  --font-heading: Charter, 'Iowan Old Style', Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --space-sm: 8px;
  --space-md: 24px;
  --space-lg: 64px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  --bg: #1C1A18;
  --surface: #262320;
  --ink: #F2EFEA;
  --ink-muted: #A39C93;
  --border: #3A3630;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  min-height: 100%;
  transition: background 0.2s ease, color 0.2s ease;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.ask-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .ask-header {
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
  }
}

.ask-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ask-header__login {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ask-header__login:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 30, 140, 0.06);
}

.ask-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ask-logo__mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ask-logo__text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.ask-logo__text em {
  font-style: italic;
  color: var(--accent);
}

/* Hero / main */
.ask-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  gap: var(--space-md);
}

.ask-hero__logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(40px, 12vw, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

.ask-hero__logo em {
  font-style: italic;
  color: var(--accent);
}

.ask-logo-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 460px;
}

.ask-logo-picker__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 16px);
  background: var(--surface);
}

.ask-logo-picker__option--dark {
  background: #1C1A18;
}

.ask-logo-picker__label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

.ask-logo-picker__img {
  max-width: 100%;
  height: auto;
  max-height: 90px;
}

.ask-hero__tagline {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
  max-width: 26ch;
  color: var(--ink-muted);
}

/* Search form */
.ask-form {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 22px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ask-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 30, 140, 0.15);
}

.ask-form__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--ink-muted);
}

.ask-form__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 12px 0;
}

.ask-form__input::placeholder {
  color: var(--ink-muted);
}

.ask-form__submit {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.ask-form__submit:hover {
  opacity: 0.9;
}

.ask-form__submit:active {
  transform: scale(0.94);
}

.ask-form__submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Answer area */
.ask-answer {
  width: 100%;
  max-width: 620px;
  min-height: 1px;
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
}

.ask-answer:empty {
  display: none;
}

.ask-answer[data-state="loading"] {
  color: var(--ink-muted);
}

.ask-answer[data-state="error"] {
  color: var(--accent);
}

/* Example chips */
.ask-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 620px;
}

.ask-examples__chip {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ask-examples__chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240, 30, 140, 0.06);
}

/* Footer */
.ask-footer {
  font-size: 14px;
  color: var(--ink-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.ask-footer__top {
  padding: 14px 16px;
}

.ask-footer__divider {
  border-top: 1px solid var(--border);
}

.ask-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  row-gap: 14px;
  column-gap: 28px;
  padding: 16px;
}

.ask-footer__row-left,
.ask-footer__row-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 14px;
  column-gap: 28px;
}

@media (min-width: 640px) {
  .ask-footer__top {
    padding: var(--space-sm) var(--space-lg);
  }

  .ask-footer__row {
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
  }
}

.ask-footer a {
  color: var(--ink-muted);
}

.ask-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.ask-footer__icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ask-footer__icon-btn:hover {
  background: rgba(240, 30, 140, 0.08);
  color: var(--accent);
}

#theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] #theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] #theme-toggle .icon-moon {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .ask-form, .ask-form__submit {
    transition: none;
  }
}
