/* easytowork - screens 01-05 (docs/SPEC.md). One codebase for the site and the mobile app. */
:root {
  --ink: #12202f;
  --ink-2: #3a4a57;
  --muted: #5b6b76;
  --teal: #0b6e63;
  --teal-deep: #084f47;
  --teal-soft: #e3f1ee;
  --marker: #ffd23f;
  --marker-soft: #fff4c7;
  --mist: #f3f7f6;
  --line: #dce5e2;
  --paper: #ffffff;
  --danger: #b3261e;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(18, 32, 47, .06), 0 4px 12px rgba(18, 32, 47, .05);
  --shadow-2: 0 2px 4px rgba(18, 32, 47, .05), 0 12px 32px rgba(18, 32, 47, .08), 0 28px 64px rgba(11, 110, 99, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 520px at 50% -180px, var(--teal-soft), transparent 70%),
    var(--paper);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 14px;
  min-height: 64px;
}
.topbar .mini-mark { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; direction: ltr; }
.topbar .mini-mark span { background: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 92%, transparent 92%); padding-inline: 2px; }
.topbar-start { display: flex; align-items: center; gap: 8px; min-width: 0; }

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 40px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.lang:hover { border-color: var(--teal); }
.lang svg { width: 18px; height: 18px; }

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* progress through the five screens */
.steps { display: flex; gap: 6px; margin: 4px 0 28px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s var(--ease); }
.steps i.on { background: var(--teal); }

/* ---------- screen 01 ---------- */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 4vh 6vh; }
.wordmark {
  direction: ltr;
  text-align: center;
  font-weight: 800;
  font-size: clamp(44px, 11vw, 84px);
  line-height: 1.02;
  margin: 0;
  color: var(--ink);
}
.wordmark .work { position: relative; display: inline-block; z-index: 0; }
.wordmark .work svg {
  position: absolute;
  inset-inline: -6% -6%;
  bottom: .02em;
  width: 112%;
  height: .42em;
  z-index: -1;
}
.wordmark .work svg path { stroke: var(--marker); stroke-width: 26; stroke-linecap: round; fill: none; }
.slogan {
  direction: ltr;
  text-align: center;
  margin: 14px 0 40px;
  font-size: clamp(16px, 3.6vw, 20px);
  color: var(--muted);
  font-weight: 500;
}

.ask {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 18px 18px 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ask:focus-within { border-color: var(--teal); box-shadow: var(--shadow-2), 0 0 0 4px rgba(11, 110, 99, .14); }
.ask textarea {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 19px;
  line-height: 1.55;
  min-height: 112px;
  max-height: 40vh;
}
.ask textarea::placeholder { color: #8a979f; }
.ask-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ask-tools { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.icon-btn.primary:hover { background: var(--teal-deep); color: #fff; }
.icon-btn.primary:disabled { background: #a9c9c4; border-color: #a9c9c4; cursor: default; }
.icon-btn.rec { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .35); } 70% { box-shadow: 0 0 0 12px rgba(179, 38, 30, 0); } 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); } }

.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.example {
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  min-height: 40px;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.example:hover { border-color: var(--teal); border-style: solid; color: var(--teal-deep); background: var(--teal-soft); }

.auth-links { text-align: center; margin-top: 36px; font-size: 16px; color: var(--muted); }
.auth-links button { background: none; border: 0; padding: 8px 10px; cursor: pointer; color: var(--ink); font-weight: 500; border-radius: 8px; }
.auth-links button:hover { color: var(--teal); }
.auth-links .sep { color: var(--line); }

/* ---------- shared screen parts ---------- */
.eyebrow { font-size: 14px; font-weight: 500; color: var(--teal); margin: 0 0 6px; }
.h1 { font-size: clamp(26px, 6vw, 36px); line-height: 1.2; font-weight: 700; margin: 0 0 10px; }
.h1 mark { background: linear-gradient(transparent 60%, var(--marker) 60%, var(--marker) 90%, transparent 90%); color: inherit; padding-inline: 2px; }
.lead { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; }
.lead p { margin: 0 0 6px; }

.understood {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--mist);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 28px;
}
.understood .dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--teal); }
.understood-body { flex: 1; min-width: 0; }
.understood-body p { margin: 0; }
.track-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.track-pick select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--paper);
  min-height: 36px;
  font-size: 14px;
  color: var(--ink);
}

/* screen 02 - three ways in */
.ways { display: grid; gap: 12px; }
.way {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: start;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.way:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.way .ico { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-deep); }
.way .ico svg { width: 26px; height: 26px; }
.way strong { display: block; font-size: 18px; font-weight: 500; }
.way small { display: block; font-size: 14px; color: var(--muted); }
.way .chev { margin-inline-start: auto; color: var(--muted); }
.way .chev svg { width: 20px; height: 20px; }
[dir="ltr"] .way .chev svg, [dir="ltr"] .btn .flip { transform: scaleX(-1); }
.note { font-size: 14px; color: var(--muted); margin-top: 18px; text-align: center; }

