/* ===== Global Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4a6cf7;
  --primary-dark: #3a5ce7;
  --dark-bg: #1a1a2e;
  --dark-secondary: #16213e;
  --dark-tertiary: #0f3460;
  --text-dark: #333;
  --text-gray: #666;
  --text-light: #555;
  --white: #ffffff;
  --light-bg: #f8f9fa;
  --border-color: #e0e0e0;

  --container-padding: clamp(1rem, 5vw, 10%);
  --section-padding: clamp(60px, 10vh, 100px);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  min-height: 100vh;
  width: 100%;
}

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

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.nav--scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--container-padding);
  max-width: 1400px;
  margin: 0 auto;
}

.nav__logo {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--dark-bg);
  cursor: pointer;
  user-select: none;
}

.nav__logo span {
  color: var(--primary-color);
}

/* Language Select */
.lang-select {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.5rem;
}

.lang-select:hover,
.lang-select:focus {
  border-color: var(--primary-color);
}

.nav__links-lang {
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
}

/* Hamburger Menu */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--dark-bg);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav__hamburger--active span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

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

.nav__hamburger--active span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* Navigation Links */
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  list-style: none;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: clamp(0.875rem, 2vw, 1rem);
  cursor: pointer;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.25rem 0;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.nav__links a:hover::after,
.nav__links a.active::after {
  width: 100%;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--primary-color);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-secondary) 50%, var(--dark-tertiary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 80px var(--container-padding) 40px;
}

.hero__background {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__particles {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(circle, rgba(74, 108, 247, 0.1) 0%, transparent 50%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 0 1rem;
}

.hero__title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: keep-all;
}

.hero__title span {
  color: var(--primary-color);
}

.hero__subtitle {
  font-size: clamp(1rem, 3vw, 1.3rem);
  opacity: 0.9;
  margin-bottom: 2rem;
  font-weight: 300;
  word-break: keep-all;
}

.hero__cta {
  display: inline-block;
  padding: clamp(0.875rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2.5rem);
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.hero__cta:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(74, 108, 247, 0.4);
}

.hero__stores {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.hero__store-btn {
  display: flex;
  align-items: center;
  height: 48px;
  transition: transform 0.3s ease;
}

.hero__store-btn:hover {
  transform: translateY(-3px);
}

.hero__store-btn--apple img {
  height: 44px;
  width: auto;
}

.hero__store-btn--google img {
  height: 64px;
  width: auto;
  margin: -10px 0;
}

.hero__cta:active {
  transform: translateY(-1px);
}

/* Scroll Indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 25px;
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.hero__scroll-indicator span {
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(20px); }
}

/* ===== Section Base Styles ===== */
.section {
  padding: var(--section-padding) 0;
}

.section__header {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  color: var(--dark-bg);
  margin-bottom: 1rem;
  font-weight: 700;
}

.section__subtitle {
  color: var(--text-gray);
  max-width: 600px;
  margin: 0 auto;
  font-size: clamp(0.9rem, 2vw, 1rem);
  word-break: keep-all;
}

/* ===== About Section ===== */
.about {
  background: var(--white);
}

.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
}

.about__text h3 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  color: var(--dark-bg);
  margin-bottom: 1.5rem;
  word-break: keep-all;
}

.about__text p {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  word-break: keep-all;
  line-height: 1.8;
}

.about__visual {
  height: clamp(300px, 50vw, 500px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about__icon {
  font-size: clamp(3rem, 10vw, 5rem);
  color: var(--white);
}

.about__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

/* ===== Services Section ===== */
.services {
  background: var(--light-bg);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
}

.service-card {
  background: var(--white);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.service-card__icon {
  width: clamp(60px, 12vw, 80px);
  height: clamp(60px, 12vw, 80px);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-bg) 100%);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.service-card__title {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--dark-bg);
  margin-bottom: 1rem;
}

.service-card__description {
  color: var(--text-gray);
  font-size: clamp(0.875rem, 2vw, 1rem);
  word-break: keep-all;
  line-height: 1.6;
}

/* ===== Values Section ===== */
.values {
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-secondary) 100%);
  color: var(--white);
}

