/* ═══════════════════════════════════════════
   WARM-TONE PORTFOLIO · INTERNSHIP REPORT
═══════════════════════════════════════════ */
:root {
  /* ── Warm Light Palette ── */
  --cream-50:  #FEFAF3;
  --cream-100: #F7FAF9;
  --cream-200: #F5E9D3;
  --cream-300: #EDD9B7;
  --cream-400: #E0C290;

  --peach-100: #E3F4F1;
  --peach-200: #BFE8E0;
  --peach-300: #FDBA74;
  --peach-400: #14B8A6;
  --peach-500: #0F9D8A;

  --amber-400: #FBBF24;
  --amber-500: #F59E0B;
  --amber-600: #0F9D8A;
  --amber-700: #B45309;

  --terra-500: #DC6803;
  --terra-600: #B54708;
  --terra-700: #93370D;

  --ink-900: #1E293B;
  --ink-700: #4A2C1F;
  --ink-500: #78502E;
  --ink-300: #A37D4E;
  --ink-200: #C2A77C;

  --green:  #16A34A;
  --blue:   #2563EB;
  --red:    #DC2626;
  --purple: #7C3AED;

  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.06);
  --shadow:    0 6px 24px rgba(17, 24, 39, 0.10);
  --shadow-lg: 0 16px 48px rgba(17, 24, 39, 0.16);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;

  --serif:  'Playfair Display', 'Noto Serif TC', serif;
  --sans:   'Plus Jakarta Sans', 'Noto Sans TC', system-ui, sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 260px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream-50);
  color: var(--ink-900);
  min-height: 100vh;
  overflow-x: hidden;
  font-weight: 400;
}

/* warm noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
#app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAF9 100%);
  border-right: 1px solid var(--cream-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  box-shadow: 2px 0 24px rgba(17, 24, 39, 0.04);
}

.sb-brand {
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--cream-200);
}

.sb-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sb-brand-dot {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--peach-400), var(--amber-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(15, 157, 138, 0.3);
}

.sb-brand-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.3;
}

.sb-brand-sub {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--ink-300);
  line-height: 1.6;
}

.sb-nav { flex: 1; padding: 14px 0; }

.sb-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-200);
  padding: 14px 22px 6px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 22px;
  cursor: pointer;
  transition: all 0.18s;
  border-left: 3px solid transparent;
  font-size: 13.5px;
  color: var(--ink-700);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.sb-item:hover {
  background: rgba(15, 157, 138, 0.06);
  color: var(--terra-600);
}

.sb-item.active {
  border-left-color: var(--peach-500);
  background: linear-gradient(90deg, rgba(15, 157, 138, 0.12), transparent 80%);
  color: var(--terra-700);
  font-weight: 700;
}

.sb-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sb-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 100px;
  background: var(--cream-200);
  color: var(--ink-500);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sb-item.active .sb-badge {
  background: var(--peach-500);
  color: white;
}

.sb-item.special {
  background: linear-gradient(90deg, rgba(15, 157, 138, 0.08), transparent);
  color: var(--terra-700);
  font-weight: 600;
}

.sb-item.special::before {
  content: '✦';
  margin-right: -4px;
  color: var(--amber-500);
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.sb-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--cream-200);
  font-size: 10.5px;
  color: var(--ink-300);
  line-height: 1.7;
}

.sb-footer strong { color: var(--terra-600); }

/* ── MAIN ── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  background: var(--cream-50);
}

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cream-200);
  padding: 0 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-300);
}

.bc strong { color: var(--terra-700); font-weight: 700; }
.bc .sep { color: var(--cream-300); }

.tb-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 100px;
  background: white;
  border: 1px solid var(--cream-200);
  color: var(--ink-500);
  font-weight: 500;
}

.pill.hot {
  background: rgba(15, 157, 138, 0.1);
  border-color: rgba(15, 157, 138, 0.3);
  color: var(--terra-600);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   HERO / PAGE-HEAD
═══════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 56px 56px 48px;
  background:
    radial-gradient(circle at 90% 10%, rgba(15, 157, 138, 0.12), transparent 50%),
    radial-gradient(circle at 10% 80%, rgba(15, 157, 138, 0.08), transparent 50%),
    linear-gradient(180deg, var(--cream-100), var(--cream-50));
  border-bottom: 1px solid var(--cream-200);
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--peach-300), transparent);
}

.hero-deco {
  position: absolute;
  right: 32px;
  top: 30px;
  font-size: 140px;
  opacity: 0.07;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  filter: blur(0.5px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra-600);
  margin-bottom: 14px;
  padding: 5px 14px;
  background: white;
  border: 1px solid rgba(15, 157, 138, 0.3);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
}

.tag::before {
  content: '◆';
  color: var(--peach-500);
  font-size: 8px;
}

h1.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

h1.hero-h1 em {
  font-style: italic;
  color: var(--terra-600);
  background: linear-gradient(120deg, var(--peach-500), var(--terra-600));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: 15px;
  color: var(--ink-500);
  max-width: 640px;
  line-height: 1.9;
  font-weight: 400;
}

.stats-row {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.stat-chip:hover { transform: translateY(-2px); }

.stat-ic {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--peach-100), var(--peach-200));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-v {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--terra-700);
  line-height: 1;
}

.stat-l {
  font-size: 11px;
  color: var(--ink-300);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════
   CONTENT
═══════════════════════════════════════════ */
.content {
  padding: 48px 56px 100px;
  max-width: 1280px;
}

