:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --accent: #4e9af1;
  --card: #f3f3f3;
}

[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #f0f0f0;
  --accent: #76b2f3;
  --card: #2a2a2a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

/* Floating theme toggle with emojis */
.theme-toggle {
  position: fixed;
  top: 10px;
  right: 20px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.5rem 0.7rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  z-index: 1000;
  transition: opacity 0.2s;
  line-height: 1;
}

.theme-toggle:hover {
  opacity: 0.85;
}

header {
  padding: 3rem 2rem;
  text-align: center;
  color: white;
  background-image: url("/cityscape.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

header p {
  font-style: italic;
  font-size: 1.2rem;
}

#banner {
  display: block;
  width: 80%;
  max-width: 900px;
  height: auto;
  margin: 0 auto 1rem;
}

nav {
  text-align: center;
  margin: 1rem 0;
}

nav a {
  margin: 0 1rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

section {
  margin: 2rem 0;
  background: var(--card);
  padding: 1.5rem;
  border-radius: 8px;
  transition: background-color 0.3s;
}

h2 {
  margin-top: 0;
  color: var(--accent);
}

ul {
  padding-left: 1.2rem;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #777;
}

/* Typewriter effect – now monospace for perfect cursor alignment */
.typewriter {
  font-family: "Courier New", Courier, monospace;   /* ← fix: monospace ensures 1ch = one character */
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid white;
  font-size: 1.3rem;
  width: 0;
  animation:
    typing 2.5s steps(var(--chars), end) forwards,
    blink 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: calc(var(--chars) * 1ch);   /* now accurate because font is monospace */
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Responsive */
@media (max-width: 600px) {
  nav a {
    display: inline-block;
    margin: 0.5rem;
  }

  #banner {
    width: 95%;
  }

  .theme-toggle {
    top: 5px;
    right: 10px;
    font-size: 1.3rem;
    padding: 0.4rem 0.6rem;
  }
}