/* ===== RAYTON Sensor Solutions - Global Styles ===== */

/* Font note: Pretendard Variable is loaded via <link> in each HTML file for performance. */

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

:root {
  --primary: #0a2e1a;
  --primary-light: #1a5c3a;
  --accent: #4ecdc4;
  --accent-hover: #3dbdb5;
  --text: #2d3436;
  --text-light: #636e72;
  --text-white: #ffffff;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-dark: #0a1a12;
  --border: #e0e0e0;
  --shadow: 0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --transition: all 0.3s ease;
  --font-main: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
  --font-heading: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', sans-serif;
  --font-feature: "ss06", "ss10";
  --max-width: 1200px;
}

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

body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

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

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

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  margin-bottom: 1.5rem;
  color: var(--text);
}

.section-desc {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

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

section {
  padding: 6rem 0;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 26, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 2px;
}

.nav-logo .logo-sub {
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-top: -4px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-white);
  background: rgba(255,255,255,0.08);
}

.nav-links a.active {
  color: var(--accent);
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

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

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

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(10, 26, 18, 0.98);
    flex-direction: column;
    padding: 1rem 2rem 2rem;
    transform: translateY(-120%);
    transition: var(--transition);
    gap: 0;
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 50%, #0d3d24 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(78, 205, 196, 0.15), transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(78, 205, 196, 0.08), transparent 40%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(78, 205, 196, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 205, 196, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 700px;
}

.hero-content h1 {
  color: var(--text-white);
  margin-bottom: 1.5rem;
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.hero-content h1 span {
  color: var(--accent);
}

.hero-content p {
  color: rgba(255,255,255,0.75);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-white);
  border: 1.5px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-dark {
  background: var(--primary);
  color: var(--text-white);
}

.btn-dark:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ===== About / Introduction Section ===== */
.about-section {
  background: var(--bg-light);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* ===== Products Section ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.product-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.product-card-img {
  background: linear-gradient(135deg, #f0f4f3 0%, #e8eeec 100%);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  overflow: hidden;
}

.product-card-img:has(img) {
  padding: 0;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
}

/* Hummingbird teal circle decoration */
.product-card-img.hb-circle {
  position: relative;
  overflow: hidden;
}

.product-card-img.hb-circle::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(78, 205, 196, 0.35);
  bottom: 10%;
  right: 10%;
  z-index: 0;
}

.product-card-img.hb-circle img {
  position: relative;
  z-index: 1;
  object-fit: contain !important;
}

.product-card-img .product-icon {
  width: 160px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.product-card-body {
  padding: 2rem;
}

.product-card-body h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.product-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.product-card-body p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.product-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.product-link:hover {
  color: var(--accent);
  gap: 0.75rem;
}

/* ===== Applications Section ===== */
.applications-section {
  background: var(--bg-dark);
  color: var(--text-white);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.app-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.app-card:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-4px);
  border-color: var(--accent);
}

.app-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.app-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-white);
}

/* ===== CTA Section ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  text-align: center;
  color: var(--text-white);
  padding: 5rem 0;
}

.cta-section h2 {
  color: var(--text-white);
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 2px;
  margin-bottom: 0.25rem;
}

.footer-brand .logo-sub {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer h4 {
  color: var(--text-white);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 0.6rem;
}

.footer ul a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
}

.footer ul a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* ===== Page Header ===== */
.page-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(78, 205, 196, 0.1), transparent 60%);
}

.page-header .section-label {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  color: var(--text-white);
  position: relative;
  z-index: 1;
}

/* ===== Contact Form ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  margin-top: 3rem;
}

.contact-info-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.contact-info-card h3 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.contact-detail {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-detail .icon {
  width: 40px;
  height: 40px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-detail .info h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.contact-detail .info p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

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

/* ===== Content Cards (for News, Video etc.) ===== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.content-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.content-card-img {
  height: 200px;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 2.5rem;
}

.content-card-body {
  padding: 1.5rem;
}

.content-card-body .date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.content-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.content-card-body p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ===== Developer Section ===== */
.dev-resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.dev-card {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.dev-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.dev-card .dev-icon {
  width: 48px;
  height: 48px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
}

.dev-card h3 {
  margin-bottom: 0.75rem;
}

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

/* ===== Video Embed ===== */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  section { padding: 4rem 0; }

  .hero { min-height: 85vh; }

  .hero-content h1 { font-size: 2rem; }

  .hero-buttons { flex-direction: column; }

  .about-stats { grid-template-columns: 1fr; }

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

  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

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

  .products-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }

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

  .dev-resources { grid-template-columns: 1fr; }

  .page-header { padding: 6rem 0 3rem; }

  .container { padding: 0 1.25rem; }
}

@media (max-width: 480px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  .app-card { padding: 1.25rem 1rem; }

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

  .nav-links a { font-size: 0.9rem; padding: 0.6rem 0.75rem; }
}

/* ===== Back to Top Button ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(78, 205, 196, 0.4);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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