:root {
  --bg-color: #0d0d0d;
  --bg-alt: #161616;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #e2e2e2;
  --accent-glow: rgba(255, 255, 255, 0.05);
  --border: #2a2a2a;
  --border-light: rgba(255, 255, 255, 0.1);
  --success: #34d399;
  --error: #f87171;
  --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;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle animated grain overlay */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.nav.scrolled {
  padding: 1rem 0;
  background: rgba(13, 13, 13, 0.8);
  border-bottom: 1px solid var(--border-light);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.05em;
  position: relative;
}

.nav-logo::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background-color: var(--accent);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: baseline;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

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

.nav-cta {
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease !important;
}

.nav-cta:hover {
  background: var(--text-primary);
  color: var(--bg-color) !important;
}

/* Mobile Menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  position: relative;
  z-index: 110;
}

.nav-toggle span {
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--text-primary);
  left: 0;
  transition: all 0.3s ease;
}

.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }

.nav-toggle.active span:first-child {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle.active span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-color);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-links {
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mobile-menu-links a {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.mobile-menu-links a:hover {
  color: var(--text-primary);
}

/* Sections */
.section {
  padding: 8rem 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 4rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.5rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.section-title {
  font-size: 2rem;
  font-weight: 400;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 5rem;
}

.hero-content {
  max-width: 800px;
}

.hero-label {
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}

.hero-name .dot {
  color: var(--text-muted);
}

.hero-tagline {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.4;
  margin-bottom: 3rem;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.hero-time {
  position: absolute;
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  text-align: right;
  font-family: var(--font-mono);
  opacity: 0.5;
}

.time-display {
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.date-display {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: rotate(-90deg);
  transform-origin: left bottom;
}

.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--text-primary);
  animation: scrollLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollLine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-ghost:hover {
  border-color: var(--text-primary);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.about-lead {
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 300;
}

.about-skills {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Projects */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 2rem;
  padding: 2.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.project-item-muted {
  opacity: 0.6;
  border: 1px dashed var(--border);
  background: transparent;
}

.project-item-muted:hover {
  opacity: 1;
  border-style: solid;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-number {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.project-status-live { color: var(--success); }
.project-status-live .status-dot { 
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.project-status-dev { color: var(--text-muted); }
.project-status-dev .status-dot { background-color: var(--text-muted); }

.project-name {
  font-size: 2rem;
  margin-bottom: 1rem;
}

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

.arrow-icon {
  width: 24px;
  height: 24px;
  opacity: 0;
  transform: translate(-10px, 10px);
  transition: all 0.3s ease;
}

.project-item:hover .arrow-icon {
  opacity: 1;
  transform: translate(0, 0);
}

.project-desc {
  font-size: 1.125rem;
  max-width: 600px;
  margin-bottom: 2rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.project-tech a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-tech a:hover {
  color: var(--text-primary);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
}

.contact-lead {
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 300;
  margin-bottom: 2rem;
}

.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.contact-social svg {
  width: 20px;
  height: 20px;
}

.contact-social:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.contact-form {
  background: var(--bg-alt);
  padding: 3rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-field {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-field label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.optional {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.field-error {
  position: absolute;
  bottom: -1.25rem;
  left: 0;
  color: var(--error);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.field-error.show {
  opacity: 1;
}

.btn-submit {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn-spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: var(--bg-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-submit.loading .btn-label { opacity: 0; }
.btn-submit.loading .btn-spinner { opacity: 1; }

.form-feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0;
  display: none;
}

.form-feedback.show {
  opacity: 1;
  display: block;
  animation: fadeIn 0.3s ease;
}

.form-feedback.success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.form-feedback.error {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* Schedule */
.schedule-content {
  background: var(--bg-alt);
  padding: 4rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-align: center;
}

.schedule-lead {
  font-size: 1.25rem;
  margin-bottom: 3rem;
}



/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-right {
  text-align: right;
}

.footer-note {
  font-family: var(--font-mono);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-time {
    display: none;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 5rem 0;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }

  .about-grid,
  .contact-grid,
  .form-row {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
  }

  .project-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .schedule-content {
    padding: 2rem 1rem;
  }
  
  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* AI Chat Widget */
.chat-widget-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-widget-toggle:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.chat-widget-toggle svg {
  width: 28px;
  height: 28px;
}

.chat-widget-container {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 8rem);
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.chat-widget-container.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-widget-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-alt);
}

.chat-title {
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-title::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.chat-close:hover {
  color: var(--text-primary);
}

.chat-close svg {
  width: 20px;
  height: 20px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.message {
  max-width: 85%;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.user-message {
  background: var(--text-primary);
  color: var(--bg-color);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bot-message {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 1rem;
  width: fit-content;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

.chat-input-area {
  padding: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.75rem;
  background: var(--bg-color);
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 0.75rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input-area input:focus {
  border-color: var(--text-primary);
}

.chat-input-area button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.chat-input-area button:hover:not(:disabled) {
  transform: scale(1.05);
}

.chat-input-area button:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.chat-input-area button svg {
  width: 18px;
  height: 18px;
  transform: translateX(-1px) translateY(1px);
}

.bot-message .chat-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.message-links {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.8rem;
  background: var(--accent);
  color: var(--bg-color);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.project-live-btn:hover {
  opacity: 0.75;
}

/* Form Message specific for AI Bot */
.form-message {
  width: 100%;
  max-width: 100%;
}
.form-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.form-group input {
  background: var(--bg-color);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: 6px;
  color: var(--text-primary);
}
.form-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.form-buttons button {
  flex: 1;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  border: none;
}
.form-buttons .primary {
  background: var(--text-primary);
  color: var(--bg-color);
}
.form-buttons .secondary {
  background: var(--bg-alt);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .chat-widget-container {
    width: calc(100% - 2rem);
    right: 1rem;
    bottom: 5rem;
  }
  .chat-widget-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
}
