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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: #f0ede8;
  color: #2c2c2c;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.base {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(102, 126, 234, 0.08) 0%, transparent 50%);
}

.base-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.base-text {
  max-width: 600px;
}

.base-text h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 0.9;
  margin-bottom: 1.5rem;
  background: linear-gradient(120deg,
      #2c2c2c,
      #444,
      #555,
      #2c2c2c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
}

body.dark-mode .base-text h1 {
  background: linear-gradient(120deg,
      #f5f5f5,
      #dcdcdc,
      #bcbcbc,
      #f5f5f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.base-text h1,
body.dark-mode .base-text h1 {
  background-size: 300% 300%;
  animation: gradientMove 3s ease-in-out infinite;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.base-subtitle {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 2rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(44, 44, 44, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #666;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.social-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.6s ease;
}

.social-link:hover::before {
  left: 100%;
}

.social-link:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
  color: #667eea;
}

.base-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

li {
  list-style: none;
}

header {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

nav {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 1.25rem;
}

nav a {
  text-decoration: none;
  color: #1a73e8;
  font-weight: 500;
  font-family: 'Inter', Arial, sans-serif;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #1558b0;
  text-decoration: underline;
}

a {
  text-decoration: none;
  color: #1a73e8;
  font-weight: 500;
  transition: color 0.2s ease;
}

a:hover {
  color: #1558b0;
  text-decoration: underline;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #e5e5e5;
}

body.dark-mode header {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}

body.dark-mode main {
  background: #1a1a1a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

body.dark-mode a {
  color: #8ab4f8;
}

body.dark-mode a:hover {
  color: #a8c8ff;
}

/* Optional button styling */
#theme-toggle {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.4rem;
  margin-left: auto;
  color: inherit;
}

body.dark-mode #theme-toggle {
  color: #f5f5f5;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f5f5f5;
}

body.dark-mode p,
body.dark-mode li,
body.dark-mode blockquote,
body.dark-mode small,
body.dark-mode label {
  color: #dcdcdc;
}

body.dark-mode blockquote {
  border-left-color: #444;
}

body.dark-mode code {
  background: #222;
  color: #ffcc66;
}

textarea {
    width: 100%;
    height: 150px;
    padding: 0.75rem;
    font-family: monospace;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

/* === Dark Mode for Tools Page === */
body.dark-mode main {
  background: #1a1a1a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

body.dark-mode label {
  color: #e0e0e0;
}

body.dark-mode textarea {
  background-color: #121212;
  color: #e0e0e0;
  border: 1px solid #444;
}

body.dark-mode textarea:focus {
  border-color: #80b3ff;
  box-shadow: 0 0 0 2px rgba(128, 179, 255, 0.2);
  outline: none;
}

body.dark-mode button {
  background-color: #3b82f6;
  color: #fff;
}

body.dark-mode button:hover {
  background-color: #2563eb;
}

body.dark-mode .encoder-decoder,
body.dark-mode .minifier {
  border: 1px solid #333;
  background-color: #1e1e1e;
}

body.dark-mode .error {
  border-color: #d32f2f !important;
  background-color: #3a1a1a;
}


/* === Material toggle styles === */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #e0e0e0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

.toggle-icon.sun {
  left: 4px;
  color: #ffb300;
}

.toggle-icon.moon {
  right: 4px;
  color: #9ecbff;
  opacity: 0;
}

body.dark-mode .theme-toggle .toggle-track {
  background: #3a3a3a;
}

body.dark-mode .theme-toggle .toggle-thumb {
  left: 26px;
  background: #f5f5f5;
}

body.dark-mode .theme-toggle .toggle-icon.sun {
  opacity: 0;
}

body.dark-mode .theme-toggle .toggle-icon.moon {
  opacity: 1;
}