/* ==========================================================================
   Kartikey Pant - Personal Website Stylesheet
   Warm Minimalist Editorial Aesthetic · Contemporary Design Engineering
   ========================================================================== */

:root {
  --bg: #faf9f6;
  --text: #171717;
  --text-muted: #737373;
  --section-label: #525252; /* text-neutral-600 */
  --border: #e5e5e5;
  
  /* Action Link Pills: Light Mode */
  --pill-bg: transparent;
  --pill-border: #d4d4d4; /* border-neutral-300 */
  --pill-text: #262626;   /* text-neutral-800 */
  --pill-hover-bg: #f5f5f5; /* hover:bg-neutral-100 */
  --pill-hover-text: #171717;

  --pulse-dot: #10b981;
  
  --font-serif: "Newsreader", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0c0d0e;
  --text: #ededed;
  --text-muted: #737373;
  --section-label: #a3a3a3; /* text-neutral-400 */
  --border: #262626;

  /* Action Link Pills: Dark Mode */
  --pill-bg: transparent;
  --pill-border: #404040; /* border-neutral-700 */
  --pill-text: #e5e5e5;   /* text-neutral-200 */
  --pill-hover-bg: #262626; /* hover:bg-neutral-800 */
  --pill-hover-text: #ffffff;

  --pulse-dot: #10b981;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d0e;
    --text: #ededed;
    --text-muted: #737373;
    --section-label: #a3a3a3; /* text-neutral-400 */
    --border: #262626;

    /* Action Link Pills: Dark Mode */
    --pill-bg: transparent;
    --pill-border: #404040; /* border-neutral-700 */
    --pill-text: #e5e5e5;   /* text-neutral-200 */
    --pill-hover-bg: #262626; /* hover:bg-neutral-800 */
    --pill-hover-text: #ffffff;

    --pulse-dot: #10b981;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7; /* leading-relaxed */
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 540px;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem 1.5rem; /* py-20 px-6 */
}

/* Header & Identity */
header {
  margin-bottom: 2.75rem;
}

.header-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.header-title-row h1.name {
  margin-bottom: 0;
}

/* 1. Theme Switcher */
.theme-toggle-btn {
  background: transparent;
  border: none;
  width: 2rem; /* w-8 */
  height: 2rem; /* h-8 */
  color: var(--section-label);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem; /* text-sm */
  cursor: pointer;
  border-radius: 0.375rem;
  transition: color 0.15s ease, background-color 0.15s ease;
  outline: none;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--text);
  background-color: var(--pill-hover-bg);
}

.sun-icon {
  display: none;
}
.moon-icon {
  display: block;
}

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

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon {
    display: block;
  }
  :root:not([data-theme="light"]) .moon-icon {
    display: none;
  }
}

h1.name {
  font-family: var(--font-serif);
  font-size: 1.875rem; /* 30px / text-3xl */
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 1rem;
}

.role-summary {
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* SF Badge with Pulse Dot */
.badge-wrapper {
  margin-bottom: 1.35rem;
}

.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem; /* 12px / text-xs */
  line-height: 1; /* leading-none */
  letter-spacing: -0.01em;
  color: var(--section-label);
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 0.375rem 0.75rem; /* px-3 py-1.5 */
  border-radius: 0.375rem; /* rounded-md */
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--pulse-dot);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background-color: var(--pulse-dot);
  opacity: 0.75;
  animation: pulse-ring 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.9);
    opacity: 0;
  }
  100% {
    transform: scale(0.9);
    opacity: 0;
  }
}

/* 2. Action Links / Connect Row */
.connect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem; /* gap-2.5 */
  margin-top: 1.5rem;
}

.pill-link {
  font-family: var(--font-mono);
  font-size: 0.75rem; /* 12px / text-xs */
  line-height: 1; /* leading-none */
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  padding: 0.375rem 0.75rem; /* px-3 py-1.5 */
  border-radius: 0.375rem; /* rounded-md */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

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

.pill-link:active {
  transform: scale(0.98);
}

.pill-link .arrow {
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.pill-link:hover .arrow {
  transform: translate(1px, -1px);
}

/* Copy Email Button */
.pill-btn {
  font-family: var(--font-mono);
  outline: none;
  user-select: none;
  line-height: 1;
}

.copied-badge {
  display: none;
  color: #10b981;
  font-weight: 500;
  line-height: 1;
}

.pill-btn.is-copied {
  border-color: rgba(16, 185, 129, 0.5);
  background-color: var(--pill-hover-bg);
}

.pill-btn.is-copied #copy-email-text {
  display: none;
}

.pill-btn.is-copied #copy-email-feedback {
  display: inline-flex;
}

/* 4. Sections & Typography */
section {
  margin-top: 2.75rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em; /* tracking-widest */
  color: var(--section-label);
  margin-bottom: 0.75rem;
}

section p {
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.7; /* leading-relaxed */
}

/* 3. Interests & Topics (Flex with Fixed Left Dash) */
.interests-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.interest-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem; /* gap-2 */
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
}

.interest-item strong {
  font-weight: 500;
  color: var(--text);
}

.interest-item .dash {
  color: var(--section-label);
  font-family: var(--font-mono);
  flex-shrink: 0;
  user-select: none;
  line-height: 1.7;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem; /* 12px */
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 520px) {
  .container {
    padding-top: 3.5rem;
    padding-bottom: 4rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .connect-row {
    gap: 0.5rem;
  }
}
