:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #101828;
  --muted: #4f5b6a;
  --line: #dde5f2;
  --primary: #1558d6;
  --primary-soft: #edf3ff;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
}

html.dark {
  --bg: #050b17;
  --surface: #0c1630;
  --text: #e8eefb;
  --muted: #a7b2ca;
  --line: #1d2d4f;
  --primary: #8bb3ff;
  --primary-soft: #122448;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
}

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

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.discord-link {
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
}

.theme-toggle {
  padding: 0 12px;
  cursor: pointer;
  font-weight: 700;
}

.discord-link {
  width: 36px;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.discord-link svg {
  width: 18px;
  height: 18px;
}

.hero {
  max-width: 900px;
  margin: 140px auto 40px;
  padding: 0 20px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.hero-sub {
  margin: 16px auto 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.portfolio {
  max-width: 1100px;
  margin: 90px auto 90px;
  padding: 0 20px;
}

.section-head p {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
}

.section-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.cards {
  max-width: 900px;
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.55rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.04rem;
}

.page-section {
  max-width: 860px;
  margin: 100px auto 90px;
  padding: 0 20px;
}

.page-section h1 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 2.8rem);
}

.page-section p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.contact-form {
  margin-top: 24px;
  display: grid;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.contact-form label {
  font-size: 0.95rem;
  font-weight: 600;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}

.submit-btn {
  justify-self: start;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.team-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.team-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}

.team-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}

.team-card h3 {
  margin: 12px 0 4px;
}

.team-username {
  margin: 0;
  color: var(--primary);
  font-weight: 600;
}

.team-description {
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.team-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 600;
}

.blog-controls {
  margin-top: 14px;
}

.blog-source {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 600;
}

.blog-content {
  margin-top: 18px;
  max-width: 860px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  line-height: 1.6;
  font-size: 0.94rem;
}

.blog-content h1,
.blog-content h2,
.blog-content h3 {
  line-height: 1.3;
  margin-top: 20px;
  margin-bottom: 8px;
}

.blog-content h1:first-child,
.blog-content h2:first-child,
.blog-content h3:first-child {
  margin-top: 0;
}

.blog-content h1 {
  font-size: 1.7rem;
}

.blog-content h2 {
  font-size: 1.35rem;
}

.blog-content h3 {
  font-size: 1.12rem;
}

.blog-content p,
.blog-content ul,
.blog-content ol {
  margin: 10px 0;
}

.blog-content code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.blog-content pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
}

.blog-content pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.blog-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-loading,
.blog-error {
  margin: 0;
  color: var(--muted);
}

.reveal-up {
  opacity: 0;
  transform: translateY(18px);
  animation: revealUp 0.55s ease forwards;
  animation-delay: var(--delay, 0s);
}

.typewriter {
  display: inline-block;
  min-width: 6.4ch;
  color: var(--primary);
}

.typewriter::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 4px;
  background: currentColor;
  vertical-align: -0.08em;
  animation: caretBlink 0.85s step-end infinite;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
  }
}