.block { margin-bottom: 64px; }

.block-h {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--cream-200);
  position: relative;
}

.block-h::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--peach-500), var(--amber-600));
}

.b-num {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--peach-400), var(--terra-600));
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(15, 157, 138, 0.25);
}

.b-num.blue {
  background: linear-gradient(135deg, #60A5FA, var(--blue));
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.b-num.green {
  background: linear-gradient(135deg, #4ADE80, var(--green));
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
}
.b-num.red {
  background: linear-gradient(135deg, #F87171, var(--red));
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
}
.b-num.purple {
  background: linear-gradient(135deg, #A78BFA, var(--purple));
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.25);
}

.b-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

.b-sub {
  font-size: 12px;
  color: var(--ink-300);
  margin-left: 6px;
  font-weight: 500;
}

.prose {
  font-size: 15px;
  color: var(--ink-700);
  line-height: 1.95;
  font-weight: 400;
  margin-bottom: 20px;
}

.prose strong { color: var(--ink-900); font-weight: 700; }
.prose em { color: var(--terra-600); font-style: normal; font-weight: 700; }

/* ── IMAGE FRAME (clearer) ── */
.imgrow { display: grid; gap: 18px; margin: 20px 0; }
.imgrow.g1 { grid-template-columns: 1fr; }
.imgrow.g2 { grid-template-columns: 1fr 1fr; }
.imgrow.g3 { grid-template-columns: 1fr 1fr 1fr; }
.imgrow.g21 { grid-template-columns: 2fr 1fr; }

.img-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--cream-200);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.img-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--peach-300);
}

.img-card .img-wrap {
  background: linear-gradient(135deg, #FAFAFA, #F5F5F5);
  padding: 8px;
  position: relative;
  overflow: hidden;
}

.img-card img {
  width: 100%;
  display: block;
  max-height: 540px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.4s ease;
}

.img-card:hover img { transform: scale(1.02); }

.img-card .cap {
  padding: 12px 18px;
  font-size: 12.5px;
  color: var(--ink-500);
  background: var(--cream-100);
  border-top: 1px solid var(--cream-200);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.img-card .cap .num {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid var(--cream-300);
  color: var(--terra-600);
  font-weight: 700;
}

.img-card .zoom {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
}

.img-card:hover .zoom { opacity: 1; }

/* ── INFO BOX ── */
.info {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
  border-left: 4px solid;
  background: white;
  box-shadow: var(--shadow-sm);
}

.info.amber { border-color: var(--amber-500); background: linear-gradient(135deg, #FFFBEB, white); }
.info.red { border-color: var(--red); background: linear-gradient(135deg, #FEF2F2, white); }
.info.green { border-color: var(--green); background: linear-gradient(135deg, #F0FDF4, white); }
.info.blue { border-color: var(--blue); background: linear-gradient(135deg, #EFF6FF, white); }
.info.purple { border-color: var(--purple); background: linear-gradient(135deg, #FAF5FF, white); }

.info-l {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info.amber .info-l { color: var(--amber-700); }
.info.red .info-l { color: var(--red); }
.info.green .info-l { color: var(--green); }
.info.blue .info-l { color: var(--blue); }
.info.purple .info-l { color: var(--purple); }

.info p {
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.85;
}

.info strong { color: var(--ink-900); font-weight: 700; }

/* ── CHIPS ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--cream-200);
  color: var(--ink-700);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
  transition: all 0.2s;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--peach-300);
}

.chip.hot {
  background: linear-gradient(135deg, var(--peach-100), white);
  border-color: var(--peach-300);
  color: var(--terra-700);
  font-weight: 700;
}

.chip.blue {
  background: linear-gradient(135deg, #DBEAFE, white);
  border-color: #93C5FD;
  color: #1E40AF;
  font-weight: 700;
}

.chip.green {
  background: linear-gradient(135deg, #DCFCE7, white);
  border-color: #86EFAC;
  color: #166534;
  font-weight: 700;
}

.chip.purple {
  background: linear-gradient(135deg, #EDE9FE, white);
  border-color: #C4B5FD;
  color: #5B21B6;
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   HOMEPAGE
═══════════════════════════════════════════ */
.home {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

.home-l {
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.home-l::before {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 157, 138, 0.18), transparent 70%);
  top: 10%; left: -120px;
  pointer-events: none;
  filter: blur(20px);
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--peach-400), var(--terra-600));
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 28px;
  width: fit-content;
  box-shadow: 0 6px 20px rgba(15, 157, 138, 0.3);
}

.home-h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.06;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.home-h1 em {
  font-style: italic;
  position: relative;
  background: linear-gradient(120deg, var(--peach-500) 0%, var(--terra-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-h1 em::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 0;
  width: 100%; height: 8px;
  background: var(--peach-200);
  z-index: -1;
  opacity: 0.5;
  border-radius: 100px;
}

.home-desc {
  font-size: 16px;
  color: var(--ink-500);
  max-width: 480px;
  line-height: 1.9;
  margin-bottom: 36px;
  font-weight: 400;
}

/* ── COVER INFO (formal report cover style) ── */
.home-cover-info {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 6px 26px;
  margin-bottom: 32px;
  max-width: 460px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.home-cover-info::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--peach-400), var(--terra-600));
  border-radius: 4px 0 0 4px;
}

.cover-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--cream-200);
  align-items: baseline;
}

.cover-row:last-child {
  border-bottom: none;
}

.cover-label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-300);
  font-weight: 700;
  font-family: var(--sans);
  white-space: nowrap;
}

.cover-value {
  font-size: 16px;
  color: var(--ink-900);
  font-weight: 600;
  font-family: var(--serif);
  letter-spacing: 0.01em;
}

.cover-suffix {
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 400;
  margin-left: 2px;
}

.home-quick {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
}

.qbtn {
  padding: 11px 22px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
}

.qbtn.primary {
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
  box-shadow: 0 8px 24px rgba(15, 157, 138, 0.3);
}

.qbtn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 157, 138, 0.4);
}

.qbtn.ghost {
  background: white;
  color: var(--ink-700);
  border: 1px solid var(--cream-300);
}

.qbtn.ghost:hover {
  background: var(--cream-100);
  border-color: var(--peach-300);
}

.home-stats {
  display: flex;
  gap: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--cream-200);
}

.home-stat .v {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--terra-600);
  line-height: 1;
  display: block;
  background: linear-gradient(120deg, var(--peach-500), var(--terra-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-stat .l {
  font-size: 12px;
  color: var(--ink-300);
  margin-top: 6px;
  font-weight: 500;
}

.home-r {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cream-200), var(--peach-100));
}

.home-r img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.home-r::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--cream-50) 0%, transparent 25%, transparent 100%);
}

.home-r-overlay {
  position: absolute;
  bottom: 32px;
  right: 32px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 18px 22px;
  max-width: 260px;
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.home-r-overlay-l {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra-600);
  margin-bottom: 4px;
}

.home-r-overlay-t {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.3;
}

.home-r-overlay-s {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 4px;
  line-height: 1.5;
}

/* Project cards on home */
.home-projects {
  padding: 0 56px 60px;
  background: linear-gradient(180deg, var(--cream-50), white);
}

.home-projects-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-top: 60px;
}

.home-projects-t {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink-900);
}

