/* ============================================================
   OpeClaud Research Lab — Global Stylesheet
   Run By OpeClaud Ai Company
   ------------------------------------------------------------
   Palette (Nordic Slate):
   - Ice gray background : #F0F5F9
   - Cool steel accent   : #C9D6DF
   - Slate text          : #52616B
   - Near-black          : #1E2022
   ============================================================ */

/* ---------- Design Tokens (Light) ---------- */
:root {
  --bg: #F0F5F9;
  --bg-alt: #E7EEF3;
  --bg-card: #FFFFFF;
  --steel: #C9D6DF;
  --steel-dark: #A9BAC8;
  --slate: #52616B;
  --slate-dark: #3B4750;
  --ink: #1E2022;
  --ink-soft: #2A2D30;
  --accent: #2F4858;
  --text: #1E2022;
  --text-muted: #52616B;
  --border: #D5DEE5;
  --shadow: 0 8px 30px rgba(30, 32, 34, 0.08);
  --shadow-sm: 0 3px 14px rgba(30, 32, 34, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-head: 'Sora', 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Design Tokens (Dark) ---------- */
[data-theme="dark"] {
  --bg: #141617;
  --bg-alt: #1B1E20;
  --bg-card: #1E2022;
  --steel: #2F4858;
  --steel-dark: #3D5A6E;
  --slate: #C9D6DF;
  --slate-dark: #A9BAC8;
  --ink: #F0F5F9;
  --ink-soft: #DDE7EE;
  --accent: #7FA6C2;
  --text: #F0F5F9;
  --text-muted: #A9BAC8;
  --border: #2A2F33;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.3);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth; /* smooth scroll navigation */
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  margin: 0;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

a:hover {
  color: var(--slate-dark);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

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

/* ---------- Top Navigation ---------- */
.navbar {
  padding: 1rem 0;
  transition: var(--transition);
  background: transparent;
}

/* Navbar turns solid once scrolled */
.navbar.scrolled {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: 0.6rem 0;
}

.navbar-brand {
  font-family: var(--font-head);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand .brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}

.navbar-brand .brand-dot {
  color: var(--accent);
}

.navbar .nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  margin: 0 0.35rem;
  position: relative;
}

/* Animated underline micro-interaction */
.navbar .nav-link::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 100%;
  bottom: 0.3rem;
  height: 2px;
  background: var(--accent);
  transition: right 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--text);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
  right: 0.5rem;
}

.navbar-toggler {
  border: none;
  color: var(--text);
  font-size: 1.4rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* ---------- Dark / Light Mode Toggle ---------- */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(20deg);
}

/* Hide the inactive icon */
[data-theme="dark"] .icon-sun,
.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: inline-block;
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 140px 0 80px;
  background: linear-gradient(160deg, rgba(240, 245, 249, 0.92), rgba(240, 245, 249, 0.82)),
              url('https://images.unsplash.com/photo-1518770660439-4636190af475?w=1920&h=1080&fit=crop') center/cover fixed no-repeat;
  color: var(--ink);
}

.hero .badge-lab {
  display: inline-block;
  background: rgba(47, 72, 88, 0.08);
  border: 1px solid rgba(47, 72, 88, 0.25);
  color: var(--accent);
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  color: var(--ink);
  margin-bottom: 1.2rem;
  line-height: 1.1;
}

.hero p {
  color: var(--slate);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto 2.2rem;
}

.hero .hero-cta .btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.hero .hero-cta .btn-outline {
  border-color: var(--slate);
  color: var(--ink);
}

.hero .scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--slate);
  font-size: 1.4rem;
  animation: bob 2s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* ---------- Section Headings ---------- */
.section {
  padding: 5rem 0;
}

.section-eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.4rem 0 0.6rem;
}

.section-sub {
  color: var(--text-muted);
  max-width: 620px;
}

/* ---------- Masonry Grid ---------- */
.masonry {
  columns: 3;
  column-gap: 1.6rem;
}

@media (max-width: 992px) {
  .masonry { columns: 2; }
}

@media (max-width: 600px) {
  .masonry { columns: 1; }
}

.masonry .masonry-item {
  break-inside: avoid;
  margin-bottom: 1.6rem;
}

/* ---------- Article Card ---------- */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  color: var(--text);
  border-color: var(--steel-dark);
}

.article-card .card-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.article-card:hover .card-img {
  transform: scale(1.05);
}

