/* =============================================
   Design Read: personal self-knowledge site
   Dials: VARIANCE 6 / MOTION 4 / DENSITY 3
   Accent: #2d8a4e (green) + warm-neutral
   ============================================= */

/* ----- Reset & Variables ----- */
:root {
  --bg: #fafaf9;
  --bg-warm: #f6f3ee;
  --text: #1a1a1a;
  --text-sub: #5c5c5c;
  --text-muted: #949494;
  --border: #e4e2dd;
  --green: #2d8a4e;
  --green-light: #ecf6f0;
  --green-soft: #d4ece0;
  --warm: #f0ebe0;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --radius: 6px;
  --radius-lg: 12px;
  --nav-h: 56px;
  --mx: 1080px;
  --ease: 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ----- Nav ----- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(250,250,249,0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav.scrolled { box-shadow: var(--shadow); }

.nav-inner {
  max-width: var(--mx);
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--green);
}

.nav-links { display: flex; gap: 2px; }

.nav-links a {
  display: block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-sub);
  transition: background var(--ease), color var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
  background: var(--green-light);
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text);
  border-radius: 1px; transition: var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }

/* ----- Section Shared ----- */
section { padding: 88px 28px; }

.sec-head { text-align: center; margin-bottom: 56px; }

.sec-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.sec-desc {
  font-size: 0.925rem;
  color: var(--text-sub);
  max-width: 480px;
  margin: 0 auto;
}

/* ----- Hero ----- */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 56px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 60%, var(--bg) 100%);
}

