﻿/*
VOICE: start page is a polished object (brushed silver, engraved serif); chat is quiet and familiar.
IDEA: a black-and-silver product tin — myAI's label card sits on metal.
PICTURE: the huge engraved "myAI" wordmark on brushed steel.
COLOUR/TYPE: silver #dcdcde, ink #111; Bodoni Moda (display, italic), IBM Plex Mono (labels).
LAYOUT: top label row, centred wordmark + card, feature row at the bottom; chat = one 768px column.
*/
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body { margin: 0; font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button, textarea { font: inherit; color: inherit; }
button, label.pill { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

/* ================= Start page: brushed silver ================= */
.setup {
  min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; color: #111;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 48px) max(18px, env(safe-area-inset-bottom));
  background:
    repeating-linear-gradient(180deg, rgb(255 255 255 / .55) 0 1px, transparent 1px 3px, rgb(0 0 0 / .045) 3px 4px, transparent 4px 6px),
    radial-gradient(120% 90% at 50% 35%, #f4f4f5 0%, #d8d8da 55%, #b9b9bc 100%);
}
.topline, .features { display: flex; justify-content: space-between; gap: 12px; }
.topline { font: 500 10px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 0; }
.dot {
  width: 34px; height: 34px; border-radius: 50%; margin-bottom: 14px;
  background: radial-gradient(circle at 35% 30%, #555, #000 60%);
  box-shadow: 0 3px 6px rgb(0 0 0 / .35), inset 0 -1px 0 rgb(255 255 255 / .25);
  position: relative;
}
.dot::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; background: #cfcfd2; }
.wordmark {
  margin: 0; font-family: "Bodoni Moda", Didot, "Bodoni 72", serif; font-weight: 700;
  font-size: clamp(76px, 20vw, 200px); line-height: 1.1; letter-spacing: -.01em;
  padding: 0 .08em .05em; -webkit-user-select: none; user-select: none;
  color: transparent;
  background: linear-gradient(180deg, #fff 0%, #cfcfd2 45%, #f7f7f8 52%, #a9a9ad 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 3px #111;
  filter: drop-shadow(4px 5px 0 rgb(0 0 0 / .55)) drop-shadow(0 12px 18px rgb(0 0 0 / .18));
}
.tagline {
  margin: 10px 0 26px; font: 600 clamp(15px, 3.4vw, 22px)/1.3 Copperplate, "Copperplate Gothic Light", "Cinzel", serif;
  text-transform: uppercase; letter-spacing: .08em;
}
.card {
  width: min(380px, 100%); text-align: left; background: #f6f6f4; padding: 14px 16px 16px;
  box-shadow: 0 10px 24px rgb(0 0 0 / .22), 0 1px 0 rgb(255 255 255 / .8) inset;
  font: 12px/1.6 "IBM Plex Mono", ui-monospace, monospace;
}
.card-head { display: flex; justify-content: space-between; font-weight: 500; padding-bottom: 8px; border-bottom: 2px solid #111; margin-bottom: 8px; }
.card-title { margin: 0 0 4px; font-weight: 500; }
.card-text { margin: 0; color: #444; }
.start {
  margin-top: 14px; width: 100%; min-height: 46px; border: 0; background: #111; color: #f6f6f4;
  font: 500 13px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .06em;
}
.start:disabled { opacity: .5; }
.progress { margin-top: 12px; display: grid; gap: 8px; }
.track { height: 6px; background: #d4d4d6; overflow: hidden; }
.fill { height: 100%; width: 0; background: #111; transition: width .3s; }
.error { margin: 10px 0 0; color: #b3261e; }
.hint { margin: 18px 0 0; font: 11px/1.5 "IBM Plex Mono", ui-monospace, monospace; color: #444; max-width: 380px; }
.features { border-top: 1px solid rgb(0 0 0 / .35); padding-top: 12px; font: italic 400 clamp(15px, 2.6vw, 20px) "Bodoni Moda", Didot, serif; color: #333; }

/* ================= Chat: ChatGPT-style ================= */
.chat {
  --bg: #fff; --ink: #0d0d0d; --muted: #6b6b6b; --soft: #f4f4f4; --line: #e5e5e5;
  height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .chat { --bg: #212121; --ink: #ececec; --muted: #a0a0a0; --soft: #303030; --line: #3a3a3a; }
}
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid transparent;
}
.title { font-weight: 600; font-size: 18px; }
.model { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.newchat { border: 0; background: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; }
.newchat:hover { background: var(--soft); }

.messages { flex: 1; overflow-y: auto; }
.messages > * { width: min(768px, 100%); margin-inline: auto; padding-inline: 18px; }
.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty h2 { margin: 0; font-size: 28px; font-weight: 600; }
.empty p { margin: 6px 0 0; color: var(--muted); }
.msg { padding-block: 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.msg:first-of-type { padding-top: 22px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .text { background: var(--soft); padding: 10px 16px; border-radius: 22px; max-width: 80%; }
.msg.ai { padding-bottom: 18px; }
.status { color: var(--muted); }
.status::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); margin-right: 8px; animation: pulse 1s infinite ease-in-out; }
@keyframes pulse { 50% { transform: scale(.6); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none; } }
.sources { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
.sources a {
  font-size: 13px; color: var(--ink); text-decoration: none; background: var(--soft);
  padding: 4px 10px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dock { width: min(768px, 100%); margin: 0 auto; padding: 6px 12px max(8px, env(safe-area-inset-bottom)); }
.composer {
  background: var(--soft); border-radius: 28px; padding: 10px 10px 10px 18px;
  box-shadow: 0 0 0 1px var(--line);
}
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px;
  max-height: 160px; padding: 6px 0;
}
.composer-row { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: 14px; color: var(--ink);
}
.pill[aria-pressed="true"] { background: #e0edff; border-color: #a9c8ff; color: #0b57d0; }
@media (prefers-color-scheme: dark) { .pill[aria-pressed="true"] { background: #1e3557; border-color: #2f5590; color: #a8c7fa; } }
.send {
  margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 0; flex: none;
  background: var(--ink); color: var(--bg); display: grid; place-items: center;
}
.send.stop svg { display: none; }
.send.stop::after { content: ""; width: 12px; height: 12px; background: var(--bg); border-radius: 2px; }
.fineprint { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 420px) { .pill { padding: 0 10px; font-size: 13px; } }

/* Homework sheet */
.sheet { border: 0; border-radius: 22px; padding: 20px; width: min(520px, 94vw); background: #fff; color: #0d0d0d; }
.sheet::backdrop { background: rgb(0 0 0 / .45); }
.sheet h2 { margin: 0 0 4px; font-size: 20px; }
.muted { margin: 0; color: #6b6b6b; font-size: 14px; }
.sheet textarea { width: 100%; margin: 12px 0; font-size: 16px; padding: 10px 12px; border-radius: 14px; border: 1px solid #e5e5e5; background: #f9f9f9; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { min-height: 46px; border-radius: 999px; border: 0; font-weight: 600; }
.btn.dark { background: #0d0d0d; color: #fff; }
.btn.light { background: #f0f0f0; }
.btn.text { width: 100%; background: none; margin-top: 6px; color: #6b6b6b; }
@media (max-width: 380px) { .row { grid-template-columns: 1fr; } }
