/* ===========================================================
   Michelle Kang — portfolio v3 "workspace"
   Icon rail + sidebar + feed. Neutrals with ONE accent (periwinkle).
   Headlines: Plus Jakarta Sans (bold). Body: Inter (regular).
   =========================================================== */

:root {
  --page: #eceae6;
  --rail: #e7e4df;
  --side: #f1efeb;
  --bg: #fbfaf8;
  --card: #ffffff;
  --card-2: #f1efeb;
  --ink: #1c1c1e;
  --ink-2: #4a4a4f;
  --muted: #7c7b80;
  --line: rgba(28, 28, 30, 0.09);
  --accent: #4d5fd6;
  --accent-soft: #e5e9fc;
  --online: #3fae6a;
  --fill: #fff4c2;
  --fill-ink: #6b5400;
  --shadow-lg: 0 1px 2px rgba(0,0,0,.04), 0 24px 60px -12px rgba(30,30,40,.16);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0c0c0e; --rail: #101012; --side: #151517; --bg: #1a1a1d; --card: #222226; --card-2: #2a2a2f;
    --ink: #f3f2ef; --ink-2: #c9c8c4; --muted: #8f8e93; --line: rgba(243,242,239,.09);
    --accent: #a9b8ff; --accent-soft: #262b42; --fill: #3b3313; --fill-ink: #f3dc8a;
    --shadow-lg: 0 1px 2px rgba(0,0,0,.4), 0 24px 60px -12px rgba(0,0,0,.6);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0c0c0e; --rail: #101012; --side: #151517; --bg: #1a1a1d; --card: #222226; --card-2: #2a2a2f;
  --ink: #f3f2ef; --ink-2: #c9c8c4; --muted: #8f8e93; --line: rgba(243,242,239,.09);
  --accent: #a9b8ff; --accent-soft: #262b42; --fill: #3b3313; --fill-ink: #f3dc8a;
  --shadow-lg: 0 1px 2px rgba(0,0,0,.4), 0 24px 60px -12px rgba(0,0,0,.6);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15.5px; line-height: 1.6; color: var(--ink-2);
  background: var(--page); -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin: 0; }
b, strong { font-weight: 600; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }
.is-hidden { display: none !important; }

/* ---------- App window ---------- */
.app {
  position: relative; height: calc(100dvh - 32px); margin: 16px;
  display: grid; grid-template-columns: 76px 244px minmax(0, 1fr);
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}

