@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #171719;
  --ink-soft: #4f5056;
  --muted: #85868d;
  --stroke: #e7e5e2;
  --canvas: #fbfbfc;
  --paper: #fff;
  --blush: #ffe7ee;
  --sky: #eaf3ff;
  --mint: #e4f8ef;
  --lemon: #fff4c9;
  --lilac: #f0e9ff;
  --peach: #ffe8d5;
  --sage: #4b7d63;
  --danger: #b63c5c;
  --shadow: 0 18px 48px rgba(23, 23, 25, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas);
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.eyebrow { margin: 0 0 8px; color: var(--sage); font-size: 11px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(40px, 5.7vw, 74px); line-height: 1.02; font-weight: 800; }
h2 { margin-bottom: 0; font-size: 25px; line-height: 1.16; font-weight: 800; }
h3 { margin-bottom: 0; font-size: 15px; font-weight: 800; }

.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 43px; height: 43px; border-radius: 14px; background: var(--blush);
  border: 1px solid rgba(0,0,0,.05); display: grid; place-items: center; font-size: 17px; font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; font-weight: 800; }
.brand small { color: var(--muted); font-size: 11px; font-weight: 600; }

.traveler-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, .65fr); }
.login-scene {
  min-height: 100vh; padding: 32px clamp(32px, 6vw, 86px) 64px;
  background: var(--lemon) url("./assets/tira-world-map.png") center / cover no-repeat;
  display: flex; flex-direction: column;
}
.scene-copy { max-width: 800px; margin-top: auto; }
.scene-copy > p:last-child { max-width: 610px; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.login-form {
  padding: clamp(34px, 5vw, 68px); background: var(--paper);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.login-form > div:first-child { margin-bottom: 8px; }
.login-form > div:first-child p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
input, textarea {
  width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid var(--stroke);
  border-radius: 12px; background: #f7f7f9; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: #aaa8a5; background: #fff; box-shadow: 0 0 0 3px rgba(23,23,25,.05); }
textarea { min-height: 110px; resize: vertical; }
.primary-button, .secondary-button, .text-button {
  min-height: 43px; border: 0; border-radius: 12px; padding: 10px 15px; font-weight: 800;
}
.primary-button { background: var(--ink); color: #fff; }
.secondary-button { background: var(--mint); color: #315f4a; }
.text-button { min-height: 36px; padding: 8px 10px; background: #f5f5f7; color: var(--ink); }
.portal-links { display: flex; justify-content: center; gap: 18px; margin-top: 4px; }
.portal-links a { color: var(--muted); font-size: 11px; font-weight: 700; }
.message { min-height: 0; margin: 0; color: #315f4a; font-size: 13px; font-weight: 700; }
.message:not(:empty) { padding: 11px 14px; border: 1px solid #c8e7d8; border-radius: 12px; background: var(--mint); }
.message.error:not(:empty) { color: var(--danger); border-color: #f1c7d2; background: #fff0f4; }

.traveler-app { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.app-nav {
  position: sticky; top: 0; height: 100vh; padding: 25px 18px 20px; border-right: 1px solid var(--stroke);
  background: var(--paper); display: flex; flex-direction: column; gap: 42px;
}
.app-nav .brand { padding: 0 10px; }
.app-nav nav { display: grid; gap: 6px; }
.nav-item { min-height: 44px; padding: 11px 13px; border-radius: 12px; color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 700; }
.nav-item:hover { background: #f5f5f7; color: var(--ink); }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-profile {
  margin-top: auto; padding: 15px 7px 0; border-top: 1px solid var(--stroke);
  display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 10px; align-items: center;
}
.nav-profile strong, .nav-profile span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-profile strong { font-size: 12px; }
.nav-profile span { color: var(--muted); font-size: 10px; }
.nav-profile button { grid-column: 1/-1; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-align: left; }
.mini-avatar, .avatar {
  border-radius: 50%; background: var(--sky); background-size: cover; background-position: center;
  display: grid; place-items: center; color: var(--ink); font-weight: 800; overflow: hidden;
}
.mini-avatar { width: 38px; height: 38px; font-size: 12px; }

.app-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px clamp(24px, 4vw, 58px) 70px; }
.mobile-header, .mobile-nav { display: none; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin-bottom: 24px; }
.page-heading p:last-child { max-width: 560px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 18px; align-items: start; }
.feed-column, .side-column, .page-stack { display: grid; gap: 15px; }
.panel { padding: 20px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--paper); }
.panel-heading { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding-bottom: 15px; border-bottom: 1px solid var(--stroke); }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.panel-heading span { color: var(--muted); font-size: 11px; font-weight: 700; }

.welcome-card {
  min-height: 210px; padding: 26px; border-radius: 18px;
  background: var(--lemon) url("./assets/tira-world-map.png") center / cover no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.welcome-card h2 { max-width: 580px; font-size: 31px; }
.welcome-card p:last-child { max-width: 600px; margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }

.stories-row { display: flex; gap: 14px; padding-top: 15px; overflow-x: auto; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.person-bubble { min-width: 64px; text-align: center; }
.person-bubble .avatar { width: 58px; height: 58px; margin: 0 auto 7px; border: 3px solid var(--blush); }
.person-bubble strong { display: block; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.person-bubble span { color: var(--muted); font-size: 9px; }

.photo-feed { display: grid; gap: 15px; }
.photo-post { overflow: hidden; border: 1px solid var(--stroke); border-radius: 16px; background: var(--paper); }
.post-header { padding: 13px 15px; display: flex; align-items: center; gap: 10px; }
.post-header .avatar { width: 37px; height: 37px; }
.post-header strong, .post-header span { display: block; }
.post-header strong { font-size: 12px; }
.post-header span { color: var(--muted); font-size: 10px; }
.post-media { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #f1f1f3; }
.photo-post.media-missing .post-body { border-top: 1px solid var(--stroke); }
.post-body { padding: 14px 15px 16px; }
.post-body p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.post-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }

.trip-preview, .trip-card { border: 1px solid rgba(0,0,0,.045); border-radius: 15px; background: var(--sky); }
.trip-preview { padding: 16px; }
.trip-preview:nth-child(2n) { background: var(--mint); }
.trip-preview strong, .trip-preview span { display: block; }
.trip-preview strong { font-size: 14px; }
.trip-preview span { margin-top: 5px; color: var(--ink-soft); font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat { padding: 14px 9px; border-radius: 14px; background: var(--lilac); text-align: center; }
.stat:nth-child(2) { background: var(--mint); }
.stat:nth-child(3) { background: var(--peach); }
.stat strong, .stat span { display: block; }
.stat strong { font-size: 21px; }
.stat span { margin-top: 4px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }

.trip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.trip-card { min-height: 190px; padding: 19px; display: flex; flex-direction: column; }
.trip-card:nth-child(3n+2) { background: var(--mint); }
.trip-card:nth-child(3n+3) { background: var(--lilac); }
.trip-card .trip-kicker { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.trip-card h3 { margin-top: auto; font-size: 22px; }
.trip-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; }
.match-stack { display: flex; margin-top: 15px; }
.match-stack .avatar { width: 31px; height: 31px; margin-right: -7px; border: 2px solid #fff; font-size: 9px; }

.trip-form, .profile-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding-top: 16px; }
.trip-form button { align-self: end; }
.profile-hero { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 22px; align-items: center; }
.profile-hero .avatar { width: 110px; height: 110px; font-size: 28px; background-color: var(--blush); }
.profile-hero h2 { font-size: 29px; }
.profile-hero p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.profile-form { grid-template-columns: 1fr auto; align-items: end; }
.profile-form label { min-width: 0; }
.profile-form textarea { min-height: 90px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding-top: 15px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #f1f1f3; }
.empty-state { padding: 26px; border: 1px dashed #d8d6d3; border-radius: 14px; background: #fafafa; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }

@media (max-width: 950px) {
  .home-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .side-column > :first-child { grid-column: 1/-1; }
}
@media (max-width: 760px) {
  .traveler-login { grid-template-columns: 1fr; }
  .login-scene { min-height: 530px; padding: 24px 24px 40px; }
  .login-form { min-height: 500px; padding: 34px 24px; }
  .traveler-app { display: block; }
  .app-nav { display: none; }
  .app-main { padding: 20px 14px 92px; }
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px;
  }
  .mobile-header .brand-mark { width: 38px; height: 38px; }
  .mobile-header button { border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
  .mobile-nav {
    position: fixed; z-index: 20; left: 12px; right: 12px; bottom: 12px;
    min-height: 58px; padding: 7px; border: 1px solid var(--stroke); border-radius: 17px;
    background: rgba(255,255,255,.96); box-shadow: var(--shadow);
    display: grid; grid-template-columns: repeat(3,1fr); gap: 5px;
  }
  .mobile-nav a { border-radius: 11px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 800; }
  .mobile-nav a.active { background: var(--ink); color: #fff; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .side-column { grid-template-columns: 1fr; }
  .side-column > :first-child { grid-column: auto; }
  .trip-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  h1 { font-size: 43px; }
  .welcome-card h2 { font-size: 26px; }
  .trip-form, .profile-form { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: 78px minmax(0,1fr); gap: 15px; }
  .profile-hero .avatar { width: 78px; height: 78px; font-size: 21px; }
  .profile-hero h2 { font-size: 23px; }
}
