/* ============================================
   Hand-Drawn Design System
   手工草图风格 — 不规则/纸质感/硬阴影/手写体
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Patrick+Hand&family=Ma+Shan+Zheng&display=swap');

/* -------- Design Tokens -------- */
:root {
  --color-paper:        #fdfbf7;
  --color-pencil:       #2d2d2d;
  --color-muted:        #e5e0d8;
  --color-accent:       #ff4d4d;
  --color-accent2:      #2d5da1;
  --color-postit:       #fff9c4;
  --color-tape:         rgba(180,170,150,0.35);
  --color-white:        #ffffff;
  --font-heading:       'Kalam', 'Ma Shan Zheng', cursive;
  --font-body:          'Patrick Hand', 'Ma Shan Zheng', cursive;
  --shadow-hard:        4px 4px 0px 0px var(--color-pencil);
  --shadow-hard-lg:     8px 8px 0px 0px var(--color-pencil);
  --shadow-subtle:      3px 3px 0px 0px rgba(45,45,45,0.10);
  --wobbly-sm:          255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobbly-md:          30px 70px 50px 80px / 80px 40px 70px 30px;
  --wobbly-lg:          40px 90px 60px 100px / 100px 50px 90px 40px;
  --max-width:          1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-pencil);
  background-color: var(--color-paper);
  background-image: radial-gradient(var(--color-muted) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--color-accent);
  color: var(--color-white);
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* -------- Typography -------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: 3.5rem; font-weight: 700; }
h2 { font-size: 2.4rem; font-weight: 700; }
h3 { font-size: 1.6rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 400; }

/* -------- Utility Classes -------- */
.wobbly      { border-radius: var(--wobbly-sm); }
.wobbly-md   { border-radius: var(--wobbly-md); }
.wobbly-lg   { border-radius: var(--wobbly-lg); }
.shadow-hard   { box-shadow: var(--shadow-hard); }
.shadow-subtle { box-shadow: var(--shadow-subtle); }
.dashed       { border-style: dashed !important; }
.rotate-1     { transform: rotate(1deg); }
.rotate-2     { transform: rotate(2deg); }
.-rotate-1    { transform: rotate(-1deg); }
.-rotate-2    { transform: rotate(-2deg); }
.text-accent  { color: var(--color-accent); }
.text-blue    { color: var(--color-accent2); }

/* -------- NAV -------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(253,251,247,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--color-pencil);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav .logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-pencil);
  padding: 0.25rem 0;
  position: relative;
}
nav .logo::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--color-pencil) 0, var(--color-pencil) 6px, transparent 6px, transparent 12px);
  opacity: 0;
  transition: opacity 0.2s;
}
nav .logo:hover::after { opacity: 1; }

nav ul { display: flex; gap: 0.25rem; }

nav a {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
  color: var(--color-pencil);
  border-radius: var(--wobbly-sm);
  transition: all 0.15s ease;
}
nav a:hover {
  background: var(--color-muted);
  transform: rotate(-1deg);
}
nav a.active {
  background: var(--color-pencil);
  color: var(--color-paper);
}

@media (max-width: 768px) {
  nav { padding: 0.6rem 1rem; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
  nav ul { gap: 0.15rem; flex-wrap: wrap; justify-content: center; }
  nav a { font-size: 0.85rem; padding: 0.3rem 0.6rem; }
}

/* -------- CONTAINER -------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

/* -------- BUTTONS -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 400;
  padding: 0.7rem 2rem;
  border-radius: var(--wobbly-md);
  border: 3px solid var(--color-pencil);
  background: var(--color-white);
  color: var(--color-pencil);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
}
.btn:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  box-shadow: 2px 2px 0px 0px var(--color-pencil);
  transform: translate(2px, 2px);
}
.btn:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.btn--blue:hover {
  background: var(--color-accent2);
  border-color: var(--color-accent2);
}

.btn--muted {
  background: var(--color-muted);
}

/* -------- HERO -------- */
.hero {
  text-align: center;
  padding: 3rem 1rem 4rem;
  position: relative;
}

.hero .avatar {
  width: 150px;
  height: 150px;
  margin: 0 auto 2rem;
  border-radius: var(--wobbly-md);
  border: 3px solid var(--color-pencil);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  background: var(--color-muted);
}
.hero .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  font-size: 3.8rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.hero h1::after {
  content: '';
  position: absolute;
  left: -10px; right: -10px;
  bottom: 6px;
  height: 10px;
  background: var(--color-postit);
  z-index: -1;
  border-radius: var(--wobbly-sm);
  opacity: 0.7;
}

.hero .hero-sub {
  font-size: 1.2rem;
  color: rgba(45,45,45,0.65);
  max-width: 500px;
  margin: 0 auto 2rem;
}

