:root {
  --wine: #7a1f3d;
  --wine-dark: #5a1429;
  --wine-tint: #f1e6ea;
  --g900: #26262a;
  --g700: #4f4f55;
  --g500: #85858c;
  --g300: #d4d4d8;
  --g200: #e6e6e9;
  --g100: #f3f3f4;
  --bg: #fbfafa;
  --sidebar-w: 300px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--g900);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
  border-radius: 6px;
}

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 30px 20px;
  background: var(--bg);
  border-right: 1px solid var(--g200);
}

.profile { display: flex; align-items: center; gap: 16px; padding: 0 10px; }

.avatar {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}

.who { display: flex; flex-direction: column; line-height: 1.3; }
.who strong { font-size: 16px; font-weight: 700; }
.who small { font-size: 13px; color: var(--g500); }

.nav { display: flex; flex-direction: column; gap: 6px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--g700);
  transition: background .15s, color .15s;
}

.nav a svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a:hover { background: var(--g100); color: var(--g900); }
.nav a[aria-current="page"] { background: var(--wine-tint); color: var(--wine); }

.recent { padding: 22px 14px 0; border-top: 1px solid var(--g200); }
.recent h4 { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--g500); margin-bottom: 14px; }
.recent ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.recent li { display: flex; align-items: center; gap: 14px; }
.recent .thumb { width: 42px; height: 42px; flex: none; border-radius: 8px; background: linear-gradient(135deg, var(--wine-tint), var(--g200)); border: 1px solid var(--g200); }
.recent b { display: block; font-size: 13px; font-weight: 500; color: var(--g900); line-height: 1.3; }
.recent small { font-size: 12px; color: var(--g500); }

.side-foot { margin-top: auto; padding: 0 14px; font-size: 12px; color: var(--g500); letter-spacing: .4px; }

/* ---------- Main ---------- */
main { flex: 1; position: relative; overflow: hidden; min-width: 0; }

.js .view { display: none; }
.js .view.active { display: block; animation: enter .35s ease both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Home */
#home { min-height: 100vh; position: relative; }

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(24px, 8vw, 140px);
  padding-bottom: 12vh;
}

.hello { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); color: var(--g900); }

.name {
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.05;
  font-weight: 700;
  color: var(--wine);
  margin: 4px 0 14px;
}

.tagline { font-family: var(--serif); font-size: clamp(17px, 1.6vw, 21px); color: var(--g700); max-width: 30em; }

.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Inner pages */
.page { max-width: 680px; padding: clamp(40px, 9vh, 96px) clamp(24px, 6vw, 80px); margin: 0 auto 0 clamp(0px, 4vw, 60px); }
.page.wide { max-width: 980px; }

.page h2 {
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 48px);
  color: var(--wine);
  line-height: 1.1;
  margin-bottom: 10px;
}

.page .lead { font-family: var(--serif); font-size: 21px; color: var(--g700); margin-bottom: 22px; }
.page p + p { margin-top: 14px; }
.page p { color: var(--g700); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 28px; }

.card {
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--g200);
}

.card.placeholder { background: transparent; border-style: dashed; border-color: var(--g300); }
.card h3 { font-family: var(--serif); font-size: 20px; color: var(--g900); margin-bottom: 6px; }
.card p { font-size: 14px; color: var(--g500); }

.empty {
  margin-top: 28px;
  padding: 36px 24px;
  border: 1px dashed var(--g300);
  border-radius: 14px;
  text-align: center;
  color: var(--g500);
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .app { flex-direction: column; }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--g200);
  }

  .profile { padding: 0; }
  .avatar { width: 40px; height: 40px; font-size: 16px; }
  .side-foot, .recent { display: none; }

  .nav { flex-direction: row; width: 100%; gap: 4px; overflow-x: auto; }
  .nav a { flex: 1; justify-content: center; height: 40px; padding: 0 10px; gap: 8px; }

  #home, .hero { min-height: calc(100vh - 130px); }
  .page { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .js .view.active { animation: none; }
}
