/* Mayank Negi — Editorial Personal Identity Stylesheet */
:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --bg-elevated: #ffffff;
  --bg-subtle: #f2f2ee;
  --text: #111318;
  --text-secondary: #374151;
  --text-muted: #5b6370;
  --border: #e4e4df;
  --border-strong: #c9c9c2;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-subtle: rgba(29, 78, 216, 0.08);
  --error: #b91c1c;
  --success: #15803d;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --container: 960px;
  --measure: 68ch;
  --radius: 8px;
  --radius-sm: 4px;
}

[data-theme="light"] {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e12;
  --bg-elevated: #14171f;
  --bg-subtle: #1a1e28;
  --text: #f3f4f6;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #232834;
  --border-strong: #363e52;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-subtle: rgba(96, 165, 250, 0.12);
  --error: #f87171;
  --success: #4ade80;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.site-brand-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  background: #38373c;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 16px;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.nav-list[popover]:popover-open {
  position: fixed;
  top: 72px;
  right: 24px;
  left: 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-subtle);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .nav-list[popover] {
    display: flex;
    position: static;
    inset: unset;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 0.875rem;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.icon-moon {
  display: block;
}

.icon-sun {
  display: none;
}

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

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

/* Main Content & Typography */
main {
  padding: 48px 0 72px;
}

.breadcrumb {
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--border-strong);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.hero-name-display {
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.hero-role {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.lead {
  margin: 0 0 24px;
  max-width: var(--measure);
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

h2 {
  margin: 0 0 14px;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 650;
}

p {
  margin: 0 0 16px;
  max-width: var(--measure);
  color: var(--text-secondary);
}

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

/* Editorial Hero Layout */
.hero-section {
  padding: 16px 0 44px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}

@media (min-width: 720px) {
  .hero-grid {
    grid-template-columns: 1fr auto;
    gap: 48px;
  }
}

.hero-portrait-wrap {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background: #38373c;
  flex-shrink: 0;
}

@media (min-width: 720px) {
  .hero-portrait-wrap {
    width: 176px;
    height: 176px;
  }
}

.hero-portrait-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

/* Sections & Cards */
.section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 680px) {
  .card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tag-accent {
  background: var(--accent-subtle);
  border-color: transparent;
  color: var(--accent);
}

.card p {
  font-size: 0.9375rem;
  margin: 0;
}

.card-links {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Fact / Metadata Table */
.dl-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

@media (min-width: 640px) {
  .dl-grid {
    grid-template-columns: 220px 1fr;
  }
}

.dl-row {
  display: contents;
}

.dl-row dt,
.dl-row dd {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.dl-row dt {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
}

.dl-row dd {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.dl-grid > .dl-row:last-child dt,
.dl-grid > .dl-row:last-child dd {
  border-bottom: none;
}

.list-clean {
  margin: 0;
  padding-left: 20px;
  max-width: var(--measure);
  color: var(--text-secondary);
}

.list-clean li {
  margin-bottom: 10px;
}

.callout {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.callout p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.filter-btn[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.is-hidden {
  display: none !important;
}

/* Contact Form (Modern Web Guidance compliant validation) */
.contact-form {
  display: grid;
  gap: 18px;
  max-width: 600px;
}

.field {
  display: grid;
  gap: 6px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: var(--error);
}

.field-error {
  min-height: 1.15em;
  font-size: 0.8125rem;
  color: var(--error);
}

.form-status {
  min-height: 1.5em;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.form-status.is-ready {
  color: var(--success);
}

.draft-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: pre-wrap;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-heading {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-base {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
}