.values .section__title {
  color: var(--white);
}

.values .section__subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.values__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
}

.value-item {
  text-align: center;
  padding: clamp(1.5rem, 3vw, 2rem);
}

.value-item__title {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.value-item__description {
  opacity: 0.8;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  word-break: keep-all;
  line-height: 1.6;
}

/* ===== Contact Section ===== */
.contact__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.contact__info h3 {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  color: var(--dark-bg);
  margin-bottom: 2rem;
}

.contact__item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact__icon {
  width: clamp(40px, 8vw, 50px);
  height: clamp(40px, 8vw, 50px);
  min-width: clamp(40px, 8vw, 50px);
  background: #f0f4ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: clamp(1rem, 3vw, 1.2rem);
}

.contact__details strong {
  display: block;
  color: var(--dark-bg);
  margin-bottom: 0.25rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.contact__details p {
  color: var(--text-gray);
  font-size: clamp(0.875rem, 2vw, 1rem);
  word-break: break-all;
}

/* Contact Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact__form input,
.contact__form textarea {
  width: 100%;
  padding: clamp(0.875rem, 2vw, 1rem);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-family: inherit;
  font-size: clamp(0.875rem, 2vw, 1rem);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact__form input:focus,
.contact__form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.contact__form textarea {
  height: clamp(120px, 20vw, 150px);
  resize: none;
}

.contact__form button {
  width: 100%;
  padding: clamp(0.875rem, 2vw, 1rem);
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact__form button:hover {
  background: var(--primary-dark);
}

.contact__form button:active {
  transform: scale(0.98);
}

/* ===== Footer ===== */
.footer {
  background: var(--dark-bg);
  color: var(--white);
  padding: clamp(2rem, 5vw, 3rem) var(--container-padding);
  text-align: center;
}

.footer p {
  opacity: 0.7;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  word-break: keep-all;
}

/* ===== Responsive Breakpoints ===== */

/* Tablet - 968px */
@media (max-width: 968px) {
  .nav__hamburger {
    display: flex;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 80vw);
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
  }

  .nav__links--open {
    right: 0;
  }

  .nav__links a {
    font-size: 1.2rem;
  }

  .nav__links-lang {
    margin-left: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .nav__links-lang .lang-select {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
  }

  .about__content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about__visual {
    order: -1;
    height: 200px;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .values__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact__content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__scroll-indicator {
    display: none;
  }
}

/* Mobile - 576px */
@media (max-width: 576px) {
  :root {
    --container-padding: 1.25rem;
    --section-padding: 50px;
  }

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

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

  .value-item {
    padding: 1rem;
  }

  .contact__item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .service-card {
    padding: 1.5rem;
  }

  .service-card:hover {
    transform: none;
  }
}

/* Small Mobile - 375px */
@media (max-width: 375px) {
  :root {
    --container-padding: 1rem;
  }

  .hero__title {
    font-size: 1.75rem;
  }

  .hero__subtitle {
    font-size: 0.95rem;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover {
    transform: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  }

  .hero__cta:hover {
    transform: none;
    box-shadow: none;
  }

  .nav__links a::after {
    display: none;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px var(--container-padding) 60px;
  }

  .hero__scroll-indicator {
    display: none;
  }
}

/* Safe Area for Notched Devices */
@supports (padding: max(0px)) {
  .nav__container {
    padding-left: max(var(--container-padding), env(safe-area-inset-left));
    padding-right: max(var(--container-padding), env(safe-area-inset-right));
  }

  .footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --text-gray: #444;
    --border-color: #666;
  }

  .service-card,
  .contact__form input,
  .contact__form textarea {
    border: 2px solid var(--dark-bg);
  }
}