.home-projects-t em {
  font-style: italic;
  color: var(--terra-600);
}

.home-projects-sub {
  font-size: 13px;
  color: var(--ink-300);
  margin-top: 6px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.proj-card {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.proj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--card-gradient, linear-gradient(135deg, var(--peach-100), transparent));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.proj-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--card-color, var(--peach-400));
}

.proj-card:hover::before { opacity: 0.5; }

.proj-card > * { position: relative; z-index: 1; }

.proj-card-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-300);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.proj-card-ic {
  width: 48px;
  height: 48px;
  background: var(--card-ic-bg, linear-gradient(135deg, var(--peach-200), var(--peach-400)));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
  box-shadow: 0 6px 16px rgba(15, 157, 138, 0.18);
}

.proj-card-t {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.3;
  margin-bottom: 8px;
}

.proj-card-d {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.7;
  margin-bottom: 16px;
}

.proj-card-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--card-color, var(--terra-600));
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.05em;
}

.proj-card-cta::after {
  content: '→';
  transition: transform 0.2s;
}

.proj-card:hover .proj-card-cta::after {
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════
   GANTT BEFORE/AFTER SLIDER
═══════════════════════════════════════════ */
.compare {
  position: relative;
  width: 100%;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--cream-200);
  box-shadow: var(--shadow);
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  margin: 20px 0;
}