/* ---------- Icon rail ---------- */
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; }
.rail-me { width: 44px; height: 44px; border-radius: 13px; overflow: hidden; background: #faf6f3; position: relative; margin-bottom: 12px; flex: none; }
.rail-me img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.2) translate(-2%, -2%); }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer; width: 64px; padding: 4px 0 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted);
}
.tab .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; transition: background-color .2s ease, box-shadow .2s ease, color .2s ease; }
.tab .ic .icon { width: 20px; height: 20px; }
.tab:hover .ic { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.tab[aria-current="true"] { color: var(--ink); }
.tab[aria-current="true"] .ic { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Sidebar ---------- */
.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 16px 10px 12px; overflow-y: auto; }
.ws { padding: 2px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.ws-name { font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -0.01em; }
.ws-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); flex: none; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63,174,106,.45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(63,174,106,0); } }
.side-label { font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 12px 10px 4px; }
.chan {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 10px; border: 0; background: transparent; border-radius: 9px;
  font-size: 14.5px; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left;
  transition: background-color .2s ease, color .2s ease;
}
.chan .icon { width: 16px; height: 16px; }
.chan:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.chan[aria-current="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chan .hash { width: 16px; text-align: center; color: var(--muted); }
.chan .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.chan .mini { width: 20px; height: 20px; border-radius: 6px; overflow: hidden; background: #faf6f3; flex: none; }
.chan .mini img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.3) translate(-2%, -1%); }
.chan .mini.bot { background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.chan .mini.bot .icon { width: 13px; height: 13px; }
.badge { font-size: 10.5px; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); }
.side-card { margin-top: auto; background: var(--card); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); line-height: 1.5; }
.side-card strong { display: block; margin-bottom: 2px; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chan-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 24px; border-bottom: 1px solid var(--line); }
.chan-head .titles { min-width: 0; margin-right: auto; }
.chan-title { font-size: 18px; }
.chan-topic { margin: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color .2s ease; }
.head-btn:hover { background: var(--card-2); }
.menu-btn { display: none; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.head-logo { display: grid; place-items: center; width: 44px; height: 36px; color: var(--ink); }
.logo { width: 38px; height: auto; overflow: visible; }
.logo .s { fill: none; stroke: currentColor; stroke-width: 13; stroke-linecap: round; stroke-linejoin: round; }

.feed { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.view { max-width: 820px; margin: 0 auto; padding: 32px 32px 28px; display: flex; flex-direction: column; gap: 24px; }
.view[hidden] { display: none; }

/* Welcome */
.welcome-avatar { width: 80px; height: 80px; border-radius: 20px; overflow: hidden; background: #faf6f3; margin-bottom: 20px; }
.welcome-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(2) translate(-2%, -4%); }
.welcome h1 { font-size: clamp(32px, 4.3vw, 50px); font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; max-width: 16ch; }
/* The rotating word: extra room below so letters like g and p aren't clipped,
   and the box resizes to each word so short words don't leave a gap. */
.rotator { display: inline-grid; vertical-align: bottom; overflow: hidden; color: var(--accent); padding-bottom: .2em; margin-bottom: -.2em; transition: width .6s var(--ease); }
.rotator > span { grid-area: 1 / 1; justify-self: start; transform: translateY(115%); opacity: 0; transition: transform .7s var(--ease), opacity .7s var(--ease); white-space: nowrap; }
.rotator > span.on { transform: none; opacity: 1; }
.rotator > span.off { transform: translateY(-115%); opacity: 0; }
.lede { margin: 16px 0 0; font-size: 17px; max-width: 56ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink); padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); transition: background-color .2s ease, transform .2s ease; }
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--card-2); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { transform: translateY(-1px); background: var(--ink); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 18px; font-size: 13px; color: var(--muted); }

