*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d0d;
  --text: #d4d4d4;
  --border: #222;
  --logo: #c0c0c0;
  --scrollbar: #2a2a2a;
  --bubble-assistant: #1a1a1a;
  --bubble-user: #242424;
  --bubble-user-text: #b8b8b8;
  --avatar-assistant: #3a3a3a;
  --avatar-assistant-text: #aaa;
  --avatar-user: #2a2a2a;
  --avatar-user-text: #888;
  --input-bg: #1a1a1a;
  --input-border: #2e2e2e;
  --input-border-focus: #444;
  --placeholder: #444;
  --btn-bg: #3a3a3a;
  --btn-color: #aaa;
  --btn-hover: #484848;
}

body.light {
  --bg: #f5f5f5;
  --text: #1a1a1a;
  --border: #e0e0e0;
  --logo: #333;
  --scrollbar: #ccc;
  --bubble-assistant: #fff;
  --bubble-user: #ececec;
  --bubble-user-text: #333;
  --avatar-assistant: #ddd;
  --avatar-assistant-text: #555;
  --avatar-user: #e8e8e8;
  --avatar-user-text: #777;
  --input-bg: #fff;
  --input-border: #ddd;
  --input-border-focus: #aaa;
  --placeholder: #bbb;
  --btn-bg: #ddd;
  --btn-color: #555;
  --btn-hover: #ccc;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}

.logo {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.45;
  letter-spacing: 0;
}

.logo-gray {
  color: #888;
}

.logo-black {
  color: #111;
}

body.light .logo-black {
  color: #111;
}

body:not(.light) .logo-black {
  color: #eee;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--logo);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fixed box: the icons are injected by initTheme(), so reserve their space to avoid a layout shift. */
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}

#theme-toggle:hover {
  background: var(--input-border);
}

/* ============================================================
   Landing page (/) — the site's only page
   ============================================================ */
html {
  scroll-behavior: smooth;
  /* sticky nav 높이만큼 보정해서 섹션 제목이 안 가려지도록 */
  scroll-padding-top: 80px;
}

body.landing {
  display: block;
  height: auto;
  min-height: 100vh;
  align-items: initial;
  justify-content: initial;
  line-height: 1.6;
}

/* --- Top nav ---------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand-nav { text-decoration: none; }

.site-nav .logo { font-size: 1.35rem; }
.site-nav .logo-sub {
  font-size: 0.66rem;
  opacity: 0.5;
}

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

.site-nav-links a {
  color: var(--text);
  opacity: 0.7;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

.site-nav-links a:hover { opacity: 1; }

/* --- Container & sections --------------------------------- */
.hero,
.section,
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.section-tight {
  padding-top: 24px;
  padding-bottom: 56px;
}

.section-alt {
  background: var(--input-bg);
  max-width: none;
  padding-left: 24px;
  padding-right: 24px;
}

.section-alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* 1100px보다 좁은 자식(대표 카드 920px)은 가운데가 아니라 제목과 같은 왼쪽 선에 맞춘다. */
.section-alt > .leadership-card { margin-left: max(0px, (100% - 1100px) / 2); }

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 1rem;
  opacity: 0.6;
  margin-top: 6px;
  margin-bottom: 36px;
}

/* Default link blue is unreadable on the dark theme; follow the text color instead. */
.section-sub a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- Hero ------------------------------------------------- */
.hero {
  padding-top: 40px;
  padding-bottom: 24px;
  text-align: center;
}

/* 제목이 한 줄로 들어가야 하므로 760px 제한을 두지 않는다.
   3.6rem에서 한 줄 폭이 934px이고 .hero 가용폭은 1052px. */
.hero-inner { margin: 0 auto; }

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0;
}