.compare-img-wrap {
  position: relative;
  width: 100%;
}

.compare-img-wrap img {
  width: 100%;
  display: block;
}

.compare-after {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 50%;
  overflow: hidden;
  transition: width 0.05s;
}

.compare-after img {
  position: absolute;
  top: 0; left: 0;
  width: var(--full-w, 100%);
  height: auto;
}

.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  background: white;
  transform: translateX(-1.5px);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: none;
}

.compare-handle::after {
  content: '⇔';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--terra-600);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-weight: 900;
}

.compare-label {
  position: absolute;
  top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
}

.compare-label.before {
  left: 16px;
  background: rgba(17, 24, 39, 0.85);
  color: white;
}

.compare-label.after {
  right: 16px;
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
}

/* ═══════════════════════════════════════════
   PROCESS TIMELINE
═══════════════════════════════════════════ */
.timeline {
  position: relative;
  padding: 0 0 0 40px;
  margin: 32px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 12px; bottom: 12px;
  left: 14px;
  width: 2px;
  background: linear-gradient(180deg, var(--peach-400), var(--terra-600));
  border-radius: 2px;
}

.tl-item {
  position: relative;
  padding: 0 0 32px;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: '';
  position: absolute;
  top: 8px;
  left: -34px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--peach-500);
  box-shadow: 0 0 0 4px rgba(15, 157, 138, 0.18);
}

.tl-stage {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra-600);
  margin-bottom: 5px;
}

