/* ============================================
   kakuoluo — Translucent Glass Aesthetic
   极简透明玻璃球美学 · 干净无衬线字体
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600&family=Ma+Shan+Zheng&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --bg: #f4f3f0;
  --bg-glow-1: #e8e6e0;
  --bg-glow-2: #f0eee9;
  --sphere-tint: rgba(220, 225, 235, 0.4);
  --iridescent-1: rgba(180, 190, 220, 0.15);
  --iridescent-2: rgba(200, 180, 210, 0.1);
  --iridescent-3: rgba(170, 200, 200, 0.08);
  --text: #1a1a1a;
  --text-2: #555555;
  --text-3: #999999;
  --text-4: #cccccc;
  --line: rgba(0, 0, 0, 0.06);
  --line-2: rgba(0, 0, 0, 0.1);
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --container: 1600px;
}

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* 固定背景层 — position:fixed 替代 background-attachment:fixed（iOS Safari 兼容） */
.bg-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/images/bg-sphere.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -1;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* --- Glass Sphere Background (on html element) --- */
.bg-sphere, .bg-glow-1, .bg-glow-2, .bg-grain {
  display: none;
}

/* --- 星光累积层：全屏 Canvas --- */
.starlight-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 24px 0;
  background: rgba(244, 243, 240, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: padding 0.4s var(--ease);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.3s var(--ease);
}

.nav-links a:hover { color: var(--text); }

/* --- Hero: 三层叠加结构 --- */
.hero {
  min-height: 100vh;
  height: 100vh;
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
}

/* Layer 2: "日常·造物" — 融入背景球体，居中在 kakuoluo 后方 */
.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  width: 100%;
  text-align: center;
}

.hero-bg-text-inner {
  font-family: 'Ma Shan Zheng', cursive;
  font-size: clamp(5rem, 17vw, 17rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text-2);
  opacity: 0.28;
  letter-spacing: 0.08em;
  white-space: nowrap;
  filter: blur(1px);
  display: inline-block;
}

/* Bit&Pieces — 页面上方 25% 位置 */
.hero-top {
  position: absolute;
  top: 22%;
  left: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-label {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.6;
  opacity: 0.7;
}

.hero-label-right {
  display: none;
}

/* kakuoluo — 页面正中央，略偏下 */
.hero-center {
  position: absolute;
  top: 55%;
  left: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-title {
  font-size: clamp(3.5rem, 15vw, 15rem);
  font-weight: 500;
  line-height: 0.82;
  letter-spacing: -0.055em;
  color: var(--text);
  margin: 0;
  text-align: center;
  width: 100%;
}

.hero-desc {
  display: none;
}

.hero-desc:hover {
  opacity: 0.25;
  filter: blur(0);
}

.hero-bottom {
  position: absolute;
  bottom: 5vh;
  left: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-meta-item {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.8;
}

.hero-scroll-hint {
  display: none;
}

.hero-scroll-line {
  width: 40px;
  height: 1px;
  background: var(--text-4);
  animation: scrollLine 2s var(--ease) infinite;
}

@keyframes scrollLine {
  0% { transform: scaleX(0.3); transform-origin: left; }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0.3); transform-origin: right; }
}

.hero-meta-item strong {
  color: var(--text);
  font-weight: 500;
}

/* --- Section --- */
.section {
  min-height: 100vh;
  height: 100vh;
  padding: 80px 0;
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}

/* 哈喽 哈喽 — 圆润正式体 */
.section-title-hello {
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.section-count {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
}

/* --- Works Grid (16:9 宽幅作品网格) --- */
.works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.work {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
  background: var(--bg-glow-2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.work-image-inner {
  width: 100%;
  height: 100%;
  transition: transform 1.2s var(--ease);
}

.work:hover .work-image-inner {
  transform: scale(1.04);
}

/* Glass-like gradient tiles */
.work-glass-1 {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.8) 0%, transparent 50%),
    linear-gradient(135deg, #e8e6e0 0%, #d8d6d0 40%, #cccacf 70%, #d4cdd5 100%);
}
.work-glass-2 {
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.7) 0%, transparent 45%),
    linear-gradient(135deg, #e0dee8 0%, #c8c4d4 40%, #bbb8c8 70%, #c4bed0 100%);
}
.work-glass-3 {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.75) 0%, transparent 50%),
    linear-gradient(135deg, #ebe9e3 0%, #dcd9d1 40%, #cfc9c3 70%, #d0ccc4 100%);
}
.work-glass-4 {
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.7) 0%, transparent 45%),
    linear-gradient(135deg, #e4e2ec 0%, #cccad8 40%, #bebcd0 70%, #c8c0d4 100%);
}
.work-glass-5 {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.8) 0%, transparent 50%),
    linear-gradient(135deg, #eae8e2 0%, #dad8d0 40%, #ccc8be 70%, #d2cec4 100%);
}
.work-glass-6 {
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.7) 0%, transparent 45%),
    linear-gradient(135deg, #e2e0ea 0%, #cac6d6 40%, #b8b4c8 70%, #c4bccf 100%);
}

.work-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.work-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
}

.work-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- 合作介绍 --- */
.about-section {
  border-top: 1px solid var(--line);
}

.about-content {
  max-width: 720px;
  margin-top: 60px;
}

.about-services {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 36px;
}

