/* =====================================================================
   Madeline Studio — 全局样式
   ---------------------------------------------------------------------
   调色板（如需改配色，改这里即可）：
   - --ink-*    : 深色文字 / 背景
   - --accent   : 主强调色（按钮 hover、链接高亮）
   - 字体在下方 @import 里，默认用 Inter（干净的无衬线）
   ===================================================================== */

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

:root {
  --ink-900: #0f1115;      /* 最深背景 */
  --ink-800: #16191f;
  --ink-700: #1f232b;
  --ink-600: #262b34;
  --text-0:  #f4f5f7;      /* 主文字(浅色，用在深色背景上) */
  --text-75: rgba(244, 245, 247, 0.78);
  --text-50: rgba(244, 245, 247, 0.55);
  --accent:  #4f8cff;      /* 主强调色 */
  --accent-soft: rgba(79, 140, 255, 0.14);
  --radius:  14px;
  --nav-h:   72px;
  --font:    'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text-0);
  background: var(--ink-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

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

/* =====================================================================
   顶部导航栏（左侧 logo，中间药丸导航，右侧 Contacts）
   ===================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
  transition: background-color .3s ease, box-shadow .3s ease;
}

/* 滚动后给导航一个深色底，避免背景图太浅时看不清文字 */
.navbar.solid {
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ------ 左侧：文字 Logo（MADELINE） ------ */
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--text-0);
  white-space: nowrap;
}
/* 给 MADELINE 加一点可选的强调色点缀，不喜欢可删掉下面两条 */
.brand span { color: var(--accent); }

/* ------ 中间：药丸导航（Home / Products） ------ */
.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(244, 245, 247, 0.08);
  border: 1px solid rgba(244, 245, 247, 0.10);
  border-radius: 999px;
  padding: 5px;
}

.nav-center > a,
.nav-item > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-0);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: background-color .2s ease, color .2s ease;
}
.nav-center > a:hover,
.nav-item > button:hover,
.nav-item.open > button {
  background: rgba(244, 245, 247, 0.14);
}
.nav-center > a.active,
.nav-item > button.active {
  background: var(--text-0);
  color: var(--ink-900);
}

/* Products 下拉：点开显示 AI Engineering / Quant Investment */
.nav-item { position: relative; }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  background: var(--ink-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.nav-item.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-75);
  transition: background-color .2s ease, color .2s ease;
}
.dropdown a:hover {
  background: var(--accent-soft);
  color: var(--text-0);
}
.dropdown a small {
  display: block;
  font-size: 12px;
  color: var(--text-50);
  margin-top: 1px;
}

/* ------ 右侧：Contacts ------ */
.nav-right a {
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  color: var(--text-0);
  opacity: .9;
  transition: opacity .2s ease;
}
.nav-right a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

