/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #111111;
  --primary-light: #555555;
  --primary-dark: #000000;
  --accent: #888888;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* Light Mode (default) */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #f5f5f7;
  --bg-card-hover: #eeeef1;
  --surface: #f0f0f3;
  --text: #333340;
  --text-muted: #6b6b80;
  --text-heading: #1a1a2e;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.1);
  --navbar-bg: rgba(255, 255, 255, 0.92);
  --logo-color: #000000;
  --logo-accent: #999999;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --surface: #16213e;
  --text: #e8e8e8;
  --text-muted: #a0a0b0;
  --text-heading: #ffffff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
  --navbar-bg: rgba(15, 15, 26, 0.92);
  --logo-color: #ffffff;
  --logo-accent: #777777;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

/* ===== Utility Classes ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

.gradient-text {
  color: var(--logo-accent);
  font-weight: 800;
}

.navbar-logo .gradient-text {
  color: var(--logo-accent);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 0 20px rgba(0, 0, 0, 0.4); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: var(--navbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--logo-color);
}

/* Theme Toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text);
  transition: var(--transition);
  cursor: pointer;
  margin-left: 1.5rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 1px;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text-heading);
}

.navbar-links a:hover::after,
.navbar-links a.active::after {
  width: 100%;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 4px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.open span:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

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

.hero::before,
.hero::after {
  display: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease forwards;
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--text-heading);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-heading);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.8s ease forwards;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

.hero-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.btn-secondary:hover {
  border-color: var(--text-heading);
  color: var(--text-heading);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ===== Features Section ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--text-heading);
  transform: scaleX(0);
  transition: var(--transition);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ===== Notes Page ===== */
.page-header {
  padding: 8rem 0 3rem;
  text-align: center;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: none;
  border-radius: 50%;
  pointer-events: none;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  animation: fadeInUp 0.6s ease;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  animation: fadeInUp 0.6s ease 0.1s forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease 0.2s forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--text-heading);
  color: var(--bg);
  border-color: var(--text-heading);
  transform: translateY(-1px);
}

.search-box {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  transition: var(--transition);
  animation: fadeInUp 0.6s ease 0.15s forwards;
  opacity: 0;
  animation-fill-mode: forwards;
}

.search-box:focus-within {
  border-color: var(--text-heading);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.5rem;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Notes List */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  gap: 1rem;
}

.note-row:first-child {
  border-top: 1px solid var(--border);
}

.note-row:hover {
  padding-left: 0.5rem;
}

.note-row-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.note-row-subject {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}

.note-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-row-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.note-row-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.note-row-actions .btn-sm {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  display: none;
}

.empty-state.show {
  display: block;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== CTA Section ===== */
.cta-section {
  text-align: center;
  padding: 5rem 0;
}

.cta-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.cta-box h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 1rem;
  position: relative;
}

.cta-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto 2rem;
  position: relative;
}

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

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 300px;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.3rem 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--text-heading);
  padding-left: 6px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Loading Animation ===== */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--text-heading);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--text-heading);
  color: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: var(--transition);
    border-left: 1px solid var(--border);
  }

  .navbar-links.open {
    right: 0;
  }

  .mobile-toggle {
    display: flex;
    z-index: 1001;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .note-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 0;
  }

  .note-row-left {
    flex-direction: column;
    gap: 0.4rem;
  }

  .note-row-meta {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .filter-bar {
    gap: 0.5rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
}

/* ===== Notification Toast ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text);
  z-index: 2000;
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-overlay.show {
  opacity: 1;
  visibility: visible;
}
