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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.8;
  color: #3A2F22;
  background-color: #F5F0E6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.texture-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

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

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

/* ===== Typography ===== */
.kicker {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #6B5B45;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.section-title {
  font-family: "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.3;
  color: #3A2F22;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 28px;
  }
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 80px;
}

.narrow {
  max-width: 800px;
  text-align: center;
}

@media (max-width: 1024px) {
  .container {
    padding: 0 48px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(245, 240, 230, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #E5DDC5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 500;
  color: #3A2F22;
}

.nav {
  display: flex;
  gap: 48px;
  align-items: center;
}

.nav-link {
  font-size: 15px;
  font-weight: 400;
  color: #3A2F22;
  position: relative;
  transition: color 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background-color: #6B5B45;
  transition: width 0.25s ease;
}

.nav-link:hover {
  color: #6B5B45;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background-color: #3A2F22;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: #F5F0E6;
    border-bottom: 1px solid #E5DDC5;
    flex-direction: column;
    gap: 0;
    padding: 24px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid #E5DDC5;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.5px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.5px) rotate(-45deg);
  }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 120px 0 160px;
  overflow: hidden;
}

.hero-deco-line {
  position: absolute;
  left: 0;
  top: 120px;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, #CFC4A8, transparent);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: center;
}

.hero-text {
  position: relative;
  max-width: 560px;
}

.hero-text::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 0;
  width: 2px;
  height: 60px;
  background-color: #CFC4A8;
}

.hero-title {
  font-family: "Noto Serif SC", serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.2;
  color: #3A2F22;
  margin-bottom: 32px;
}

