/* MochaSkills app. Espresso look: conversation on espresso, documents on cream. Fonts are bundled in /assets/fonts (task 6). */
@font-face { font-family: "Lora"; src: url("/assets/fonts/Lora-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Bold.woff") format("woff"); font-weight: 700; font-display: swap }

:root {
  --bg: #1A1310; --surface: #251C17; --raised: #2F241E; --line: #3A2E27; --ink: #F4ECE2; --quiet: #B8A99C; --muted: #8E7F74;
  --mocha: #D2A787; --cta: #E08A52; --on-cta: #1A1310;
  --roast: #E6A15C; --roast-soft: #3A2A1C; --brew: #7FB0D1; --brew-soft: #22323D; --grind: #8FC79A; --grind-soft: #22382A;
  --bad: #E07A6A; --good: #8FC79A;
  --cream: #FBF6EC; --cream-line: #E6DDCB; --cream-ink: #2B211C; --cream-quiet: #5C514A; --cream-roast: #B5582A;
  --display: "Lora", Georgia, serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box }
html, body { height: 100%; margin: 0 }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--brew); outline-offset: 2px }
h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--display); font-weight: 600 }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15 }
h2 { font-size: 1.3rem; line-height: 1.25 }
h3 { font-size: 1.05rem }
p { margin: 0 }
.quiet { color: var(--quiet) } .muted { color: var(--muted) } .small { font-size: .875rem }
.eyebrow { font: 700 .7rem/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--mocha) }
.eyebrow.roast { color: var(--roast) } .eyebrow.brew { color: var(--brew) } .eyebrow.grind { color: var(--grind) }

/* shell */
.shell { min-height: 100%; display: grid; grid-template-rows: 1fr auto }
main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(26,19,16,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20 }
.bottombar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .02em; border-radius: 14px }
.bottombar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.bottombar a[aria-current="page"] { color: var(--ink) }
.bottombar a.center span.av { width: 46px; height: 46px; border-radius: 50%; background: var(--mocha) url("/assets/mocha-avatar.png") center/cover no-repeat; margin-top: -22px; border: 3px solid var(--bg); box-shadow: 0 6px 18px rgba(0,0,0,.45) }
@media (min-width: 900px) {
  .shell { grid-template-columns: 240px 1fr; grid-template-rows: 1fr }
  .bottombar { position: sticky; top: 0; height: 100vh; grid-template-columns: 1fr; align-content: start; gap: 4px; border-top: 0; border-right: 1px solid var(--line); padding: 24px 14px; backdrop-filter: none; background: #140E0B }
  .bottombar a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 14px; font-size: .92rem; border-radius: 999px }
  .bottombar a[aria-current="page"] { background: var(--raised) }
  .bottombar a.center span.av { width: 28px; height: 28px; margin: 0; border: 0; box-shadow: none }
  .bottombar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 18px; font-family: var(--display); font-size: 1.25rem; color: var(--ink) }
  .bottombar .brand i { font-style: normal; color: var(--cta) }
  main { padding: 36px 32px 60px; max-width: 820px }
}
.bottombar .brand { display: none } @media (min-width: 900px) { .bottombar .brand { display: flex } }