.tl-t {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
  line-height: 1.3;
}

.tl-d {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.85;
}

/* ═══════════════════════════════════════════
   MOCK TERMINAL
═══════════════════════════════════════════ */
.terminal {
  background: #0F172A;
  border-radius: var(--radius);
  border: 1px solid #1E293B;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 20px 0;
}

.term-bar {
  background: linear-gradient(180deg, #1E293B, #0F172A);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #1E293B;
}

.term-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}

.term-dot.r { background: #FF5F57; }
.term-dot.y { background: #FEBC2E; }
.term-dot.g { background: #28C840; }

.term-title {
  margin-left: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: #64748B;
}

.term-body {
  padding: 20px 24px;
  font-family: var(--mono);
  font-size: 13px;
  color: #E2E8F0;
  line-height: 1.85;
  min-height: 180px;
  background: linear-gradient(180deg, #0F172A, #111827);
}

.term-line { display: block; }

.term-prompt {
  color: var(--peach-400);
  font-weight: 700;
}

.term-cmd { color: #99F6E4; }

.term-out {
  color: #94A3B8;
  display: block;
  padding-left: 0;
}

.term-out.ok { color: #6EE7B7; }
.term-out.warn { color: #FBBF24; }
.term-out.err { color: #F87171; }

.term-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--peach-400);
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ═══════════════════════════════════════════
   PERMISSION SWITCHER
═══════════════════════════════════════════ */
.perm-demo {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.perm-toggle {
  display: flex;
  background: var(--cream-100);
  padding: 5px;
  border-radius: 100px;
  margin-bottom: 28px;
  width: fit-content;
  border: 1px solid var(--cream-200);
}

.perm-btn {
  padding: 9px 22px;
  border-radius: 100px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 600;
  transition: all 0.25s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.perm-btn.active {
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
  box-shadow: 0 4px 12px rgba(15, 157, 138, 0.3);
}

.perm-content { display: none; }
.perm-content.active { display: block; }

.perm-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}

.perm-card-info {
  background: linear-gradient(135deg, var(--cream-100), white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--cream-200);
}

.perm-card-info .ic {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.perm-card-info h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
}

.perm-card-info p {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.8;
  margin-bottom: 18px;
}

.perm-feats {
  list-style: none;
  display: grid;
  gap: 8px;
}

.perm-feats li {
  font-size: 13px;
  color: var(--ink-700);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
}

.perm-feats .y { color: var(--green); flex-shrink: 0; }
.perm-feats .n { color: var(--red); flex-shrink: 0; }

/* ═══════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════ */
.dt {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  margin: 20px 0;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-200);
}

.dt thead {
  background: linear-gradient(180deg, var(--cream-100), var(--cream-200));
}

.dt th {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  text-align: left;
  border-bottom: 1px solid var(--cream-300);
}

.dt td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--cream-100);
  color: var(--ink-700);
  vertical-align: top;
  line-height: 1.6;
}

.dt tr:last-child td { border-bottom: none; }
.dt tr:hover td { background: rgba(15, 157, 138, 0.04); }

.dt .hl {
  color: var(--terra-600);
  font-weight: 700;
  font-family: var(--serif);
  font-size: 17px;
}

.dt .total td {
  background: linear-gradient(90deg, var(--peach-100), transparent);
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   FLOW DIAGRAM
═══════════════════════════════════════════ */
.flow {
  display: flex;
  gap: 0;
  align-items: stretch;
  margin: 24px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 0;
}

.fn { flex: 1; min-width: 150px; display: flex; align-items: center; }

.fbox {
  flex: 1;
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
  position: relative;
}

.fbox:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--peach-300);
}

.fbox-num {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--peach-400), var(--terra-600));
  border-radius: 10px;
  color: white;
  font-weight: 700;
  font-family: var(--serif);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 4px 10px rgba(15, 157, 138, 0.25);
}

.fbox-t {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 5px;
}

.fbox-s {
  font-size: 11px;
  color: var(--ink-500);
  line-height: 1.5;
}

.farrow {
  color: var(--peach-400);
  font-size: 22px;
  font-weight: 700;
  padding: 0 6px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CATEGORY BARS
═══════════════════════════════════════════ */
.cats { display: grid; gap: 10px; margin: 20px 0; }

.cat {
  display: grid;
  grid-template-columns: 280px 1fr 70px;
  align-items: center;
  gap: 14px;
}

.cat-l {
  font-size: 13px;
  color: var(--ink-700);
  font-weight: 500;
}

.cat-l b { color: var(--terra-700); font-weight: 700; font-family: var(--mono); }

.cat-bar {
  height: 12px;
  background: var(--cream-200);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.cat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--peach-400), var(--terra-600));
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-c {
  font-size: 12px;
  font-weight: 700;
  color: var(--terra-700);
  font-family: var(--mono);
  text-align: right;
}

/* ═══════════════════════════════════════════
   LANG TABLE
═══════════════════════════════════════════ */
.lang-t {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 1px;
  background: var(--cream-300);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-300);
}

.lang-t > div {
  background: white;
  padding: 14px 20px;
  font-size: 13.5px;
  color: var(--ink-700);
}

.lang-t .lh {
  background: linear-gradient(180deg, var(--cream-100), var(--cream-200));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* ═══════════════════════════════════════════
   REFLECTION CARDS
═══════════════════════════════════════════ */
.ref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}

.ref-card {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.ref-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.ref-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--c, linear-gradient(90deg, var(--peach-500), var(--terra-600)));
}