.hero-desc {
  font-size: 17px;
  line-height: 1.9;
  color: #6B5B45;
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: #3A2F22;
  border-bottom: 1px solid #3A2F22;
  padding-bottom: 4px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.hero-cta:hover {
  color: #6B5B45;
  border-color: #6B5B45;
}

.hero-image {
  position: relative;
  aspect-ratio: 8/9;
  overflow: hidden;
  border-radius: 2px;
  background-color: #E5DDC5;
}

.hero-image-frame {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  pointer-events: none;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-image {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 80px 0 100px;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-desc {
    font-size: 16px;
  }
}

/* ===== Philosophy ===== */
.philosophy {
  position: relative;
  padding: 160px 0;
  border-top: 1px solid #E5DDC5;
}

.quote-mark {
  position: absolute;
  font-family: "Noto Serif SC", serif;
  font-size: 200px;
  font-weight: 400;
  line-height: 1;
  color: #E5DDC5;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.quote-mark-open {
  top: 80px;
  left: 80px;
}

.philosophy-quote {
  position: relative;
  z-index: 1;
  font-family: "Noto Serif SC", serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.5;
  color: #3A2F22;
  margin-bottom: 40px;
}

.philosophy-desc {
  position: relative;
  z-index: 1;
  font-size: 17px;
  line-height: 1.8;
  color: #6B5B45;
  max-width: 560px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .philosophy {
    padding: 100px 0;
  }

  .quote-mark {
    font-size: 120px;
  }

  .quote-mark-open {
    top: 60px;
    left: 24px;
  }

  .philosophy-quote {
    font-size: 26px;
  }
}

/* ===== Stats ===== */
.stats {
  padding: 80px 0;
  border-top: 1px solid #E5DDC5;
  border-bottom: 1px solid #E5DDC5;
}

.stats-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.stat-num {
  font-family: "Noto Serif SC", serif;
  font-size: 48px;
  font-weight: 400;
  color: #3A2F22;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: #6B5B45;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 60px;
  background-color: #E5DDC5;
}

@media (max-width: 768px) {
  .stats-inner {
    flex-direction: column;
    gap: 32px;
  }

  .stat-divider {
    width: 60px;
    height: 1px;
  }

  .stat-num {
    font-size: 36px;
  }
}

/* ===== Services ===== */
.services {
  padding: 160px 0;
  border-top: 1px solid #E5DDC5;
}

.service-block {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 120px;
}

.service-block:last-child {
  margin-bottom: 0;
}

.service-bg-num {
  position: absolute;
  top: -40px;
  left: -20px;
  font-family: "Noto Serif SC", serif;
  font-size: 180px;
  font-weight: 400;
  color: #E5DDC5;
  opacity: 0.5;
  line-height: 1;
  z-index: 0;
  pointer-events: none;
}

.service-block-flipped .service-bg-num {
  left: auto;
  right: -20px;
}

.service-text {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.service-num {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #6B5B45;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.service-title {
  font-family: "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 400;
  color: #3A2F22;
  margin-bottom: 20px;
}

.service-desc {
  font-size: 16px;
  line-height: 1.9;
  color: #6B5B45;
}

.service-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 2px;
  background-color: #E5DDC5;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .service-block {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 80px;
  }

  .service-bg-num {
    top: -30px;
    left: -10px;
    font-size: 120px;
  }

  .service-block-flipped .service-bg-num {
    left: -10px;
    right: auto;
  }

  .service-block-flipped .service-image {
    order: 2;
  }

  .service-block-flipped .service-text {
    order: 1;
  }

  .service-text {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .services {
    padding: 100px 0;
  }

  .service-title {
    font-size: 24px;
  }
}

/* ===== Works ===== */
.works {
  padding: 160px 0;
  border-top: 1px solid #E5DDC5;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-card {
  position: relative;
  cursor: pointer;
}

.work-card:nth-child(2) {
  margin-top: 40px;
}

.work-image {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 16px;
  background-color: #E5DDC5;
}

.work-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(58, 47, 34, 0.25), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card:hover .work-image img {
  transform: scale(1.03);
}

.work-card:hover .work-image::after {
  opacity: 1;
}

.work-title {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 400;
  color: #3A2F22;
  margin-bottom: 6px;
  transition: color 0.25s ease;
}

.work-card:hover .work-title {
  color: #6B5B45;
}

.work-tag {
  font-size: 14px;
  color: #6B5B45;
}

@media (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-card:nth-child(2) {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .works {
    padding: 100px 0;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Mini Apps ===== */
.miniapps {
  position: relative;
  padding: 160px 0;
  border-top: 1px solid #E5DDC5;
  overflow: hidden;
}

.miniapps-header {
  position: relative;
  margin-bottom: 80px;
}

.miniapps-header .kicker {
  margin-bottom: 16px;
}

.miniapps-header .section-title {
  max-width: 520px;
}

.miniapps-deco-line {
  display: block;
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, #CFC4A8, transparent);
  margin-top: 24px;
}

.miniapps-bg-num {
  position: absolute;
  top: -40px;
  right: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 180px;
  font-weight: 400;
  color: #E5DDC5;
  opacity: 0.5;
  line-height: 1;
  pointer-events: none;
}

.miniapps-grid {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  max-width: 720px;
  margin: 0 auto;
}

.miniapp-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 48px 56px;
  gap: 48px;
  background-color: #FDFBF7;
  border: 1px solid #E5DDC5;
  border-radius: 2px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.miniapp-card:hover {
  transform: translateY(-4px);
  border-color: #CFC4A8;
}

.miniapp-visual {
  flex-shrink: 0;
}

.miniapp-card-solo .miniapp-qrcode {
  width: 200px;
  height: 200px;
  margin-bottom: 0;
}

.miniapp-info {
  flex: 1;
  text-align: left;
}

.miniapp-qrcode {
  width: 160px;
  height: 160px;
  padding: 12px;
  background-color: #FFFFFF;
  border: 1px solid #E5DDC5;
  border-radius: 2px;
  margin-bottom: 28px;
}

.miniapp-qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.miniapp-name {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 400;
  color: #3A2F22;
  margin-bottom: 10px;
}

.miniapp-tag {
  font-size: 13px;
  font-weight: 500;
  color: #6B5B45;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.miniapp-desc {
  font-size: 15px;
  color: #6B5B45;
  line-height: 1.7;
  margin-bottom: 20px;
}

.miniapp-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6B5B45;
  padding: 8px 16px;
  background-color: #F5F0E6;
  border-radius: 2px;
}

.miniapp-hint::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: #07C160;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .miniapps-bg-num {
    font-size: 120px;
    top: -20px;
  }
}

@media (max-width: 768px) {
  .miniapps {
    padding: 100px 0;
  }

  .miniapps-header {
    margin-bottom: 60px;
  }

  .miniapps-bg-num {
    display: none;
  }

  .miniapps-grid {
    max-width: 360px;
  }

  .miniapp-card {
    flex-direction: column;
    padding: 36px 28px;
    gap: 28px;
  }

  .miniapp-card-solo .miniapp-qrcode {
    width: 180px;
    height: 180px;
  }

  .miniapp-info {
    text-align: center;
  }

  .miniapp-qrcode {
    width: 180px;
    height: 180px;
  }

  .miniapp-hint {
    justify-content: center;
  }
}

/* ===== About ===== */
.about {
  padding: 160px 0;
  border-top: 1px solid #E5DDC5;
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image {
  aspect-ratio: 5/6;
  overflow: hidden;
  border-radius: 2px;
  background-color: #E5DDC5;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text {
  max-width: 520px;
}

.about-text .section-title {
  margin-bottom: 32px;
}

.about-desc {
  font-size: 16px;
  line-height: 1.9;
  color: #6B5B45;
  margin-bottom: 24px;
}

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

@media (max-width: 1024px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-text {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .about {
    padding: 100px 0;
  }
}

/* ===== Contact ===== */
.contact {
  position: relative;
  padding: 200px 0;
  border-top: 1px solid #E5DDC5;
  text-align: center;
  overflow: hidden;
}

.contact::before,
.contact::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #CFC4A8);
  transform: translateY(-50%);
}

.contact::before {
  left: 80px;
}

.contact::after {
  right: 80px;
  transform: translateY(-50%) rotate(180deg);
}

.contact-title {
  font-family: "Noto Serif SC", serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.4;
  color: #3A2F22;
  margin-bottom: 40px;
}

.contact-email {
  font-size: 18px;
  color: #6B5B45;
  border-bottom: 1px solid #6B5B45;
  padding-bottom: 4px;
  transition: color 0.25s ease;
}

.contact-email:hover {
  color: #3A2F22;
}

@media (max-width: 768px) {
  .contact {
    padding: 120px 0;
  }

  .contact::before,
  .contact::after {
    display: none;
  }

  .contact-title {
    font-size: 32px;
  }
}

/* ===== Footer ===== */
.footer {
  background-color: #3A2F22;
  color: #E5DDC5;
  padding: 80px 0 40px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

.footer-logo {
  font-family: "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 500;
  color: #F5F0E6;
}

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-link {
  font-size: 14px;
  color: #E5DDC5;
  transition: color 0.25s ease;
}

.footer-link:hover {
  color: #F5F0E6;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(229, 221, 197, 0.2);
}

.footer-copy {
  justify-self: start;
  font-size: 13px;
  color: #E5DDC5;
}

.footer-icp {
  justify-self: center;
  font-size: 13px;
  color: #E5DDC5;
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-icp:hover {
  color: #F5F0E6;
}

@media (max-width: 768px) {
  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    gap: 32px;
  }

  .footer-bottom {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 12px;
  }

  .footer-copy,
  .footer-icp {
    justify-self: start;
  }
}

/* ===== Focus states for accessibility ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #6B5B45;
  outline-offset: 4px;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
