:root {
  --ink: #17212a;
  --muted: #65727f;
  --line: rgba(23, 33, 42, 0.14);
  --paper: #f7f3ea;
  --panel: #fffdf8;
  --blue: #31556a;
  --blue-soft: #dce9ee;
  --green: #4e6843;
  --gold: #a9822f;
  --danger: #8b2f2a;
  --shadow: 0 24px 80px rgba(23, 33, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(49, 85, 106, 0.22), transparent 26rem),
    radial-gradient(circle at 90% 0%, rgba(169, 130, 47, 0.16), transparent 24rem),
    linear-gradient(135deg, #f8f1e3, #fffdf8 56%, #e8f1f4);
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  color: var(--blue);
  background: rgba(255, 253, 248, 0.72);
  border-color: var(--line);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

input,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--panel);
}

textarea {
  resize: vertical;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.talk2dad-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card,
.hero-card,
.voice-card,
.chat-card,
.memory-card,
.features article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 54px);
}

.login-card h1,
.hero-card h1,
.section-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 0.98;
  letter-spacing: 0;
}

.login-card h1 {
  font-size: clamp(3rem, 8vw, 5.6rem);
}

.lead,
.caption,
.fine-print,
.features p,
.hero-card p,
.memory-panel {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.login-form label {
  font-weight: 800;
}

.form-message.error,
.caption.error {
  color: var(--danger);
  font-weight: 800;
}

.app-shell {
  width: min(100% - 28px, 1240px);
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.88);
  backdrop-filter: blur(14px);
}

.topbar strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-top: 24px;
}

.hero-card,
.voice-card,
.chat-card,
.memory-card {
  padding: clamp(18px, 3vw, 28px);
}

.hero-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 22px;
  background:
    linear-gradient(135deg, rgba(220, 233, 238, 0.92), rgba(255, 253, 248, 0.94)),
    var(--panel);
}

.dad-avatar {
  width: 170px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  object-position: center 20%;
  background: var(--blue-soft);
}

.hero-card h1 {
  font-size: clamp(3rem, 8vw, 6.4rem);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 3.1rem);
}

.status-pill {
  border: 1px solid rgba(49, 85, 106, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.82rem;
  font-weight: 900;
}

.control-row,
.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-log {
  min-height: 260px;
  max-height: 520px;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.message {
  width: min(100%, 760px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.message.user {
  justify-self: end;
  background: #eef4f7;
}

.message strong {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 0.84rem;
}

.message p {
  margin: 0;
}

.prompt-row {
  margin: 12px 0;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.mode-toggle input {
  width: auto;
  min-height: auto;
}

.memory-panel {
  display: grid;
  gap: 12px;
}

.memory-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

.memory-item h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.memory-item p {
  margin: 0;
}

.features {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.features article {
  padding: 18px;
}

.features h3 {
  margin: 0 0 8px;
}

@media (max-width: 900px) {
  .layout,
  .hero-card,
  .features,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .section-head,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
  }

  button {
    width: 100%;
  }

  .dad-avatar {
    width: 132px;
  }
}
