:root {
  --font-heading: "Lexend", sans-serif;
  --font-body: "M PLUS 1p", sans-serif;

  --bg: #fff7ea;
  --bg-layer: #ffe9c6;
  --surface: #fffef9;
  --surface-soft: #fdf3dd;
  --ink: #1e2940;
  --ink-secondary: #5f657c;
  --brand: #ff5d3d;
  --brand-strong: #da3c20;
  --accent: #16b092;
  --accent-strong: #0a8a72;
  --deep: #1d2b4d;
  --line: #ead9bc;
  --line-strong: #d6bd95;
  --success: #238d73;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-soft: 0 10px 24px rgba(30, 41, 64, 0.08);
  --shadow-card: 0 18px 34px rgba(30, 41, 64, 0.12);
  --topbar-height: 92px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 158, 123, 0.26) 0%, transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(22, 176, 146, 0.18) 0%, transparent 30%),
    linear-gradient(165deg, #fff4df 0%, #fff8ee 52%, #fdf4e8 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -180px;
  right: -120px;
  background: rgba(255, 138, 106, 0.34);
}

.orb-b {
  width: 320px;
  height: 320px;
  left: -90px;
  bottom: 8%;
  background: rgba(38, 188, 162, 0.24);
}

.bg-grid {
  position: fixed;
  z-index: -3;
  inset: 0;
  background-image:
    linear-gradient(rgba(57, 74, 107, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 74, 107, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black 36%, transparent 100%);
  pointer-events: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1.25;
}

p {
  margin: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(234, 217, 188, 0.8);
  background: rgba(255, 248, 235, 0.88);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  max-width: 1220px;
  margin: 0 auto;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--ink);
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 1rem var(--font-heading);
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.logo-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 0.08rem;
}

.logo-copy strong {
  font: 700 1.02rem var(--font-heading);
}

.logo-copy small {
  font-size: 0.73rem;
  color: var(--ink-secondary);
  letter-spacing: 0.05em;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.topbar-nav-btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
  color: var(--deep);
  border-radius: 999px;
  padding: 0.54rem 0.96rem;
  font: 700 0.78rem var(--font-heading);
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.topbar-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(30, 41, 64, 0.15);
}

.topbar-nav-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--deep), #395083);
}

.app-main {
  width: min(1220px, 94vw);
  margin: 1.2rem auto 2.8rem;
}

.hero-shell {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 1.15rem;
  background:
    linear-gradient(118deg, rgba(255, 248, 234, 0.95) 0%, rgba(255, 235, 209, 0.72) 54%, rgba(220, 247, 241, 0.64) 100%);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-shell::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -120px;
  right: -88px;
  border-radius: 50%;
  background: rgba(255, 93, 61, 0.16);
}

.hero-kicker {
  margin-bottom: 0.48rem;
  color: var(--brand-strong);
  letter-spacing: 0.08em;
  font: 700 0.75rem var(--font-heading);
}

.hero-shell h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.45rem);
  letter-spacing: 0.015em;
}