.hero-kicker {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-quote {
  font-size: 1.2rem;
  color: var(--text-sub);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 420px;
}

.hero-values {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.val {
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.val-green { background: var(--green-light); color: var(--green); }
.val-warm  { background: var(--warm); color: #8b6f4e; }

/* ----- Inventory ----- */
.inv { max-width: var(--mx); margin: 0 auto; }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  align-items: start;
}

.inv-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  cursor: pointer;
  transition: box-shadow var(--ease), transform var(--ease);
  position: relative;
}

/* bento background diversity: 3+ cells get subtle green tint */
.inv-card:nth-child(1) { background: linear-gradient(135deg, #fafdfb, #f4f9f6); }
.inv-card:nth-child(4) { background: linear-gradient(135deg, #fafdfb, #f6f9f4); }
.inv-card:nth-child(7) { background: linear-gradient(135deg, #fafdfb, #f4f9f6); }

.inv-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* bento sizing: span across columns */
.inv-card:nth-child(1) { grid-column: span 3; }
.inv-card:nth-child(2) { grid-column: span 3; }
.inv-card:nth-child(3) { grid-column: span 2; }
.inv-card:nth-child(4) { grid-column: span 2; }
.inv-card:nth-child(5) { grid-column: span 2; }
.inv-card:nth-child(6) { grid-column: span 3; }
.inv-card:nth-child(7) { grid-column: span 3; }
.inv-card:nth-child(8) { grid-column: span 2; }
.inv-card:nth-child(9) { grid-column: span 2; }

.inv-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--green);
  margin-bottom: 6px;
}

.inv-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.inv-summary {
  font-size: 0.84rem;
  color: var(--text-sub);
  line-height: 1.6;
}

/* ----- Quadrant ----- */
.quad {
  background: var(--bg-warm);
  max-width: 100%;
  padding-left: max(28px, calc((100vw - var(--mx)) / 2));
  padding-right: max(28px, calc((100vw - var(--mx)) / 2));
}

.quad-chart {
  max-width: 760px;
  margin: 0 auto;
}

.quad-axis {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 10px 0;
}

.quad-axis-y { margin-bottom: 8px; }
.quad-axis-x { margin-top: 8px; }

.quad-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.q-cell {
  padding: 26px 22px;
}

.q-cell:nth-child(1) { background: #eef7f1; }
.q-cell:nth-child(2) { background: #e4f2e9; }
.q-cell:nth-child(3) { background: #f8f4ee; }
.q-cell:nth-child(4) { background: #f3ece0; }

.q-cell-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.q-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.q-dot.g { background: var(--green); }
.q-dot.w { background: #b8936e; }

.q-label { font-size: 0.9rem; font-weight: 700; }
.q-sub   { font-size: 0.74rem; color: var(--text-muted); }

.q-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.q-tag {
  font-size: 0.76rem;
  color: var(--text-sub);
  background: rgba(255,255,255,0.65);
  padding: 3px 11px;
  border-radius: 12px;
}

/* ----- Contract ----- */
.contract { max-width: var(--mx); margin: 0 auto; }

.contract-list {
  max-width: 660px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: contract-counter;
}

.contract-item {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--white);
  counter-increment: contract-counter;
  transition: box-shadow var(--ease);
}

.contract-item:hover { box-shadow: var(--shadow); }

.contract-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contract-num.want    { background: var(--green-light); color: var(--green); }
.contract-num.notwant { background: var(--warm); color: #8b6f4e; }
.contract-num.check   { background: #fef9e7; color: #b7950b; }
.contract-num.comm    { background: #eaf0fb; color: #3b6cb4; }
.contract-num.resp    { background: #fce8ec; color: #b8445a; }

.contract-body h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.contract-body p {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.65;
}

/* ----- Timeline ----- */
.tl { max-width: var(--mx); margin: 0 auto; }

.tl-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tl-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: box-shadow var(--ease);
}

.tl-item.open { box-shadow: var(--shadow-md); }

.tl-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.tl-header:hover { background: #fafaf8; }

.tl-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
  min-width: 32px;
}

.tl-mod {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.tl-arr {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.25s;
}

.tl-item.open .tl-arr { transform: rotate(180deg); color: var(--green); }

.tl-body { display: none; padding: 0 20px 20px; }
.tl-item.open .tl-body { display: block; }

.tl-msg {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.86rem;
  line-height: 1.7;
  margin-bottom: 10px;
  max-width: 94%;
}

.tl-msg-ai {
  background: #f5f4f1;
  color: var(--text);
  border-top-left-radius: 2px;
}

.tl-msg-me {
  background: var(--green-light);
  color: var(--text);
  border-top-right-radius: 2px;
  margin-left: auto;
}

.tl-msg-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
}

/* ----- Footer ----- */
.footer {
  text-align: center;
  padding: 52px 28px;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
}

.footer-quote {
  font-size: 1rem;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----- Back to Top ----- */
.btt {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 99;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
  box-shadow: var(--shadow);
}

.btt.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btt:hover { color: var(--green); border-color: var(--green); }

/* ----- Entrance ----- */
.entr {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.entr.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .entr { opacity: 1; transform: none; transition: none; }
  .inv-card:hover { transform: none; }
  .btt { transition: none; }
}

/* ----- Highlight flash (card -> timeline) ----- */
@keyframes hl {
  0%   { box-shadow: 0 0 0 0 var(--green-soft); }
  50%  { box-shadow: 0 0 0 4px var(--green-soft); }
  100% { box-shadow: 0 0 0 0 var(--green-soft); }
}

.tl-item.hl { animation: hl 1.4s ease; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
  section { padding: 60px 20px; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0; right: 0;
    width: 240px;
    height: 100dvh;
    background: var(--white);
    flex-direction: column;
    padding: 72px 24px 24px;
    gap: 2px;
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open { transform: translateX(0); }

  .nav-links a {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.9rem;
  }

  .hero-title { font-size: 1.9rem; }
  .hero-quote { font-size: 1.05rem; }

  .inv-grid { grid-template-columns: 1fr; }
  .inv-card:nth-child(n) { grid-column: span 1; }

  .quad-cells { grid-template-columns: 1fr; grid-template-rows: auto; }
  .quad { padding-left: 20px; padding-right: 20px; }

  .contract-item { flex-direction: column; gap: 10px; }

  .btt { bottom: 16px; right: 16px; width: 36px; height: 36px; }
}