.ref-card-deco {
  position: absolute;
  font-size: 120px;
  opacity: 0.05;
  top: 16px;
  right: -10px;
  pointer-events: none;
  line-height: 1;
}

.ref-ic {
  width: 56px; height: 56px;
  background: var(--c-bg, linear-gradient(135deg, var(--peach-200), var(--peach-400)));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(15, 157, 138, 0.2);
}

.ref-t {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 12px;
  line-height: 1.35;
}

.ref-d {
  font-size: 14px;
  color: var(--ink-500);
  line-height: 1.9;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   SECURITY LIST
═══════════════════════════════════════════ */
.sec-list { display: grid; gap: 12px; margin: 20px 0; }

.sec {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 18px 22px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--cream-200);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  align-items: flex-start;
}

.sec:hover {
  transform: translateX(4px);
  border-color: var(--peach-300);
  box-shadow: var(--shadow);
}

.sec-i {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--cream-100), var(--peach-100));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sec-t {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.sec-d {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════
   HIGHLIGHT BAND
═══════════════════════════════════════════ */
.hl-band {
  background: linear-gradient(135deg, var(--peach-400), var(--terra-600));
  color: white;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 12px 36px rgba(15, 157, 138, 0.25);
  position: relative;
  overflow: hidden;
}

.hl-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hl-band .ic { font-size: 36px; flex-shrink: 0; position: relative; z-index: 1; }
.hl-band p { font-size: 15.5px; line-height: 1.7; font-weight: 400; position: relative; z-index: 1; }
.hl-band strong { font-weight: 800; }

/* ═══════════════════════════════════════════
   DIVIDER
═══════════════════════════════════════════ */
.div {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cream-300), transparent);
  margin: 40px 0;
}

/* ═══════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════ */
#lb {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}

#lb.open { display: flex; }

#lb-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

#lb-cap {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
}

#lb-close, .lb-nav {
  position: fixed;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}

#lb-close {
  top: 24px; right: 32px;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lb-nav {
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 300;
}

#lb-prev { left: 24px; }
#lb-next { right: 24px; }

#lb-close:hover, .lb-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

.page.active .hero,
.page.active .content > *,
.page.active .home-projects {
  animation: fadeUp 0.5s ease both;
}

