/* light */
:root {
  --bg: #f8f3ed;
  --text: #2b2118;
  --card: #fff7ee;
  --accent: #d47b39;
  --accent-2: #f79b45;
  --muted: #7a675b;
}

/* dark */
body.dark {
  --bg: #141313;
  --text: #f4ede6;
  --card: #1a1918;
  --accent-2: #ffd6a6;
  --muted: #c9b59e;
}

/* base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  transition:
    0.4s,
    color 0.4s;
  padding: 1rem;
}

/* Nav */
nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
nav .brand {
  font-weight: 800;
  font-family: "Merriweather", serif;
  margin-right: 1rem;
}
nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
nav a:hover {
  color: var(--accent);
}
.icon-btn {
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}
.spacer {
  flex: 1;
}

/* header / hero */
.site-header {
  background: var(--card);
  padding: 1.4rem;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.25rem;
}
.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}
.hero-photo {
  width: 240px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.6s;
}
.hero-photo:hover {
  transform: scale(1.04);
}
.hero-text {
  max-width: 640px;
  padding: 0.4rem;
}
.hero-text h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}
.hero-buttons {
  margin-top: 0.8rem;
}
.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  margin-right: 0.5rem;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.btn.ghost {
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.06);
  color: var(--text);
}
.btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* sections */
.section {
  background: var(--card);
  padding: 1.4rem;
  border-radius: 14px;
  margin: 1rem 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}
.section h2 {
  color: var(--accent);
  margin-bottom: 0.8rem;
}

/* grid helpers */
.projects-grid,
.maps-container,
.skills-cards,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* Mistakes */
.cs2-mistakes {
  background: #f8f3ed;
  color: #2b2118;
  padding: 60px 20px;
  font-family: "Poppins", sans-serif;
  text-align: center;
  border-radius: 20px;
}
.cs2-mistakes h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  color: #d35400;
  letter-spacing: 1px;
}
.mistake-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  justify-items: center;
}
.mistake {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 20px;
  max-width: 340px;
  transition: all 0.3s ease;
}
.mistake:hover {
  transform: translateY(-6px);
}
.mistake h3 {
  font-size: 1.2rem;
  color: #d47b39;
  margin-bottom: 10px;
}
.mistake p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* skills */
.skill-card {
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  transition: transform 0.25s;
}
.skill-card h4 {
  margin: 0.6rem 0;
  color: #d47b39;
}
.skill-card p {
  font-size: 0.9rem;
  color: var(--muted);
}
.skill-card:hover {
  transform: scale(1.05);
}

/* maps */
.map-card {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0.2)
  );
  transition:
    transform 0.35s,
    box-shadow 0.35s;
  display: flex;
  flex-direction: column;
}
.map-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.map-info {
  padding: 1rem;
}
.map-info h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.map-info p {
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.map-info .small-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin: 5px;
  transition: 0.3s;
}
.map-info .small-btn:hover {
  background: var(--accent-2);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* footer */
.site-footer {
  margin-top: 1rem;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: var(--card);
}

/* animations */
.fade-in,
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}
.visible {
  opacity: 1;
  transform: translateY(0);
}

/* effect p */
.typewriter {
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.typewriter::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  background: currentColor;
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(2, start) infinite;
}
.no-cursor::after {
  display: none;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.typewriter span {
  display: inline-block;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    text-shadow 0.3s ease;
}
.typewriter span.visible {
  opacity: 1;
}
.typewriter span.glow {
  color: #ff9800;
  text-shadow:
    0 0 8px #ff9800,
    0 0 16px #ff9800;
}

/* Media */
@media (max-width: 600px) {
  body {
    padding: 0.5rem;
  }

  nav ul {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-photo {
    width: 180px;
  }

  .hero-text h1 {
    font-size: 1.6rem;
  }

  .skills-cards,
  .maps-container,
  .mistake-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .map-card img {
    height: 140px;
  }
}

@media (min-width: 601px) and (max-width: 1024px) {
  nav ul {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .hero-photo {
    width: 200px;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .skills-cards,
  .maps-container,
  .mistake-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .map-card img {
    height: 150px;
  }
}

@media (min-width: 1025px) {
  .hero-photo {
    width: 240px;
  }

  .hero-text h1 {
    font-size: 2rem;
  }
}