/* ------ 移动端汉堡按钮（<=900px 显示） ------ */
/* ------ 移动端汉堡按钮（<=900px 显示）
   默认在导航右侧。想让它居中 + 往下一点，用下面的 transform。 ------ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 0 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  /* 右上角：垂直居中于导航栏，与左上角 logo 同一水平线 */
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}
.hamburger span {
  height: 2px;
  background: var(--text-0);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================================
   Landing 页首屏
   背景：桌面端用 pic/lake_horizontal.jpg；手机端自动换成 lake_vertical.jpg
   ===================================================================== */
.hero {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  overflow: hidden;
  isolation: isolate;   /* 建立层叠上下文，让 .hero-bg 的 z-index:-1 不会被 body 背景盖住 */
}

/* 背景图 + 压暗渐变，让白色文字读得清。
   如果觉得图片不够亮 / 太暗，改下面这组 rgba 透明度：
   数值越大越暗，越小越亮。 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to bottom,
      rgba(15, 17, 21, 0.35) 0%,
      rgba(15, 17, 21, 0.15) 40%,
      rgba(15, 17, 21, 0.50) 100%),
    url('../pic/lake_horizontal.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* 手机端：竖版湖景图更合适 */
@media (max-width: 768px) {
  .hero-bg { background-image:
    linear-gradient(to bottom,
      rgba(15, 17, 21, 0.35) 0%,
      rgba(15, 17, 21, 0.15) 40%,
      rgba(15, 17, 21, 0.50) 100%),
    url('../pic/lake_vertical.jpg');
  }
}

/* 首屏主体内容（这里是“About me 介绍”预留区，见 index.html 注释） */
.hero-content {
  max-width: 760px;
  animation: rise .7s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-50);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.hero p.sub {
  font-size: clamp(16px, 2.2vw, 21px);
  color: var(--text-75);
  max-width: 560px;
  margin: 0 auto 34px;
}

/* 首屏 CTA 按键（“Learn More”） */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-primary { background: var(--text-0); color: var(--ink-900); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
.btn-accent  { background: var(--accent); color: #fff; }
.btn-accent:hover  { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 140, 255, 0.35); }
.btn-ghost   { background: transparent; color: var(--text-0); border: 1px solid rgba(244, 245, 247, 0.35); }
.btn-ghost:hover { background: rgba(244, 245, 247, 0.10); }

/* 让 CTA 排成一排，可换行 */
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* =====================================================================
   内页通用内容区（Products / Contacts / 子页面）
   ===================================================================== */
.page {
  flex: 1;
  padding: calc(var(--nav-h) + 56px) 32px 80px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;            /* 让内容盖在背景之上 */
}

/* 子页面背景也用湖景图（叠加暗色渐变保证文字可读）。
   想取消子页湖景背景，把下面 .page-bg 的 display 改成 none。 */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;            /* 在 content 之下、导航(100)之下 */
  background-image:
    linear-gradient(to bottom,
      rgba(15, 17, 21, 0.82) 0%,
      rgba(15, 17, 21, 0.68) 40%,
      rgba(15, 17, 21, 0.85) 100%),
    url('../pic/lake_horizontal.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
@media (max-width: 768px) {
  .page-bg { background-image:
    linear-gradient(to bottom,
      rgba(15, 17, 21, 0.82) 0%,
      rgba(15, 17, 21, 0.68) 40%,
      rgba(15, 17, 21, 0.85) 100%),
    url('../pic/lake_vertical.jpg');
  }
}
.page-head { margin-bottom: 40px; }
.page-head .hero-eyebrow { margin-bottom: 10px; }
.page-head h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -1px; }
.page-head p { color: var(--text-75); max-width: 640px; margin-top: 12px; }

/* 卡片网格（Products 页两个子项） */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.card {
  background: linear-gradient(160deg, var(--ink-800), var(--ink-700));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(79, 140, 255, 0.4); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.card .card-icon { font-size: 30px; }
.card h3 { font-size: 22px; font-weight: 700; }
.card p { color: var(--text-75); font-size: 15px; flex: 1; }
.card .btn { align-self: flex-start; margin-top: 4px; }

/* 单栏介绍（AI Engineering / Quant Investment 子页面） */
.prose { max-width: 760px; }
.prose + .prose { margin-top: 28px; }
.prose h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.prose p  { color: var(--text-75); margin-bottom: 18px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

/* =====================================================================
   Footer（初版：左 Tel/Email · 中 Address · 右 LinkedIn + 版权）
   ===================================================================== */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ink-800);
  padding: 40px 32px 32px;
}
.footer-grid {
  max-width: 1080px;
  margin: auto;
  display: flex;          /* Contact/Address 注释掉后只剩一栏，靠右显示 */
  justify-content: flex-end;
  gap: 32px;
  align-items: flex-start;
  text-align: right;
}
.footer-col label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-50);
  margin-bottom: 6px;
}
.footer-col p { font-size: 15px; color: var(--text-75); }

/* 右侧一栏：仅 LinkedIn 图标 + 版权，靠右对齐 */
.footer-col.right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.socials { display: flex; gap: 10px; }
.socials a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-75);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.socials a svg { width: 18px; height: 18px; }
.copyright { font-size: 13px; color: var(--text-50); }


/* =====================================================================
   移动端适配
   ===================================================================== */

/* 移动折叠菜单：默认隐藏（否则桌面上会露出堆叠的链接） */
.mobile-menu { display: none; }

@media (max-width: 900px) {
  .nav-center,
  .nav-right { display: none; }

  /* 展开的移动面板 */
  .hamburger { display: flex; }

  .mobile-menu {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--ink-800);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 24px 24px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 99;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu > a,
  .mobile-menu .m-sub {
    padding: 12px 8px;
    font-size: 17px;
    font-weight: 500;
    border-radius: 10px;
    color: var(--text-0);
  }
  .mobile-menu > a:hover { background: rgba(244, 245, 247, 0.07); }
  .mobile-menu .m-sub { display: flex; flex-direction: column; gap: 2px; }
  .mobile-menu .m-sub > span { padding: 12px 8px; font-weight: 500; font-size: 17px; }
  .mobile-menu .m-sub a { padding: 8px 8px 8px 22px; font-size: 15px; color: var(--text-75); }
  .mobile-menu .m-sub a:hover { color: var(--text-0); }

  .page { padding-left: 20px; padding-right: 20px; }

  /* footer 改上下堆叠 */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-col.right { align-items: flex-end; }
}
