/* ============================================================
   wseed.world — Global stylesheet
   ============================================================ */

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

:root {
  --accent:      #1B7A8A;
  --accent-dark: #145f6d;
  --text:        #1a1a1a;
  --muted:       #555;
  --border:      #ddd;
  --bg:          #ffffff;
  --bg-alt:      #f7f7f5;
  --nav-height:  56px;
  --max-w:       760px;
  --font-serif:  'Georgia', 'Times New Roman', serif;
  --font-sans:   'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Scroll progress bar ──────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ── Navigation ───────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  height: var(--nav-height);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.2s;
}

/* ── Page layout ──────────────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* ── Hero (homepage only) ─────────────────────────────────── */
.hero {
  margin-bottom: 48px;
}

.hero-img {
  width: 100%;
  border-radius: 2px;
  margin-bottom: 36px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: bold;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
}

.hero .subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.img-caption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -28px;
  margin-bottom: 28px;
  text-align: center;
  line-height: 1.5;
}

.wseed-label {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 14px;
  text-align: center;
  white-space: nowrap;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.paper-subtitle {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 16px;
  text-align: left;
}

/* ── Section headings ─────────────────────────────────────── */
h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: normal;
  margin: 48px 0 16px;
  color: var(--text);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 32px 0 8px;
  color: var(--text);
}

p { margin-bottom: 16px; text-align: justify; }

/* ── Divider ──────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── Research page ────────────────────────────────────────── */
.paper-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 12px;
}

.paper-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.paper-img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin: 28px 0;
}

.abstract {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 0.95rem;
  color: var(--text);
}

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

/* download buttons */
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-size: 0.88rem;
  color: var(--accent);
  background: var(--bg);
  transition: background 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
}

/* ── Data page ────────────────────────────────────────────── */
.data-section {
  margin-bottom: 36px;
}

.data-section h3 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.citation-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 16px 14px;
  font-size: 0.85rem;
  font-family: var(--font-serif);
  color: var(--text);
  margin-top: 12px;
  line-height: 1.6;
}

/* ── App page ─────────────────────────────────────────────── */
.app-frame-wrapper {
  position: relative;
  width: 100%;
  padding-top: 75%;   /* 4:3 aspect ratio */
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 28px 0;
}

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

.app-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 8px;
}

/* ── People page ──────────────────────────────────────────── */
.person {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.person:first-of-type { padding-top: 0; }
.person:last-of-type  { border-bottom: none; }

.person-photo {
  width: 135px;
  height: 135px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.person-photo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--border);
}

.person-info { flex: 1; }

.person-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.person-name a { color: var(--text); }
.person-name a:hover { color: var(--accent); text-decoration: none; }

.person-role {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.person-bio {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.person-email {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Carousel ─────────────────────────────────────────────── */
.carousel {
  position: relative;
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-alt);
  overflow: hidden;
}

.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--bg-alt);
}

.carousel-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active  { display: flex; }

.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.88);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s, color 0.15s;
}
.carousel-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 12px;
}

.carousel-dots { display: flex; gap: 7px; }

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.carousel-dot.active { background: var(--accent); }

.carousel-counter {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  text-align: left;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2001;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.carousel-slide img { cursor: zoom-in; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 12px 24px;
  }
  .nav-toggle { display: flex; }

  nav { position: relative; }

  .hero h1 { font-size: 1.5rem; }

  .wseed-label { white-space: normal; font-size: 1.5rem; }

.person { flex-direction: column; gap: 16px; align-items: center; }
  .person-info { text-align: center; }

  .downloads { flex-direction: column; }

  .app-frame-wrapper { padding-top: 120%; }
}
