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

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --text-subtle: #999999;
  --border: #e0e0e0;
  --link-hover: #000000;
  --accent: #1a1a1a;
  --search-bg: #f8f8f8;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: 'IBM Plex Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #e8e8e8;
  --text-muted: #999999;
  --text-subtle: #666666;
  --border: #2a2a2a;
  --link-hover: #ffffff;
  --accent: #e8e8e8;
  --search-bg: #1a1a1a;
}

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  font-weight: 500;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
  padding: 56px 24px 80px;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.2s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0;
}

.nav-logo {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}
.nav-logo:hover { opacity: 0.7; }

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

.nav-link {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
  position: relative;
}
.nav-link:hover,
.nav-link.active { color: var(--text); }

.nav-rule {
  height: 1px;
  background-color: var(--border);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  line-height: 1;
}
.icon-btn:hover { color: var(--text); }

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.hamburger-btn { display: none; }

.menu-icon line {
  transition: opacity 75ms ease-in-out;
}
.menu-icon .close { opacity: 0; }
.menu-icon.is-active .line { opacity: 0; }
.menu-icon.is-active .close { opacity: 1; }

.mobile-menu {
  display: none;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}
.mobile-menu.open { display: block; }

.mobile-nav-link {
  display: block;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover,
.mobile-nav-link.active { color: var(--text); }

@media (max-width: 600px) {
  .hamburger-btn { display: flex; }
  .nav-link { display: none; }
  .search-btn { display: none; }
  .nav { padding: 16px 0; }
}

.search-bar {
  display: none;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  position: relative;
}
.search-bar.open { display: block; }

.search-input {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: block;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 14px 0;
  outline: none;
}
.search-input::placeholder { color: var(--text-subtle); }

.search-results {
  max-width: 700px;
  margin: 0 auto;
  padding-bottom: 12px;
}

.search-result-item {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.search-result-item:hover { opacity: 0.7; }
.search-result-title {
  font-size: 0.875rem;
  color: var(--text);
}
.search-result-type {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-left: 8px;
}
.search-no-results {
  font-size: 0.875rem;
  color: var(--text-subtle);
  padding: 8px 0;
}

.page { display: none; }
.page.active {
  display: block;
  animation: pageFade 0.15s ease forwards;
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.go-back {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: color 0.15s;
}
.go-back:hover { color: var(--text); }

.project-date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-style: italic;
  margin-bottom: 24px;
}


.page-title {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.page-section {
  margin-bottom: 52px;
}

.section-title {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.post-list {
  list-style: none;
  margin-bottom: 20px;
}

.post-item {
  margin-bottom: 24px;
}
.post-item:last-child { margin-bottom: 0; }

.post-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.15s;
}
.post-link:hover { opacity: 0.75; }

.post-title {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  align-self: flex-start;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.post-link:hover .post-title {
  border-color: var(--text);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-style: italic;
}

.post-time-ago {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--text-subtle);
  letter-spacing: 0.02em;
}

.post-time-ago::before {
  content: '·';
  margin-right: 6px;
}

.post-date-icon {
  display: flex;
  align-items: center;
  opacity: 0.6;
}

.post-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-tag {
  font-size: 0.72rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-style: normal;
}

.home-intro {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.home-intro p {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 600px) {
  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.skill-group-label {
  display: block;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.skill-list {
  list-style: none;
}

.skill-list li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.skill-list li:last-child {
  border-bottom: none;
}


.home-bio {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.home-bio p {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}

.home-bio strong {
  color: var(--text);
  font-weight: 600;
}

.all-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  transition: color 0.15s;
}
.all-link:hover { color: var(--text); }
.all-link.centered {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.about-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

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

.about-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-profile-name {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.about-profile-role {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.about-content {
  max-width: 560px;
}

.about-content p {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 18px;
}

.about-content strong {
  font-weight: 600;
  color: var(--text);
}

.about-section-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
}

.about-list {
  list-style: none;
  margin-bottom: 8px;
}

.about-list li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.about-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-subtle);
}

.about-links {
  list-style: none;
}
.about-links li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.about-links li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-subtle);
}
.about-links a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.about-links a:hover {
  border-color: var(--text);
}

.about-inline-link {
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.15s;
}
.about-inline-link:hover {
  border-color: var(--text);
}

.project-feature-list {
  list-style: none;
  margin-top: 12px;
  margin-bottom: 0;
}

.project-feature-list li {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 5px 0 5px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  line-height: 1.6;
}

.project-feature-list li:last-child {
  border-bottom: none;
}

.project-feature-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-subtle);
}

#project-desc strong {
  color: var(--text);
  font-weight: 600;
}

.screenshots-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.screenshot-img {
  height: 340px;
  width: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: block;
}

.site-footer {
  margin-top: auto;
}

.footer-rule {
  height: 1px;
  background-color: var(--border);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 36px;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-align: center;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-icons a {
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.footer-icons a:hover { color: var(--text); }

@media (max-width: 600px) {
  .nav-links { gap: 16px; }
  .nav-link { font-size: 0.8rem; }
  main { padding: 32px 0 48px; }
  .page-title { font-size: 1.25rem; }
}

@media (max-width: 420px) {
  .nav-link:not(.active) { display: none; }
  .nav-links { gap: 12px; }
}