/* --- Buttons (unused right now; kept for reuse) ------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s, border-color 0.18s;
}

.btn-primary {
  background: #3498db;
  color: #fff;
  border: 1px solid #3498db;
}

.btn-primary:hover {
  background: #2980b9;
  border-color: #2980b9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--input-border-focus);
}

.btn-secondary:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

/* --- Products grid ---------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.product-card {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: var(--input-border-focus);
  transform: translateY(-3px);
  outline: none;
}

.product-card:hover .card-cta {
  opacity: 1;
  border-bottom-color: var(--text);
}

.product-thumb {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
  margin-bottom: 14px;
}

.product-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.product-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.72;
  margin-bottom: 18px;
  flex: 1;
}

.product-tag {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
}

.badge.live { background: #2e7d32; }

.card-cta {
  align-self: flex-start;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.85;
}

.card-cta:hover {
  opacity: 1;
  border-bottom-color: var(--text);
}

/* --- Inside Crop Monitoring (product walkthrough) --------- */
.product-feature {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 56px;
}

.product-feature:last-child { margin-bottom: 0; }

.product-feature.reverse {
  grid-template-columns: 1.4fr 1fr;
}

.product-feature.reverse .product-feature-text {
  order: 2;
}

.feature-num {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0.45;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.product-feature-text h3 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.product-feature-text p {
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.85;
}

.product-feature-shot {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--input-border);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
}

.product-feature-shot img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 880px) {
  .product-feature,
  .product-feature.reverse {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 36px;
  }
  .product-feature.reverse .product-feature-text { order: 0; }
  .product-feature-text h3 { font-size: 1.2rem; }
}

/* --- How it works (steps) --------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  list-style: none;
}

.step {
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  padding: 22px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #3498db;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step p {
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.72;
}

/* --- About block ------------------------------------------ */
.about-block {
  max-width: 760px;
  font-size: 1.04rem;
  line-height: 1.7;
}

.about-block p { margin-bottom: 16px; opacity: 0.85; }

.about-block strong { color: var(--text); }

/* --- Leadership / Founder card ---------------------------- */
.leadership-card {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 16px;
  padding: 28px;
  max-width: 920px;
}

.leadership-header {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.founder-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db, #2c3e50);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.founder-meta h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.founder-name-kr {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 6px;
}

.founder-title {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-top: 2px;
}

.founder-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  opacity: 0.85;
  transition: opacity 0.15s, border-color 0.15s;
}

.founder-link:hover {
  opacity: 1;
  border-bottom-color: var(--text);
}

.founder-bio p {
  font-size: 0.98rem;
  line-height: 1.65;
  opacity: 0.85;
  margin-bottom: 12px;
}

.founder-bio p:last-child { margin-bottom: 0; }

.founder-bio strong { color: var(--text); }

/* 1열. 2열(열폭 ~407px)에서는 항목 대부분이 두 줄로 끊겨 연도만 다음 줄에
   남았다. 전체 폭을 쓰면 가장 긴 항목도 한 줄에 들어간다. */
.founder-credentials {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--input-border);
}

.credential-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.6;
  margin-bottom: 10px;
}

.credential-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.credential-block li {
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.8;
  padding-left: 14px;
  position: relative;
  margin-bottom: 7px;
}

.credential-block li::before {
  content: "•";
  position: absolute;
  left: 0;
  opacity: 0.5;
}

/* 연도는 보조 정보 — 작게 낮추고, 좁은 화면에서도 괄호가 쪼개지지 않게 고정 */
.credential-year {
  font-size: 0.82em;
  opacity: 0.65;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .leadership-card { padding: 22px; }
  .leadership-header { flex-direction: column; align-items: flex-start; }
}

/* --- Office (address + map) ------------------------------- */
.office-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.office-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.office-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.6;
  margin-bottom: 8px;
}

.office-address {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  opacity: 0.9;
}

.office-address.kr {
  font-size: 0.92rem;
  opacity: 0.7;
}

.office-link {
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  opacity: 0.85;
  transition: opacity 0.15s, border-color 0.15s;
}

.office-link:hover {
  opacity: 1;
  border-bottom-color: var(--text);
}

#office-leaflet {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  z-index: 1;
}

/* Leaflet tooltip on the office marker */
.office-tooltip {
  font-size: 11px;
  font-weight: 600;
}

/* Map data credits (OpenStreetMap). Themed so it reads on dark and light pages alike;
   the corner pad keeps it clear of the container's 12px radius. */