.view-intro h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.view-intro p { margin: 6px 0 0; max-width: 58ch; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider span { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* Messages */
.msg { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
.msg-avatar { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; background: #faf6f3; }
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.2) translate(-2%, -2%); }
.msg-avatar.bot { background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.msg-avatar.you { background: var(--card-2); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.msg-meta b { font-family: var(--head); font-weight: 700; font-size: 15px; }
.msg-meta time, .msg-meta .pin { font-size: 12.5px; color: var(--muted); }
.msg-meta .pin { display: inline-flex; align-items: center; gap: 4px; }
.msg-meta .pin .icon { width: 13px; height: 13px; }
.msg h3 { font-size: 19px; margin: 4px 0 6px; }
.msg p { margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul { margin: 4px 0 8px; padding-left: 20px; }
.msg li { margin-bottom: 3px; }
.tag-link { appearance: none; border: 0; background: var(--accent-soft); color: var(--accent); padding: 0 6px; border-radius: 6px; cursor: pointer; font-size: inherit; font-weight: 500; }
.tag-link:hover { text-decoration: underline; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.tools li { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin: 0; }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.cards.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pcard { appearance: none; text-align: left; cursor: pointer; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 14px; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pcard .media { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--card-2); }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pcard:hover .media img { transform: scale(1.04); }
.pcard .p-body { padding: 12px 8px 0; }
.pcard .kicker { font-size: 12.5px; color: var(--muted); }
.pcard h3 { font-size: 17px; line-height: 1.3; margin: 2px 0 0; }
.cards.small .pcard h3 { font-size: 15px; }
.pcard .reply { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--accent); }
.pcard .reply .icon { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
button.chip { cursor: pointer; color: var(--ink); font-weight: 500; transition: background-color .2s ease, border-color .2s ease; }
button.chip:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* Experience + files */
.rows { list-style: none; margin: 10px 0 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rows li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 11px 16px; border-top: 1px solid var(--line); margin: 0; }
.rows li:first-child { border-top: 0; }
.rows .co { font-weight: 600; color: var(--ink); }
.rows .yr { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rows .rl { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; }
.file { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line); transition: background-color .2s ease; }
.file:first-child { border-top: 0; }
.file:hover { background: var(--card-2); }
.file .f-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.file .f-name { font-weight: 600; color: var(--ink); }
.file .f-meta { font-size: 13px; color: var(--muted); }
.file .f-go { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--accent); white-space: nowrap; }
.filebox { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.group-label { font-family: var(--head); font-weight: 700; font-size: 15px; color: var(--ink); margin: 0 0 -12px; }

/* Typing dots */
.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Composer */
.composer-wrap { padding: 0 24px 16px; }
.composer { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 7px 7px 7px 16px; transition: border-color .2s ease, box-shadow .2s ease; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; padding: 6px 0; }
.composer input::placeholder { color: var(--muted); }
.send { appearance: none; border: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; transition: transform .2s ease; }
.send:hover { transform: scale(1.06); }
.composer-hint { max-width: 820px; margin: 6px auto 0; font-size: 12px; color: var(--muted); padding-left: 4px; }

/* ---------- Thread panel ---------- */
.thread { position: absolute; top: 0; right: 0; bottom: 0; width: min(470px, 100%); z-index: 5; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(0,0,0,.3); display: flex; flex-direction: column; transform: translateX(104%); transition: transform .5s var(--ease); visibility: hidden; }
.thread.open { transform: none; visibility: visible; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.thread-head .titles { margin-right: auto; min-width: 0; }
.thread-head .lbl { font-size: 12.5px; color: var(--muted); }
.thread-head h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-body { flex: 1; overflow-y: auto; padding: 22px; }
.thread-body h3 { font-size: 23px; font-weight: 800; line-height: 1.2; margin: 2px 0 10px; }
.thread-body .kicker { font-size: 13px; color: var(--muted); }
.thread-body .t-img { border-radius: 14px; overflow: hidden; margin: 12px 0; background: var(--card-2); }
.thread-body .t-img img { width: 100%; }
.thread-body .t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.thread-body .t-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; aspect-ratio: 1; }
.thread-body .t-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.thread-body .t-stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.thread-body .t-stat b { display: block; font-family: var(--head); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.thread-body .t-stat span { font-size: 13px; color: var(--muted); }
.thread-foot { padding: 14px 22px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.scrim { position: absolute; inset: 0; background: rgba(10,10,14,.25); opacity: 0; pointer-events: none; transition: opacity .3s ease; z-index: 4; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- Motion ---------- */
.js .anim { opacity: 0; transform: translateY(12px); }
.js .anim.in { animation: msgIn .5s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes msgIn { to { opacity: 1; transform: none; } }
.js .logo .s { stroke-dasharray: var(--len, 320); stroke-dashoffset: var(--len, 320); animation: draw 1.3s cubic-bezier(.6,.05,.3,1) .15s forwards; }
.head-logo.redraw .logo .s { animation: redraw 1.1s cubic-bezier(.6,.05,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes redraw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .anim { opacity: 1; transform: none; }
  .js .logo .s { stroke-dashoffset: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .cards.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { margin: 0; height: 100dvh; border-radius: 0; border: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); gap: 0; }
  .rail-me { display: none; }
  .tab .ic { width: 44px; height: 32px; }
  .sidebar { position: absolute; top: 0; left: 0; bottom: 0; width: min(290px, 86%); z-index: 6; transform: translateX(-104%); transition: transform .4s var(--ease); box-shadow: 24px 0 60px -30px rgba(0,0,0,.35); }
  .sidebar.open { transform: none; }
  .main { grid-row: 1; }
  .menu-btn { display: grid; }
  .chan-head { padding: 10px 14px; gap: 10px; }
  .view { padding: 22px 16px 16px; }
  .composer-wrap { padding: 0 12px 10px; }
  .composer-hint { display: none; }
}
@media (max-width: 560px) {
  .cards, .cards.small { grid-template-columns: minmax(0, 1fr); }
  .msg { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .msg-avatar { width: 32px; height: 32px; border-radius: 9px; }
  .file .f-go { display: none; }
}
