/* ============================================================
   AfterLife Office - Muji × Apple Inspired Design System
   ============================================================ */

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

:root {
  /* Colors */
  --black: #1d1d1f;
  --dark: #2c2c2e;
  --gray-900: #3a3a3c;
  --gray-700: #555557;
  --gray-500: #86868b;
  --gray-400: #aeaeb2;
  --gray-300: #d1d1d6;
  --gray-200: #e5e5ea;
  --gray-100: #f2f2f7;
  --gray-50: #f7f7f8;
  --white: #ffffff;
  --warm-bg: #faf9f7;
  --warm-light: #f5f3ef;
  --accent: #1d1d1f;
  --accent-hover: #424245;
  
  /* Typography */
  --font-sans: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --section-padding: 120px 0;
  --container-width: 1120px;
  --nav-height: 72px;
  
  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  line-height: 1.8;
  font-size: 16px;
  font-weight: 400;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s var(--ease);
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 40px;
}

/* --- Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0);
  transition: all 0.4s var(--ease);
}

.nav.scrolled {
  border-bottom-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 40px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 44px;
  width: auto;
}

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

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-700);
  letter-spacing: 0.02em;
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--black);
  transition: width 0.3s var(--ease);
}

.nav-link:hover {
  color: var(--black);
}

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

.nav-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  background: var(--black);
  padding: 10px 28px;
  border-radius: 100px;
  transition: all 0.3s var(--ease);
  letter-spacing: 0.02em;
}

.nav-cta:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 1100;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--black);
  transition: all 0.3s var(--ease);
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4.5px, 4.5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4.5px, -4.5px);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-link {
  font-size: 22px;
  font-weight: 400;
  color: var(--gray-700);
  letter-spacing: 0.05em;
  transition: color 0.3s var(--ease);
}

.mobile-link:hover {
  color: var(--black);
}

.mobile-cta {
  margin-top: 16px;
  font-weight: 500;
  color: var(--white);
  background: var(--black);
  padding: 14px 48px;
  border-radius: 100px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--warm-bg);
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 55%;
  overflow: hidden;
  opacity: 0.35;
  pointer-events: none;
}

.hero-ginkgo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 40px;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--black);
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(14px, 2vw, 17px);
  color: var(--gray-700);
  font-weight: 300;
  letter-spacing: 0.12em;
  margin-bottom: 48px;
}

.hero-actions {
  margin-bottom: 20px;
}

.hero-note {
  font-size: 13px;
  color: var(--gray-500);
  letter-spacing: 0.08em;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.3s var(--ease);
  border-radius: 100px;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
  padding: 16px 48px;
  font-size: 16px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-full {
  width: 100%;
}

/* --- Section Styles --- */
.section {
  padding: var(--section-padding);
  position: relative;
}

.section-title {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  color: var(--black);
}

.section-desc {
  font-size: 15px;
  color: var(--gray-500);
  text-align: center;
  letter-spacing: 0.06em;
  margin-bottom: 64px;
}

/* --- Services --- */
.services {
  background: var(--white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.service-card {
  background: var(--gray-50);
  border-radius: 20px;
  padding: 40px 24px 36px;
  text-align: center;
  transition: all 0.4s var(--ease);
  border: 1px solid transparent;
}

.service-card:hover {
  background: var(--white);
  border-color: var(--gray-200);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.service-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--gray-700);
  transition: color 0.3s var(--ease);
}

.service-card:hover .service-icon {
  color: var(--black);
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.service-sub {
  font-size: 13px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}

.services-tagline {
  text-align: center;
  font-size: 16px;
  color: var(--gray-500);
  letter-spacing: 0.2em;
  font-weight: 300;
}

/* --- About --- */
.about {
  background: var(--warm-bg);
  overflow: hidden;
}

.about-bg-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.15;
  pointer-events: none;
}

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

.about-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.about-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: 0.12em;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.about-headline {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
}

.about-text {
  margin-bottom: 56px;
}

.about-text p {
  font-size: 16px;
  line-height: 2;
  color: var(--gray-700);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 48px;
  border-top: 1px solid var(--gray-300);
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-en);
  font-size: 42px;
  font-weight: 700;
  color: var(--black);
  line-height: 1;
  display: inline;
}

.stat-suffix {
  font-size: 18px;
  font-weight: 500;
  color: var(--gray-700);
  margin-left: 2px;
}

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 8px;
  letter-spacing: 0.06em;
}

/* --- Audience --- */
.audience {
  background: var(--white);
}

.audience-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.audience-card {
  padding: 40px 28px;
  border-radius: 20px;
  background: var(--gray-50);
  transition: all 0.4s var(--ease);
  border: 1px solid transparent;
}

