/* ============================================================
   sinbow.org — 样式表
   无外部依赖、无构建步骤，纯 CSS。
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
                "Songti SC", "Noto Serif SC", serif;

  --maxw: 1080px;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --bg: #0e0f11;
  --bg-soft: #14161a;
  --surface: #171a1f;
  --surface-hover: #1d2127;
  --border: #262a31;
  --border-strong: #343a44;
  --text: #e9eaee;
  --text-soft: #b6bac2;
  --muted: #828893;
  --accent: #e29a7c;
  --accent-soft: rgba(226, 154, 124, 0.14);
  --accent-line: rgba(226, 154, 124, 0.32);

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #faf9f7;
  --bg-soft: #f3f1ed;
  --surface: #ffffff;
  --surface-hover: #fdfbf8;
  --border: #e4e0d9;
  --border-strong: #d2ccc2;
  --text: #1b1a18;
  --text-soft: #4a4741;
  --muted: #7a756c;
  --accent: #b8593a;
  --accent-soft: rgba(184, 89, 58, 0.10);
  --accent-line: rgba(184, 89, 58, 0.28);

  color-scheme: light;
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

::selection {
  background: var(--accent);
  color: #0e0f11;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 16px;
  padding: 10px 18px;
  background: var(--accent);
  color: #0e0f11;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus {
  left: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  z-index: -1;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-scrolled::before {
  border-bottom-color: var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #0e0f11;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 2px;
}

.brand-text { font-size: 15px; }

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--text);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

/* 主题切换按钮 */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 4px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

/* 深色模式显示太阳（点击切到浅色），浅色模式显示月亮 */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 28px 120px;
  /* 装饰性光晕会超出容器，clip 掉避免撑大文档宽度 */
  overflow-x: clip;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.6s var(--ease) infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-line); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  margin: 0 0 28px;
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 12vw, 7.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, var(--text) 30%, var(--muted) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}

.hero-lead {
  max-width: 34em;
  margin: 0 0 38px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 550;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #14100e;
  box-shadow: 0 8px 24px -12px var(--accent);
}
.btn-primary:hover { box-shadow: 0 14px 30px -14px var(--accent); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text-soft);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--muted);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 620px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
  list-style: none;
}

.hero-meta li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--bg);
}

.meta-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta-value {
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.hero-glow {
  position: absolute;
  top: -180px;
  right: -220px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 62%);
  opacity: 0.16;
  filter: blur(48px);
  pointer-events: none;
  animation: drift 22s var(--ease) infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-40px, 50px, 0) scale(1.08); }
}

/* ---------- 通用 section ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 28px;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
}

.section-num {
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-intro {
  max-width: 46em;
  margin: -24px 0 40px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.about-copy p {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 1.3vw, 1.06rem);
  line-height: 1.85;
}

.about-copy p:last-child { margin-bottom: 0; }

.about-facts {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.facts-title {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-facts dl { margin: 0; }

.fact {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.fact:first-child {
  padding-top: 0;
  border-top: 0;
}

.fact dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.fact dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 项目 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  background: var(--surface);
}

.project-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.project-card h3 {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-arrow {
  color: var(--muted);
  font-size: 15px;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}

.project-card:hover .project-arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

.project-card p {
  flex: 1;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

/* ---------- 联系 ---------- */
.contact-card {
  padding: 44px 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--bg-soft);
}

.contact-lead {
  margin: 0 0 22px;
  max-width: 34em;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
}

.contact-mail {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4.2vw, 2.4rem);
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 3px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.contact-mail:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13.5px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease);
}

.social a:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 28px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-footer p { margin: 0; }
.footer-meta { font-size: 12px; opacity: 0.75; }

/* ---------- 加载动画 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    animation: rise 0.9s var(--ease) both;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-inner > *:nth-child(2) { animation-delay: 0.13s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.21s; }
  .hero-inner > *:nth-child(4) { animation-delay: 0.29s; }
  .hero-inner > *:nth-child(5) { animation-delay: 0.37s; }

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

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
  .hero { padding: 72px 24px 88px; }
  .section { padding: 60px 24px; }
  .site-header { padding: 16px 24px; }
  .site-footer { padding: 30px 24px 40px; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .hero-meta { grid-template-columns: minmax(0, 1fr); }
  .contact-card { padding: 32px 24px; border-radius: 16px; }
  .hero-glow { width: 420px; height: 420px; top: -120px; right: -160px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