.article-card .card-img-wrap {
  overflow: hidden;
}

.article-card .card-body {
  padding: 1.4rem;
}

.article-card .card-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.article-card h3 {
  font-size: 1.15rem;
  margin: 0.5rem 0 0.6rem;
  line-height: 1.35;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.article-card .card-meta i {
  margin-right: 0.3rem;
}

/* ---------- Feature Card (home spotlight) ---------- */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.feature-card img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

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

/* ---------- Newsletter / CTA band ---------- */
.newsletter-band {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 3.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-band h2 {
  color: var(--bg);
}

.newsletter-band p {
  color: var(--steel);
}

.newsletter-band .form-control {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
}

.newsletter-band .form-control::placeholder {
  color: var(--steel-dark);
}

.newsletter-band .form-control:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--steel);
  box-shadow: none;
  color: #fff;
}

.newsletter-band .btn {
  background: var(--steel);
  color: var(--ink);
  border: none;
}

.newsletter-band .btn:hover {
  background: #fff;
  color: var(--ink);
}

/* ---------- Fat Footer ---------- */
.fat-footer {
  background: var(--ink);
  color: var(--slate);
  padding: 4rem 0 0;
  margin-top: 5rem;
}

.fat-footer h5 {
  color: var(--bg);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.fat-footer a {
  color: var(--slate);
  font-size: 0.92rem;
}

.fat-footer a:hover {
  color: #fff;
}

.fat-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.fat-footer .footer-brand {
  font-family: var(--font-head);
  font-weight: 800;
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fat-footer .footer-brand .brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
}

.fat-footer .social-row {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.fat-footer .social-row a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 214, 223, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--steel);
  transition: var(--transition);
}

.fat-footer .social-row a:hover {
  background: var(--steel);
  color: var(--ink);
  transform: translateY(-3px);
}

.fat-footer .footer-map {
  width: 100%;
  border-radius: var(--radius-sm);
  border: none;
  min-height: 150px;
  filter: grayscale(1) contrast(0.9);
}

.fat-footer .footer-bottom {
  border-top: 1px solid rgba(201, 214, 223, 0.15);
  margin-top: 3rem;
  padding: 1.4rem 0;
  font-size: 0.85rem;
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 1050;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Scroll Fade-in Animations ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Staggered delays for grids */
.masonry .masonry-item:nth-child(2) .fade-up { transition-delay: 0.08s; }
.masonry .masonry-item:nth-child(3) .fade-up { transition-delay: 0.16s; }
.masonry .masonry-item:nth-child(4) .fade-up { transition-delay: 0.24s; }
.masonry .masonry-item:nth-child(5) .fade-up { transition-delay: 0.32s; }
.masonry .masonry-item:nth-child(6) .fade-up { transition-delay: 0.4s; }

/* ---------- Article / Post Page ---------- */
.post-header {
  padding: 9rem 0 3rem;
  text-align: center;
  background: var(--bg-alt);
}

.post-header .post-cat {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.post-header h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  max-width: 820px;
  margin: 0.8rem auto;
}

.post-header .post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-body {
  font-size: 1.05rem;
  color: var(--text);
}

.post-body h2 {
  font-size: 1.5rem;
  margin: 2.4rem 0 1rem;
}

.post-body p {
  margin-bottom: 1.4rem;
  color: var(--text-muted);
}

.post-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  padding: 1.2rem 1.6rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
  margin: 1.8rem 0;
}

.post-body ul {
  margin: 0 0 1.4rem 1.2rem;
}

.post-body ul li {
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}

/* ---------- About / Stat blocks ---------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.stat-card .stat-num {
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Contact / Form ---------- */
.form-control, .form-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.1rem;
}

.form-control:focus, .form-select:focus {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(47, 72, 88, 0.12);
  color: var(--text);
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Upload / Submit page ---------- */
.upload-zone {
  border: 2px dashed var(--steel-dark);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-alt);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--bg-card);
}

.upload-zone i {
  font-size: 2.6rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

/* Uploaded user posts keep the same card style (reused .article-card) */

/* ---------- Utilities ---------- */
.text-accent { color: var(--accent); }
.bg-alt { background: var(--bg-alt); }
.gap-2r { gap: 2rem; }
.badge-cat {
  display: inline-block;
  background: var(--steel);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}

/* Responsive navbar collapse panel */
@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-top: 0.8rem;
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow-sm);
  }
  .navbar .nav-link { padding: 0.6rem 0; }
}