#office-leaflet .leaflet-control-attribution {
  font-size: 10px;
  line-height: 1.4;
  padding: 1px 8px 1px 6px;
  border-top-left-radius: 6px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--text);
}

#office-leaflet .leaflet-control-attribution a {
  color: var(--text);
  text-decoration: underline;
}

.office-map-fallback {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.office-map-fallback a {
  color: var(--text);
  text-decoration: underline;
}

.office-map-caption {
  margin-top: 8px;
  font-size: 0.78rem;
  opacity: 0.5;
  text-align: center;
}

@media (max-width: 768px) {
  .office-grid { grid-template-columns: 1fr; }
  #office-leaflet { height: 240px; }
}

/* --- Contact grid ----------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-card,
.contact-card:link,
.contact-card:visited {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.18s, transform 0.12s;
}

.contact-card:hover {
  border-color: var(--input-border-focus);
  transform: translateY(-2px);
}

.contact-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.7;
}

.contact-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 36px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.site-footer .logo.small { font-size: 1.1rem; }

.footer-sub {
  font-size: 0.78rem;
  opacity: 0.55;
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 880px) {
  html { scroll-padding-top: 64px; }
  .site-nav { padding: 12px 16px; }
  .site-nav-links { gap: 14px; }
  /* 좁은 화면에서는 앵커 목록을 감추고 로고+테마 토글만 남긴다.
     (예전에는 .nav-cta만 예외로 남겼으나 해당 버튼이 삭제되어 예외가 사라졌다.) */
  .site-nav-links a { display: none; }
  .site-nav .logo-sub { display: none; }

  .product-grid,
  .steps-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .section { padding-top: 56px; padding-bottom: 56px; }
  .hero { padding-top: 50px; padding-bottom: 40px; }
  .hero-title { font-size: 2rem; }

  .site-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* --- 카드 2장 그리드 + 변화탐지 섹션 (2026-10-22, ko.html 전용) ---- */
/* 변화탐지 카드는 ko.html에만 있어 2열은 .two-up을 단 그리드에만 건다. 영문 index.html의 카드 1장
   레이아웃은 6c45a2c 이전 그대로다. 880px 이하는 위 Responsive 규칙대로 1열(그래서 min-width로 한정).
   두 썸네일의 원본 비율이 달라(1400×741 / 1400×792) 같은 높이로 맞추고 위쪽 기준으로 자른다. */
@media (min-width: 881px) { .product-grid.two-up { grid-template-columns: repeat(2, 1fr); } }
.product-grid.two-up .product-thumb img { aspect-ratio: 1400 / 741; object-fit: cover; object-position: top; }

/* 면책·출처 문구 */
.product-note {
  margin-top: 44px;
  font-size: 0.85rem;
  line-height: 1.65;
  opacity: 0.6;
}

/* 네비 항목이 8개가 되어 881~1040px에서 "지구의 변화"·"How it works"가 두 줄로 접혔다. */
.site-nav-links a { white-space: nowrap; }
@media (min-width: 881px) and (max-width: 1040px) { .site-nav-links { gap: 14px; } }

/* --- 언어 전환 링크 (EN / 한국어) ------------------------------ */
/* 880px 이하에서는 앵커 링크를 모두 숨기지만, 언어 전환은 모바일에서도 남긴다. */
.site-nav-links a.lang-switch {
  padding: 2px 8px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 0.8rem;
}
@media (max-width: 880px) { .site-nav-links a.lang-switch { display: inline-block; } }
/* 전환 링크가 더해져 영문 네비가 881~960px에서 15px 넘쳤다(가로 스크롤). 이 구간만 조금 좁힌다. */
@media (min-width: 881px) and (max-width: 960px) {
  .site-nav { padding-left: 20px; padding-right: 20px; }
  .site-nav-links { gap: 12px; }
  .site-nav-links a { font-size: 0.85rem; }
}

/* 한글은 음절마다 줄이 바뀌어 "통찰합니/다"처럼 단어가 잘린다. 어절 단위로 줄바꿈한다. */
html:lang(ko) body { word-break: keep-all; overflow-wrap: break-word; }
