/* --- Classical Minimalist (2025) --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  /* Typography */
  --font-serif: "Playfair Display", serif;
  --font-display: "Cinzel", serif;
  --font-sans: "Lato", sans-serif;

  /* Palette - Monochrome (Dark Default) */
  --bg-color: #0c0c0c;
  /* Deep Charcoal/Black */
  --text-primary: #f2f2f2;
  /* Off-White */
  --text-secondary: #a0a0a0;
  /* Muted Grey */
  --border-color: #333333;
  --surface-color: rgba(255, 255, 255, 0.03);
  --btn-hover-bg: #f2f2f2;
  --btn-hover-text: #0c0c0c;
  --feature-border: #333333;

  /* Spacing */
  --container-width: 1000px;
  /* Narrower for reading focus */
  --header-height: 100px;
}

/* --- Light Mode Override --- */
[data-theme="light"] {
  --bg-color: #f7f7f5;
  /* Warm Paper White */
  --text-primary: #1a1a1a;
  /* Ink Black */
  --text-secondary: #666666;
  /* Pencil Grey */
  --border-color: #e5e5e5;
  --surface-color: rgba(0, 0, 0, 0.03);
  --btn-hover-bg: #1a1a1a;
  --btn-hover-text: #f7f7f5;
  --feature-border: #e5e5e5;
}

/* --- Utilities --- */
.hidden {
  display: none !important;
}

/* Language Visibility Logic */
:root[lang="en"] [data-zh] {
  display: none !important;
}

:root[lang="zh"] [data-en] {
  display: none !important;
}

/* Theme Transition */
body,
.btn,
.feature-item,
.navbar,
.icon-btn,
.text-btn {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Canvas */
#diffuse-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 2rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--text-primary);
  margin-top: 1rem;
  opacity: 0.5;
}

p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 600px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.4s ease;
}

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

/* --- Components --- */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border: 1px solid var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
  transition: all 0.4s ease;
  margin-top: 2rem;
}

.btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
}

.btn-secondary {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background: transparent;
  color: var(--text-primary);
}

.icon-btn,
.text-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition: color 0.3s ease;
}

.icon-btn:hover,
.text-btn:hover {
  color: var(--text-secondary);
}

.text-btn {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
}

/* --- Header --- */
.navbar {
  position: absolute;
  top: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 10;
  display: flex;
  align-items: center;
}

.navbar .container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo img {
  height: 32px;
  /* In dark mode we invert white logo to black? No, usually white on dark. 
       If logo is black svg: invert in dark mode (white), no invert in light mode (black). */
  filter: invert(1);
  opacity: 0.9;
  transition: filter 0.3s ease;
}

[data-theme="light"] .logo img {
  filter: invert(0);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
}

.hero-content {
  animation: fadeInSlow 1.5s ease-out;
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  display: block;
}

.hero-image-container {
  margin-top: 4rem;
  position: relative;
  border: 1px solid var(--border-color);
  padding: 20px;
  background: rgba(255, 255, 255, 0.01);
}

.hero-image {
  width: 100%;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  /* Grayscale image */
  transition: filter 0.5s ease;
}

.hero-image:hover {
  filter: grayscale(0%) contrast(1);
  /* Reveal color on hover */
}

/* --- Philosophy / Features Section --- */
.philosophy {
  padding: 10rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6rem 4rem;
  margin-top: 5rem;
}

.feature-item {
  border-top: 1px solid var(--feature-border);
  padding-top: 2rem;
  transition: border-color 0.4s ease;
}

.feature-item:hover {
  border-color: var(--text-primary);
}

.feature-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  display: block;
}

.feature-item h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 400;
}

.feature-item p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.feature-preview {
  margin-top: 2rem;
  border: 1px solid var(--border-color);
  padding: 10px;
  background: var(--surface-color);
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

.feature-item:hover .feature-preview {
  transform: translateY(-10px);
  border-color: var(--text-primary);
}

.preview-img {
  width: 100%;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.5s ease;
}

.feature-item:hover .preview-img {
  filter: grayscale(0%) contrast(1);
}

/* --- Quote Section --- */
.quote-section {
  padding: 8rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.quote {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.4;
  max-width: 800px;
  margin: 0 auto;
}

.quote-mission {
  margin-top: 2rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.05em;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeInSlow 2s ease-out;
}

/* --- Installation --- */
.installation {
  padding: 10rem 0;
}

.step-list {
  margin-top: 4rem;
  list-style: none;
}

.step {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: padding 0.3s ease;
}

.step:hover {
  padding-left: 20px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: right;
}

/* --- Footer --- */
footer {
  padding: 3rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--border-color);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Animations --- */
@keyframes fadeInSlow {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .step {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .step-desc {
    text-align: left;
  }

  h1 {
    font-size: 2.5rem;
  }
}