.page.active .content > *:nth-child(2) { animation-delay: 0.05s; }
.page.active .content > *:nth-child(3) { animation-delay: 0.1s; }
.page.active .content > *:nth-child(4) { animation-delay: 0.15s; }

/* Floating back to top */
#fab {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(15, 157, 138, 0.35);
  z-index: 150;
  transition: transform 0.2s;
}

#fab:hover { transform: translateY(-2px) scale(1.05); }
#fab.show { display: flex; }


/* ═══════════════════════════════════════════
   INTERACTIVE RAG DEMO STYLES
   (mimics user's actual Error Code system UI)
═══════════════════════════════════════════ */

.rag-banner {
  background: linear-gradient(135deg, #F0FAF8 0%, #E3F4F1 50%, #BFE8E0 100%);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid var(--peach-200);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.rag-banner::before {
  content: '';
  position: absolute;
  right: -50px; top: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(15, 157, 138, 0.18), transparent 70%);
  pointer-events: none;
}

.rag-banner-ic {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--peach-400), var(--terra-600));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(15, 157, 138, 0.25);
}

.rag-banner-c {
  flex: 1;
  position: relative;
  z-index: 1;
}

.rag-banner-t {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.rag-banner-s {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.6;
}

/* ── RAG INTERFACE (like the user's actual system) ── */
.rag-app {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 24px 0;
}

.rag-header {
  background: linear-gradient(135deg, #F7FAF9, #EEF5F3);
  padding: 24px 28px;
  border-bottom: 1px solid var(--cream-200);
  text-align: center;
}

.rag-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.rag-header p {
  font-size: 13px;
  color: var(--ink-500);
}

.rag-lang {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--cream-50);
  border-bottom: 1px solid var(--cream-200);
}

.rag-lang-btn {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid var(--cream-300);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rag-lang-btn:hover {
  border-color: var(--peach-400);
  color: var(--terra-600);
}

.rag-lang-btn.active {
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  border-color: var(--terra-600);
  color: white;
  box-shadow: 0 4px 12px rgba(15, 157, 138, 0.3);
}

.rag-messages {
  padding: 24px 28px;
  min-height: 360px;
  max-height: 540px;
  overflow-y: auto;
  background: linear-gradient(180deg, #FFFFFF, white);
}

.rag-welcome {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
  background: linear-gradient(135deg, var(--cream-100), white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-200);
}

.rag-welcome-ic {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--peach-300), var(--terra-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.rag-welcome h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 6px;
}

.rag-welcome p {
  font-size: 13.5px;
  color: var(--ink-500);
  line-height: 1.75;
  margin-bottom: 8px;
}

.rag-welcome ul {
  margin: 8px 0;
  padding-left: 18px;
}

.rag-welcome li {
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.85;
  font-family: var(--mono);
}

.rag-welcome .hint {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(15, 157, 138, 0.08);
  border-radius: 8px;
  font-size: 12px;
  color: var(--terra-700);
  display: inline-block;
  font-weight: 600;
}

/* User message */
.rag-msg-user {
  display: flex;
  justify-content: flex-end;
  margin: 20px 0 12px;
}

.rag-msg-user-bubble {
  max-width: 70%;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(15, 157, 138, 0.25);
}

/* AI message */
.rag-msg-ai {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  align-items: flex-start;
}

.rag-msg-ai-av {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--peach-300), var(--terra-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.rag-msg-ai-c {
  flex: 1;
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: 4px 18px 18px 18px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}

.rag-msg-ai-c h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rag-msg-ai-c .badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--cream-200);
  color: var(--terra-600);
  font-weight: 700;
}

.rag-msg-ai-c p {
  font-size: 13px;
  color: var(--ink-700);
  line-height: 1.75;
  margin-bottom: 12px;
}

.rag-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.rag-row {
  display: grid;
  grid-template-columns: 28px 80px 1fr 50px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--cream-50);
  border-radius: 8px;
  border: 1px solid var(--cream-200);
  font-size: 12.5px;
  transition: all 0.2s;
  cursor: pointer;
}

.rag-row:hover {
  background: white;
  border-color: var(--peach-400);
  transform: translateX(4px);
}

.rag-row-rank {
  font-weight: 700;
  color: var(--ink-300);
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
}

.rag-row-code {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--terra-700);
  font-size: 12px;
}