/* components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px }
.card.raised { background: var(--raised) }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center }
.between { justify-content: space-between }
.stack { display: flex; flex-direction: column; gap: 12px }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 11px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem; text-decoration: none; min-height: 44px }
.btn:hover { border-color: var(--mocha) }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--on-cta) }
.btn.ghost { background: transparent }
.btn.danger { color: var(--bad); border-color: var(--bad) }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: .84rem }
.btn[disabled] { opacity: .55; cursor: default }
.field { display: grid; gap: 6px }
.field label { font-weight: 600; font-size: .92rem }
.field .hint { font-size: .82rem; color: var(--muted) }
input[type=text], input[type=email], input[type=number], select, textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 12px 14px; min-width: 0; color: var(--ink) }
textarea { min-height: 120px; resize: vertical }
::placeholder { color: var(--muted) }
.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--raised); color: var(--quiet) }
.pill.Strong { background: var(--grind-soft); color: var(--grind) } .pill.Good { background: var(--roast-soft); color: var(--roast) } .pill.Stretch { background: var(--brew-soft); color: var(--brew) }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer }
.note { border-left: 3px solid var(--mocha); padding: 6px 0 6px 12px; font-size: .9rem; color: var(--quiet) }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 50 }
.list { display: flex; flex-direction: column; gap: 8px }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface) }
.item .t { font-weight: 600 } .item .s { font-size: .84rem; color: var(--muted) }
.item.link { text-decoration: none; cursor: pointer } .item.link:hover { border-color: var(--mocha) }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none }
.tabs::-webkit-scrollbar { display: none }
.tab { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--quiet); font-weight: 600; font-size: .88rem; cursor: pointer }
.tab[aria-selected="true"] { background: var(--roast-soft); color: var(--roast); border-color: transparent }
ul.plain { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px }
.kv { display: grid; gap: 4px } .kv b { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) }

/* doors (home) */
.hero { display: flex; gap: 16px; align-items: center }
.hero .av { width: 64px; height: 64px; border-radius: 50%; background: var(--mocha) url("/assets/mocha-avatar.png") center/cover no-repeat; flex: none; border: 2px solid var(--line) }
.door { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); text-decoration: none }
.door:hover { border-color: var(--mocha) }
.door .ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center }
.door .ic svg { width: 26px; height: 26px; fill: none; stroke: #1A1310; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round }
.door.roast .ic { background: var(--roast) } .door.brew .ic { background: var(--brew) } .door.grind .ic { background: var(--grind) }
.door b { font-family: var(--display); font-size: 1.15rem; display: block } .door small { color: var(--quiet) }
.door.soon { opacity: .6 }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 40vh }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 92% }
.msg.mocha .av { width: 30px; height: 30px; border-radius: 50%; background: var(--mocha) url("/assets/mocha-avatar.png") center/cover no-repeat; flex: none }
.msg .b { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; line-height: 1.5 }
.msg.mocha .b { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px }
.msg.me { align-self: flex-end } .msg.me .b { background: var(--roast-soft); color: var(--ink); border-bottom-right-radius: 4px }
.dots { display: inline-flex; gap: 4px; padding: 6px 0 } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite } .dots i:nth-child(2) { animation-delay: .2s } .dots i:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%, 80%, 100% { opacity: .3 } 40% { opacity: 1 } }
.composer { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; background: var(--bg); padding-top: 8px }
@media (min-width: 900px) { .composer { bottom: 0 } }
.chat.embedded { min-height: 0 }
.composer.embedded { position: static; padding-top: 0 }
.composer textarea { min-height: 48px; max-height: 160px; border-radius: 22px }
.quick { display: flex; gap: 6px; flex-wrap: wrap }

/* document on cream */
.doc { background: var(--cream); color: var(--cream-ink); border-radius: 20px; padding: clamp(20px, 4vw, 40px); font-family: var(--body); line-height: 1.5 }
.doc h1, .doc h2, .doc h3 { color: var(--cream-ink) }
.doc h1 { font-size: 1.8rem } .doc .headline { color: var(--cream-roast); font-weight: 600; margin-top: 2px } .doc .contact { font-size: .88rem; color: var(--cream-quiet) }
.doc h2 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-roast); border-bottom: 1px solid var(--cream-line); padding-bottom: 6px; margin: 22px 0 10px }
.doc .job { margin-bottom: 12px } .doc .job .h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap } .doc .job b { font-weight: 700 } .doc .job .d { color: var(--cream-quiet); font-size: .9rem }
.doc ul { margin: 6px 0 0; padding-left: 1.1em } .doc li { margin-bottom: 3px }
.doc .skills { display: flex; flex-wrap: wrap; gap: 6px } .doc .skills span { border: 1px solid var(--cream-line); border-radius: 999px; padding: 3px 10px; font-size: .85rem }
.doc.letter { white-space: pre-wrap }
@media print {
  body { background: #fff } .bottombar, .no-print, .composer, .tabs, header.page { display: none !important }
  main { padding: 0; max-width: none } .doc { border-radius: 0; padding: 0; box-shadow: none; font-size: 11pt } .doc h1 { font-size: 20pt }
  @page { margin: 16mm }
}

/* sign-in */
.signin { max-width: 440px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 18px; text-align: left }
.signin .av { width: 88px; height: 88px; border-radius: 50%; background: var(--mocha) url("/assets/mocha-avatar.png") center/cover no-repeat; border: 2px solid var(--line) }
.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums }
.langswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden }
.langswitch button { padding: 6px 14px; background: transparent; border: 0; color: var(--quiet); font-weight: 700; cursor: pointer }
.langswitch button[aria-pressed="true"] { background: var(--raised); color: var(--ink) }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--quiet) } .check input { margin-top: 3px; accent-color: var(--cta) }
.hidden { display: none !important }
