/* ===== iOS Light / Dark Appearance ===== */
:root,
[data-appearance="light"] {
  color-scheme: light;
  --primary: #007AFF;
  --primary-dark: #0051D5;
  --primary-light: rgba(0, 122, 255, 0.12);
  --bg: #F2F2F7;
  --bg-card: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-grouped: #F2F2F7;
  --text: #000000;
  --text-secondary: rgba(60, 60, 67, 0.6);
  --text-tertiary: rgba(60, 60, 67, 0.3);
  --border: rgba(60, 60, 67, 0.12);
  --separator: rgba(60, 60, 67, 0.29);
  --shadow: rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(60, 60, 67, 0.12);
  --fill-tertiary: rgba(118, 118, 128, 0.12);
  --switch-bg: rgba(118, 118, 128, 0.12);
  --switch-active: #FFFFFF;
  --footer-bg: #FFFFFF;
  --footer-text: rgba(60, 60, 67, 0.6);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-appearance="dark"] {
  color-scheme: dark;
  --primary: #0A84FF;
  --primary-dark: #409CFF;
  --primary-light: rgba(10, 132, 255, 0.18);
  --bg: #000000;
  --bg-card: #1C1C1E;
  --bg-secondary: #2C2C2E;
  --bg-grouped: #000000;
  --text: #FFFFFF;
  --text-secondary: rgba(235, 235, 245, 0.6);
  --text-tertiary: rgba(235, 235, 245, 0.3);
  --border: rgba(84, 84, 88, 0.65);
  --separator: rgba(84, 84, 88, 0.65);
  --shadow: rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(28, 28, 30, 0.72);
  --nav-border: rgba(84, 84, 88, 0.65);
  --fill-tertiary: rgba(118, 118, 128, 0.24);
  --switch-bg: rgba(118, 118, 128, 0.24);
  --switch-active: rgba(142, 142, 147, 0.45);
  --footer-bg: #1C1C1E;
  --footer-text: rgba(235, 235, 245, 0.6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
  transition: background-color 0.3s ease;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--primary);
  margin: 12px auto 0;
  border-radius: 2px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.subsection-title {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 48px 0 32px;
  color: var(--text);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--nav-border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: 0 0.5px 0 var(--nav-border), 0 4px 16px var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo img { height: 36px; width: auto; }

[data-appearance="light"] .logo-light { display: block; }
[data-appearance="light"] .logo-dark { display: none; }
[data-appearance="dark"] .logo-light { display: none; }
[data-appearance="dark"] .logo-dark { display: block; }

.logo-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.nav-menu {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: var(--fill-tertiary);
}

.nav-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--fill-tertiary);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.ctrl-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* iOS segmented appearance switch */
.appearance-switch {
  display: flex;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--switch-bg);
  gap: 2px;
}

.appearance-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.appearance-btn.active {
  background: var(--switch-active);
  color: var(--primary);
  box-shadow: 0 1px 3px var(--shadow);
}

[data-appearance="dark"] .appearance-btn.active {
  color: #FFFFFF;
}

.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px var(--shadow);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 100;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.dropdown-menu li:hover {
  background: var(--fill-tertiary);
  color: var(--primary);
}

.dropdown-menu li:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.dropdown-menu li:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

/* ===== Hero / Banner ===== */
.hero { padding-top: 64px; }

.banner-carousel {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: #000;
}

.banner-track { height: 100%; position: relative; }

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.banner-slide.active { opacity: 1; }

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-slide--brand {
  background: var(--bg-card);
}

.banner-slide--brand img {
  object-fit: contain;
  padding: 24px 48px;
}

.banner-slide--brand .banner-caption {
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
}

[data-appearance="dark"] .banner-slide--brand {
  background: #1C1C1E;
}

.banner-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
}

.banner-caption h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.banner-caption p {
  font-size: 1rem;
  opacity: 0.85;
}

.banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}

.banner-btn:hover { background: rgba(255,255,255,0.3); }
.banner-btn.prev { left: 16px; }
.banner-btn.next { right: 16px; }

.banner-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.banner-dot.active { background: var(--primary); }

/* ===== Intro & Business ===== */
.intro-block {
  text-align: center;
  max-width: 720px;
  margin: 64px auto 48px;
}

.intro-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.business-card,
.team-card,
.contact-card,
.marquee-item {
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s ease, border-color 0.3s ease;
}

.business-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}

.business-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px var(--shadow);
}

.business-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--fill-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.business-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.business-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== About ===== */
.about { background: var(--bg-grouped); }

.about-intro {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 16px;
}

.about-brand-img {
  border-radius: 16px;
  box-shadow: 0 4px 24px var(--shadow);
  width: 100%;
}

.about-text h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--primary);
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}

.about-info {
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.about-info li { margin-bottom: 6px; }
.about-info strong { color: var(--text); }

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

.team-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--shadow);
}

.team-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary-light);
}

.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h4 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.team-role {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.team-id {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  margin-bottom: 12px;
}

.team-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===== Works Marquee ===== */
.works { padding-bottom: 64px; }

.marquee-wrapper {
  overflow: hidden;
  margin-top: 16px;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.marquee-track {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: marquee 40s linear infinite;
}

.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  flex-shrink: 0;
  width: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  transition: transform 0.2s;
}

.marquee-item:hover { transform: scale(1.03); }

.marquee-item img {
  width: 320px;
  height: 200px;
  object-fit: cover;
}

.marquee-item span {
  display: block;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

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

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

.contact-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px var(--shadow);
}

.contact-icon { font-size: 2rem; margin-bottom: 12px; }

.contact-card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.contact-card a,
.contact-card span {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 32px 0;
  border-top: 0.5px solid var(--border);
  transition: background 0.3s ease;
}

[data-appearance="light"] .footer-logo-light { display: block; }
[data-appearance="light"] .footer-logo-dark { display: none; }
[data-appearance="dark"] .footer-logo-light { display: none; }
[data-appearance="dark"] .footer-logo-dark { display: block; }

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-logo { height: 40px; width: auto; }
.footer-logo-light,
.footer-logo-dark { display: none; }

.footer-text p {
  font-size: 0.85rem;
  line-height: 1.8;
}

.footer-lunan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 0.5px solid var(--border);
}

.lunan-logo {
  height: 28px;
  width: auto;
}

.footer-lunan span {
  font-size: 0.8rem;
  color: var(--footer-text);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-top: 0.5px solid var(--border);
  font-size: 0.75rem;
}

.footer-bottom a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--primary);
}

.footer-bottom-sep {
  color: var(--text-tertiary);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .business-grid,
  .team-grid,
  .contact-grid { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }

  .about-intro { grid-template-columns: 1fr; }
  .about-brand { max-width: 400px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    flex-direction: column;
    padding: 16px;
    border-bottom: 0.5px solid var(--nav-border);
    transform: translateY(-120%);
    opacity: 0;
    transition: all 0.3s;
    margin-left: 0;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-controls { margin-left: 8px; }

  .banner-slide--brand img { padding: 16px 24px; }

  .banner-carousel { height: 280px; }
  .banner-caption h2 { font-size: 1.25rem; }

  .section { padding: 56px 0; }
  .section-title { font-size: 1.5rem; }

  .footer-inner { flex-direction: column; text-align: center; }

  .marquee-item { width: 260px; }
  .marquee-item img { width: 260px; height: 160px; }
}
