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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --tab-active-bg: #1e1e1e;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Tabs */
nav {
  display: flex;
  gap: 0;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Panels */
.panel {
  display: none;
  animation: fadein 0.15s ease;
}

.panel.active {
  display: block;
  flex: 1;
}

#about.panel.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  text-align: center;
}

section>p {
  color: var(--muted);
  max-width: 60ch;
  font-size: 1rem;
}

/* About layout */
.about-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.about-inner p {
  color: var(--muted);
  font-size: 1rem;
  flex: 1;
}

.about-photo {
  width: 210px;
  height: 210px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  justify-items: center;
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: #444;
}

.card.placeholder {
  opacity: 0.45;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card p {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Button */
.btn {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
}

/* Resume */
.resume-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.resume-btn {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

.resume-body {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.resume-contact a {
  color: var(--accent);
  text-decoration: none;
}

.resume-contact a:hover {
  text-decoration: underline;
}

.resume-section h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.resume-entry {
  margin-bottom: 1.25rem;
}

.resume-entry:last-child {
  margin-bottom: 0;
}

.resume-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}

.resume-entry-header strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.resume-entry-header span {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.resume-entry-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.resume-section > p {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: none;
}

.resume-entry ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.resume-entry ul li {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 600px) {
  .about-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* Project group labels */
.project-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.project-grid + .project-group-label {
  margin-top: 1.75rem;
}

/* Closed source tag */
.closed-source-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Footer */
footer {
  padding-top: 3rem;
  color: var(--muted);
  font-size: 0.82rem;
}