/* screen 03 - composer */
.modes { display: inline-flex; gap: 4px; background: var(--mist); border-radius: 999px; padding: 4px; margin-bottom: 12px; }
.mode {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; border-radius: 999px;
  padding: 8px 14px; min-height: 40px; cursor: pointer; color: var(--ink-2); font-size: 15px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.mode svg { width: 18px; height: 18px; }
.mode[aria-pressed="true"] { background: var(--paper); color: var(--teal-deep); box-shadow: var(--shadow-1); font-weight: 500; }

.composer {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.composer:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(11, 110, 99, .12); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: vertical; min-height: 120px; font-size: 17px; line-height: 1.6; background: transparent; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rec-state { font-size: 14px; color: var(--danger); display: inline-flex; align-items: center; gap: 6px; }
.rec-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; border: 1.5px dashed var(--line); border-radius: var(--r-md);
  background: var(--mist); color: var(--muted); text-align: center; padding: 20px; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-deep); }
.drop svg { width: 30px; height: 30px; }
.drop strong { color: var(--ink); font-weight: 500; }

.items { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.item {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--paper);
}
.item .tag { flex: none; font-size: 12px; font-weight: 500; color: var(--teal-deep); background: var(--teal-soft); border-radius: 6px; padding: 2px 8px; margin-top: 2px; }
.item p { margin: 0; flex: 1; min-width: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item .x { flex: none; border: 0; background: none; width: 36px; height: 36px; margin: -6px; border-radius: 8px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.item .x:hover { background: var(--mist); color: var(--danger); }
.item .x svg { width: 18px; height: 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; }
.actions.end { justify-content: flex-end; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font-size: 16px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--teal); color: var(--teal-deep); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(11, 110, 99, .22); }
.btn.primary:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 12px; }
.btn.ghost:hover { color: var(--teal-deep); background: var(--mist); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

:focus-visible { outline: 3px solid rgba(11, 110, 99, .45); outline-offset: 2px; }

/* screen 04 - one question at a time */
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.q-topic { display: inline-block; background: var(--marker-soft); color: #6b5400; border-radius: 6px; padding: 2px 10px; font-weight: 500; }
.bubble {
  position: relative;
  background: var(--mist);
  border-radius: var(--r-lg);
  border-start-start-radius: 6px;
  padding: 20px 22px;
  font-size: clamp(20px, 4.6vw, 24px);
  line-height: 1.45;
  font-weight: 500;
  margin-bottom: 16px;
  animation: rise .35s var(--ease);
}
.bubble small { display: block; margin-top: 8px; font-size: 15px; font-weight: 400; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.thinking { display: inline-flex; gap: 6px; padding: 6px 0; }
.thinking i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); opacity: .3; animation: blink 1.2s infinite; }
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

.history { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.history summary { cursor: pointer; font-size: 15px; color: var(--ink-2); padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
.history summary::-webkit-details-marker { display: none; }
.history summary svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.history[open] summary svg { transform: rotate(180deg); }
.history ol { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.history li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.history li div { flex: 1; min-width: 0; }
.history li b { display: block; font-weight: 500; color: var(--ink); }
.history li span { color: var(--muted); overflow-wrap: anywhere; }
.link-btn { border: 0; background: none; color: var(--teal); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { background: var(--teal-soft); }

/* screen 05 - what we learned */
.learned { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-1); }
.row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .topic { font-size: 14px; color: var(--muted); font-weight: 500; }
.row .value { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.row .value input { width: 100%; border: 1px solid var(--teal); border-radius: 8px; padding: 8px 10px; font-size: 16px; outline: 0; }
.row .topic input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px; }
.row-tools { display: flex; align-items: center; gap: 4px; }
.level {
  border: 0; border-radius: 999px; padding: 4px 10px; min-height: 30px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: filter .15s var(--ease);
}
.level:hover { filter: brightness(.96); }
.level[data-level="must"] { background: var(--marker); color: #4d3c00; }
.level[data-level="want"] { background: var(--teal-soft); color: var(--teal-deep); }
.level[data-level="flex"] { background: #e8eef9; color: #234a8c; }
.level[data-level="any"] { background: #eef0f1; color: var(--muted); }
.tiny { border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.tiny:hover { background: var(--mist); color: var(--ink); }
.tiny.del:hover { color: var(--danger); }
.tiny svg { width: 17px; height: 17px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--muted); margin: 12px 2px 0; align-items: center; }
.legend .level { cursor: default; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.done-card { text-align: center; padding: 8vh 8px; }
.done-card .badge { width: 72px; height: 72px; border-radius: 50%; background: var(--marker); display: grid; place-items: center; margin: 0 auto 20px; }
.done-card .badge svg { width: 34px; height: 34px; color: var(--ink); }

/* toast + sheet */
.toast {
  position: fixed; inset-inline: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 520px;
  background: var(--ink); color: #fff; border-radius: 14px; padding: 12px 16px; font-size: 15px; box-shadow: var(--shadow-2);
  animation: rise .25s var(--ease); z-index: 30;
}
.sheet-wrap { position: fixed; inset: 0; background: rgba(18, 32, 47, .35); display: grid; place-items: end center; z-index: 20; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-radius: 22px 22px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); animation: rise .25s var(--ease); }
@media (min-width: 640px) { .sheet-wrap { place-items: center; } .sheet { border-radius: 22px; } }
.sheet h2 { margin: 0 0 6px; font-size: 22px; }
.sheet p { margin: 0 0 16px; color: var(--ink-2); }
.lang-list { display: grid; gap: 8px; }
.lang-list button { text-align: start; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); padding: 12px 14px; cursor: pointer; font-size: 16px; min-height: 48px; }
.lang-list button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }

.screen { animation: enter .35s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr auto; }
  .row .topic { grid-column: 1 / -1; margin-bottom: -6px; }
  .ask textarea { font-size: 18px; min-height: 120px; }
  .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
