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

:root {
  --text:   #111111;
  --muted:  #888888;
  --accent: #2563eb;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 48px 24px;
  -webkit-font-smoothing: antialiased;
}

/* ── Card ── */

main {
  width: 100%;
  max-width: 520px;
}

h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.role {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.lang {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.bio {
  font-size: 1rem;
  max-width: 420px;
  margin-bottom: 20px;
}

.stack {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.stack span:not(:last-child)::after {
  content: ' \00B7  ';
  white-space: pre;
}

.stack span {
  position: relative;
  cursor: default;
  transition: color 0.15s;
}

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

.stack span[data-tip]::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.stack span[data-tip]:hover::before { opacity: 1; }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #ddd;
  padding-bottom: 2px;
  transition: border-color 0.15s, color 0.15s;
}


nav a:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ── Portfolio page ── */

main.portfolio {
  max-width: 560px;
}

.back {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #ddd;
  padding-bottom: 2px;
  margin-bottom: 40px;
  transition: border-color 0.15s, color 0.15s;
}

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

main.portfolio h1 {
  font-size: 1.5rem;
  margin-bottom: 40px;
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.project-list li {
  padding-bottom: 36px;
  border-bottom: 1px solid #eee;
}

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

.project-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.project-name {
  font-weight: 500;
  font-size: 1rem;
}

.project-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}

.project-list p {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 480px;
  margin-bottom: 10px;
}

.project-stack {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.project-media {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 16px;
  background: #f4f4f4;
}

.project-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin-bottom: 16px;
  border-radius: 4px;
  overflow: hidden;
  background: #f4f4f4;
}

.project-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Entrance animations ── */

@keyframes fadein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Homepage */
main:not(.portfolio) > * {
  animation: fadein 0.5s ease-out both;
}

main:not(.portfolio) > *:nth-child(1) { animation-delay: 0.05s; }
main:not(.portfolio) > *:nth-child(2) { animation-delay: 0.12s; }
main:not(.portfolio) > *:nth-child(3) { animation-delay: 0.22s; }
main:not(.portfolio) > *:nth-child(4) { animation-delay: 0.32s; }
main:not(.portfolio) > *:nth-child(5) { animation-delay: 0.42s; }
main:not(.portfolio) > *:nth-child(6) { animation-delay: 0.52s; }

/* Portfolio page */
main.portfolio .back,
main.portfolio h1 {
  animation: fadein 0.5s ease-out both;
}

main.portfolio h1 { animation-delay: 0.05s; }

main.portfolio .project-list li {
  animation: fadein 0.5s ease-out both;
}

main.portfolio .project-list li:nth-child(1) { animation-delay: 0.15s; }
main.portfolio .project-list li:nth-child(2) { animation-delay: 0.28s; }
main.portfolio .project-list li:nth-child(3) { animation-delay: 0.41s; }
main.portfolio .project-list li:nth-child(4) { animation-delay: 0.54s; }

/* ── Now page ── */

main.now {
  max-width: 520px;
}

main.now h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.now-updated {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.now-section {
  margin-bottom: 36px;
}

.now-section h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.now-section p {
  font-size: 1rem;
  max-width: 460px;
}

.now-img {
  margin-top: 14px;
  max-width: 460px;
  border-radius: 8px;
  display: block;
}

/* Now page animations */
main.now > * {
  animation: fadein 0.5s ease-out both;
}

main.now > *:nth-child(1) { animation-delay: 0s; }
main.now > *:nth-child(2) { animation-delay: 0.05s; }
main.now > *:nth-child(3) { animation-delay: 0.12s; }
main.now > *:nth-child(4) { animation-delay: 0.22s; }
main.now > *:nth-child(5) { animation-delay: 0.32s; }
main.now > *:nth-child(6) { animation-delay: 0.42s; }

/* ── Mobile ── */

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  main.portfolio h1, main.now h1 { font-size: 1.25rem; }
  .bio { max-width: 100%; }
  .project-list p { max-width: 100%; }
  .now-section p { max-width: 100%; }
}

/* Hide tooltips on touch devices — hover doesn't exist */
@media (hover: none) {
  .stack span[data-tip]::before { display: none; }
}