.rag-row-desc {
  color: var(--ink-700);
  line-height: 1.5;
}

.rag-row-score {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  text-align: right;
}

.rag-ai-tip {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #F0FAF8, white);
  border: 1px solid var(--peach-200);
  border-radius: 10px;
  border-left: 3px solid var(--peach-500);
}

.rag-ai-tip-l {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra-600);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rag-ai-tip p {
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.75;
  margin: 0;
}

/* Quick hints */
.rag-input-area {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--cream-200);
  background: var(--cream-50);
}

.rag-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.rag-hint {
  padding: 7px 13px;
  background: white;
  border: 1px solid var(--cream-300);
  border-radius: 100px;
  font-size: 12px;
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rag-hint:hover {
  background: linear-gradient(135deg, var(--peach-100), white);
  border-color: var(--peach-400);
  color: var(--terra-700);
  transform: translateY(-1px);
}

.rag-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.rag-input {
  flex: 1;
  border: 1px solid var(--cream-300);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  background: white;
  color: var(--ink-900);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  max-height: 100px;
}

.rag-input:focus {
  border-color: var(--peach-500);
  box-shadow: 0 0 0 3px rgba(15, 157, 138, 0.15);
}

.rag-send {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 6px 16px rgba(15, 157, 138, 0.3);
  flex-shrink: 0;
}

.rag-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 157, 138, 0.4);
}

.rag-send:active { transform: scale(0.95); }

.rag-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 18px;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--cream-200);
}

.rag-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--peach-400);
  animation: typing 1.4s infinite;
}

.rag-typing span:nth-child(2) { animation-delay: 0.15s; }
.rag-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.rag-note {
  text-align: center;
  font-size: 11px;
  color: var(--ink-300);
  padding: 12px;
  background: var(--cream-100);
  border-top: 1px solid var(--cream-200);
}

.rag-note strong { color: var(--terra-600); }

/* ═══════════════════════════════════════════
   INTERACTIVE BORROW DEMO (Project 3)
═══════════════════════════════════════════ */
.borrow-demo {
  background: white;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.borrow-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--cream-100);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.borrow-step {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-300);
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
}

.borrow-step.done {
  color: var(--terra-700);
}

.borrow-step.active {
  background: linear-gradient(135deg, var(--peach-500), var(--terra-600));
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 157, 138, 0.25);
}

.borrow-step-num {
  display: inline-block;
  width: 18px; height: 18px;
  background: var(--cream-200);
  color: var(--ink-500);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
  line-height: 18px;
}

.borrow-step.done .borrow-step-num {
  background: var(--green);
  color: white;
}

.borrow-step.active .borrow-step-num {
  background: white;
  color: var(--terra-600);
}

.borrow-stage { display: none; padding: 16px 4px 4px; }
.borrow-stage.active { display: block; animation: fadeUp 0.4s ease; }

.borrow-stage h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
}

.borrow-stage p {
  font-size: 13.5px;
  color: var(--ink-500);
  line-height: 1.8;
  margin-bottom: 14px;
}

.borrow-mock {
  background: var(--cream-50);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 12px;
}

.borrow-mock-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.borrow-mock-row .l {
  color: var(--ink-300);
  font-weight: 600;
  font-size: 12px;
}

.borrow-mock-row .v {
  color: var(--ink-900);
  font-weight: 500;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.status-badge.g { background: #DCFCE7; color: #166534; }
.status-badge.r { background: #FEE2E2; color: #991B1B; }
.status-badge.y { background: #FEF3C7; color: #92400E; }