.audience-card:hover {
  background: var(--white);
  border-color: var(--gray-200);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.audience-icon {
  width: 44px;
  height: 44px;
  color: var(--gray-700);
  margin-bottom: 20px;
}

.audience-icon svg {
  width: 100%;
  height: 100%;
}

.audience-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.audience-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.8;
}

/* --- Process --- */
.process {
  background: var(--warm-bg);
}

.process-steps {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.process-step {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  position: relative;
}

.step-number {
  font-family: var(--font-en);
  font-size: 48px;
  font-weight: 700;
  color: var(--gray-200);
  line-height: 1;
  flex-shrink: 0;
  width: 80px;
  text-align: right;
  transition: color 0.4s var(--ease);
}

.process-step:hover .step-number {
  color: var(--gray-400);
}

.step-content {
  padding-top: 4px;
}

.step-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.step-content p {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.8;
}

.process-line {
  width: 1px;
  height: 48px;
  background: var(--gray-300);
  margin-left: 79px;
  margin-top: 8px;
  margin-bottom: 8px;
}

/* --- Guarantee --- */
.guarantee {
  background: var(--white);
}

.guarantee-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.guarantee-card {
  text-align: center;
  padding: 48px 24px;
  border-radius: 20px;
  background: var(--gray-50);
  transition: all 0.4s var(--ease);
  border: 1px solid transparent;
}

.guarantee-card:hover {
  background: var(--white);
  border-color: var(--gray-200);
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06);
}

.guarantee-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--gray-700);
}

.guarantee-icon svg {
  width: 100%;
  height: 100%;
}

.guarantee-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.guarantee-card p {
  font-size: 13px;
  color: var(--gray-500);
  letter-spacing: 0.04em;
}

/* --- Contact --- */
.contact {
  background: var(--warm-bg);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-title {
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.contact-desc {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--gray-700);
}

.contact-item svg {
  flex-shrink: 0;
  color: var(--gray-500);
}

/* --- Form --- */
.contact-form {
  background: var(--white);
  padding: 48px;
  border-radius: 24px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  font-size: 15px;
  color: var(--black);
  background: var(--gray-50);
  transition: all 0.3s var(--ease);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gray-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--gray-400);
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-note {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 16px;
  letter-spacing: 0.04em;
}

/* --- Footer --- */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 72px 0 36px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 36px;
}

.footer-logo {
  height: 48px;
  width: auto;
  filter: invert(1);
  margin-bottom: 12px;
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.12em;
}

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

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.06em;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 10px;
  transition: color 0.3s var(--ease);
}

.footer-col a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.04em;
}

/* --- Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--white);
  border-radius: 24px;
  padding: 56px 48px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-out);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--black);
}

.modal-icon svg {
  width: 100%;
  height: 100%;
}

.modal-content h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-content p {
  font-size: 15px;
  color: var(--gray-500);
  margin-bottom: 32px;
  line-height: 1.8;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --section-padding: 96px 0;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .audience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .guarantee-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  
  .footer-top {
    flex-direction: column;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
    --nav-height: 64px;
  }
  
  .container {
    padding: 0 24px;
  }
  
  .nav-inner {
    padding: 0 24px;
  }
  
  .nav-links, .nav-cta {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .hero {
    min-height: 100svh;
  }
  
  .hero-bg {
    width: 100%;
    opacity: 0.2;
  }
  
  .hero-content {
    padding: 100px 24px 80px;
  }
  
  .hero-title {
    font-size: 30px;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .service-card {
    padding: 28px 16px 24px;
  }
  
  .audience-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .stat-number {
    font-size: 32px;
  }
  
  .guarantee-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .guarantee-card {
    padding: 32px 16px;
  }
  
  .process-step {
    gap: 24px;
  }
  
  .step-number {
    font-size: 36px;
    width: 56px;
  }
  
  .process-line {
    margin-left: 55px;
  }
  
  .contact-form {
    padding: 32px 24px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .footer-links-grid {
    flex-direction: column;
    gap: 32px;
  }

  .section-desc {
    margin-bottom: 48px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 26px;
  }
  
  .services-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .service-card {
    padding: 24px 12px 20px;
  }
  
  .service-icon {
    width: 36px;
    height: 36px;
  }
  
  .service-name {
    font-size: 15px;
  }
  
  .guarantee-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* --- Smooth scroll offset for fixed nav --- */
section[id] {
  scroll-margin-top: var(--nav-height);
}

/* --- Selection --- */
::selection {
  background: rgba(29, 29, 31, 0.12);
}