.hero-shell p {
  margin-top: 0.72rem;
  color: var(--ink-secondary);
  max-width: 64ch;
  line-height: 1.55;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.view {
  display: none;
  animation: viewFade 0.34s ease;
}

.view.is-active {
  display: block;
}

@keyframes viewFade {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.studio-stage,
.stage-grid {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
  align-items: start;
}

.auth-stage {
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
}

.board-stack {
  display: grid;
  gap: 1rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
}

.card h2 {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.card h3 {
  font-size: 1rem;
}

.card-sub,
.section-copy {
  margin-top: 0.4rem;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.poster-card {
  background:
    linear-gradient(165deg, #1d2b4d 0%, #2e3d67 52%, #384c80 100%);
  color: #f8f9ff;
  border-color: #1f2e52;
  box-shadow: var(--shadow-card);
}

.poster-label,
.side-note-label {
  display: inline-block;
  padding: 0.24rem 0.54rem;
  border-radius: 999px;
  font: 700 0.71rem var(--font-heading);
  letter-spacing: 0.07em;
}

.poster-label {
  background: rgba(255, 241, 221, 0.22);
  color: #ffd9b0;
}

.poster-card h2 {
  margin-top: 0.65rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.poster-card p {
  margin-top: 0.62rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
  line-height: 1.65;
}

.poster-list {
  margin: 0.86rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.48rem;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.92);
}

.poster-list.compact {
  color: var(--ink-secondary);
}

.form-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 249, 237, 0.9) 100%);
}

label {
  display: block;
  margin-top: 0.72rem;
  margin-bottom: 0.28rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--deep);
}

input,
select,
textarea,
button {
  font-family: var(--font-body);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffdf7;
  color: var(--ink);
  font-size: 0.92rem;
  padding: 0.6rem 0.72rem;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(22, 176, 146, 0.34);
  outline-offset: 1px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.skill-form-grid {
  display: grid;
  gap: 0.2rem;
}

.search-input {
  background: #fffaf0;
}

.intent-select {
  margin-top: 0.86rem;
  margin-bottom: 0.86rem;
  display: flex;
  gap: 0.7rem;
}

.intent-option {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.intent-option input {
  width: auto;
}

.intent-label {
  padding: 0.28rem 0.64rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.intent-label.teach {
  color: var(--brand-strong);
  background: #ffe4dd;
}

.intent-label.learn {
  color: var(--accent-strong);
  background: #dff7f1;
}

.btn-primary,
.btn-outline,
.btn-secondary {
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  padding: 0.6rem 1rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(218, 60, 32, 0.22);
}

.btn-outline {
  border: 1px solid var(--deep);
  color: var(--deep);
  background: rgba(255, 255, 255, 0.74);
  padding: 0.55rem 0.98rem;
}

.btn-outline:hover {
  transform: translateY(-1px);
  background: #f1ecff;
}

.btn-secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink-secondary);
  background: #fff8ee;
  padding: 0.55rem 0.94rem;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: var(--deep);
  color: var(--deep);
}

.btn-full {
  width: 100%;
  margin-top: 1rem;
}

.micro-copy {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.demo-login-block {
  margin-top: 0.9rem;
  padding-top: 0.72rem;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 0.52rem;
}

.demo-login-title {
  font: 700 0.78rem var(--font-heading);
  color: var(--deep);
  letter-spacing: 0.03em;
}

.demo-login-list {
  display: grid;
  gap: 0.45rem;
}

.demo-login-btn {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fffdf8;
  text-align: left;
  padding: 0.56rem 0.66rem;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.demo-login-btn:hover {
  transform: translateY(-1px);
  border-color: var(--deep);
  box-shadow: 0 10px 18px rgba(30, 41, 64, 0.12);
}

.demo-login-btn strong {
  font: 700 0.82rem var(--font-heading);
  color: var(--ink);
}

.demo-login-btn span {
  font-size: 0.74rem;
  color: var(--ink-secondary);
}

.profile-summary-card {
  overflow: hidden;
  padding: 0;
}

.profile-banner {
  height: 74px;
  background:
    linear-gradient(118deg, #ff825f 0%, #ff5d3d 48%, #16b092 100%);
}

.profile-avatar-wrap {
  margin-top: -28px;
  display: flex;
  justify-content: center;
}

.profile-avatar {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--deep), #344a79);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font: 800 1.4rem var(--font-heading);
  box-shadow: 0 10px 18px rgba(30, 41, 64, 0.26);
}

.profile-summary-name {
  margin-top: 0.64rem;
  text-align: center;
  font-size: 1.03rem;
}

.profile-summary-bio {
  margin-top: 0.3rem;
  text-align: center;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  line-height: 1.48;
  padding: 0 0.9rem;
}

.profile-summary-stats {
  margin-top: 0.94rem;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.76rem 0.68rem 0.84rem;
}

.pss-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: center;
}

.pss-label {
  font-size: 0.68rem;
  color: var(--ink-secondary);
}

.pss-value {
  font-family: var(--font-heading);
  font-size: 1.24rem;
  color: var(--brand-strong);
}

.side-note-card {
  background: linear-gradient(160deg, #fffef8 0%, #fff0d5 100%);
}

.side-note-label {
  background: #f4e3c6;
  color: var(--brand-strong);
}

.side-note-card h3 {
  margin-top: 0.65rem;
}

.side-note-card p {
  margin-top: 0.52rem;
  color: var(--ink-secondary);
  font-size: 0.87rem;
  line-height: 1.58;
}

.side-note-card button {
  margin-top: 0.78rem;
}

.action-list,
.connection-list,
.skill-list,
.msg-user-list {
  list-style: none;
  margin: 0.72rem 0 0;
  padding: 0;
}

.action-list,
.connection-list {
  display: grid;
  gap: 0.52rem;
}

.action-list li,
.connection-list li {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.68rem;
  background: rgba(255, 252, 244, 0.95);
  font-size: 0.87rem;
}

.inline-actions {
  margin-top: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.sticker-wall {
  background: linear-gradient(160deg, #ecfff7 0%, #f2fffb 48%, #f8fffd 100%);
}

.popular-tags,
.tag-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag,
.tag {
  border-radius: 999px;
  border: 1px solid #ffd1c5;
  background: #ffe9e2;
  color: var(--brand-strong);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.24rem 0.54rem;
}

.tag-learn {
  border-color: #9ce0d1;
  background: #ddfaf3;
  color: var(--accent-strong);
}

.skill-list {
  display: grid;
  gap: 0.42rem;
}

.skill-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdf6;
  padding: 0.56rem 0.66rem;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.84rem;
}

.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fffdf8;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.match-card-banner {
  height: 56px;
  background: linear-gradient(120deg, #1d2b4d 0%, #3b4f84 42%, #16b092 100%);
}

.match-card-avatar {
  margin: -22px auto 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 3px solid #fff;
  color: #fff;
  font: 800 1.2rem var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 14px rgba(30, 41, 64, 0.24);
}

.match-card-body {
  padding: 0.74rem;
  display: grid;
  gap: 0.44rem;
}

.match-card-body h3 {
  text-align: center;
  font-size: 0.98rem;
}

.match-meta,
.match-bio {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.79rem;
  line-height: 1.5;
}

.match-bio {
  min-height: 2.3rem;
}

.match-score {
  justify-self: start;
  border-radius: 999px;
  border: 1px solid #9ce0d1;
  background: #e3fcf5;
  color: var(--accent-strong);
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.match-btn {
  margin: 0.18rem 0.74rem 0.82rem;
}

.messaging-layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 0.86rem;
}

.msg-sidebar,
.msg-main {
  min-height: 560px;
}

.msg-sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(180deg, #fffef9 0%, #fff5e8 100%);
}

.msg-sidebar-title {
  padding: 0.92rem;
  border-bottom: 1px solid var(--line);
}

.msg-user-list {
  padding: 0.74rem;
  display: grid;
  gap: 0.52rem;
  align-content: start;
  overflow-x: hidden;
}

.msg-user-list li {
  min-width: 0;
}

.chat-user-btn {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffef9;
  text-align: left;
  padding: 0.5rem 0.58rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.56rem;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.chat-user-btn:hover {
  border-color: var(--brand);
}

.chat-user-btn.active {
  border-color: var(--accent);
  background: #e7fff8;
}

.chat-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--deep), #395083);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 0.9rem var(--font-heading);
}

.chat-user-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.chat-user-name {
  font-size: 0.88rem;
}

.chat-user-preview {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-main {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.msg-header {
  padding: 0.92rem;
  border-bottom: 1px solid var(--line);
  background: #fff9ee;
}

.msg-thread {
  flex: 1;
  padding: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff9ed 0%, #fffef9 100%);
}

.bubble {
  max-width: 80%;
  border-radius: 12px;
  padding: 0.5rem 0.64rem;
  font-size: 0.86rem;
  line-height: 1.44;
  animation: bubblePop 0.18s ease;
}

@keyframes bubblePop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.bubble.self {
  align-self: flex-end;
  background: #ffe4dd;
  border: 1px solid #ffc8bc;
}

.bubble.other {
  align-self: flex-start;
  background: #e9fff8;
  border: 1px solid #c7f1e5;
}

.bubble time {
  display: block;
  margin-top: 0.24rem;
  color: var(--ink-secondary);
  font-size: 0.68rem;
}

.msg-compose {
  padding: 0.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.52rem;
  background: #fffdf7;
}

.msg-compose input {
  flex: 1;
}

.btn-send {
  flex-shrink: 0;
}

.profile-form {
  display: grid;
}

.empty-note {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fffef8;
  padding: 0.84rem;
  text-align: center;
  color: var(--ink-secondary);
  font-size: 0.84rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(130%);
  margin: 0;
  border-radius: 999px;
  background: rgba(29, 43, 77, 0.95);
  color: #fff;
  padding: 0.56rem 0.86rem;
  font-size: 0.8rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease;
  z-index: 80;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1160px) {
  .stage-grid {
    grid-template-columns: 1fr;
  }

  .side-note-card,
  .sticker-wall {
    order: 3;
  }

  .profile-summary-card {
    order: 1;
  }
}

@media (max-width: 920px) {
  :root {
    --topbar-height: 84px;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-nav {
    width: 100%;
    padding-bottom: 0.36rem;
  }

  .auth-stage,
  .auth-grid,
  .form-row,
  .match-grid,
  .messaging-layout {
    grid-template-columns: 1fr;
  }

  .msg-sidebar,
  .msg-main {
    min-height: auto;
  }

  .msg-thread {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .app-main {
    width: min(1220px, 95vw);
    margin-top: 1rem;
  }

  .hero-shell {
    border-radius: 22px;
  }

  .topbar-nav-btn {
    padding: 0.48rem 0.82rem;
    font-size: 0.74rem;
  }

  .card {
    padding: 0.86rem;
  }

  .msg-compose {
    flex-direction: column;
  }

  .btn-send,
  .msg-compose input {
    width: 100%;
  }
}