.about-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 2;
  color: var(--text-2);
  margin-bottom: 28px;
}

.about-sincerity {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

/* --- 絮语 & 联系 (第三屏) --- */
.message-section {
  border-top: 1px solid var(--line);
}

.message-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: start;
}

.message-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 24px;
}

.contact-wrap {
  border-left: 1px solid var(--line);
  padding-left: 48px;
}

/* --- 絮语区 --- */
.starlight-zone {
  position: relative;
}

.starlight-intro {
  margin-bottom: 32px;
}

.starlight-hint {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-3);
  line-height: 2;
  letter-spacing: 0.05em;
}

/* 留言区 — 轻盈无框感 */
.starlight-bottle {
  position: relative;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  transition: border-color 0.6s var(--ease);
  overflow: visible;
}

.starlight-bottle::before {
  display: none;
}

.starlight-bottle:focus-within {
  border-bottom-color: var(--text-faint, #cccccc);
  box-shadow: none;
}

.starlight-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 200;
  color: var(--text);
  line-height: 2;
  min-height: 72px;
  max-height: 200px;
  letter-spacing: 0.02em;
}

.starlight-textarea::placeholder {
  color: var(--text-4);
  font-weight: 200;
}

.starlight-count {
  margin-top: 8px;
  text-align: right;
  font-size: 10px;
  color: var(--text-4);
  font-weight: 300;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* 寄出按钮 — 极简文字风格 */
.starlight-send {
  margin-top: 24px;
  padding: 8px 0;
  background: transparent;
  color: var(--text-2);
  border: none;
  border-radius: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: color 0.4s var(--ease), letter-spacing 0.4s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: visible;
}

.starlight-send::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-2);
  transition: width 0.5s var(--ease);
}

.starlight-send:hover {
  color: var(--text);
  letter-spacing: 0.2em;
}

.starlight-send:hover::after {
  width: 100%;
}

.starlight-send:active {
  color: var(--text-3);
}

.starlight-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.starlight-send-icon {
  transition: transform 0.5s var(--ease);
}

.starlight-send:hover .starlight-send-icon {
  transform: translateX(6px);
}

/* 寄出结果 — 含蓄淡入 */
.starlight-result {
  margin-top: 24px;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 200;
  color: var(--text-3);
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.8s var(--ease);
  pointer-events: none;
  letter-spacing: 0.05em;
  line-height: 1.8;
}

.starlight-result.show {
  opacity: 1;
  transform: translateY(0);
}

.starlight-result::before {
  display: none;
}

/* 粒子动画 */
.star-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.star-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(180, 190, 220, 0.7);
  box-shadow: 0 0 6px rgba(180, 190, 220, 0.4);
  opacity: 0;
  pointer-events: none;
}

@keyframes star-fly {
  0% {
    opacity: 0.8;
    transform: translate(0, 0) scale(0.3);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.8);
  }
}

/* --- Contact --- */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  cursor: pointer;
  transition: opacity 0.3s var(--ease);
}

.contact-item:hover { opacity: 0.5; }

.contact-item-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.contact-item-value {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.005em;
}

/* --- Footer --- */
.footer {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-text {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 300;
}

.footer-link {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.3s var(--ease);
  font-weight: 300;
}

.footer-link:hover { color: var(--text); }

/* --- Admin Link --- */
.admin-link {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-4);
  opacity: 0.3;
  z-index: 100;
  transition: opacity 0.3s;
}

.admin-link:hover { opacity: 0.7; }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  z-index: 9999;
  opacity: 0;
  transition: all 0.4s var(--ease);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .container { padding: 0 24px; }
  .nav { padding: 16px 0; padding-top: max(16px, env(safe-area-inset-top)); }
  .nav-links { gap: 24px; }
  .nav-links a { font-size: 12px; }
  html { scroll-snap-type: none; }

  /* Hero 保持满屏高度，使用 svh 兼容 iOS 动态工具栏 */
  .hero { padding: 0; min-height: 100vh; height: 100vh; }
  @supports (height: 100svh) {
    .hero { min-height: 100svh; height: 100svh; }
  }

  .hero-label-right { display: none; }
  .hero-scroll-hint { display: none; }
  .hero-title { font-size: clamp(3rem, 14vw, 6rem); }

  /* "日常·造物" 手机端加大字号 + 提升可见度，保持震撼感 */
  .hero-bg-text-inner {
    font-size: clamp(5rem, 30vw, 12rem);
    opacity: 0.35;
    filter: blur(0.5px);
    letter-spacing: 0.04em;
  }

  /* 微调百分比定位，适配小屏比例 */
  .hero-top { top: 18%; }
  .hero-center { top: 52%; }
  .hero-bottom { bottom: 8vh; }

  .section { padding: 64px 0; min-height: auto; height: auto; }
  .section-header { flex-direction: column; gap: 8px; margin-bottom: 32px; }
  .works { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .message-grid { grid-template-columns: 1fr; gap: 32px; }
  .message-label { margin-bottom: 16px; }
  .contact-wrap { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 32px; }
  .message-fields { grid-template-columns: 1fr; gap: 0; }
  .contact-grid { gap: 16px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer { padding-bottom: max(20px, env(safe-area-inset-bottom)); }

  /* 禁用移动端点击高亮 */
  * { -webkit-tap-highlight-color: transparent; }
}