.hero .hero-doodle {
  display: inline-block;
  margin-top: 1rem;
  font-size: 2.5rem;
  animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* -------- CARDS -------- */
.card {
  background: var(--color-white);
  border: 2px solid var(--color-pencil);
  border-radius: var(--wobbly-md);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-subtle);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: rotate(-0.5deg);
  box-shadow: 6px 6px 0px 0px rgba(45,45,45,0.08);
}

.card h2 {
  font-size: 2rem;
  margin-bottom: 1.2rem;
  position: relative;
  display: inline-block;
}
.card h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 5px;
  background: var(--color-postit);
  opacity: 0.6;
  border-radius: 2px;
}

.card p { margin-bottom: 0.8rem; }

.card ul { padding-left: 1.5rem; }
.card li {
  position: relative;
  padding: 0.35rem 0;
  padding-left: 1.5rem;
}
.card li::before {
  content: '✎';
  position: absolute;
  left: 0;
  top: 0.35rem;
  font-size: 0.9rem;
  color: var(--color-accent);
}

/* Card variants */
.card--postit {
  background: var(--color-postit);
  border-color: var(--color-pencil);
  transform: rotate(1deg);
}
.card--postit:hover {
  transform: rotate(-0.5deg);
}

.card--dashed {
  border-style: dashed;
  border-width: 2px;
}

/* Tape decoration */
.card--tape::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 80px;
  height: 26px;
  background: var(--color-tape);
  border-radius: 2px;
}

/* Thumbtack decoration */
.card--tack::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 1px 1px 0 var(--color-pencil);
}

/* -------- GRID CARDS (dream page, etc.) -------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card-grid .card {
  margin-bottom: 0;
}

.card-grid .card .number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  color: rgba(45,45,45,0.12);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* -------- PAGE TITLE -------- */
.page-title {
  text-align: center;
  margin-bottom: 3rem;
}
.page-title h1 {
  display: inline-block;
  position: relative;
}
.page-title h1::after {
  content: '';
  position: absolute;
  left: -8px; right: -8px;
  bottom: 4px;
  height: 8px;
  background: var(--color-postit);
  z-index: -1;
  opacity: 0.7;
  border-radius: var(--wobbly-sm);
}
.page-title p {
  font-size: 1.15rem;
  color: rgba(45,45,45,0.6);
  margin-top: 0.5rem;
}

/* -------- GALLERY -------- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}
.gallery-item {
  text-align: center;
}
.gallery-item a {
  display: block;
  border-radius: var(--wobbly-sm);
  border: 2px solid var(--color-pencil);
  overflow: hidden;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-hard);
}
.gallery-item a:hover {
  transform: rotate(-2deg) translateY(-4px);
}
.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}
.image-caption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: rgba(45,45,45,0.55);
}

/* -------- ARROW DECORATION -------- */
.arrow-down {
  display: inline-block;
  margin: 1rem 0;
  font-size: 2rem;
  color: var(--color-accent);
}

/* -------- BACK HOME BUTTON -------- */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.6rem 1.8rem;
  border-radius: var(--wobbly-md);
  border: 3px solid var(--color-pencil);
  background: var(--color-white);
  color: var(--color-pencil);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
}
.back-home:hover {
  background: var(--color-pencil);
  color: var(--color-paper);
  box-shadow: 2px 2px 0px 0px var(--color-pencil);
  transform: translate(2px, 2px);
}
.back-home:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

/* -------- DREAM CARDS (legacy compat) -------- */
.dream-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.dream-card {
  background: var(--color-white);
  border: 2px solid var(--color-pencil);
  border-radius: var(--wobbly-md);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s ease;
}
.dream-card:nth-child(1) { transform: rotate(-0.8deg); }
.dream-card:nth-child(2) { transform: rotate(0.5deg); }
.dream-card:nth-child(3) { transform: rotate(-0.3deg); }
.dream-card:nth-child(4) { transform: rotate(1deg); }
.dream-card:hover {
  transform: rotate(0deg) translateY(-4px) !important;
  box-shadow: var(--shadow-hard);
}
.dream-card .number {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: rgba(45,45,45,0.1);
  line-height: 1;
}
.dream-card h3 {
  font-size: 1.4rem;
  margin: 0.5rem 0;
}
.dream-card p {
  color: rgba(45,45,45,0.65);
}

/* -------- TIMELINE (education) -------- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(180deg,
    var(--color-pencil) 0, var(--color-pencil) 8px,
    transparent 8px, transparent 16px);
}
.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 0.4rem;
  width: 14px; height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-pencil);
}

/* -------- FOOTER -------- */
footer {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(45,45,45,0.4);
  font-size: 0.9rem;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.8rem; }
  .container { padding: 5rem 1rem 3rem; }
  .image-gallery { grid-template-columns: 1fr 1fr; }
  .card { padding: 1.5rem; }
  .btn, .back-home { font-size: 1rem; padding: 0.6rem 1.5rem; }
}
