/* Navendu Brajesh — portfolio styles */

:root {
  color-scheme: light dark;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #fafaf9;
  --bg-alt: #f5f5f4;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #57534e;
  --border: #e7e5e4;
  --accent: #0f766e;
  --accent-hover: #0d9488;
  --accent-soft: #ccfbf1;
  --shadow: 0 1px 3px rgb(28 25 23 / 0.08), 0 8px 24px rgb(28 25 23 / 0.06);
  --header-h: 4.5rem;
  --radius: 12px;
  --max-w: 68rem;
  --focus: 0 0 0 3px rgb(15 118 110 / 0.35);
}

[data-theme="dark"] {
  --bg: #0c0a09;
  --bg-alt: #1c1917;
  --surface: #292524;
  --text: #fafaf9;
  --text-muted: #a8a29e;
  --border: #44403c;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgb(45 212 191 / 0.12);
  --shadow: 0 1px 3px rgb(0 0 0 / 0.35), 0 8px 24px rgb(0 0 0 / 0.25);
  --focus: 0 0 0 3px rgb(45 212 191 / 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

.container {
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus { left: 1rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: height 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  height: 3.5rem;
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: min(100% - 2rem, var(--max-w));
  margin-inline: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.wordmark span {
  transition: opacity 0.2s ease;
}

.site-header.is-scrolled .wordmark span {
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover { border-color: var(--accent); }

[data-theme="light"] .theme-icon-moon,
[data-theme="dark"] .theme-icon-sun { display: none; }

/* Hero */
.hero {
  padding: clamp(4rem, 12vw, 7rem) 0 clamp(3rem, 8vw, 5rem);
}

.hero-inner { max-width: 42rem; }

.hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-tagline {
  margin: 0 0 1rem;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

.hero-intro {
  margin: 0 0 2rem;
  color: var(--text-muted);
  max-width: 36rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sections */
.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.section-alt { background: var(--bg-alt); }

.section-header {
  margin-bottom: 2rem;
  max-width: 40rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

.section-header code {
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.project-card.is-featured {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%);
}

@media (min-width: 48rem) {
  .project-card.is-featured {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  .project-card.is-featured .project-body { flex: 1; }
}

.project-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  width: fit-content;
}

.project-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.project-date {
  margin-left: auto;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.project-card h3 {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  min-width: 0;
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card h3 a:hover { color: var(--accent); }

.project-desc {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.975rem;
  flex: 1;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
}

.project-links a {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.loading, .error-msg {
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.error-msg { color: #b91c1c; }

[data-theme="dark"] .error-msg { color: #fca5a5; }

/* Writing */
.writing-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.writing-item a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.writing-item a:hover {
  border-color: var(--accent);
}

.writing-title {
  font-weight: 600;
  flex: 1 1 16rem;
}

.writing-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.writing-more {
  margin: 1.5rem 0 0;
  font-weight: 600;
}

/* About */
.about-grid .section-header { margin-bottom: 1.5rem; }

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 44rem;
}

@media (min-width: 40rem) {
  .about-content {
    flex-direction: row;
    align-items: flex-start;
  }
}

.about-monogram {
  flex-shrink: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.about-bio {
  margin: 0;
  font-size: 1.0625rem;
}

/* Connect */
.connect-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connect-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.connect-card-static {
  cursor: default;
}

.connect-card-static:hover {
  transform: none;
  border-color: var(--border);
}

.connect-icon {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  color: var(--accent);
}

.connect-icon-logo {
  object-fit: contain;
}

.connect-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.connect-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.connect-handle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.connect-card-static .connect-handle {
  color: var(--text);
}

.connect-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.project-link-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer-inner p { margin: 0; }

/* Mobile nav */
@media (max-width: 40rem) {
  .site-nav { gap: 0.75rem; }
  .site-nav a { font-size: 0.8125rem; }
  .wordmark span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
