/* =========
   Global CSS
   ========= */

/* Root design tokens */
:root {
  --bg: #ffffff;
  --bg-alt: #f3f4f6;
  --text: #111827;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --accent: #111827;
  --accent-soft: #e5e7eb;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);

  --bg-footer: #ffffff;
  --link: #2563eb;
  --link-hover: #1e40af;

  /* Case-study / surfaces */
  --surface-card: #ffffff;   /* elevated cards */
  --surface-soft: #f8fafc;   /* soft panels / bands */
  --surface-tag: #f1f5f9;    /* pills / tags / chips */
  --border-strong: #e2e8f0;  /* stronger border for cards */
}

/* Dark mode overrides */
[data-theme="dark"] {
  --bg: #020617;
  --bg-alt: #020617;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2937;
  --accent: #f9fafb;
  --accent-soft: #111827;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.7);

  --bg-footer: #020617;
  --link: #93c5fd;
  --link-hover: #bfdbfe;

  /* Case-study / surfaces */
  --surface-card: #020617;   /* cards blend with page but framed by border */
  --surface-soft: #020617;   /* soft sections */
  --surface-tag: #020617;    /* chips / tags (border still defines shape) */
  --border-strong: #1f2937;  /* stronger border for cards */
}

/* Respect system preferences */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
  }
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Global content wrapper */
.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

/* Offset for sticky header */
main {
  padding-top: 5rem;
}

/* =========
   Header / Nav
   ========= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .site-header {
  background-color: rgba(2, 6, 23, 0.9);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hide tagline on mobile */
@media (max-width: 640px) {
  .nav-tagline {
    display: none;
  }
}

.nav-logo {
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
}

.nav-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.nav-link--active {
  color: var(--accent);
  font-weight: 500;
}

/* Theme toggle – icon-only button */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.theme-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Hover state */
.theme-toggle:hover {
  background-color: var(--bg-alt);
  color: var(--text);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

/* Slightly smaller on mobile */
@media (max-width: 640px) {
  .theme-toggle {
    width: 30px;
    height: 30px;
  }

  .theme-icon {
    font-size: 1rem;
  }
}


.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Mobile hamburger */
.nav-menu-toggle {
  display: none;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.nav-menu-toggle span {
  font-size: 1.1rem;
}

/* Mobile menu */
.nav-links-mobile {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 0.75rem;
}

.nav-links-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-alt);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-links-mobile a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links-mobile a.nav-link--active {
  color: var(--accent);
  font-weight: 500;
}

.nav-links-mobile.is-open {
  display: block;
}

/* Show hamburger on small screens */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-menu-toggle {
    display: inline-flex;
  }
}

/* =========
   Typography
   ========= */

.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Keep H1 global consistent with your case-study.css (larger, modern) */
h1,
.page-title {
  font-size: 2.8rem;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

h2 {
  font-size: 2rem;
  margin: 2.75rem 0 0.75rem;
  line-height: 1.25;
}

h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0.25rem 0 1rem;
}

/* No max-width on any text. */
.selected-work-intro,
.connect-section p,
.page-shell p,
main > p {
  max-width: none;
}

/* =========
   Links
   ========= */

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.link-underline:hover::after {
  transform: scaleX(1);
}

/* =========================
   CONNECT / CTA SECTION
   ========================= */

.connect-section {
  padding: 2.5rem 1.5rem 3.5rem;  /* modest top, comfy bottom */
  margin-top: 2.5rem;             /* space off previous content */
  border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.06));
}

[data-theme="dark"] .connect-section {
  border-top-color: var(--border-subtle-dark, rgba(255,255,255,0.12));
}

.connect-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.connect-section h2 {
  margin-bottom: 0.75rem;
}

.connect-section p {
  margin: 0 0 1.25rem;
}

.connect-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  justify-content: center;
}

/* Tighten up on very small screens if needed */
@media (max-width: 600px) {
  .connect-section {
    padding-top: 2rem;
    padding-bottom: 3rem;
    margin-top: 2rem;
  }
}


/* =========
   Utilities: fade-in sections
   ========= */

.fade-section {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.fade-delay-1 {
  transition-delay: 0.1s;
}

.fade-delay-2 {
  transition-delay: 0.2s;
}

.fade-delay-3 {
  transition-delay: 0.3s;
}


/* =========
   Footer
   ========= */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 2rem 2.5rem;
  background: var(--bg-footer);
  margin-top: 3.5rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-social a {
  margin: 0 0.5rem;
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: 0.2s ease;
}

.footer-social a:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .footer-social a {
    font-size: 1.25rem;
  }
  .footer-copy {
    font-size: 0.8rem;
  }
}
